Clean code
This commit is contained in:
parent
7fbcb4fe7d
commit
6a9bf009f2
@ -121,16 +121,7 @@ class modResource extends DolibarrModules
|
||||
// List of particular constants to add when module is enabled
|
||||
// (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||
// Example:
|
||||
$this->const = array(
|
||||
0=>array(
|
||||
'PLACE_DEFAULT_ZOOM_FOR_MAP',
|
||||
'chaine',
|
||||
'1',
|
||||
'This is a constant to defined default zoom into link to OSM map',
|
||||
1
|
||||
)
|
||||
|
||||
);
|
||||
$this->const = array();
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
// Example:
|
||||
@ -165,47 +156,6 @@ class modResource extends DolibarrModules
|
||||
'thirdparty:+resources:Resources:resource:$user->rights->resource->read:/resource/element_resource.php?element=societe&element_id=__ID__'
|
||||
);
|
||||
|
||||
/* Example:
|
||||
// This is to avoid warnings
|
||||
if (! isset($conf->resource->enabled)) $conf->resource->enabled=0;
|
||||
$this->dictionnaries=array(
|
||||
'langs'=>'resource@resource',
|
||||
// List of tables we want to see into dictonnary editor
|
||||
'tabname'=>array(
|
||||
MAIN_DB_PREFIX."table1",
|
||||
MAIN_DB_PREFIX."table2",
|
||||
MAIN_DB_PREFIX."table3"
|
||||
),
|
||||
// Label of tables
|
||||
'tablib'=>array("Table1","Table2","Table3"),
|
||||
// Request to select fields
|
||||
'tabsql'=>array(
|
||||
'SELECT f.rowid as rowid, f.code, f.label, f.active'
|
||||
. ' FROM ' . MAIN_DB_PREFIX . 'table1 as f',
|
||||
'SELECT f.rowid as rowid, f.code, f.label, f.active'
|
||||
. ' FROM ' . MAIN_DB_PREFIX . 'table2 as f',
|
||||
'SELECT f.rowid as rowid, f.code, f.label, f.active'
|
||||
. ' FROM ' . MAIN_DB_PREFIX . 'table3 as f'
|
||||
),
|
||||
// Sort order
|
||||
'tabsqlsort'=>array("label ASC","label ASC","label ASC"),
|
||||
// List of fields (result of select to show dictionnary)
|
||||
'tabfield'=>array("code,label","code,label","code,label"),
|
||||
// List of fields (list of fields to edit a record)
|
||||
'tabfieldvalue'=>array("code,label","code,label","code,label"),
|
||||
// List of fields (list of fields for insert)
|
||||
'tabfieldinsert'=>array("code,label","code,label","code,label"),
|
||||
// Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabrowid'=>array("rowid","rowid","rowid"),
|
||||
// Condition to show each dictionnary
|
||||
'tabcond'=>array(
|
||||
$conf->resource->enabled,
|
||||
$conf->resource->enabled,
|
||||
$conf->resource->enabled
|
||||
)
|
||||
);
|
||||
*/
|
||||
|
||||
// Boxes
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
|
||||
$this->boxes = array(); // Boxes list
|
||||
|
||||
@ -161,8 +161,7 @@ class FormResource
|
||||
if ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype);
|
||||
|
||||
$resourcestat->load_cache_code_type_resource();
|
||||
|
||||
print '<select id="select'.$htmlname.'" class="flat select_tickettype" name="'.$htmlname.'">';
|
||||
print '<select id="select'.$htmlname.'" class="flat select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($empty) print '<option value=""> </option>';
|
||||
if (is_array($resourcestat->cache_code_type_resource) && count($resourcestat->cache_code_type_resource))
|
||||
{
|
||||
|
||||
@ -692,9 +692,9 @@ class Resource extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
||||
$label=($langs->trans("ResourceTypeShort".$obj->code)!=("ResourceTypeShort".$obj->code)?$langs->trans("ResourceTypeShort".$obj->code):($obj->label!='-'?$obj->label:''));
|
||||
$this->cache_code_type_resource[$obj->rowid]['code'] =$obj->code;
|
||||
$this->cache_code_type_resource[$obj->rowid]['label']=$label;
|
||||
$this->cache_code_type_resource[$obj->rowid]['active'] =$obj->active;
|
||||
$this->cache_code_type_resource[$obj->rowid]['code'] = $obj->code;
|
||||
$this->cache_code_type_resource[$obj->rowid]['label'] = $label;
|
||||
$this->cache_code_type_resource[$obj->rowid]['active'] = $obj->active;
|
||||
$i++;
|
||||
}
|
||||
return $num;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user