Debug modulebuilder

This commit is contained in:
Laurent Destailleur
2017-07-11 20:47:49 +02:00
parent cbde99b419
commit ceeb9d7f1b
4 changed files with 198 additions and 79 deletions

View File

@@ -52,22 +52,24 @@ class MyObject extends CommonObject
* @var array Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
protected $ismultientitymanaged = 1;
/**
* @var string String with name of icon for myobject
*/
* @var string String with name of icon for myobject
*/
public $picto = 'myobject';
/**
* @var int Entity Id
*/
public $entity;
/* BEGIN PROPERTY FIELDS - Do not remove this comment */
/**
* @var array Array with all fields and their property
*/
public $fields;
public $fields=array(
'ref'=>array('type'=>'string','label'=>'Ref','position'=>10,'index'=>true,'comment'=>'Reference of object'),
'entity'=>array('type'=>'integer','label'=>'Entity','index'=>true),
'status'=>array('type'=>'integer','label'=>'Status','index'=>true),
'date'=>array('type'=>'date','label'=>'Date','default'=>'__NOW__'),
'title'=>array('type'=>'string','label'=>'Title'),
);
/* END PROPERTY FIELDS - Do not remove this comment */

View File

@@ -68,13 +68,7 @@ $toselect = GETPOST('toselect', 'array');
$id = GETPOST('id','int');
$backtopage = GETPOST('backtopage');
$myparam = GETPOST('myparam','alpha');
$search_all=trim(GETPOST("sall"));
$search_field1=GETPOST("search_field1");
$search_field2=GETPOST("search_field2");
$search_myfield=GETPOST('search_myfield');
$optioncss = GETPOST('optioncss','alpha');
$optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
@@ -85,6 +79,7 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined,
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield="t.rowid"; // Set here default search field
if (! $sortorder) $sortorder="ASC";
@@ -96,6 +91,19 @@ if ($user->societe_id > 0)
//accessforbidden();
}
// Initialize array of search criterias
$object=new MyModule($db);
$search_all=trim(GETPOST("search_all"));
$search=array();
foreach($object->fields as $key)
{
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
}
/*$search_field1=GETPOST("search_field1");
$search_field2=GETPOST("search_field2");
$search_myfield=GETPOST('search_myfield');
*/
// Initialize technical object to manage context to save list fields
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist';
@@ -133,8 +141,6 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
}
$object=new Skeleton_Class($db);