@@ -31,170 +31,170 @@ discard block |
||
| 31 | 31 | class modSubtotal extends DolibarrModules |
| 32 | 32 | { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | - * |
|
| 37 | - * @param DoliDB $db Database handler |
|
| 38 | - */ |
|
| 34 | + /** |
|
| 35 | + * Constructor. Define names, constants, directories, boxes, permissions |
|
| 36 | + * |
|
| 37 | + * @param DoliDB $db Database handler |
|
| 38 | + */ |
|
| 39 | 39 | |
| 40 | - public function __construct($db) |
|
| 41 | - { |
|
| 42 | - global $langs, $conf; |
|
| 40 | + public function __construct($db) |
|
| 41 | + { |
|
| 42 | + global $langs, $conf; |
|
| 43 | 43 | |
| 44 | - $this->db = $db; |
|
| 44 | + $this->db = $db; |
|
| 45 | 45 | |
| 46 | 46 | $this->editor_name = 'ATM-Consulting'; |
| 47 | - // Id for module (must be unique). |
|
| 48 | - // Use a free id here |
|
| 49 | - // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | - $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | - // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | - $this->rights_class = 'subtotal'; |
|
| 47 | + // Id for module (must be unique). |
|
| 48 | + // Use a free id here |
|
| 49 | + // (See in Home -> System information -> Dolibarr for list of used modules id). |
|
| 50 | + $this->numero = 104777; // 104000 to 104999 for ATM CONSULTING |
|
| 51 | + // Key text used to identify module (for permissions, menus, etc...) |
|
| 52 | + $this->rights_class = 'subtotal'; |
|
| 53 | 53 | |
| 54 | - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | - // It is used to group modules in module setup page |
|
| 56 | - $this->family = "technic"; |
|
| 57 | - // Module label (no space allowed) |
|
| 58 | - // used if translation string 'ModuleXXXName' not found |
|
| 59 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | - $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | - // Module description |
|
| 62 | - // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | - // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | - $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | - // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | - $this->version = '3.1.2'; |
|
| 67 | - // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | - // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | - $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | - // Where to store the module in setup page |
|
| 71 | - // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | - $this->special = 2; |
|
| 73 | - // Name of image file used for this module. |
|
| 74 | - // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | - // use this->picto='pictovalue' |
|
| 76 | - // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | - // use this->picto='pictovalue@module' |
|
| 78 | - $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | - // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | - // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | - // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | - // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | - $this->module_parts = array( |
|
| 84 | - // Set this to 1 if module has its own trigger directory |
|
| 85 | - 'triggers' => 1, |
|
| 86 | - // Set this to 1 if module has its own login method directory |
|
| 87 | - //'login' => 0, |
|
| 88 | - // Set this to 1 if module has its own substitution function file |
|
| 89 | - //'substitutions' => 0, |
|
| 90 | - // Set this to 1 if module has its own menus handler directory |
|
| 91 | - //'menus' => 0, |
|
| 92 | - // Set this to 1 if module has its own barcode directory |
|
| 93 | - //'barcode' => 0, |
|
| 94 | - // Set this to 1 if module has its own models directory |
|
| 95 | - 'models' => 1, |
|
| 96 | - // Set this to relative path of css if module has its own css file |
|
| 97 | - //'css' => '/titre/css/mycss.css.php', |
|
| 98 | - // Set here all hooks context managed by module |
|
| 99 | - 'hooks' => array('invoicecard','propalcard','ordercard','odtgeneration','orderstoinvoice','admin','consumptionthirdparty') |
|
| 100 | - // Set here all workflow context managed by module |
|
| 101 | - //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 102 | - ); |
|
| 54 | + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
| 55 | + // It is used to group modules in module setup page |
|
| 56 | + $this->family = "technic"; |
|
| 57 | + // Module label (no space allowed) |
|
| 58 | + // used if translation string 'ModuleXXXName' not found |
|
| 59 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 60 | + $this->name = preg_replace('/^mod/i', '', get_class($this)); |
|
| 61 | + // Module description |
|
| 62 | + // used if translation string 'ModuleXXXDesc' not found |
|
| 63 | + // (where XXX is value of numeric property 'numero' of module) |
|
| 64 | + $this->description = "Module permettant l'ajout de sous-totaux et sous-totaux intermédiaires et le déplacement d'une ligne aisée de l'un dans l'autre"; |
|
| 65 | + // Possible values for version are: 'development', 'experimental' or version |
|
| 66 | + $this->version = '3.1.2'; |
|
| 67 | + // Key used in llx_const table to save module status enabled/disabled |
|
| 68 | + // (where MYMODULE is value of property name of module in uppercase) |
|
| 69 | + $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
| 70 | + // Where to store the module in setup page |
|
| 71 | + // (0=common,1=interface,2=others,3=very specific) |
|
| 72 | + $this->special = 2; |
|
| 73 | + // Name of image file used for this module. |
|
| 74 | + // If file is in theme/yourtheme/img directory under name object_pictovalue.png |
|
| 75 | + // use this->picto='pictovalue' |
|
| 76 | + // If file is in module/img directory under name object_pictovalue.png |
|
| 77 | + // use this->picto='pictovalue@module' |
|
| 78 | + $this->picto = 'subtotal@subtotal'; // mypicto@titre |
|
| 79 | + // Defined all module parts (triggers, login, substitutions, menus, css, etc...) |
|
| 80 | + // for default path (eg: /titre/core/xxxxx) (0=disable, 1=enable) |
|
| 81 | + // for specific path of parts (eg: /titre/core/modules/barcode) |
|
| 82 | + // for specific css file (eg: /titre/css/titre.css.php) |
|
| 83 | + $this->module_parts = array( |
|
| 84 | + // Set this to 1 if module has its own trigger directory |
|
| 85 | + 'triggers' => 1, |
|
| 86 | + // Set this to 1 if module has its own login method directory |
|
| 87 | + //'login' => 0, |
|
| 88 | + // Set this to 1 if module has its own substitution function file |
|
| 89 | + //'substitutions' => 0, |
|
| 90 | + // Set this to 1 if module has its own menus handler directory |
|
| 91 | + //'menus' => 0, |
|
| 92 | + // Set this to 1 if module has its own barcode directory |
|
| 93 | + //'barcode' => 0, |
|
| 94 | + // Set this to 1 if module has its own models directory |
|
| 95 | + 'models' => 1, |
|
| 96 | + // Set this to relative path of css if module has its own css file |
|
| 97 | + //'css' => '/titre/css/mycss.css.php', |
|
| 98 | + // Set here all hooks context managed by module |
|
| 99 | + 'hooks' => array('invoicecard','propalcard','ordercard','odtgeneration','orderstoinvoice','admin','consumptionthirdparty') |
|
| 100 | + // Set here all workflow context managed by module |
|
| 101 | + //'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) |
|
| 102 | + ); |
|
| 103 | 103 | |
| 104 | - // Data directories to create when module is enabled. |
|
| 105 | - // Example: this->dirs = array("/titre/temp"); |
|
| 106 | - $this->dirs = array(); |
|
| 104 | + // Data directories to create when module is enabled. |
|
| 105 | + // Example: this->dirs = array("/titre/temp"); |
|
| 106 | + $this->dirs = array(); |
|
| 107 | 107 | |
| 108 | - // Config pages. Put here list of php pages |
|
| 109 | - // stored into titre/admin directory, used to setup module. |
|
| 110 | - $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 108 | + // Config pages. Put here list of php pages |
|
| 109 | + // stored into titre/admin directory, used to setup module. |
|
| 110 | + $this->config_page_url = array("subtotal_setup.php@subtotal"); |
|
| 111 | 111 | |
| 112 | - // Dependencies |
|
| 113 | - // List of modules id that must be enabled if this module is enabled |
|
| 114 | - $this->depends = array(); |
|
| 112 | + // Dependencies |
|
| 113 | + // List of modules id that must be enabled if this module is enabled |
|
| 114 | + $this->depends = array(); |
|
| 115 | 115 | |
| 116 | 116 | $this->conflictwith=array('modMilestone'); |
| 117 | - // List of modules id to disable if this one is disabled |
|
| 118 | - $this->requiredby = array(); |
|
| 119 | - // Minimum version of PHP required by module |
|
| 120 | - $this->phpmin = array(5, 3); |
|
| 121 | - // Minimum version of Dolibarr required by module |
|
| 122 | - $this->need_dolibarr_version = array(3, 2); |
|
| 123 | - $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 124 | - // Constants |
|
| 125 | - // List of particular constants to add when module is enabled |
|
| 126 | - // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 127 | - // Example: |
|
| 128 | - $this->const = array( |
|
| 129 | - 0=>array( |
|
| 130 | - 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 131 | - 'chaine', |
|
| 132 | - 'I', |
|
| 133 | - 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 134 | - 1 |
|
| 135 | - ) |
|
| 117 | + // List of modules id to disable if this one is disabled |
|
| 118 | + $this->requiredby = array(); |
|
| 119 | + // Minimum version of PHP required by module |
|
| 120 | + $this->phpmin = array(5, 3); |
|
| 121 | + // Minimum version of Dolibarr required by module |
|
| 122 | + $this->need_dolibarr_version = array(3, 2); |
|
| 123 | + $this->langfiles = array("subtotal@subtotal"); // langfiles@titre |
|
| 124 | + // Constants |
|
| 125 | + // List of particular constants to add when module is enabled |
|
| 126 | + // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) |
|
| 127 | + // Example: |
|
| 128 | + $this->const = array( |
|
| 129 | + 0=>array( |
|
| 130 | + 'SUBTOTAL_STYLE_TITRES_SI_LIGNES_CACHEES', |
|
| 131 | + 'chaine', |
|
| 132 | + 'I', |
|
| 133 | + 'Définit le style (B : gras, I : Italique, U : Souligné) des sous titres lorsque le détail des lignes et des ensembles est caché', |
|
| 134 | + 1 |
|
| 135 | + ) |
|
| 136 | 136 | ,1=>array('SUBTOTAL_ALLOW_ADD_BLOCK', 'chaine', '1', 'Permet l\'ajout de titres et sous-totaux') |
| 137 | 137 | ,2=>array('SUBTOTAL_ALLOW_EDIT_BLOCK', 'chaine', '1', 'Permet de modifier titres et sous-totaux') |
| 138 | 138 | ,3=>array('SUBTOTAL_ALLOW_REMOVE_BLOCK', 'chaine', '1', 'Permet de supprimer les titres et sous-totaux') |
| 139 | 139 | ,4=>array('SUBTOTAL_TITLE_STYLE', 'chaine', 'BU') |
| 140 | 140 | ,5=>array('SUBTOTAL_SUBTOTAL_STYLE', 'chaine', 'B') |
| 141 | - // 1=>array( |
|
| 142 | - // 'MYMODULE_MYNEWCONST2', |
|
| 143 | - // 'chaine', |
|
| 144 | - // 'myvalue', |
|
| 145 | - // 'This is another constant to add', |
|
| 146 | - // 0 |
|
| 147 | - // ) |
|
| 148 | - ); |
|
| 141 | + // 1=>array( |
|
| 142 | + // 'MYMODULE_MYNEWCONST2', |
|
| 143 | + // 'chaine', |
|
| 144 | + // 'myvalue', |
|
| 145 | + // 'This is another constant to add', |
|
| 146 | + // 0 |
|
| 147 | + // ) |
|
| 148 | + ); |
|
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | - // Array to add new pages in new tabs |
|
| 154 | - // Example: |
|
| 155 | - $this->tabs = array( |
|
| 156 | - // // To add a new tab identified by code tabname1 |
|
| 157 | - // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 158 | - // // To add another new tab identified by code tabname2 |
|
| 159 | - // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 160 | - // // To remove an existing tab identified by code tabname |
|
| 161 | - // 'objecttype:-tabname' |
|
| 162 | - ); |
|
| 163 | - // where objecttype can be |
|
| 164 | - // 'thirdparty' to add a tab in third party view |
|
| 165 | - // 'intervention' to add a tab in intervention view |
|
| 166 | - // 'order_supplier' to add a tab in supplier order view |
|
| 167 | - // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 168 | - // 'invoice' to add a tab in customer invoice view |
|
| 169 | - // 'order' to add a tab in customer order view |
|
| 170 | - // 'product' to add a tab in product view |
|
| 171 | - // 'stock' to add a tab in stock view |
|
| 172 | - // 'propal' to add a tab in propal view |
|
| 173 | - // 'member' to add a tab in fundation member view |
|
| 174 | - // 'contract' to add a tab in contract view |
|
| 175 | - // 'user' to add a tab in user view |
|
| 176 | - // 'group' to add a tab in group view |
|
| 177 | - // 'contact' to add a tab in contact view |
|
| 178 | - // 'categories_x' to add a tab in category view |
|
| 179 | - // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 180 | - // Dictionnaries |
|
| 181 | - if (! isset($conf->subtotal->enabled)) { |
|
| 182 | - $conf->subtotal=new stdClass(); |
|
| 183 | - $conf->subtotal->enabled = 0; |
|
| 184 | - } |
|
| 185 | - $this->dictionaries = array( |
|
| 153 | + // Array to add new pages in new tabs |
|
| 154 | + // Example: |
|
| 155 | + $this->tabs = array( |
|
| 156 | + // // To add a new tab identified by code tabname1 |
|
| 157 | + // 'objecttype:+tabname1:Title1:langfile@titre:$user->rights->titre->read:/titre/mynewtab1.php?id=__ID__', |
|
| 158 | + // // To add another new tab identified by code tabname2 |
|
| 159 | + // 'objecttype:+tabname2:Title2:langfile@titre:$user->rights->othermodule->read:/titre/mynewtab2.php?id=__ID__', |
|
| 160 | + // // To remove an existing tab identified by code tabname |
|
| 161 | + // 'objecttype:-tabname' |
|
| 162 | + ); |
|
| 163 | + // where objecttype can be |
|
| 164 | + // 'thirdparty' to add a tab in third party view |
|
| 165 | + // 'intervention' to add a tab in intervention view |
|
| 166 | + // 'order_supplier' to add a tab in supplier order view |
|
| 167 | + // 'invoice_supplier' to add a tab in supplier invoice view |
|
| 168 | + // 'invoice' to add a tab in customer invoice view |
|
| 169 | + // 'order' to add a tab in customer order view |
|
| 170 | + // 'product' to add a tab in product view |
|
| 171 | + // 'stock' to add a tab in stock view |
|
| 172 | + // 'propal' to add a tab in propal view |
|
| 173 | + // 'member' to add a tab in fundation member view |
|
| 174 | + // 'contract' to add a tab in contract view |
|
| 175 | + // 'user' to add a tab in user view |
|
| 176 | + // 'group' to add a tab in group view |
|
| 177 | + // 'contact' to add a tab in contact view |
|
| 178 | + // 'categories_x' to add a tab in category view |
|
| 179 | + // (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
| 180 | + // Dictionnaries |
|
| 181 | + if (! isset($conf->subtotal->enabled)) { |
|
| 182 | + $conf->subtotal=new stdClass(); |
|
| 183 | + $conf->subtotal->enabled = 0; |
|
| 184 | + } |
|
| 185 | + $this->dictionaries = array( |
|
| 186 | 186 | 'langs'=>'subtotal@subtotal', |
| 187 | - 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 188 | - 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 189 | - 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 190 | - 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 191 | - 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 192 | - 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 193 | - 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 194 | - 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 195 | - 'tabcond'=>array($conf->subtotal->enabled) |
|
| 187 | + 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
| 188 | + 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
| 189 | + 'tabsql'=>array('SELECT f.rowid as rowid, f.label, f.content, f.entity, f.active FROM '.MAIN_DB_PREFIX.'c_subtotal_free_text as f WHERE f.entity='.$conf->entity), // Request to select fields |
|
| 190 | + 'tabsqlsort'=>array('label ASC'), // Sort order |
|
| 191 | + 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
| 192 | + 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
| 193 | + 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
| 194 | + 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
| 195 | + 'tabcond'=>array($conf->subtotal->enabled) |
|
| 196 | 196 | ); |
| 197 | - /* Example: |
|
| 197 | + /* Example: |
|
| 198 | 198 | // This is to avoid warnings |
| 199 | 199 | if (! isset($conf->titre->enabled)) $conf->titre->enabled=0; |
| 200 | 200 | $this->dictionnaries=array( |
@@ -235,223 +235,223 @@ discard block |
||
| 235 | 235 | ); |
| 236 | 236 | */ |
| 237 | 237 | |
| 238 | - // Boxes |
|
| 239 | - // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 240 | - $this->boxes = array(); // Boxes list |
|
| 238 | + // Boxes |
|
| 239 | + // Add here list of php file(s) stored in core/boxes that contains class to show a box. |
|
| 240 | + $this->boxes = array(); // Boxes list |
|
| 241 | 241 | |
| 242 | - /* |
|
| 242 | + /* |
|
| 243 | 243 | $this->boxes[$r][1] = "myboxb.php"; |
| 244 | 244 | $r++; |
| 245 | 245 | */ |
| 246 | 246 | |
| 247 | - // Permissions |
|
| 248 | - $this->rights = array(); // Permission array used by this module |
|
| 249 | - $r = 0; |
|
| 247 | + // Permissions |
|
| 248 | + $this->rights = array(); // Permission array used by this module |
|
| 249 | + $r = 0; |
|
| 250 | 250 | |
| 251 | - // Add here list of permission defined by |
|
| 252 | - // an id, a label, a boolean and two constant strings. |
|
| 253 | - // Example: |
|
| 254 | - //// Permission id (must not be already used) |
|
| 255 | - //$this->rights[$r][0] = 2000; |
|
| 256 | - //// Permission label |
|
| 257 | - //$this->rights[$r][1] = 'Permision label'; |
|
| 258 | - //// Permission by default for new user (0/1) |
|
| 259 | - //$this->rights[$r][3] = 1; |
|
| 260 | - //// In php code, permission will be checked by test |
|
| 261 | - //// if ($user->rights->permkey->level1->level2) |
|
| 262 | - //$this->rights[$r][4] = 'level1'; |
|
| 263 | - //// In php code, permission will be checked by test |
|
| 264 | - //// if ($user->rights->permkey->level1->level2) |
|
| 265 | - //$this->rights[$r][5] = 'level2'; |
|
| 266 | - //$r++; |
|
| 267 | - // Main menu entries |
|
| 268 | - $this->menus = array(); // List of menus to add |
|
| 269 | - $r = 0; |
|
| 251 | + // Add here list of permission defined by |
|
| 252 | + // an id, a label, a boolean and two constant strings. |
|
| 253 | + // Example: |
|
| 254 | + //// Permission id (must not be already used) |
|
| 255 | + //$this->rights[$r][0] = 2000; |
|
| 256 | + //// Permission label |
|
| 257 | + //$this->rights[$r][1] = 'Permision label'; |
|
| 258 | + //// Permission by default for new user (0/1) |
|
| 259 | + //$this->rights[$r][3] = 1; |
|
| 260 | + //// In php code, permission will be checked by test |
|
| 261 | + //// if ($user->rights->permkey->level1->level2) |
|
| 262 | + //$this->rights[$r][4] = 'level1'; |
|
| 263 | + //// In php code, permission will be checked by test |
|
| 264 | + //// if ($user->rights->permkey->level1->level2) |
|
| 265 | + //$this->rights[$r][5] = 'level2'; |
|
| 266 | + //$r++; |
|
| 267 | + // Main menu entries |
|
| 268 | + $this->menus = array(); // List of menus to add |
|
| 269 | + $r = 0; |
|
| 270 | 270 | |
| 271 | - // Add here entries to declare new menus |
|
| 272 | - // |
|
| 273 | - // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 274 | - //$this->menu[$r]=array( |
|
| 275 | - // // Put 0 if this is a top menu |
|
| 276 | - // 'fk_menu'=>0, |
|
| 277 | - // // This is a Top menu entry |
|
| 278 | - // 'type'=>'top', |
|
| 279 | - // 'titre'=>'titre top menu', |
|
| 280 | - // 'mainmenu'=>'titre', |
|
| 281 | - // 'leftmenu'=>'titre', |
|
| 282 | - // 'url'=>'/titre/pagetop.php', |
|
| 283 | - // // Lang file to use (without .lang) by module. |
|
| 284 | - // // File must be in langs/code_CODE/ directory. |
|
| 285 | - // 'langs'=>'mylangfile', |
|
| 286 | - // 'position'=>100, |
|
| 287 | - // // Define condition to show or hide menu entry. |
|
| 288 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 289 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 290 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 291 | - // // if you want your menu with a permission rules |
|
| 292 | - // 'perms'=>'1', |
|
| 293 | - // 'target'=>'', |
|
| 294 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 295 | - // 'user'=>2 |
|
| 296 | - //); |
|
| 297 | - //$r++; |
|
| 298 | - //$this->menu[$r]=array( |
|
| 299 | - // // Use r=value where r is index key used for the parent menu entry |
|
| 300 | - // // (higher parent must be a top menu entry) |
|
| 301 | - // 'fk_menu'=>'r=0', |
|
| 302 | - // // This is a Left menu entry |
|
| 303 | - // 'type'=>'left', |
|
| 304 | - // 'titre'=>'titre left menu', |
|
| 305 | - // 'mainmenu'=>'titre', |
|
| 306 | - // 'leftmenu'=>'titre', |
|
| 307 | - // 'url'=>'/titre/pagelevel1.php', |
|
| 308 | - // // Lang file to use (without .lang) by module. |
|
| 309 | - // // File must be in langs/code_CODE/ directory. |
|
| 310 | - // 'langs'=>'mylangfile', |
|
| 311 | - // 'position'=>100, |
|
| 312 | - // // Define condition to show or hide menu entry. |
|
| 313 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 314 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 315 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 316 | - // // if you want your menu with a permission rules |
|
| 317 | - // 'perms'=>'1', |
|
| 318 | - // 'target'=>'', |
|
| 319 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 320 | - // 'user'=>2 |
|
| 321 | - //); |
|
| 322 | - //$r++; |
|
| 323 | - // |
|
| 324 | - // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 325 | - //$this->menu[$r]=array( |
|
| 326 | - // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 327 | - // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 328 | - // // This is a Left menu entry |
|
| 329 | - // 'type'=>'left', |
|
| 330 | - // 'titre'=>'titre left menu', |
|
| 331 | - // 'mainmenu'=>'mainmenucode', |
|
| 332 | - // 'leftmenu'=>'titre', |
|
| 333 | - // 'url'=>'/titre/pagelevel2.php', |
|
| 334 | - // // Lang file to use (without .lang) by module. |
|
| 335 | - // // File must be in langs/code_CODE/ directory. |
|
| 336 | - // 'langs'=>'mylangfile', |
|
| 337 | - // 'position'=>100, |
|
| 338 | - // // Define condition to show or hide menu entry. |
|
| 339 | - // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 340 | - // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 341 | - // 'enabled'=>'$conf->titre->enabled', |
|
| 342 | - // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 343 | - // // if you want your menu with a permission rules |
|
| 344 | - // 'perms'=>'1', |
|
| 345 | - // 'target'=>'', |
|
| 346 | - // // 0=Menu for internal users, 1=external users, 2=both |
|
| 347 | - // 'user'=>2 |
|
| 348 | - //); |
|
| 349 | - //$r++; |
|
| 350 | - // Exports |
|
| 351 | - $r = 1; |
|
| 271 | + // Add here entries to declare new menus |
|
| 272 | + // |
|
| 273 | + // Example to declare a new Top Menu entry and its Left menu entry: |
|
| 274 | + //$this->menu[$r]=array( |
|
| 275 | + // // Put 0 if this is a top menu |
|
| 276 | + // 'fk_menu'=>0, |
|
| 277 | + // // This is a Top menu entry |
|
| 278 | + // 'type'=>'top', |
|
| 279 | + // 'titre'=>'titre top menu', |
|
| 280 | + // 'mainmenu'=>'titre', |
|
| 281 | + // 'leftmenu'=>'titre', |
|
| 282 | + // 'url'=>'/titre/pagetop.php', |
|
| 283 | + // // Lang file to use (without .lang) by module. |
|
| 284 | + // // File must be in langs/code_CODE/ directory. |
|
| 285 | + // 'langs'=>'mylangfile', |
|
| 286 | + // 'position'=>100, |
|
| 287 | + // // Define condition to show or hide menu entry. |
|
| 288 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 289 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 290 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 291 | + // // if you want your menu with a permission rules |
|
| 292 | + // 'perms'=>'1', |
|
| 293 | + // 'target'=>'', |
|
| 294 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 295 | + // 'user'=>2 |
|
| 296 | + //); |
|
| 297 | + //$r++; |
|
| 298 | + //$this->menu[$r]=array( |
|
| 299 | + // // Use r=value where r is index key used for the parent menu entry |
|
| 300 | + // // (higher parent must be a top menu entry) |
|
| 301 | + // 'fk_menu'=>'r=0', |
|
| 302 | + // // This is a Left menu entry |
|
| 303 | + // 'type'=>'left', |
|
| 304 | + // 'titre'=>'titre left menu', |
|
| 305 | + // 'mainmenu'=>'titre', |
|
| 306 | + // 'leftmenu'=>'titre', |
|
| 307 | + // 'url'=>'/titre/pagelevel1.php', |
|
| 308 | + // // Lang file to use (without .lang) by module. |
|
| 309 | + // // File must be in langs/code_CODE/ directory. |
|
| 310 | + // 'langs'=>'mylangfile', |
|
| 311 | + // 'position'=>100, |
|
| 312 | + // // Define condition to show or hide menu entry. |
|
| 313 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 314 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 315 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 316 | + // // if you want your menu with a permission rules |
|
| 317 | + // 'perms'=>'1', |
|
| 318 | + // 'target'=>'', |
|
| 319 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 320 | + // 'user'=>2 |
|
| 321 | + //); |
|
| 322 | + //$r++; |
|
| 323 | + // |
|
| 324 | + // Example to declare a Left Menu entry into an existing Top menu entry: |
|
| 325 | + //$this->menu[$r]=array( |
|
| 326 | + // // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' |
|
| 327 | + // 'fk_menu'=>'fk_mainmenu=mainmenucode', |
|
| 328 | + // // This is a Left menu entry |
|
| 329 | + // 'type'=>'left', |
|
| 330 | + // 'titre'=>'titre left menu', |
|
| 331 | + // 'mainmenu'=>'mainmenucode', |
|
| 332 | + // 'leftmenu'=>'titre', |
|
| 333 | + // 'url'=>'/titre/pagelevel2.php', |
|
| 334 | + // // Lang file to use (without .lang) by module. |
|
| 335 | + // // File must be in langs/code_CODE/ directory. |
|
| 336 | + // 'langs'=>'mylangfile', |
|
| 337 | + // 'position'=>100, |
|
| 338 | + // // Define condition to show or hide menu entry. |
|
| 339 | + // // Use '$conf->titre->enabled' if entry must be visible if module is enabled. |
|
| 340 | + // // Use '$leftmenu==\'system\'' to show if leftmenu system is selected. |
|
| 341 | + // 'enabled'=>'$conf->titre->enabled', |
|
| 342 | + // // Use 'perms'=>'$user->rights->titre->level1->level2' |
|
| 343 | + // // if you want your menu with a permission rules |
|
| 344 | + // 'perms'=>'1', |
|
| 345 | + // 'target'=>'', |
|
| 346 | + // // 0=Menu for internal users, 1=external users, 2=both |
|
| 347 | + // 'user'=>2 |
|
| 348 | + //); |
|
| 349 | + //$r++; |
|
| 350 | + // Exports |
|
| 351 | + $r = 1; |
|
| 352 | 352 | |
| 353 | - // Example: |
|
| 354 | - //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 355 | - //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 356 | - //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 357 | - //// Condition to show export in list (ie: '$user->id==3'). |
|
| 358 | - //// Set to 1 to always show when module is enabled. |
|
| 359 | - //$this->export_enabled[$r]='1'; |
|
| 360 | - //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 361 | - //$this->export_fields_array[$r]=array( |
|
| 362 | - // 's.rowid'=>"IdCompany", |
|
| 363 | - // 's.nom'=>'CompanyName', |
|
| 364 | - // 's.address'=>'Address', |
|
| 365 | - // 's.cp'=>'Zip', |
|
| 366 | - // 's.ville'=>'Town', |
|
| 367 | - // 's.fk_pays'=>'Country', |
|
| 368 | - // 's.tel'=>'Phone', |
|
| 369 | - // 's.siren'=>'ProfId1', |
|
| 370 | - // 's.siret'=>'ProfId2', |
|
| 371 | - // 's.ape'=>'ProfId3', |
|
| 372 | - // 's.idprof4'=>'ProfId4', |
|
| 373 | - // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 374 | - // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 375 | - // 'f.rowid'=>"InvoiceId", |
|
| 376 | - // 'f.facnumber'=>"InvoiceRef", |
|
| 377 | - // 'f.datec'=>"InvoiceDateCreation", |
|
| 378 | - // 'f.datef'=>"DateInvoice", |
|
| 379 | - // 'f.total'=>"TotalHT", |
|
| 380 | - // 'f.total_ttc'=>"TotalTTC", |
|
| 381 | - // 'f.tva'=>"TotalVAT", |
|
| 382 | - // 'f.paye'=>"InvoicePaid", |
|
| 383 | - // 'f.fk_statut'=>'InvoiceStatus', |
|
| 384 | - // 'f.note'=>"InvoiceNote", |
|
| 385 | - // 'fd.rowid'=>'LineId', |
|
| 386 | - // 'fd.description'=>"LineDescription", |
|
| 387 | - // 'fd.price'=>"LineUnitPrice", |
|
| 388 | - // 'fd.tva_tx'=>"LineVATRate", |
|
| 389 | - // 'fd.qty'=>"LineQty", |
|
| 390 | - // 'fd.total_ht'=>"LineTotalHT", |
|
| 391 | - // 'fd.total_tva'=>"LineTotalTVA", |
|
| 392 | - // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 393 | - // 'fd.date_start'=>"DateStart", |
|
| 394 | - // 'fd.date_end'=>"DateEnd", |
|
| 395 | - // 'fd.fk_product'=>'ProductId', |
|
| 396 | - // 'p.ref'=>'ProductRef' |
|
| 397 | - //); |
|
| 398 | - //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 399 | - // 's.nom'=>'company', |
|
| 400 | - // 's.address'=>'company', |
|
| 401 | - // 's.cp'=>'company', |
|
| 402 | - // 's.ville'=>'company', |
|
| 403 | - // 's.fk_pays'=>'company', |
|
| 404 | - // 's.tel'=>'company', |
|
| 405 | - // 's.siren'=>'company', |
|
| 406 | - // 's.siret'=>'company', |
|
| 407 | - // 's.ape'=>'company', |
|
| 408 | - // 's.idprof4'=>'company', |
|
| 409 | - // 's.code_compta'=>'company', |
|
| 410 | - // 's.code_compta_fournisseur'=>'company', |
|
| 411 | - // 'f.rowid'=>"invoice", |
|
| 412 | - // 'f.facnumber'=>"invoice", |
|
| 413 | - // 'f.datec'=>"invoice", |
|
| 414 | - // 'f.datef'=>"invoice", |
|
| 415 | - // 'f.total'=>"invoice", |
|
| 416 | - // 'f.total_ttc'=>"invoice", |
|
| 417 | - // 'f.tva'=>"invoice", |
|
| 418 | - // 'f.paye'=>"invoice", |
|
| 419 | - // 'f.fk_statut'=>'invoice', |
|
| 420 | - // 'f.note'=>"invoice", |
|
| 421 | - // 'fd.rowid'=>'invoice_line', |
|
| 422 | - // 'fd.description'=>"invoice_line", |
|
| 423 | - // 'fd.price'=>"invoice_line", |
|
| 424 | - // 'fd.total_ht'=>"invoice_line", |
|
| 425 | - // 'fd.total_tva'=>"invoice_line", |
|
| 426 | - // 'fd.total_ttc'=>"invoice_line", |
|
| 427 | - // 'fd.tva_tx'=>"invoice_line", |
|
| 428 | - // 'fd.qty'=>"invoice_line", |
|
| 429 | - // 'fd.date_start'=>"invoice_line", |
|
| 430 | - // 'fd.date_end'=>"invoice_line", |
|
| 431 | - // 'fd.fk_product'=>'product', |
|
| 432 | - // 'p.ref'=>'product' |
|
| 433 | - //); |
|
| 434 | - //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 435 | - //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 436 | - // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 437 | - //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 438 | - // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 439 | - //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 440 | - // . 'AND f.rowid = fd.fk_facture'; |
|
| 441 | - //$r++; |
|
| 442 | - } |
|
| 353 | + // Example: |
|
| 354 | + //$this->export_code[$r]=$this->rights_class.'_'.$r; |
|
| 355 | + //// Translation key (used only if key ExportDataset_xxx_z not found) |
|
| 356 | + //$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; |
|
| 357 | + //// Condition to show export in list (ie: '$user->id==3'). |
|
| 358 | + //// Set to 1 to always show when module is enabled. |
|
| 359 | + //$this->export_enabled[$r]='1'; |
|
| 360 | + //$this->export_permission[$r]=array(array("facture","facture","export")); |
|
| 361 | + //$this->export_fields_array[$r]=array( |
|
| 362 | + // 's.rowid'=>"IdCompany", |
|
| 363 | + // 's.nom'=>'CompanyName', |
|
| 364 | + // 's.address'=>'Address', |
|
| 365 | + // 's.cp'=>'Zip', |
|
| 366 | + // 's.ville'=>'Town', |
|
| 367 | + // 's.fk_pays'=>'Country', |
|
| 368 | + // 's.tel'=>'Phone', |
|
| 369 | + // 's.siren'=>'ProfId1', |
|
| 370 | + // 's.siret'=>'ProfId2', |
|
| 371 | + // 's.ape'=>'ProfId3', |
|
| 372 | + // 's.idprof4'=>'ProfId4', |
|
| 373 | + // 's.code_compta'=>'CustomerAccountancyCode', |
|
| 374 | + // 's.code_compta_fournisseur'=>'SupplierAccountancyCode', |
|
| 375 | + // 'f.rowid'=>"InvoiceId", |
|
| 376 | + // 'f.facnumber'=>"InvoiceRef", |
|
| 377 | + // 'f.datec'=>"InvoiceDateCreation", |
|
| 378 | + // 'f.datef'=>"DateInvoice", |
|
| 379 | + // 'f.total'=>"TotalHT", |
|
| 380 | + // 'f.total_ttc'=>"TotalTTC", |
|
| 381 | + // 'f.tva'=>"TotalVAT", |
|
| 382 | + // 'f.paye'=>"InvoicePaid", |
|
| 383 | + // 'f.fk_statut'=>'InvoiceStatus', |
|
| 384 | + // 'f.note'=>"InvoiceNote", |
|
| 385 | + // 'fd.rowid'=>'LineId', |
|
| 386 | + // 'fd.description'=>"LineDescription", |
|
| 387 | + // 'fd.price'=>"LineUnitPrice", |
|
| 388 | + // 'fd.tva_tx'=>"LineVATRate", |
|
| 389 | + // 'fd.qty'=>"LineQty", |
|
| 390 | + // 'fd.total_ht'=>"LineTotalHT", |
|
| 391 | + // 'fd.total_tva'=>"LineTotalTVA", |
|
| 392 | + // 'fd.total_ttc'=>"LineTotalTTC", |
|
| 393 | + // 'fd.date_start'=>"DateStart", |
|
| 394 | + // 'fd.date_end'=>"DateEnd", |
|
| 395 | + // 'fd.fk_product'=>'ProductId', |
|
| 396 | + // 'p.ref'=>'ProductRef' |
|
| 397 | + //); |
|
| 398 | + //$this->export_entities_array[$r]=array('s.rowid'=>"company", |
|
| 399 | + // 's.nom'=>'company', |
|
| 400 | + // 's.address'=>'company', |
|
| 401 | + // 's.cp'=>'company', |
|
| 402 | + // 's.ville'=>'company', |
|
| 403 | + // 's.fk_pays'=>'company', |
|
| 404 | + // 's.tel'=>'company', |
|
| 405 | + // 's.siren'=>'company', |
|
| 406 | + // 's.siret'=>'company', |
|
| 407 | + // 's.ape'=>'company', |
|
| 408 | + // 's.idprof4'=>'company', |
|
| 409 | + // 's.code_compta'=>'company', |
|
| 410 | + // 's.code_compta_fournisseur'=>'company', |
|
| 411 | + // 'f.rowid'=>"invoice", |
|
| 412 | + // 'f.facnumber'=>"invoice", |
|
| 413 | + // 'f.datec'=>"invoice", |
|
| 414 | + // 'f.datef'=>"invoice", |
|
| 415 | + // 'f.total'=>"invoice", |
|
| 416 | + // 'f.total_ttc'=>"invoice", |
|
| 417 | + // 'f.tva'=>"invoice", |
|
| 418 | + // 'f.paye'=>"invoice", |
|
| 419 | + // 'f.fk_statut'=>'invoice', |
|
| 420 | + // 'f.note'=>"invoice", |
|
| 421 | + // 'fd.rowid'=>'invoice_line', |
|
| 422 | + // 'fd.description'=>"invoice_line", |
|
| 423 | + // 'fd.price'=>"invoice_line", |
|
| 424 | + // 'fd.total_ht'=>"invoice_line", |
|
| 425 | + // 'fd.total_tva'=>"invoice_line", |
|
| 426 | + // 'fd.total_ttc'=>"invoice_line", |
|
| 427 | + // 'fd.tva_tx'=>"invoice_line", |
|
| 428 | + // 'fd.qty'=>"invoice_line", |
|
| 429 | + // 'fd.date_start'=>"invoice_line", |
|
| 430 | + // 'fd.date_end'=>"invoice_line", |
|
| 431 | + // 'fd.fk_product'=>'product', |
|
| 432 | + // 'p.ref'=>'product' |
|
| 433 | + //); |
|
| 434 | + //$this->export_sql_start[$r] = 'SELECT DISTINCT '; |
|
| 435 | + //$this->export_sql_end[$r] = ' FROM (' . MAIN_DB_PREFIX . 'facture as f, ' |
|
| 436 | + // . MAIN_DB_PREFIX . 'facturedet as fd, ' . MAIN_DB_PREFIX . 'societe as s)'; |
|
| 437 | + //$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX |
|
| 438 | + // . 'product as p on (fd.fk_product = p.rowid)'; |
|
| 439 | + //$this->export_sql_end[$r] .= ' WHERE f.fk_soc = s.rowid ' |
|
| 440 | + // . 'AND f.rowid = fd.fk_facture'; |
|
| 441 | + //$r++; |
|
| 442 | + } |
|
| 443 | 443 | |
| 444 | - /** |
|
| 445 | - * Function called when module is enabled. |
|
| 446 | - * The init function add constants, boxes, permissions and menus |
|
| 447 | - * (defined in constructor) into Dolibarr database. |
|
| 448 | - * It also creates data directories |
|
| 449 | - * |
|
| 450 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 451 | - * @return int 1 if OK, 0 if KO |
|
| 452 | - */ |
|
| 453 | - public function init($options = '') |
|
| 454 | - { |
|
| 444 | + /** |
|
| 445 | + * Function called when module is enabled. |
|
| 446 | + * The init function add constants, boxes, permissions and menus |
|
| 447 | + * (defined in constructor) into Dolibarr database. |
|
| 448 | + * It also creates data directories |
|
| 449 | + * |
|
| 450 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 451 | + * @return int 1 if OK, 0 if KO |
|
| 452 | + */ |
|
| 453 | + public function init($options = '') |
|
| 454 | + { |
|
| 455 | 455 | global $conf, $db; |
| 456 | 456 | |
| 457 | 457 | |
@@ -459,46 +459,46 @@ discard block |
||
| 459 | 459 | exit("Attention, ce module rentre ne conflit avec le module Jalon/Milestones. Merci de le désactiver auparavant."); |
| 460 | 460 | } |
| 461 | 461 | */ |
| 462 | - $sql = array(); |
|
| 462 | + $sql = array(); |
|
| 463 | 463 | |
| 464 | - $result = $this->loadTables(); |
|
| 465 | - dol_include_once('/core/class/extrafields.class.php'); |
|
| 464 | + $result = $this->loadTables(); |
|
| 465 | + dol_include_once('/core/class/extrafields.class.php'); |
|
| 466 | 466 | |
| 467 | - $extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
|
| 468 | - $TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
|
| 469 | - foreach($TElementType as $element_type) { |
|
| 470 | - $extra->addExtraField('show_total_ht', 'Afficher le Total HT sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 471 | - $extra->addExtraField('show_reduc', 'Afficher la réduction sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 472 | - } |
|
| 467 | + $extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
|
| 468 | + $TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
|
| 469 | + foreach($TElementType as $element_type) { |
|
| 470 | + $extra->addExtraField('show_total_ht', 'Afficher le Total HT sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 471 | + $extra->addExtraField('show_reduc', 'Afficher la réduction sur le sous-total', 'int', 0, 10, $element_type, 0, 0, '', unserialize('a:1:{s:7:"options";a:1:{s:0:"";N;}}'), 0, '', 0, 1); |
|
| 472 | + } |
|
| 473 | 473 | |
| 474 | - return $this->_init($sql, $options); |
|
| 475 | - } |
|
| 474 | + return $this->_init($sql, $options); |
|
| 475 | + } |
|
| 476 | 476 | |
| 477 | - /** |
|
| 478 | - * Function called when module is disabled. |
|
| 479 | - * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 480 | - * Data directories are not deleted |
|
| 481 | - * |
|
| 482 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
| 483 | - * @return int 1 if OK, 0 if KO |
|
| 484 | - */ |
|
| 485 | - public function remove($options = '') |
|
| 486 | - { |
|
| 487 | - $sql = array(); |
|
| 477 | + /** |
|
| 478 | + * Function called when module is disabled. |
|
| 479 | + * Remove from database constants, boxes and permissions from Dolibarr database. |
|
| 480 | + * Data directories are not deleted |
|
| 481 | + * |
|
| 482 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
| 483 | + * @return int 1 if OK, 0 if KO |
|
| 484 | + */ |
|
| 485 | + public function remove($options = '') |
|
| 486 | + { |
|
| 487 | + $sql = array(); |
|
| 488 | 488 | |
| 489 | - return $this->_remove($sql, $options); |
|
| 490 | - } |
|
| 489 | + return $this->_remove($sql, $options); |
|
| 490 | + } |
|
| 491 | 491 | |
| 492 | - /** |
|
| 493 | - * Create tables, keys and data required by module |
|
| 494 | - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 495 | - * and create data commands must be stored in directory /titre/sql/ |
|
| 496 | - * This function is called by this->init |
|
| 497 | - * |
|
| 498 | - * @return int <=0 if KO, >0 if OK |
|
| 499 | - */ |
|
| 500 | - private function loadTables() |
|
| 501 | - { |
|
| 502 | - return $this->_load_tables('/subtotal/sql/'); |
|
| 503 | - } |
|
| 492 | + /** |
|
| 493 | + * Create tables, keys and data required by module |
|
| 494 | + * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
| 495 | + * and create data commands must be stored in directory /titre/sql/ |
|
| 496 | + * This function is called by this->init |
|
| 497 | + * |
|
| 498 | + * @return int <=0 if KO, >0 if OK |
|
| 499 | + */ |
|
| 500 | + private function loadTables() |
|
| 501 | + { |
|
| 502 | + return $this->_load_tables('/subtotal/sql/'); |
|
| 503 | + } |
|
| 504 | 504 | } |
@@ -36,68 +36,68 @@ discard block |
||
| 36 | 36 | class Interfacesubtotaltrigger |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - private $db; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Constructor |
|
| 43 | - * |
|
| 44 | - * @param DoliDB $db Database handler |
|
| 45 | - */ |
|
| 46 | - public function __construct($db) |
|
| 47 | - { |
|
| 48 | - $this->db = $db; |
|
| 49 | - |
|
| 50 | - $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
| 51 | - $this->family = "demo"; |
|
| 52 | - $this->description = "Triggers of this module are empty functions." |
|
| 53 | - . "They have no effect." |
|
| 54 | - . "They are provided for tutorial purpose only."; |
|
| 55 | - // 'development', 'experimental', 'dolibarr' or version |
|
| 56 | - $this->version = 'development'; |
|
| 57 | - $this->picto = 'titre@titre'; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Trigger name |
|
| 62 | - * |
|
| 63 | - * @return string Name of trigger file |
|
| 64 | - */ |
|
| 65 | - public function getName() |
|
| 66 | - { |
|
| 67 | - return $this->name; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * Trigger description |
|
| 72 | - * |
|
| 73 | - * @return string Description of trigger file |
|
| 74 | - */ |
|
| 75 | - public function getDesc() |
|
| 76 | - { |
|
| 77 | - return $this->description; |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Trigger version |
|
| 82 | - * |
|
| 83 | - * @return string Version of trigger file |
|
| 84 | - */ |
|
| 85 | - public function getVersion() |
|
| 86 | - { |
|
| 87 | - global $langs; |
|
| 88 | - $langs->load("admin"); |
|
| 89 | - |
|
| 90 | - if ($this->version == 'development') { |
|
| 91 | - return $langs->trans("Development"); |
|
| 92 | - } elseif ($this->version == 'experimental') |
|
| 93 | - |
|
| 94 | - return $langs->trans("Experimental"); |
|
| 95 | - elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 96 | - elseif ($this->version) return $this->version; |
|
| 97 | - else { |
|
| 98 | - return $langs->trans("Unknown"); |
|
| 99 | - } |
|
| 100 | - } |
|
| 39 | + private $db; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Constructor |
|
| 43 | + * |
|
| 44 | + * @param DoliDB $db Database handler |
|
| 45 | + */ |
|
| 46 | + public function __construct($db) |
|
| 47 | + { |
|
| 48 | + $this->db = $db; |
|
| 49 | + |
|
| 50 | + $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
| 51 | + $this->family = "demo"; |
|
| 52 | + $this->description = "Triggers of this module are empty functions." |
|
| 53 | + . "They have no effect." |
|
| 54 | + . "They are provided for tutorial purpose only."; |
|
| 55 | + // 'development', 'experimental', 'dolibarr' or version |
|
| 56 | + $this->version = 'development'; |
|
| 57 | + $this->picto = 'titre@titre'; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Trigger name |
|
| 62 | + * |
|
| 63 | + * @return string Name of trigger file |
|
| 64 | + */ |
|
| 65 | + public function getName() |
|
| 66 | + { |
|
| 67 | + return $this->name; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * Trigger description |
|
| 72 | + * |
|
| 73 | + * @return string Description of trigger file |
|
| 74 | + */ |
|
| 75 | + public function getDesc() |
|
| 76 | + { |
|
| 77 | + return $this->description; |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Trigger version |
|
| 82 | + * |
|
| 83 | + * @return string Version of trigger file |
|
| 84 | + */ |
|
| 85 | + public function getVersion() |
|
| 86 | + { |
|
| 87 | + global $langs; |
|
| 88 | + $langs->load("admin"); |
|
| 89 | + |
|
| 90 | + if ($this->version == 'development') { |
|
| 91 | + return $langs->trans("Development"); |
|
| 92 | + } elseif ($this->version == 'experimental') |
|
| 93 | + |
|
| 94 | + return $langs->trans("Experimental"); |
|
| 95 | + elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 96 | + elseif ($this->version) return $this->version; |
|
| 97 | + else { |
|
| 98 | + return $langs->trans("Unknown"); |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | 102 | public function addToBegin(&$parent, &$object, $rang) |
| 103 | 103 | { |
@@ -147,27 +147,27 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Function called when a Dolibarrr business event is done. |
|
| 152 | - * All functions "run_trigger" are triggered if file |
|
| 153 | - * is inside directory core/triggers |
|
| 154 | - * |
|
| 155 | - * @param string $action Event action code |
|
| 156 | - * @param Object $object Object |
|
| 157 | - * @param User $user Object user |
|
| 158 | - * @param Translate $langs Object langs |
|
| 159 | - * @param conf $conf Object conf |
|
| 160 | - * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
| 161 | - */ |
|
| 162 | - public function run_trigger($action, $object, $user, $langs, $conf) |
|
| 163 | - { |
|
| 164 | - // Put here code you want to execute when a Dolibarr business events occurs. |
|
| 165 | - // Data and type of action are stored into $object and $action |
|
| 166 | - // Users |
|
| 167 | - dol_include_once('/subtotal/class/subtotal.class.php'); |
|
| 168 | - $langs->load('subtotal@subtotal'); |
|
| 150 | + /** |
|
| 151 | + * Function called when a Dolibarrr business event is done. |
|
| 152 | + * All functions "run_trigger" are triggered if file |
|
| 153 | + * is inside directory core/triggers |
|
| 154 | + * |
|
| 155 | + * @param string $action Event action code |
|
| 156 | + * @param Object $object Object |
|
| 157 | + * @param User $user Object user |
|
| 158 | + * @param Translate $langs Object langs |
|
| 159 | + * @param conf $conf Object conf |
|
| 160 | + * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
| 161 | + */ |
|
| 162 | + public function run_trigger($action, $object, $user, $langs, $conf) |
|
| 163 | + { |
|
| 164 | + // Put here code you want to execute when a Dolibarr business events occurs. |
|
| 165 | + // Data and type of action are stored into $object and $action |
|
| 166 | + // Users |
|
| 167 | + dol_include_once('/subtotal/class/subtotal.class.php'); |
|
| 168 | + $langs->load('subtotal@subtotal'); |
|
| 169 | 169 | |
| 170 | - if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT'))) |
|
| 170 | + if (!empty($conf->global->SUBTOTAL_ALLOW_ADD_LINE_UNDER_TITLE) && in_array($action, array('LINEPROPAL_INSERT', 'LINEORDER_INSERT', 'LINEBILL_INSERT'))) |
|
| 171 | 171 | { |
| 172 | 172 | |
| 173 | 173 | $rang = GETPOST('under_title', 'int'); // Rang du titre |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| 202 | - if ($action == 'LINEBILL_INSERT' && $object->special_code != TSubtotal::$module_number) |
|
| 202 | + if ($action == 'LINEBILL_INSERT' && $object->special_code != TSubtotal::$module_number) |
|
| 203 | 203 | { |
| 204 | 204 | $subtotal_add_title_bloc_from_orderstoinvoice = GETPOST('subtotal_add_title_bloc_from_orderstoinvoice'); |
| 205 | 205 | if (!empty($subtotal_add_title_bloc_from_orderstoinvoice)) |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | if (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && in_array($action, array('LINEPROPAL_INSERT', 'LINEPROPAL_UPDATE', 'LINEORDER_INSERT', 'LINEORDER_UPDATE', 'LINEBILL_INSERT', 'LINEBILL_UPDATE'))) |
| 257 | 257 | { |
| 258 | - if(! function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 258 | + if(! function_exists('_updateLineNC')) dol_include_once('/subtotal/lib/subtotal.lib.php'); |
|
| 259 | 259 | |
| 260 | 260 | $doli_action = GETPOST('action'); |
| 261 | 261 | $set = GETPOST('set'); |
@@ -321,173 +321,173 @@ discard block |
||
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | |
| 324 | - if ($action == 'USER_LOGIN') { |
|
| 325 | - dol_syslog( |
|
| 326 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 327 | - ); |
|
| 328 | - } elseif ($action == 'USER_UPDATE_SESSION') { |
|
| 329 | - // Warning: To increase performances, this action is triggered only if |
|
| 330 | - // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. |
|
| 331 | - dol_syslog( |
|
| 332 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 333 | - ); |
|
| 334 | - } elseif ($action == 'USER_CREATE') { |
|
| 335 | - dol_syslog( |
|
| 336 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 337 | - ); |
|
| 338 | - } elseif ($action == 'USER_CREATE_FROM_CONTACT') { |
|
| 339 | - dol_syslog( |
|
| 340 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 341 | - ); |
|
| 342 | - } elseif ($action == 'USER_MODIFY') { |
|
| 343 | - dol_syslog( |
|
| 344 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 345 | - ); |
|
| 346 | - } elseif ($action == 'USER_NEW_PASSWORD') { |
|
| 347 | - dol_syslog( |
|
| 348 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 349 | - ); |
|
| 350 | - } elseif ($action == 'USER_ENABLEDISABLE') { |
|
| 351 | - dol_syslog( |
|
| 352 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 353 | - ); |
|
| 354 | - } elseif ($action == 'USER_DELETE') { |
|
| 355 | - dol_syslog( |
|
| 356 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 357 | - ); |
|
| 358 | - } elseif ($action == 'USER_LOGOUT') { |
|
| 359 | - dol_syslog( |
|
| 360 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 361 | - ); |
|
| 362 | - } elseif ($action == 'USER_SETINGROUP') { |
|
| 363 | - dol_syslog( |
|
| 364 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 365 | - ); |
|
| 366 | - } elseif ($action == 'USER_REMOVEFROMGROUP') { |
|
| 367 | - dol_syslog( |
|
| 368 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 369 | - ); |
|
| 370 | - } |
|
| 371 | - |
|
| 372 | - // Groups |
|
| 373 | - elseif ($action == 'GROUP_CREATE') { |
|
| 374 | - dol_syslog( |
|
| 375 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 376 | - ); |
|
| 377 | - } elseif ($action == 'GROUP_MODIFY') { |
|
| 378 | - dol_syslog( |
|
| 379 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 380 | - ); |
|
| 381 | - } elseif ($action == 'GROUP_DELETE') { |
|
| 382 | - dol_syslog( |
|
| 383 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 384 | - ); |
|
| 385 | - } |
|
| 386 | - |
|
| 387 | - // Companies |
|
| 388 | - elseif ($action == 'COMPANY_CREATE') { |
|
| 389 | - dol_syslog( |
|
| 390 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 391 | - ); |
|
| 392 | - } elseif ($action == 'COMPANY_MODIFY') { |
|
| 393 | - dol_syslog( |
|
| 394 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 395 | - ); |
|
| 396 | - } elseif ($action == 'COMPANY_DELETE') { |
|
| 397 | - dol_syslog( |
|
| 398 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 399 | - ); |
|
| 400 | - } |
|
| 401 | - |
|
| 402 | - // Contacts |
|
| 403 | - elseif ($action == 'CONTACT_CREATE') { |
|
| 404 | - dol_syslog( |
|
| 405 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 406 | - ); |
|
| 407 | - } elseif ($action == 'CONTACT_MODIFY') { |
|
| 408 | - dol_syslog( |
|
| 409 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 410 | - ); |
|
| 411 | - } elseif ($action == 'CONTACT_DELETE') { |
|
| 412 | - dol_syslog( |
|
| 413 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 414 | - ); |
|
| 415 | - } |
|
| 416 | - |
|
| 417 | - // Products |
|
| 418 | - elseif ($action == 'PRODUCT_CREATE') { |
|
| 419 | - dol_syslog( |
|
| 420 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 421 | - ); |
|
| 422 | - } elseif ($action == 'PRODUCT_MODIFY') { |
|
| 423 | - dol_syslog( |
|
| 424 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 425 | - ); |
|
| 426 | - } elseif ($action == 'PRODUCT_DELETE') { |
|
| 427 | - dol_syslog( |
|
| 428 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 429 | - ); |
|
| 430 | - } |
|
| 431 | - |
|
| 432 | - // Customer orders |
|
| 433 | - elseif ($action == 'ORDER_CREATE') { |
|
| 434 | - dol_syslog( |
|
| 435 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 436 | - ); |
|
| 437 | - } elseif ($action == 'ORDER_VALIDATE') { |
|
| 438 | - dol_syslog( |
|
| 439 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 440 | - ); |
|
| 441 | - } elseif ($action == 'ORDER_DELETE') { |
|
| 442 | - dol_syslog( |
|
| 443 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 444 | - ); |
|
| 445 | - } elseif ($action == 'ORDER_BUILDDOC') { |
|
| 446 | - dol_syslog( |
|
| 447 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 448 | - ); |
|
| 449 | - } elseif ($action == 'ORDER_SENTBYMAIL') { |
|
| 450 | - dol_syslog( |
|
| 451 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 452 | - ); |
|
| 453 | - } elseif ($action == 'LINEORDER_INSERT') { |
|
| 454 | - dol_syslog( |
|
| 455 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 456 | - ); |
|
| 457 | - } elseif ($action == 'LINEORDER_DELETE') { |
|
| 458 | - dol_syslog( |
|
| 459 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 460 | - ); |
|
| 461 | - } |
|
| 462 | - |
|
| 463 | - // Supplier orders |
|
| 464 | - elseif ($action == 'ORDER_SUPPLIER_CREATE') { |
|
| 465 | - dol_syslog( |
|
| 466 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 467 | - ); |
|
| 468 | - } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { |
|
| 469 | - dol_syslog( |
|
| 470 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 471 | - ); |
|
| 472 | - } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { |
|
| 473 | - dol_syslog( |
|
| 474 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 475 | - ); |
|
| 476 | - } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') { |
|
| 477 | - dol_syslog( |
|
| 478 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 479 | - ); |
|
| 480 | - } |
|
| 481 | - |
|
| 482 | - // Proposals |
|
| 483 | - elseif ($action == 'PROPAL_CREATE') { |
|
| 484 | - dol_syslog( |
|
| 485 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 486 | - ); |
|
| 487 | - } elseif (in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) { |
|
| 488 | - dol_syslog( |
|
| 489 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 490 | - ); |
|
| 324 | + if ($action == 'USER_LOGIN') { |
|
| 325 | + dol_syslog( |
|
| 326 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 327 | + ); |
|
| 328 | + } elseif ($action == 'USER_UPDATE_SESSION') { |
|
| 329 | + // Warning: To increase performances, this action is triggered only if |
|
| 330 | + // constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1. |
|
| 331 | + dol_syslog( |
|
| 332 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 333 | + ); |
|
| 334 | + } elseif ($action == 'USER_CREATE') { |
|
| 335 | + dol_syslog( |
|
| 336 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 337 | + ); |
|
| 338 | + } elseif ($action == 'USER_CREATE_FROM_CONTACT') { |
|
| 339 | + dol_syslog( |
|
| 340 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 341 | + ); |
|
| 342 | + } elseif ($action == 'USER_MODIFY') { |
|
| 343 | + dol_syslog( |
|
| 344 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 345 | + ); |
|
| 346 | + } elseif ($action == 'USER_NEW_PASSWORD') { |
|
| 347 | + dol_syslog( |
|
| 348 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 349 | + ); |
|
| 350 | + } elseif ($action == 'USER_ENABLEDISABLE') { |
|
| 351 | + dol_syslog( |
|
| 352 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 353 | + ); |
|
| 354 | + } elseif ($action == 'USER_DELETE') { |
|
| 355 | + dol_syslog( |
|
| 356 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 357 | + ); |
|
| 358 | + } elseif ($action == 'USER_LOGOUT') { |
|
| 359 | + dol_syslog( |
|
| 360 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 361 | + ); |
|
| 362 | + } elseif ($action == 'USER_SETINGROUP') { |
|
| 363 | + dol_syslog( |
|
| 364 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 365 | + ); |
|
| 366 | + } elseif ($action == 'USER_REMOVEFROMGROUP') { |
|
| 367 | + dol_syslog( |
|
| 368 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 369 | + ); |
|
| 370 | + } |
|
| 371 | + |
|
| 372 | + // Groups |
|
| 373 | + elseif ($action == 'GROUP_CREATE') { |
|
| 374 | + dol_syslog( |
|
| 375 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 376 | + ); |
|
| 377 | + } elseif ($action == 'GROUP_MODIFY') { |
|
| 378 | + dol_syslog( |
|
| 379 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 380 | + ); |
|
| 381 | + } elseif ($action == 'GROUP_DELETE') { |
|
| 382 | + dol_syslog( |
|
| 383 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 384 | + ); |
|
| 385 | + } |
|
| 386 | + |
|
| 387 | + // Companies |
|
| 388 | + elseif ($action == 'COMPANY_CREATE') { |
|
| 389 | + dol_syslog( |
|
| 390 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 391 | + ); |
|
| 392 | + } elseif ($action == 'COMPANY_MODIFY') { |
|
| 393 | + dol_syslog( |
|
| 394 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 395 | + ); |
|
| 396 | + } elseif ($action == 'COMPANY_DELETE') { |
|
| 397 | + dol_syslog( |
|
| 398 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 399 | + ); |
|
| 400 | + } |
|
| 401 | + |
|
| 402 | + // Contacts |
|
| 403 | + elseif ($action == 'CONTACT_CREATE') { |
|
| 404 | + dol_syslog( |
|
| 405 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 406 | + ); |
|
| 407 | + } elseif ($action == 'CONTACT_MODIFY') { |
|
| 408 | + dol_syslog( |
|
| 409 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 410 | + ); |
|
| 411 | + } elseif ($action == 'CONTACT_DELETE') { |
|
| 412 | + dol_syslog( |
|
| 413 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 414 | + ); |
|
| 415 | + } |
|
| 416 | + |
|
| 417 | + // Products |
|
| 418 | + elseif ($action == 'PRODUCT_CREATE') { |
|
| 419 | + dol_syslog( |
|
| 420 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 421 | + ); |
|
| 422 | + } elseif ($action == 'PRODUCT_MODIFY') { |
|
| 423 | + dol_syslog( |
|
| 424 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 425 | + ); |
|
| 426 | + } elseif ($action == 'PRODUCT_DELETE') { |
|
| 427 | + dol_syslog( |
|
| 428 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 429 | + ); |
|
| 430 | + } |
|
| 431 | + |
|
| 432 | + // Customer orders |
|
| 433 | + elseif ($action == 'ORDER_CREATE') { |
|
| 434 | + dol_syslog( |
|
| 435 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 436 | + ); |
|
| 437 | + } elseif ($action == 'ORDER_VALIDATE') { |
|
| 438 | + dol_syslog( |
|
| 439 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 440 | + ); |
|
| 441 | + } elseif ($action == 'ORDER_DELETE') { |
|
| 442 | + dol_syslog( |
|
| 443 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 444 | + ); |
|
| 445 | + } elseif ($action == 'ORDER_BUILDDOC') { |
|
| 446 | + dol_syslog( |
|
| 447 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 448 | + ); |
|
| 449 | + } elseif ($action == 'ORDER_SENTBYMAIL') { |
|
| 450 | + dol_syslog( |
|
| 451 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 452 | + ); |
|
| 453 | + } elseif ($action == 'LINEORDER_INSERT') { |
|
| 454 | + dol_syslog( |
|
| 455 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 456 | + ); |
|
| 457 | + } elseif ($action == 'LINEORDER_DELETE') { |
|
| 458 | + dol_syslog( |
|
| 459 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 460 | + ); |
|
| 461 | + } |
|
| 462 | + |
|
| 463 | + // Supplier orders |
|
| 464 | + elseif ($action == 'ORDER_SUPPLIER_CREATE') { |
|
| 465 | + dol_syslog( |
|
| 466 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 467 | + ); |
|
| 468 | + } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { |
|
| 469 | + dol_syslog( |
|
| 470 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 471 | + ); |
|
| 472 | + } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { |
|
| 473 | + dol_syslog( |
|
| 474 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 475 | + ); |
|
| 476 | + } elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') { |
|
| 477 | + dol_syslog( |
|
| 478 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 479 | + ); |
|
| 480 | + } |
|
| 481 | + |
|
| 482 | + // Proposals |
|
| 483 | + elseif ($action == 'PROPAL_CREATE') { |
|
| 484 | + dol_syslog( |
|
| 485 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 486 | + ); |
|
| 487 | + } elseif (in_array($action, array('PROPAL_CLONE', 'ORDER_CLONE', 'BILL_CLONE'))) { |
|
| 488 | + dol_syslog( |
|
| 489 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 490 | + ); |
|
| 491 | 491 | |
| 492 | 492 | $doli_action = GETPOST('action'); |
| 493 | 493 | |
@@ -520,277 +520,277 @@ discard block |
||
| 520 | 520 | if (!empty($line)) $object->update_price(1); |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | - } elseif ($action == 'PROPAL_MODIFY') { |
|
| 524 | - dol_syslog( |
|
| 525 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 526 | - ); |
|
| 527 | - } elseif ($action == 'PROPAL_VALIDATE') { |
|
| 528 | - dol_syslog( |
|
| 529 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 530 | - ); |
|
| 531 | - } elseif ($action == 'PROPAL_BUILDDOC') { |
|
| 532 | - dol_syslog( |
|
| 533 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 534 | - ); |
|
| 535 | - } elseif ($action == 'PROPAL_SENTBYMAIL') { |
|
| 536 | - dol_syslog( |
|
| 537 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 538 | - ); |
|
| 539 | - } elseif ($action == 'PROPAL_CLOSE_SIGNED') { |
|
| 540 | - dol_syslog( |
|
| 541 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 542 | - ); |
|
| 543 | - } elseif ($action == 'PROPAL_CLOSE_REFUSED') { |
|
| 544 | - dol_syslog( |
|
| 545 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 546 | - ); |
|
| 547 | - } elseif ($action == 'PROPAL_DELETE') { |
|
| 548 | - dol_syslog( |
|
| 549 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 550 | - ); |
|
| 551 | - } elseif ($action == 'LINEPROPAL_INSERT') { |
|
| 552 | - dol_syslog( |
|
| 553 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 554 | - ); |
|
| 555 | - } elseif ($action == 'LINEPROPAL_MODIFY') { |
|
| 556 | - dol_syslog( |
|
| 557 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 558 | - ); |
|
| 559 | - } elseif ($action == 'LINEPROPAL_DELETE') { |
|
| 560 | - dol_syslog( |
|
| 561 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 562 | - ); |
|
| 563 | - } |
|
| 564 | - |
|
| 565 | - // Contracts |
|
| 566 | - elseif ($action == 'CONTRACT_CREATE') { |
|
| 567 | - dol_syslog( |
|
| 568 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 569 | - ); |
|
| 570 | - } elseif ($action == 'CONTRACT_MODIFY') { |
|
| 571 | - dol_syslog( |
|
| 572 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 573 | - ); |
|
| 574 | - } elseif ($action == 'CONTRACT_ACTIVATE') { |
|
| 575 | - dol_syslog( |
|
| 576 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 577 | - ); |
|
| 578 | - } elseif ($action == 'CONTRACT_CANCEL') { |
|
| 579 | - dol_syslog( |
|
| 580 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 581 | - ); |
|
| 582 | - } elseif ($action == 'CONTRACT_CLOSE') { |
|
| 583 | - dol_syslog( |
|
| 584 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 585 | - ); |
|
| 586 | - } elseif ($action == 'CONTRACT_DELETE') { |
|
| 587 | - dol_syslog( |
|
| 588 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 589 | - ); |
|
| 590 | - } |
|
| 523 | + } elseif ($action == 'PROPAL_MODIFY') { |
|
| 524 | + dol_syslog( |
|
| 525 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 526 | + ); |
|
| 527 | + } elseif ($action == 'PROPAL_VALIDATE') { |
|
| 528 | + dol_syslog( |
|
| 529 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 530 | + ); |
|
| 531 | + } elseif ($action == 'PROPAL_BUILDDOC') { |
|
| 532 | + dol_syslog( |
|
| 533 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 534 | + ); |
|
| 535 | + } elseif ($action == 'PROPAL_SENTBYMAIL') { |
|
| 536 | + dol_syslog( |
|
| 537 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 538 | + ); |
|
| 539 | + } elseif ($action == 'PROPAL_CLOSE_SIGNED') { |
|
| 540 | + dol_syslog( |
|
| 541 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 542 | + ); |
|
| 543 | + } elseif ($action == 'PROPAL_CLOSE_REFUSED') { |
|
| 544 | + dol_syslog( |
|
| 545 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 546 | + ); |
|
| 547 | + } elseif ($action == 'PROPAL_DELETE') { |
|
| 548 | + dol_syslog( |
|
| 549 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 550 | + ); |
|
| 551 | + } elseif ($action == 'LINEPROPAL_INSERT') { |
|
| 552 | + dol_syslog( |
|
| 553 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 554 | + ); |
|
| 555 | + } elseif ($action == 'LINEPROPAL_MODIFY') { |
|
| 556 | + dol_syslog( |
|
| 557 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 558 | + ); |
|
| 559 | + } elseif ($action == 'LINEPROPAL_DELETE') { |
|
| 560 | + dol_syslog( |
|
| 561 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 562 | + ); |
|
| 563 | + } |
|
| 564 | + |
|
| 565 | + // Contracts |
|
| 566 | + elseif ($action == 'CONTRACT_CREATE') { |
|
| 567 | + dol_syslog( |
|
| 568 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 569 | + ); |
|
| 570 | + } elseif ($action == 'CONTRACT_MODIFY') { |
|
| 571 | + dol_syslog( |
|
| 572 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 573 | + ); |
|
| 574 | + } elseif ($action == 'CONTRACT_ACTIVATE') { |
|
| 575 | + dol_syslog( |
|
| 576 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 577 | + ); |
|
| 578 | + } elseif ($action == 'CONTRACT_CANCEL') { |
|
| 579 | + dol_syslog( |
|
| 580 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 581 | + ); |
|
| 582 | + } elseif ($action == 'CONTRACT_CLOSE') { |
|
| 583 | + dol_syslog( |
|
| 584 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 585 | + ); |
|
| 586 | + } elseif ($action == 'CONTRACT_DELETE') { |
|
| 587 | + dol_syslog( |
|
| 588 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 589 | + ); |
|
| 590 | + } |
|
| 591 | 591 | |
| 592 | 592 | elseif ($action == 'BILL_MODIFY') { |
| 593 | - dol_syslog( |
|
| 594 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 595 | - ); |
|
| 596 | - } elseif ($action == 'BILL_VALIDATE') { |
|
| 597 | - dol_syslog( |
|
| 598 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 599 | - ); |
|
| 600 | - } elseif ($action == 'BILL_BUILDDOC') { |
|
| 601 | - dol_syslog( |
|
| 602 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 603 | - ); |
|
| 604 | - } elseif ($action == 'BILL_SENTBYMAIL') { |
|
| 605 | - dol_syslog( |
|
| 606 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 607 | - ); |
|
| 608 | - } elseif ($action == 'BILL_CANCEL') { |
|
| 609 | - dol_syslog( |
|
| 610 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 611 | - ); |
|
| 612 | - } elseif ($action == 'BILL_DELETE') { |
|
| 613 | - dol_syslog( |
|
| 614 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 615 | - ); |
|
| 616 | - } elseif ($action == 'LINEBILL_INSERT') { |
|
| 593 | + dol_syslog( |
|
| 594 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 595 | + ); |
|
| 596 | + } elseif ($action == 'BILL_VALIDATE') { |
|
| 597 | + dol_syslog( |
|
| 598 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 599 | + ); |
|
| 600 | + } elseif ($action == 'BILL_BUILDDOC') { |
|
| 601 | + dol_syslog( |
|
| 602 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 603 | + ); |
|
| 604 | + } elseif ($action == 'BILL_SENTBYMAIL') { |
|
| 605 | + dol_syslog( |
|
| 606 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 607 | + ); |
|
| 608 | + } elseif ($action == 'BILL_CANCEL') { |
|
| 609 | + dol_syslog( |
|
| 610 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 611 | + ); |
|
| 612 | + } elseif ($action == 'BILL_DELETE') { |
|
| 613 | + dol_syslog( |
|
| 614 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 615 | + ); |
|
| 616 | + } elseif ($action == 'LINEBILL_INSERT') { |
|
| 617 | 617 | |
| 618 | - dol_syslog( |
|
| 619 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 620 | - ); |
|
| 621 | - } elseif ($action == 'LINEBILL_DELETE') { |
|
| 622 | - dol_syslog( |
|
| 623 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 624 | - ); |
|
| 625 | - } |
|
| 626 | - |
|
| 627 | - // Payments |
|
| 628 | - elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { |
|
| 629 | - dol_syslog( |
|
| 630 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 631 | - ); |
|
| 632 | - } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') { |
|
| 633 | - dol_syslog( |
|
| 634 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 635 | - ); |
|
| 636 | - } elseif ($action == 'PAYMENT_ADD_TO_BANK') { |
|
| 637 | - dol_syslog( |
|
| 638 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 639 | - ); |
|
| 640 | - } elseif ($action == 'PAYMENT_DELETE') { |
|
| 641 | - dol_syslog( |
|
| 642 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 643 | - ); |
|
| 644 | - } |
|
| 645 | - |
|
| 646 | - // Interventions |
|
| 647 | - elseif ($action == 'FICHEINTER_CREATE') { |
|
| 648 | - dol_syslog( |
|
| 649 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 650 | - ); |
|
| 651 | - } elseif ($action == 'FICHEINTER_MODIFY') { |
|
| 652 | - dol_syslog( |
|
| 653 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 654 | - ); |
|
| 655 | - } elseif ($action == 'FICHEINTER_VALIDATE') { |
|
| 656 | - dol_syslog( |
|
| 657 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 658 | - ); |
|
| 659 | - } elseif ($action == 'FICHEINTER_DELETE') { |
|
| 660 | - dol_syslog( |
|
| 661 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 662 | - ); |
|
| 663 | - } |
|
| 664 | - |
|
| 665 | - // Members |
|
| 666 | - elseif ($action == 'MEMBER_CREATE') { |
|
| 667 | - dol_syslog( |
|
| 668 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 669 | - ); |
|
| 670 | - } elseif ($action == 'MEMBER_VALIDATE') { |
|
| 671 | - dol_syslog( |
|
| 672 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 673 | - ); |
|
| 674 | - } elseif ($action == 'MEMBER_SUBSCRIPTION') { |
|
| 675 | - dol_syslog( |
|
| 676 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 677 | - ); |
|
| 678 | - } elseif ($action == 'MEMBER_MODIFY') { |
|
| 679 | - dol_syslog( |
|
| 680 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 681 | - ); |
|
| 682 | - } elseif ($action == 'MEMBER_NEW_PASSWORD') { |
|
| 683 | - dol_syslog( |
|
| 684 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 685 | - ); |
|
| 686 | - } elseif ($action == 'MEMBER_RESILIATE') { |
|
| 687 | - dol_syslog( |
|
| 688 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 689 | - ); |
|
| 690 | - } elseif ($action == 'MEMBER_DELETE') { |
|
| 691 | - dol_syslog( |
|
| 692 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 693 | - ); |
|
| 694 | - } |
|
| 695 | - |
|
| 696 | - // Categories |
|
| 697 | - elseif ($action == 'CATEGORY_CREATE') { |
|
| 698 | - dol_syslog( |
|
| 699 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 700 | - ); |
|
| 701 | - } elseif ($action == 'CATEGORY_MODIFY') { |
|
| 702 | - dol_syslog( |
|
| 703 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 704 | - ); |
|
| 705 | - } elseif ($action == 'CATEGORY_DELETE') { |
|
| 706 | - dol_syslog( |
|
| 707 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 708 | - ); |
|
| 709 | - } |
|
| 710 | - |
|
| 711 | - // Projects |
|
| 712 | - elseif ($action == 'PROJECT_CREATE') { |
|
| 713 | - dol_syslog( |
|
| 714 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 715 | - ); |
|
| 716 | - } elseif ($action == 'PROJECT_MODIFY') { |
|
| 717 | - dol_syslog( |
|
| 718 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 719 | - ); |
|
| 720 | - } elseif ($action == 'PROJECT_DELETE') { |
|
| 721 | - dol_syslog( |
|
| 722 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 723 | - ); |
|
| 724 | - } |
|
| 725 | - |
|
| 726 | - // Project tasks |
|
| 727 | - elseif ($action == 'TASK_CREATE') { |
|
| 728 | - dol_syslog( |
|
| 729 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 730 | - ); |
|
| 731 | - } elseif ($action == 'TASK_MODIFY') { |
|
| 732 | - dol_syslog( |
|
| 733 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 734 | - ); |
|
| 735 | - } elseif ($action == 'TASK_DELETE') { |
|
| 736 | - dol_syslog( |
|
| 737 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 738 | - ); |
|
| 739 | - } |
|
| 740 | - |
|
| 741 | - // Task time spent |
|
| 742 | - elseif ($action == 'TASK_TIMESPENT_CREATE') { |
|
| 743 | - dol_syslog( |
|
| 744 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 745 | - ); |
|
| 746 | - } elseif ($action == 'TASK_TIMESPENT_MODIFY') { |
|
| 747 | - dol_syslog( |
|
| 748 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 749 | - ); |
|
| 750 | - } elseif ($action == 'TASK_TIMESPENT_DELETE') { |
|
| 751 | - dol_syslog( |
|
| 752 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 753 | - ); |
|
| 754 | - } |
|
| 755 | - |
|
| 756 | - // Shipping |
|
| 757 | - elseif ($action == 'SHIPPING_CREATE') { |
|
| 758 | - dol_syslog( |
|
| 759 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 760 | - ); |
|
| 761 | - } elseif ($action == 'SHIPPING_MODIFY') { |
|
| 762 | - dol_syslog( |
|
| 763 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 764 | - ); |
|
| 765 | - } elseif ($action == 'SHIPPING_VALIDATE') { |
|
| 766 | - dol_syslog( |
|
| 767 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 768 | - ); |
|
| 769 | - } elseif ($action == 'SHIPPING_SENTBYMAIL') { |
|
| 770 | - dol_syslog( |
|
| 771 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 772 | - ); |
|
| 773 | - } elseif ($action == 'SHIPPING_DELETE') { |
|
| 774 | - dol_syslog( |
|
| 775 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 776 | - ); |
|
| 777 | - } elseif ($action == 'SHIPPING_BUILDDOC') { |
|
| 778 | - dol_syslog( |
|
| 779 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 780 | - ); |
|
| 781 | - } |
|
| 782 | - |
|
| 783 | - // File |
|
| 784 | - elseif ($action == 'FILE_UPLOAD') { |
|
| 785 | - dol_syslog( |
|
| 786 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 787 | - ); |
|
| 788 | - } elseif ($action == 'FILE_DELETE') { |
|
| 789 | - dol_syslog( |
|
| 790 | - "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 791 | - ); |
|
| 792 | - } |
|
| 793 | - |
|
| 794 | - return 0; |
|
| 795 | - } |
|
| 618 | + dol_syslog( |
|
| 619 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 620 | + ); |
|
| 621 | + } elseif ($action == 'LINEBILL_DELETE') { |
|
| 622 | + dol_syslog( |
|
| 623 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 624 | + ); |
|
| 625 | + } |
|
| 626 | + |
|
| 627 | + // Payments |
|
| 628 | + elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { |
|
| 629 | + dol_syslog( |
|
| 630 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 631 | + ); |
|
| 632 | + } elseif ($action == 'PAYMENT_SUPPLIER_CREATE') { |
|
| 633 | + dol_syslog( |
|
| 634 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 635 | + ); |
|
| 636 | + } elseif ($action == 'PAYMENT_ADD_TO_BANK') { |
|
| 637 | + dol_syslog( |
|
| 638 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 639 | + ); |
|
| 640 | + } elseif ($action == 'PAYMENT_DELETE') { |
|
| 641 | + dol_syslog( |
|
| 642 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 643 | + ); |
|
| 644 | + } |
|
| 645 | + |
|
| 646 | + // Interventions |
|
| 647 | + elseif ($action == 'FICHEINTER_CREATE') { |
|
| 648 | + dol_syslog( |
|
| 649 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 650 | + ); |
|
| 651 | + } elseif ($action == 'FICHEINTER_MODIFY') { |
|
| 652 | + dol_syslog( |
|
| 653 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 654 | + ); |
|
| 655 | + } elseif ($action == 'FICHEINTER_VALIDATE') { |
|
| 656 | + dol_syslog( |
|
| 657 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 658 | + ); |
|
| 659 | + } elseif ($action == 'FICHEINTER_DELETE') { |
|
| 660 | + dol_syslog( |
|
| 661 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 662 | + ); |
|
| 663 | + } |
|
| 664 | + |
|
| 665 | + // Members |
|
| 666 | + elseif ($action == 'MEMBER_CREATE') { |
|
| 667 | + dol_syslog( |
|
| 668 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 669 | + ); |
|
| 670 | + } elseif ($action == 'MEMBER_VALIDATE') { |
|
| 671 | + dol_syslog( |
|
| 672 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 673 | + ); |
|
| 674 | + } elseif ($action == 'MEMBER_SUBSCRIPTION') { |
|
| 675 | + dol_syslog( |
|
| 676 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 677 | + ); |
|
| 678 | + } elseif ($action == 'MEMBER_MODIFY') { |
|
| 679 | + dol_syslog( |
|
| 680 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 681 | + ); |
|
| 682 | + } elseif ($action == 'MEMBER_NEW_PASSWORD') { |
|
| 683 | + dol_syslog( |
|
| 684 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 685 | + ); |
|
| 686 | + } elseif ($action == 'MEMBER_RESILIATE') { |
|
| 687 | + dol_syslog( |
|
| 688 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 689 | + ); |
|
| 690 | + } elseif ($action == 'MEMBER_DELETE') { |
|
| 691 | + dol_syslog( |
|
| 692 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 693 | + ); |
|
| 694 | + } |
|
| 695 | + |
|
| 696 | + // Categories |
|
| 697 | + elseif ($action == 'CATEGORY_CREATE') { |
|
| 698 | + dol_syslog( |
|
| 699 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 700 | + ); |
|
| 701 | + } elseif ($action == 'CATEGORY_MODIFY') { |
|
| 702 | + dol_syslog( |
|
| 703 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 704 | + ); |
|
| 705 | + } elseif ($action == 'CATEGORY_DELETE') { |
|
| 706 | + dol_syslog( |
|
| 707 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 708 | + ); |
|
| 709 | + } |
|
| 710 | + |
|
| 711 | + // Projects |
|
| 712 | + elseif ($action == 'PROJECT_CREATE') { |
|
| 713 | + dol_syslog( |
|
| 714 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 715 | + ); |
|
| 716 | + } elseif ($action == 'PROJECT_MODIFY') { |
|
| 717 | + dol_syslog( |
|
| 718 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 719 | + ); |
|
| 720 | + } elseif ($action == 'PROJECT_DELETE') { |
|
| 721 | + dol_syslog( |
|
| 722 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 723 | + ); |
|
| 724 | + } |
|
| 725 | + |
|
| 726 | + // Project tasks |
|
| 727 | + elseif ($action == 'TASK_CREATE') { |
|
| 728 | + dol_syslog( |
|
| 729 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 730 | + ); |
|
| 731 | + } elseif ($action == 'TASK_MODIFY') { |
|
| 732 | + dol_syslog( |
|
| 733 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 734 | + ); |
|
| 735 | + } elseif ($action == 'TASK_DELETE') { |
|
| 736 | + dol_syslog( |
|
| 737 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 738 | + ); |
|
| 739 | + } |
|
| 740 | + |
|
| 741 | + // Task time spent |
|
| 742 | + elseif ($action == 'TASK_TIMESPENT_CREATE') { |
|
| 743 | + dol_syslog( |
|
| 744 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 745 | + ); |
|
| 746 | + } elseif ($action == 'TASK_TIMESPENT_MODIFY') { |
|
| 747 | + dol_syslog( |
|
| 748 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 749 | + ); |
|
| 750 | + } elseif ($action == 'TASK_TIMESPENT_DELETE') { |
|
| 751 | + dol_syslog( |
|
| 752 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 753 | + ); |
|
| 754 | + } |
|
| 755 | + |
|
| 756 | + // Shipping |
|
| 757 | + elseif ($action == 'SHIPPING_CREATE') { |
|
| 758 | + dol_syslog( |
|
| 759 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 760 | + ); |
|
| 761 | + } elseif ($action == 'SHIPPING_MODIFY') { |
|
| 762 | + dol_syslog( |
|
| 763 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 764 | + ); |
|
| 765 | + } elseif ($action == 'SHIPPING_VALIDATE') { |
|
| 766 | + dol_syslog( |
|
| 767 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 768 | + ); |
|
| 769 | + } elseif ($action == 'SHIPPING_SENTBYMAIL') { |
|
| 770 | + dol_syslog( |
|
| 771 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 772 | + ); |
|
| 773 | + } elseif ($action == 'SHIPPING_DELETE') { |
|
| 774 | + dol_syslog( |
|
| 775 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 776 | + ); |
|
| 777 | + } elseif ($action == 'SHIPPING_BUILDDOC') { |
|
| 778 | + dol_syslog( |
|
| 779 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 780 | + ); |
|
| 781 | + } |
|
| 782 | + |
|
| 783 | + // File |
|
| 784 | + elseif ($action == 'FILE_UPLOAD') { |
|
| 785 | + dol_syslog( |
|
| 786 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 787 | + ); |
|
| 788 | + } elseif ($action == 'FILE_DELETE') { |
|
| 789 | + dol_syslog( |
|
| 790 | + "Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id |
|
| 791 | + ); |
|
| 792 | + } |
|
| 793 | + |
|
| 794 | + return 0; |
|
| 795 | + } |
|
| 796 | 796 | } |
| 797 | 797 | \ No newline at end of file |