|
@@ -23,7 +23,7 @@ discard block |
|
|
block discarded – undo |
|
23
|
23
|
* \ingroup titre |
|
24
|
24
|
* \brief Description and activation file for module titre |
|
25
|
25
|
*/ |
|
26
|
|
-include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php"; |
|
|
26
|
+include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; |
|
27
|
27
|
|
|
28
|
28
|
/** |
|
29
|
29
|
* Description and activation class for module titre |
|
@@ -66,7 +66,7 @@ discard block |
|
|
block discarded – undo |
|
66
|
66
|
$this->version = '3.3.0'; |
|
67
|
67
|
// Key used in llx_const table to save module status enabled/disabled |
|
68
|
68
|
// (where MYMODULE is value of property name of module in uppercase) |
|
69
|
|
- $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
|
69
|
+ $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
70
|
70
|
// Where to store the module in setup page |
|
71
|
71
|
// (0=common,1=interface,2=others,3=very specific) |
|
72
|
72
|
$this->special = 2; |
|
@@ -130,7 +130,7 @@ discard block |
|
|
block discarded – undo |
|
130
|
130
|
// List of modules id that must be enabled if this module is enabled |
|
131
|
131
|
$this->depends = array(); |
|
132
|
132
|
|
|
133
|
|
- $this->conflictwith=array('modMilestone'); |
|
|
133
|
+ $this->conflictwith = array('modMilestone'); |
|
134
|
134
|
// List of modules id to disable if this one is disabled |
|
135
|
135
|
$this->requiredby = array(); |
|
136
|
136
|
// Minimum version of PHP required by module |
|
@@ -195,20 +195,20 @@ discard block |
|
|
block discarded – undo |
|
195
|
195
|
// 'categories_x' to add a tab in category view |
|
196
|
196
|
// (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) |
|
197
|
197
|
// Dictionnaries |
|
198
|
|
- if (! isset($conf->subtotal->enabled)) { |
|
199
|
|
- $conf->subtotal=new stdClass(); |
|
|
198
|
+ if (!isset($conf->subtotal->enabled)) { |
|
|
199
|
+ $conf->subtotal = new stdClass(); |
|
200
|
200
|
$conf->subtotal->enabled = 0; |
|
201
|
201
|
} |
|
202
|
202
|
$this->dictionaries = array( |
|
203
|
203
|
'langs'=>'subtotal@subtotal', |
|
204
|
|
- 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
205
|
|
- 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
206
|
|
- '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 |
|
207
|
|
- 'tabsqlsort'=>array('label ASC'), // Sort order |
|
208
|
|
- 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
209
|
|
- 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
210
|
|
- 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
211
|
|
- 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
|
204
|
+ 'tabname'=>array(MAIN_DB_PREFIX.'c_subtotal_free_text'), // List of tables we want to see into dictonnary editor |
|
|
205
|
+ 'tablib'=>array($langs->trans('subtotalFreeLineDictionary')), // Label of tables |
|
|
206
|
+ '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 |
|
|
207
|
+ 'tabsqlsort'=>array('label ASC'), // Sort order |
|
|
208
|
+ 'tabfield'=>array('label,content'), // List of fields (result of select to show dictionary) |
|
|
209
|
+ 'tabfieldvalue'=>array('label,content'), // List of fields (list of fields to edit a record) |
|
|
210
|
+ 'tabfieldinsert'=>array('label,content,entity'), // List of fields (list of fields for insert) |
|
|
211
|
+ 'tabrowid'=>array('rowid'), // Name of columns with primary key (try to always name it 'rowid') |
|
212
|
212
|
'tabcond'=>array($conf->subtotal->enabled) |
|
213
|
213
|
); |
|
214
|
214
|
/* Example: |
|
@@ -483,7 +483,7 @@ discard block |
|
|
block discarded – undo |
|
483
|
483
|
|
|
484
|
484
|
$extra = new ExtraFields($db); // propaldet, commandedet, facturedet |
|
485
|
485
|
$TElementType = array('propaldet', 'commandedet', 'facturedet', 'supplier_proposaldet', 'commande_fournisseurdet', 'facture_fourn_det'); |
|
486
|
|
- foreach($TElementType as $element_type) { |
|
|
486
|
+ foreach ($TElementType as $element_type) { |
|
487
|
487
|
$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); |
|
488
|
488
|
$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); |
|
489
|
489
|
} |