For constants that must be stored for allentities, we now must use 'allentities' in const array instead of '0'. This is more clear.

This commit is contained in:
Laurent Destailleur 2010-04-03 10:26:33 +00:00
parent 933c84c127
commit f6f5346229
5 changed files with 15 additions and 14 deletions

View File

@ -93,7 +93,7 @@ class modMyModule extends DolibarrModules
$this->langfiles = array("mymodule"); $this->langfiles = array("mymodule");
// Constants // Constants
$this->const = array(); // List of particular constants to add when module is enabled $this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities', condition)
//Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), //Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );

View File

@ -790,7 +790,7 @@ class DolibarrModules
$val = $this->const[$key][2]; $val = $this->const[$key][2];
$note = $this->const[$key][3]; $note = $this->const[$key][3];
$visible= $this->const[$key][4]; $visible= $this->const[$key][4];
$entity = isset($this->const[$key][5])?$this->const[$key][5]:$conf->entity; $entity = ! empty($this->const[$key][5])?0:$conf->entity;
$sql = "SELECT count(*)"; $sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " FROM ".MAIN_DB_PREFIX."const";

View File

@ -87,7 +87,7 @@ class modMultiCompany extends DolibarrModules
// List of particular constants to add when module is enabled // List of particular constants to add when module is enabled
//Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0), //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0),
// 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) ); // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) );
$this->const=array(1=>array('MAIN_MODULE_MULTICOMPANY_NEEDSMARTY',"chaine",1,'Need smarty',0,0)); $this->const=array(1=>array('MAIN_MODULE_MULTICOMPANY_NEEDSMARTY',"chaine",1,'Need smarty',0,'allentities'));
// Boxes // Boxes
$this->boxes = array(); // List of boxes $this->boxes = array(); // List of boxes

View File

@ -84,7 +84,7 @@ class modProduit extends DolibarrModules
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";
$this->const[$r][3] = "Affichage formulaire de recherche des Produits et Services dans la barre de gauche"; $this->const[$r][3] = "Affichage formulaire de recherche des Produits et Services dans la barre de gauche";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$this->const[$r][5] = 0; $this->const[$r][5] = 'allentities';
$r++; $r++;
// Boxes // Boxes

View File

@ -91,7 +91,7 @@ class modSociete extends DolibarrModules
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";
$this->const[$r][3] = "Affichage formulaire de recherche des Societes dans la barre de gauche"; $this->const[$r][3] = "Affichage formulaire de recherche des Societes dans la barre de gauche";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$this->const[$r][5] = 0; $this->const[$r][5] = 'allentities';
$r++; $r++;
$this->const[$r][0] = "MAIN_SEARCHFORM_CONTACT"; $this->const[$r][0] = "MAIN_SEARCHFORM_CONTACT";
@ -99,7 +99,7 @@ class modSociete extends DolibarrModules
$this->const[$r][2] = "1"; $this->const[$r][2] = "1";
$this->const[$r][3] = "Affichage formulaire de recherche des Contacts dans la barre de gauche"; $this->const[$r][3] = "Affichage formulaire de recherche des Contacts dans la barre de gauche";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$this->const[$r][5] = 0; $this->const[$r][5] = 'allentities';
$r++; $r++;
$this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH"; $this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH";
@ -107,6 +107,7 @@ class modSociete extends DolibarrModules
$this->const[$r][2] = "DOL_DATA_ROOT/odttemplates/thirdparties"; $this->const[$r][2] = "DOL_DATA_ROOT/odttemplates/thirdparties";
$this->const[$r][3] = ""; $this->const[$r][3] = "";
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$this->const[$r][6] = '$this->db->type != \'pgsql\''; // Condition
$r++; $r++;
// Boxes // Boxes