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:
parent
933c84c127
commit
f6f5346229
@ -18,7 +18,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \defgroup mymodule Module MyModule
|
||||
* \brief Example of a module descriptor.
|
||||
* Such a file must be copied into htdocs/includes/module directory.
|
||||
@ -33,7 +33,7 @@
|
||||
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* \class modMyModule
|
||||
* \brief Description and activation class for module MyModule
|
||||
*/
|
||||
@ -70,7 +70,7 @@ class modMyModule extends DolibarrModules
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
$this->picto='generic';
|
||||
|
||||
|
||||
// Defined if the directory /mymodule/inc/triggers/ contains triggers or not
|
||||
$this->triggers = 0;
|
||||
|
||||
@ -93,7 +93,7 @@ class modMyModule extends DolibarrModules
|
||||
$this->langfiles = array("mymodule");
|
||||
|
||||
// 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),
|
||||
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ class DolibarrModules
|
||||
|
||||
// Insert new pages for tabs into llx_const
|
||||
if (! $err) $err+=$this->insert_tabs();
|
||||
|
||||
|
||||
// Insert activation triggers
|
||||
if (! $err) $err+=$this->insert_triggers();
|
||||
|
||||
@ -184,7 +184,7 @@ class DolibarrModules
|
||||
|
||||
// Remove activation of module's new tabs
|
||||
if (! $err) $err+=$this->delete_tabs();
|
||||
|
||||
|
||||
// Remove activation of module's triggers
|
||||
if (! $err) $err+=$this->delete_triggers();
|
||||
|
||||
@ -790,7 +790,7 @@ class DolibarrModules
|
||||
$val = $this->const[$key][2];
|
||||
$note = $this->const[$key][3];
|
||||
$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.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
@ -1205,7 +1205,7 @@ class DolibarrModules
|
||||
|
||||
return $err;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Insert activation triggers from modules in llx_const
|
||||
* \return int Number of errors (0 if ok)
|
||||
@ -1240,7 +1240,7 @@ class DolibarrModules
|
||||
}
|
||||
return $err;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Remove activation triggers from modules in llx_const
|
||||
* \return int Nombre d'erreurs (0 si ok)
|
||||
|
||||
@ -87,7 +87,7 @@ class modMultiCompany extends DolibarrModules
|
||||
// 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),
|
||||
// 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
|
||||
$this->boxes = array(); // List of boxes
|
||||
|
||||
@ -84,7 +84,7 @@ class modProduit extends DolibarrModules
|
||||
$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][4] = 0;
|
||||
$this->const[$r][5] = 0;
|
||||
$this->const[$r][5] = 'allentities';
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
|
||||
@ -91,7 +91,7 @@ class modSociete extends DolibarrModules
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = "Affichage formulaire de recherche des Societes dans la barre de gauche";
|
||||
$this->const[$r][4] = 0;
|
||||
$this->const[$r][5] = 0;
|
||||
$this->const[$r][5] = 'allentities';
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "MAIN_SEARCHFORM_CONTACT";
|
||||
@ -99,14 +99,15 @@ class modSociete extends DolibarrModules
|
||||
$this->const[$r][2] = "1";
|
||||
$this->const[$r][3] = "Affichage formulaire de recherche des Contacts dans la barre de gauche";
|
||||
$this->const[$r][4] = 0;
|
||||
$this->const[$r][5] = 0;
|
||||
$this->const[$r][5] = 'allentities';
|
||||
$r++;
|
||||
|
||||
|
||||
$this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "DOL_DATA_ROOT/odttemplates/thirdparties";
|
||||
$this->const[$r][3] = "";
|
||||
$this->const[$r][4] = 0;
|
||||
$this->const[$r][6] = '$this->db->type != \'pgsql\''; // Condition
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
|
||||
Loading…
Reference in New Issue
Block a user