Merge branch '11.0' of github.com:Dolibarr/dolibarr into 11.0
This commit is contained in:
commit
2847131be0
@ -512,7 +512,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
$keyforbreak = 'description';
|
||||
$keyforbreak = 'efficiency';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
|
||||
@ -39,8 +39,10 @@ $object->fields = dol_sort_array($object->fields, 'position');
|
||||
|
||||
foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if (!empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column
|
||||
|
||||
// Discard if extrafield is a hidden field on form
|
||||
if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) continue;
|
||||
if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4 && abs($val['visible']) != 5) continue;
|
||||
|
||||
if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) continue; // We don't want this field
|
||||
if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner
|
||||
@ -62,8 +64,6 @@ foreach ($object->fields as $key => $val)
|
||||
//print dol_escape_htmltag($object->$key, 1, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -80,12 +80,16 @@ foreach ($object->fields as $key => $val)
|
||||
{
|
||||
if ($alreadyoutput)
|
||||
{
|
||||
if (!empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column
|
||||
continue;
|
||||
if (!empty($keyforbreak) && $key == $keyforbreak) {
|
||||
$alreadyoutput = 0; // key used for break on second column
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Discard if extrafield is a hidden field on form
|
||||
if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) continue;
|
||||
if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4 && abs($val['visible']) != 5) continue;
|
||||
|
||||
if (array_key_exists('enabled', $val) && isset($val['enabled']) && !$val['enabled']) continue; // We don't want this field
|
||||
if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner
|
||||
|
||||
@ -70,7 +70,7 @@ class MyObject extends CommonObject
|
||||
* 'enabled' is a condition when the field must be managed.
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
@ -83,6 +83,8 @@ class MyObject extends CommonObject
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
@ -217,6 +219,12 @@ class MyObject extends CommonObject
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
|
||||
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
|
||||
|
||||
// Example to show how to set values of fields definition dynamically
|
||||
/*if ($user->rights->mymodule->myobject->read) {
|
||||
$this->fields['myfield']['visible'] = 1;
|
||||
$this->fields['myfield']['noteditable'] = 0;
|
||||
}*/
|
||||
|
||||
// Unset fields that are disabled
|
||||
foreach ($this->fields as $key => $val)
|
||||
{
|
||||
|
||||
@ -99,7 +99,8 @@ class Mo extends CommonObject
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75'),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>52),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1,),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>52),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
|
||||
@ -108,7 +109,6 @@ class Mo extends CommonObject
|
||||
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,),
|
||||
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'),
|
||||
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '-1'=>'Canceled')),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user