diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 1f24245fece..b3acbbf91d3 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -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 diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index eaf38da9559..bb507c98106 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -161,8 +161,7 @@ class FormResource if ($filtertype != '' && $filtertype != '-1') $filterarray=explode(',',$filtertype); $resourcestat->load_cache_code_type_resource(); - - print ''; if ($empty) print ''; if (is_array($resourcestat->cache_code_type_resource) && count($resourcestat->cache_code_type_resource)) { diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 4f56fcce0b5..1ad1ead30a4 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -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;