Work on module builder
This commit is contained in:
parent
812687e10c
commit
36ad17cc95
@ -266,8 +266,10 @@ DateApprove2=Approving date (second approval)
|
||||
RegistrationDate=Registration date
|
||||
UserCreation=Creation user
|
||||
UserModification=Modification user
|
||||
UserValidation=Validation user
|
||||
UserCreationShort=Creat. user
|
||||
UserModificationShort=Modif. user
|
||||
UserValidationShort=Valid. user
|
||||
DurationYear=year
|
||||
DurationMonth=month
|
||||
DurationWeek=week
|
||||
|
||||
@ -82,11 +82,11 @@ class MyObject extends CommonObject
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>45),
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>46),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>500),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValid', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
);
|
||||
|
||||
@ -380,7 +380,7 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
||||
print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -417,7 +417,7 @@ print $hookmanager->resPrint;
|
||||
// Rest of fields search
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -437,7 +437,7 @@ print '</tr>'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
|
||||
@ -465,7 +465,7 @@ print $hookmanager->resPrint;
|
||||
// Rest of fields title
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -504,7 +504,7 @@ while ($i < min($num, $limit))
|
||||
print '<tr class="oddeven">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Discard some field output at end
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue; // Discard some field output at end
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
|
||||
@ -556,7 +556,7 @@ while ($i < min($num, $limit))
|
||||
// Rest of fields
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Keep only field not yet already output
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue; // Keep only field not yet already output
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
|
||||
@ -70,8 +70,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
|
||||
/*
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
*/
|
||||
|
||||
$parameters=array();
|
||||
@ -86,7 +84,7 @@ if (empty($reshook))
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/inventory/inventory_list.php',1);
|
||||
$urltogo=$backtopage?$backtopage:(DOL_URL_ROOT.'/product/inventory/list.php');
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
@ -192,8 +190,6 @@ if (empty($reshook))
|
||||
|
||||
/*
|
||||
* VIEW
|
||||
*
|
||||
* Put here all code to build page
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@ -73,16 +73,16 @@ class Inventory extends CommonObject
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
|
||||
'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object',),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'fk_warehouse' => array('type'=>'integer', 'label'=>'', 'visible'=>1, 'enabled'=>1, 'index'=>1,),
|
||||
'date_inventory' => array('type'=>'date', 'label'=>'', 'visible'=>1, 'enabled'=>1,),
|
||||
'title' => array('type'=>'varchar(255)', 'label'=>'', 'visible'=>1, 'enabled'=>1,),
|
||||
'fk_warehouse' => array('type'=>'integer', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1,),
|
||||
'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,),
|
||||
'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1,),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'index'=>1,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,),
|
||||
'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500,),
|
||||
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500,),
|
||||
'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValid', 'visible'=>-1, 'enabled'=>1, 'position'=>500,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1,),
|
||||
'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>502,),
|
||||
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>510,),
|
||||
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>511,),
|
||||
'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'visible'=>-1, 'enabled'=>1, 'position'=>512,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-1, 'enabled'=>1, 'position'=>1000, 'index'=>1,),
|
||||
);
|
||||
|
||||
@ -136,7 +136,12 @@ class Inventory extends CommonObject
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible']=0;
|
||||
if (empty($conf->multicompany->enabled)) $this->fields['entity']['enabled']=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
||||
print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -369,7 +369,7 @@ print $hookmanager->resPrint;
|
||||
// Rest of fields search
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -388,7 +388,7 @@ print '</tr>'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
|
||||
@ -415,7 +415,7 @@ print $hookmanager->resPrint;
|
||||
// Rest of fields title
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=' nowrap';
|
||||
@ -453,7 +453,7 @@ while ($i < min($num, $limit))
|
||||
print '<tr class="oddeven">';
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.='nowrap';
|
||||
@ -504,7 +504,7 @@ while ($i < min($num, $limit))
|
||||
// Rest of fields
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue;
|
||||
if (! in_array($key, array('fk_user_creat', 'fk_user_valid', 'fk_user_modif', 'date_creation', 'date_validation', 'tms', 'import_key', 'status'))) continue;
|
||||
$align='';
|
||||
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||
|
||||
@ -76,11 +76,11 @@ class WebsitePage extends CommonObject
|
||||
'content' =>array('type'=>'mediumtext', 'label'=>'Content', 'enabled'=>1, 'visible'=>0, 'position'=>51, 'searchall'=>0),
|
||||
'grabbed_from' =>array('type'=>'varchar(255)', 'label'=>'GrabbedFrom', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>400, 'comment'=>'URL page content was grabbed from'),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
//'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>500),
|
||||
//'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValid', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>502),
|
||||
//'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'position'=>510),
|
||||
//'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'index'=>1, 'position'=>1000, 'notnull'=>-1),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
Loading…
Reference in New Issue
Block a user