Works on product canvas
This commit is contained in:
parent
965071a711
commit
80e51539e0
@ -26,7 +26,7 @@ include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
|
||||
* \class ActionsCardProduct
|
||||
* \brief Class with controller methods for product canvas
|
||||
*/
|
||||
class ActionsCardProduct
|
||||
class ActionsCardProduct extends Product
|
||||
{
|
||||
var $db;
|
||||
var $targetmodule;
|
||||
@ -182,7 +182,7 @@ class ActionsCardProduct
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Fetch datas list
|
||||
* Fetch datas list
|
||||
*/
|
||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||
{
|
||||
@ -219,7 +219,6 @@ class ActionsCardProduct
|
||||
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if (!$user->rights->produit->hidden) $sql.=' AND p.hidden = 0';
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
@ -257,6 +256,7 @@ class ActionsCardProduct
|
||||
$sql.= $this->db->order($sortfield,$sortorder);
|
||||
$sql.= $this->db->plimit($limit + 1 ,$offset);
|
||||
//print $sql;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -306,7 +306,7 @@ class ActionsCardProduct
|
||||
}
|
||||
else
|
||||
{
|
||||
print $sql;
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,12 +20,13 @@
|
||||
* \ingroup service
|
||||
* \brief Fichier de la classe des services par defaut
|
||||
*/
|
||||
include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
|
||||
|
||||
/**
|
||||
* \class ProductService
|
||||
* \brief Class with controller methods for product canvas
|
||||
*/
|
||||
class ActionsCardService
|
||||
class ActionsCardService extends Product
|
||||
{
|
||||
var $db;
|
||||
var $targetmodule;
|
||||
|
||||
@ -64,7 +64,7 @@ if (! empty($canvas))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php");
|
||||
$objcanvas = new Canvas($db,$action);
|
||||
//$objcanvas->getCanvas('product','xxx',$canvas);
|
||||
$objcanvas->getCanvas('product','list',$canvas);
|
||||
|
||||
// Security check
|
||||
if ($type=='0') $result=$objcanvas->restrictedArea($user,'produit');
|
||||
@ -107,8 +107,8 @@ $html=new Form($db);
|
||||
|
||||
if (! empty($objcanvas->template_dir))
|
||||
{
|
||||
$classname = 'Product'.ucfirst($canvas);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/product/canvas/'.$canvas.'/product.'.$canvas.'.class.php');
|
||||
$classname = 'ActionsCard'.ucfirst($canvas);
|
||||
include_once(DOL_DOCUMENT_ROOT.'/product/canvas/'.$canvas.'/actions_card_'.$canvas.'.class.php');
|
||||
|
||||
$object = new $classname($db);
|
||||
$object->getFieldList();
|
||||
@ -221,7 +221,7 @@ if ($resql)
|
||||
print "</div><br>";
|
||||
}
|
||||
|
||||
if (!empty($_GET["canvas"]) && file_exists(DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/product.'.$_GET["canvas"].'.class.php'))
|
||||
if (!empty($_GET["canvas"]) && file_exists(DOL_DOCUMENT_ROOT.'/product/canvas/'.$_GET["canvas"].'/actions_card_'.$_GET["canvas"].'.class.php'))
|
||||
{
|
||||
$fieldlist = $object->field_list;
|
||||
$datas = $object->list_datas;
|
||||
@ -233,8 +233,7 @@ if ($resql)
|
||||
// Default templates directory
|
||||
$template_dir = DOL_DOCUMENT_ROOT . '/product/canvas/'.$_GET["canvas"].'/tpl/';
|
||||
// Check if a custom template is present
|
||||
if (file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$_GET["canvas"].'/list.tpl')
|
||||
|| file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$_GET["canvas"].'/list.tpl.php'))
|
||||
if (file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$_GET["canvas"].'/list.tpl.php'))
|
||||
{
|
||||
$template_dir = DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$_GET["canvas"].'/';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user