diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index a772cb2f58b..09b9bb1793c 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -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
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 29de762c486..030ecd0b1c2 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -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')),
);
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 6900a947a06..369c218adb4 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -380,7 +380,7 @@ print '
';
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 ''."\n";
print '';
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 '
';
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';
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 6fb8b223007..b441234fb63 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -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);
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index c4e5a7be4c8..fdd49d99d7b 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -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;
}
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 3985af45699..426dab725b3 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -333,7 +333,7 @@ print '';
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 ''."\n";
print '';
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 '
';
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';
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index e2a5a09da99..12f36f5daa7 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -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