@@ -25,25 +25,25 @@ discard block |
||
25 | 25 | |
26 | 26 | function subtotalAdminPrepareHead() |
27 | 27 | { |
28 | - global $langs, $conf; |
|
28 | + global $langs, $conf; |
|
29 | 29 | |
30 | - $langs->load("subtotal@subtotal"); |
|
30 | + $langs->load("subtotal@subtotal"); |
|
31 | 31 | |
32 | - $h = 0; |
|
33 | - $head = array(); |
|
32 | + $h = 0; |
|
33 | + $head = array(); |
|
34 | 34 | |
35 | - $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_setup.php", 1); |
|
36 | - $head[$h][1] = $langs->trans("Parameters"); |
|
37 | - $head[$h][2] = 'settings'; |
|
38 | - $h++; |
|
39 | - $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_about.php", 1); |
|
40 | - $head[$h][1] = $langs->trans("About"); |
|
41 | - $head[$h][2] = 'about'; |
|
42 | - $h++; |
|
35 | + $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_setup.php", 1); |
|
36 | + $head[$h][1] = $langs->trans("Parameters"); |
|
37 | + $head[$h][2] = 'settings'; |
|
38 | + $h++; |
|
39 | + $head[$h][0] = dol_buildpath("/subtotal/admin/subtotal_about.php", 1); |
|
40 | + $head[$h][1] = $langs->trans("About"); |
|
41 | + $head[$h][2] = 'about'; |
|
42 | + $h++; |
|
43 | 43 | |
44 | - complete_head_from_modules($conf, $langs, $object, $head, $h, 'subtotal', $showLabel=false); |
|
44 | + complete_head_from_modules($conf, $langs, $object, $head, $h, 'subtotal', $showLabel=false); |
|
45 | 45 | |
46 | - return $head; |
|
46 | + return $head; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | function getHtmlSelectTitle(&$object, $showLabel=false) |
@@ -239,17 +239,17 @@ discard block |
||
239 | 239 | $classname = ucfirst($element); |
240 | 240 | |
241 | 241 | switch ($element) { |
242 | - case 'supplier_proposal': |
|
243 | - $classname = 'SupplierProposal'; |
|
244 | - break; |
|
242 | + case 'supplier_proposal': |
|
243 | + $classname = 'SupplierProposal'; |
|
244 | + break; |
|
245 | 245 | |
246 | - case 'order_supplier': |
|
247 | - $classname = 'CommandeFournisseur'; |
|
248 | - break; |
|
246 | + case 'order_supplier': |
|
247 | + $classname = 'CommandeFournisseur'; |
|
248 | + break; |
|
249 | 249 | |
250 | - case 'invoice_supplier': |
|
251 | - $classname = 'FactureFournisseur'; |
|
252 | - break; |
|
250 | + case 'invoice_supplier': |
|
251 | + $classname = 'FactureFournisseur'; |
|
252 | + break; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | $object = new $classname($db); // Propal | Commande | Facture |
@@ -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.0.1'; |
|
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', 'invoicesuppliercard','propalcard', 'supplier_proposalcard', 'ordercard', 'ordersuppliercard','odtgeneration','orderstoinvoice','admin','invoicereccard') |
|
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.0.1'; |
|
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', 'invoicesuppliercard','propalcard', 'supplier_proposalcard', 'ordercard', 'ordersuppliercard','odtgeneration','orderstoinvoice','admin','invoicereccard') |
|
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; |
456 | 456 | |
457 | 457 | |
@@ -459,39 +459,39 @@ 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(); |
|
464 | + $result = $this->loadTables(); |
|
465 | 465 | |
466 | 466 | |
467 | - return $this->_init($sql, $options); |
|
468 | - } |
|
467 | + return $this->_init($sql, $options); |
|
468 | + } |
|
469 | 469 | |
470 | - /** |
|
471 | - * Function called when module is disabled. |
|
472 | - * Remove from database constants, boxes and permissions from Dolibarr database. |
|
473 | - * Data directories are not deleted |
|
474 | - * |
|
475 | - * @param string $options Options when enabling module ('', 'noboxes') |
|
476 | - * @return int 1 if OK, 0 if KO |
|
477 | - */ |
|
478 | - public function remove($options = '') |
|
479 | - { |
|
480 | - $sql = array(); |
|
470 | + /** |
|
471 | + * Function called when module is disabled. |
|
472 | + * Remove from database constants, boxes and permissions from Dolibarr database. |
|
473 | + * Data directories are not deleted |
|
474 | + * |
|
475 | + * @param string $options Options when enabling module ('', 'noboxes') |
|
476 | + * @return int 1 if OK, 0 if KO |
|
477 | + */ |
|
478 | + public function remove($options = '') |
|
479 | + { |
|
480 | + $sql = array(); |
|
481 | 481 | |
482 | - return $this->_remove($sql, $options); |
|
483 | - } |
|
482 | + return $this->_remove($sql, $options); |
|
483 | + } |
|
484 | 484 | |
485 | - /** |
|
486 | - * Create tables, keys and data required by module |
|
487 | - * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
488 | - * and create data commands must be stored in directory /titre/sql/ |
|
489 | - * This function is called by this->init |
|
490 | - * |
|
491 | - * @return int <=0 if KO, >0 if OK |
|
492 | - */ |
|
493 | - private function loadTables() |
|
494 | - { |
|
495 | - return $this->_load_tables('/subtotal/sql/'); |
|
496 | - } |
|
485 | + /** |
|
486 | + * Create tables, keys and data required by module |
|
487 | + * Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys |
|
488 | + * and create data commands must be stored in directory /titre/sql/ |
|
489 | + * This function is called by this->init |
|
490 | + * |
|
491 | + * @return int <=0 if KO, >0 if OK |
|
492 | + */ |
|
493 | + private function loadTables() |
|
494 | + { |
|
495 | + return $this->_load_tables('/subtotal/sql/'); |
|
496 | + } |
|
497 | 497 | } |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @var $object Facture fournisseur |
40 | 40 | */ |
41 | 41 | else if($object->element=='invoice_supplier') { |
42 | - $object->special_code = TSubtotal::$module_number; |
|
43 | - $rang = $object->line_max() + 1; |
|
44 | - $res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
42 | + $object->special_code = TSubtotal::$module_number; |
|
43 | + $rang = $object->line_max() + 1; |
|
44 | + $res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang); |
|
45 | 45 | } |
46 | 46 | /** |
47 | 47 | * @var $object Propal |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @var $object Commande fournisseur |
61 | 61 | */ |
62 | 62 | else if($object->element=='order_supplier') { |
63 | - $object->special_code = TSubtotal::$module_number; |
|
64 | - $res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9); |
|
63 | + $object->special_code = TSubtotal::$module_number; |
|
64 | + $res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9); |
|
65 | 65 | } |
66 | 66 | /** |
67 | 67 | * @var $object Facturerec |
@@ -403,16 +403,16 @@ discard block |
||
403 | 403 | $createRight = $user->rights->{$object->element}->creer; |
404 | 404 | if($object->element == 'facturerec' ) |
405 | 405 | { |
406 | - $object->statut = 0; // hack for facture rec |
|
407 | - $createRight = $user->rights->facture->creer; |
|
406 | + $object->statut = 0; // hack for facture rec |
|
407 | + $createRight = $user->rights->facture->creer; |
|
408 | 408 | } |
409 | 409 | elseif($object->element == 'order_supplier' ) |
410 | 410 | { |
411 | - $createRight = $user->rights->fournisseur->commande->creer; |
|
411 | + $createRight = $user->rights->fournisseur->commande->creer; |
|
412 | 412 | } |
413 | 413 | elseif($object->element == 'invoice_supplier' ) |
414 | 414 | { |
415 | - $createRight = $user->rights->fournisseur->facture->creer; |
|
415 | + $createRight = $user->rights->fournisseur->facture->creer; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($object->statut == 0 && $createRight && !empty($conf->global->SUBTOTAL_ALLOW_DUPLICATE_BLOCK)) |
@@ -437,8 +437,8 @@ discard block |
||
437 | 437 | break; |
438 | 438 | |
439 | 439 | case 'supplier_proposal': |
440 | - $res = $object->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, 'HT', 0, $line->info_bits, $line->product_type, -1, $line->special_code, 0, 0, $line->pa_ht, $line->label, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->origin, $line->origin_id); |
|
441 | - break; |
|
440 | + $res = $object->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, 'HT', 0, $line->info_bits, $line->product_type, -1, $line->special_code, 0, 0, $line->pa_ht, $line->label, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->origin, $line->origin_id); |
|
441 | + break; |
|
442 | 442 | |
443 | 443 | case 'commande': |
444 | 444 | //$desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0) |
@@ -446,10 +446,10 @@ discard block |
||
446 | 446 | break; |
447 | 447 | |
448 | 448 | case 'order_supplier': |
449 | - $object->line = $line; |
|
450 | - $object->line->fk_commande = $object->id; |
|
451 | - $object->line->rang = $object->line_max() +1; |
|
452 | - $res = $object->line->insert(1); |
|
449 | + $object->line = $line; |
|
450 | + $object->line->fk_commande = $object->id; |
|
451 | + $object->line->rang = $object->line_max() +1; |
|
452 | + $res = $object->line->insert(1); |
|
453 | 453 | break; |
454 | 454 | |
455 | 455 | case 'facture': |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | $object->db->commit(); |
503 | 503 | foreach ($TLineAdded as &$line) |
504 | 504 | { |
505 | - // ça peut paraitre non optimisé de déclancher la fonction sur toutes les lignes mais ceci est nécessaire pour réappliquer l'état exact de chaque ligne |
|
506 | - _updateLineNC($object->element, $object->id, $line->id, $line->array_options['options_subtotal_nc']); |
|
505 | + // ça peut paraitre non optimisé de déclancher la fonction sur toutes les lignes mais ceci est nécessaire pour réappliquer l'état exact de chaque ligne |
|
506 | + _updateLineNC($object->element, $object->id, $line->id, $line->array_options['options_subtotal_nc']); |
|
507 | 507 | } |
508 | 508 | return count($TLineAdded); |
509 | 509 | } |
@@ -577,33 +577,33 @@ discard block |
||
577 | 577 | |
578 | 578 | switch ($object->element) |
579 | 579 | { |
580 | - case 'propal': |
|
581 | - $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $date_start, $date_end, $array_options, $fk_unit); |
|
582 | - break; |
|
580 | + case 'propal': |
|
581 | + $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $date_start, $date_end, $array_options, $fk_unit); |
|
582 | + break; |
|
583 | 583 | |
584 | - case 'supplier_proposal': |
|
585 | - $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $array_options,'', $fk_unit); |
|
586 | - break; |
|
584 | + case 'supplier_proposal': |
|
585 | + $res = $object->updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $desc, $price_base_type, $info_bits, $special_code, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $type, $array_options,'', $fk_unit); |
|
586 | + break; |
|
587 | 587 | |
588 | 588 | case 'commande': |
589 | 589 | $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $date_start, $date_end, $type, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $special_code, $array_options, $fk_unit); |
590 | 590 | break; |
591 | 591 | |
592 | 592 | case 'order_supplier': |
593 | - $object->special_code = SELF::$module_number; |
|
594 | - if (empty($desc)) $desc = $label; |
|
595 | - $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
596 | - break; |
|
593 | + $object->special_code = SELF::$module_number; |
|
594 | + if (empty($desc)) $desc = $label; |
|
595 | + $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
596 | + break; |
|
597 | 597 | |
598 | 598 | case 'facture': |
599 | 599 | $res = $object->updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line, $skip_update_total, $fk_fournprice, $pa_ht, $label, $special_code, $array_options, $situation_percent, $fk_unit); |
600 | 600 | break; |
601 | 601 | |
602 | 602 | case 'invoice_supplier': |
603 | - $object->special_code = SELF::$module_number; |
|
604 | - if (empty($desc)) $desc = $label; |
|
605 | - $res = $object->updateline($rowid, $desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, 0, $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
606 | - break; |
|
603 | + $object->special_code = SELF::$module_number; |
|
604 | + if (empty($desc)) $desc = $label; |
|
605 | + $res = $object->updateline($rowid, $desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, 0, $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $fk_unit); |
|
606 | + break; |
|
607 | 607 | |
608 | 608 | case 'facturerec': |
609 | 609 | // Add extrafields and get rang |
@@ -994,8 +994,8 @@ discard block |
||
994 | 994 | { |
995 | 995 | if (is_readable($logo)) |
996 | 996 | { |
997 | - $height=pdf_getHeightForLogo($logo); |
|
998 | - $pdf->Image($logo, $objmarge->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
997 | + $height=pdf_getHeightForLogo($logo); |
|
998 | + $pdf->Image($logo, $objmarge->marge_gauche, $posy, 0, $height); // width=0 (auto) |
|
999 | 999 | } |
1000 | 1000 | else |
1001 | 1001 | { |
@@ -1186,13 +1186,13 @@ discard block |
||
1186 | 1186 | * @param int $hidebottom Hide bottom |
1187 | 1187 | * @return void |
1188 | 1188 | */ |
1189 | - private static function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) |
|
1190 | - { |
|
1191 | - if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); |
|
1192 | - $pdf->line($x+$l, $y, $x+$l, $y+$h); |
|
1193 | - if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); |
|
1194 | - $pdf->line($x, $y+$h, $x, $y); |
|
1195 | - } |
|
1189 | + private static function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) |
|
1190 | + { |
|
1191 | + if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); |
|
1192 | + $pdf->line($x+$l, $y, $x+$l, $y+$h); |
|
1193 | + if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); |
|
1194 | + $pdf->line($x, $y+$h, $x, $y); |
|
1195 | + } |
|
1196 | 1196 | |
1197 | 1197 | |
1198 | 1198 | public static function concat(&$outputlangs, $files, $fileoutput='') |
@@ -1202,14 +1202,14 @@ discard block |
||
1202 | 1202 | if (empty($fileoutput)) $fileoutput = $file[0]; |
1203 | 1203 | |
1204 | 1204 | $pdf=pdf_getInstance(); |
1205 | - if (class_exists('TCPDF')) |
|
1206 | - { |
|
1207 | - $pdf->setPrintHeader(false); |
|
1208 | - $pdf->setPrintFooter(false); |
|
1209 | - } |
|
1210 | - $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
|
1205 | + if (class_exists('TCPDF')) |
|
1206 | + { |
|
1207 | + $pdf->setPrintHeader(false); |
|
1208 | + $pdf->setPrintFooter(false); |
|
1209 | + } |
|
1210 | + $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
|
1211 | 1211 | |
1212 | - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
1212 | + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); |
|
1213 | 1213 | |
1214 | 1214 | |
1215 | 1215 | foreach($files as $file) |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | * @return void |
48 | 48 | */ |
49 | 49 | |
50 | - var $module_number = 104777; |
|
50 | + var $module_number = 104777; |
|
51 | 51 | |
52 | - function formObjectOptions($parameters, &$object, &$action, $hookmanager) |
|
53 | - { |
|
54 | - global $langs,$db,$user, $conf; |
|
52 | + function formObjectOptions($parameters, &$object, &$action, $hookmanager) |
|
53 | + { |
|
54 | + global $langs,$db,$user, $conf; |
|
55 | 55 | |
56 | 56 | $langs->load('subtotal@subtotal'); |
57 | 57 | |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | $createRight = $user->rights->facture->creer; |
67 | 67 | } elseif($object->element == 'order_supplier' ) |
68 | 68 | { |
69 | - $createRight = $user->rights->fournisseur->commande->creer; |
|
69 | + $createRight = $user->rights->fournisseur->commande->creer; |
|
70 | 70 | } elseif($object->element == 'invoice_supplier' ) |
71 | 71 | { |
72 | - $createRight = $user->rights->fournisseur->facture->creer; |
|
72 | + $createRight = $user->rights->fournisseur->facture->creer; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($object->statut == 0 && $createRight) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | if (!empty($conf->global->SUBTOTAL_AUTO_ADD_SUBTOTAL_ON_ADDING_NEW_TITLE) && $qty < 10) TSubtotal::addSubtotalMissing($object, $qty); |
121 | 121 | |
122 | - TSubtotal::addSubTotalLine($object, $title, $qty); |
|
122 | + TSubtotal::addSubTotalLine($object, $title, $qty); |
|
123 | 123 | } |
124 | 124 | else if($action==='ask_deleteallline') { |
125 | 125 | $form=new Form($db); |
@@ -341,35 +341,35 @@ discard block |
||
341 | 341 | $TContext = explode(':',$parameters['context']); |
342 | 342 | if ( |
343 | 343 | in_array('invoicecard',$TContext) |
344 | - || in_array('invoicesuppliercard',$TContext) |
|
344 | + || in_array('invoicesuppliercard',$TContext) |
|
345 | 345 | || in_array('propalcard',$TContext) |
346 | 346 | || in_array('ordercard',$TContext) |
347 | - || in_array('ordersuppliercard',$TContext) |
|
347 | + || in_array('ordersuppliercard',$TContext) |
|
348 | 348 | || in_array('invoicereccard',$TContext) |
349 | 349 | ) |
350 | - { |
|
350 | + { |
|
351 | 351 | $hideInnerLines = isset( $_SESSION['subtotal_hideInnerLines_'.$parameters['modulepart']] ) ? $_SESSION['subtotal_hideInnerLines_'.$parameters['modulepart']] : 0; |
352 | 352 | $hidedetails = isset( $_SESSION['subtotal_hidedetails_'.$parameters['modulepart']] ) ? $_SESSION['subtotal_hidedetails_'.$parameters['modulepart']] : 0; |
353 | 353 | $hideprices= isset( $_SESSION['subtotal_hideprices_'.$parameters['modulepart']] ) ? $_SESSION['subtotal_hideprices_'.$parameters['modulepart']] : 0; |
354 | 354 | |
355 | 355 | $var=false; |
356 | - $out.= '<tr '.$bc[$var].'> |
|
356 | + $out.= '<tr '.$bc[$var].'> |
|
357 | 357 | <td colspan="4" align="right"> |
358 | 358 | <label for="hideInnerLines">'.$langs->trans('HideInnerLines').'</label> |
359 | 359 | <input type="checkbox" onclick="if($(this).is(\':checked\')) { $(\'#hidedetails\').prop(\'checked\', \'checked\') }" id="hideInnerLines" name="hideInnerLines" value="1" '.(( $hideInnerLines ) ? 'checked="checked"' : '' ).' /> |
360 | 360 | </td> |
361 | 361 | </tr>'; |
362 | 362 | |
363 | - $var=!$var; |
|
364 | - $out.= '<tr '.$bc[$var].'> |
|
363 | + $var=!$var; |
|
364 | + $out.= '<tr '.$bc[$var].'> |
|
365 | 365 | <td colspan="4" align="right"> |
366 | 366 | <label for="hidedetails">'.$langs->trans('SubTotalhidedetails').'</label> |
367 | 367 | <input type="checkbox" id="hidedetails" name="hidedetails" value="1" '.(( $hidedetails ) ? 'checked="checked"' : '' ).' /> |
368 | 368 | </td> |
369 | 369 | </tr>'; |
370 | 370 | |
371 | - $var=!$var; |
|
372 | - $out.= '<tr '.$bc[$var].'> |
|
371 | + $var=!$var; |
|
372 | + $out.= '<tr '.$bc[$var].'> |
|
373 | 373 | <td colspan="4" align="right"> |
374 | 374 | <label for="hidedetails">'.$langs->trans('SubTotalhidePrice').'</label> |
375 | 375 | <input type="checkbox" id="hideprices" name="hideprices" value="1" '.(( $hideprices ) ? 'checked="checked"' : '' ).' /> |
@@ -381,9 +381,9 @@ discard block |
||
381 | 381 | if ( |
382 | 382 | (in_array('propalcard',$TContext) && !empty($conf->global->SUBTOTAL_PROPAL_ADD_RECAP)) |
383 | 383 | || (in_array('ordercard',$TContext) && !empty($conf->global->SUBTOTAL_COMMANDE_ADD_RECAP)) |
384 | - || (in_array('ordersuppliercard',$TContext) && !empty($conf->global->SUBTOTAL_COMMANDE_ADD_RECAP)) |
|
384 | + || (in_array('ordersuppliercard',$TContext) && !empty($conf->global->SUBTOTAL_COMMANDE_ADD_RECAP)) |
|
385 | 385 | || (in_array('invoicecard',$TContext) && !empty($conf->global->SUBTOTAL_INVOICE_ADD_RECAP)) |
386 | - || (in_array('invoicesuppliercard',$TContext) && !empty($conf->global->SUBTOTAL_INVOICE_ADD_RECAP)) |
|
386 | + || (in_array('invoicesuppliercard',$TContext) && !empty($conf->global->SUBTOTAL_INVOICE_ADD_RECAP)) |
|
387 | 387 | || (in_array('invoicereccard',$TContext) && !empty($conf->global->SUBTOTAL_INVOICE_ADD_RECAP )) |
388 | 388 | ) |
389 | 389 | { |
@@ -402,19 +402,19 @@ discard block |
||
402 | 402 | } |
403 | 403 | |
404 | 404 | |
405 | - return 1; |
|
405 | + return 1; |
|
406 | 406 | } |
407 | 407 | |
408 | - function formEditProductOptions($parameters, &$object, &$action, $hookmanager) |
|
409 | - { |
|
408 | + function formEditProductOptions($parameters, &$object, &$action, $hookmanager) |
|
409 | + { |
|
410 | 410 | |
411 | - if (in_array('invoicecard',explode(':',$parameters['context']))) |
|
412 | - { |
|
411 | + if (in_array('invoicecard',explode(':',$parameters['context']))) |
|
412 | + { |
|
413 | 413 | |
414 | - } |
|
414 | + } |
|
415 | 415 | |
416 | - return 0; |
|
417 | - } |
|
416 | + return 0; |
|
417 | + } |
|
418 | 418 | |
419 | 419 | function ODTSubstitutionLine(&$parameters, &$object, $action, $hookmanager) { |
420 | 420 | global $conf; |
@@ -463,11 +463,11 @@ discard block |
||
463 | 463 | |
464 | 464 | if ( |
465 | 465 | in_array('invoicecard',explode(':',$parameters['context'])) |
466 | - || in_array('invoicesuppliercard',explode(':',$parameters['context'])) |
|
466 | + || in_array('invoicesuppliercard',explode(':',$parameters['context'])) |
|
467 | 467 | || in_array('propalcard',explode(':',$parameters['context'])) |
468 | - || in_array('supplier_proposalcard',explode(':',$parameters['context'])) |
|
468 | + || in_array('supplier_proposalcard',explode(':',$parameters['context'])) |
|
469 | 469 | || in_array('ordercard',explode(':',$parameters['context'])) |
470 | - || in_array('ordersuppliercard',explode(':',$parameters['context'])) |
|
470 | + || in_array('ordersuppliercard',explode(':',$parameters['context'])) |
|
471 | 471 | || in_array('invoicereccard',explode(':',$parameters['context'])) |
472 | 472 | ) { |
473 | 473 | |
@@ -546,20 +546,20 @@ discard block |
||
546 | 546 | in_array('invoicecard',explode(':',$parameters['context'])) |
547 | 547 | || in_array('propalcard',explode(':',$parameters['context'])) |
548 | 548 | || in_array('ordercard',explode(':',$parameters['context'])) |
549 | - || in_array('ordersuppliercard',explode(':',$parameters['context'])) |
|
550 | - || in_array('invoicesuppliercard',explode(':',$parameters['context'])) |
|
551 | - || in_array('supplier_proposalcard',explode(':',$parameters['context'])) |
|
549 | + || in_array('ordersuppliercard',explode(':',$parameters['context'])) |
|
550 | + || in_array('invoicesuppliercard',explode(':',$parameters['context'])) |
|
551 | + || in_array('supplier_proposalcard',explode(':',$parameters['context'])) |
|
552 | 552 | ) |
553 | - { |
|
553 | + { |
|
554 | 554 | if(in_array('invoicecard',explode(':',$parameters['context']))) { |
555 | 555 | $sessname = 'subtotal_hideInnerLines_facture'; |
556 | 556 | $sessname2 = 'subtotal_hidedetails_facture'; |
557 | 557 | $sessname3 = 'subtotal_hideprices_facture'; |
558 | 558 | } |
559 | 559 | elseif(in_array('invoicesuppliercard',explode(':',$parameters['context']))) { |
560 | - $sessname = 'subtotal_hideInnerLines_facture_fournisseur'; |
|
561 | - $sessname2 = 'subtotal_hidedetails_facture_fournisseur'; |
|
562 | - $sessname3 = 'subtotal_hideprices_facture_fournisseur'; |
|
560 | + $sessname = 'subtotal_hideInnerLines_facture_fournisseur'; |
|
561 | + $sessname2 = 'subtotal_hidedetails_facture_fournisseur'; |
|
562 | + $sessname3 = 'subtotal_hideprices_facture_fournisseur'; |
|
563 | 563 | } |
564 | 564 | elseif(in_array('propalcard',explode(':',$parameters['context']))) { |
565 | 565 | $sessname = 'subtotal_hideInnerLines_propal'; |
@@ -567,9 +567,9 @@ discard block |
||
567 | 567 | $sessname3 = 'subtotal_hideprices_propal'; |
568 | 568 | } |
569 | 569 | elseif(in_array('supplier_proposalcard',explode(':',$parameters['context']))) { |
570 | - $sessname = 'subtotal_hideInnerLines_supplier_proposal'; |
|
571 | - $sessname2 = 'subtotal_hidedetails_supplier_proposal'; |
|
572 | - $sessname3 = 'subtotal_hideprices_supplier_proposal'; |
|
570 | + $sessname = 'subtotal_hideInnerLines_supplier_proposal'; |
|
571 | + $sessname2 = 'subtotal_hidedetails_supplier_proposal'; |
|
572 | + $sessname3 = 'subtotal_hideprices_supplier_proposal'; |
|
573 | 573 | } |
574 | 574 | elseif(in_array('ordercard',explode(':',$parameters['context']))) { |
575 | 575 | $sessname = 'subtotal_hideInnerLines_commande'; |
@@ -577,9 +577,9 @@ discard block |
||
577 | 577 | $sessname3 = 'subtotal_hideprices_commande'; |
578 | 578 | } |
579 | 579 | elseif(in_array('ordersuppliercard',explode(':',$parameters['context']))) { |
580 | - $sessname = 'subtotal_hideInnerLines_commande_fournisseur'; |
|
581 | - $sessname2 = 'subtotal_hidedetails_commande_fournisseur'; |
|
582 | - $sessname3 = 'subtotal_hideprices_commande_fournisseur'; |
|
580 | + $sessname = 'subtotal_hideInnerLines_commande_fournisseur'; |
|
581 | + $sessname2 = 'subtotal_hidedetails_commande_fournisseur'; |
|
582 | + $sessname3 = 'subtotal_hideprices_commande_fournisseur'; |
|
583 | 583 | } |
584 | 584 | else { |
585 | 585 | $sessname = 'subtotal_hideInnerLines_unknown'; |
@@ -601,17 +601,17 @@ discard block |
||
601 | 601 | foreach($object->lines as &$line) { |
602 | 602 | if ($line->product_type == 9 && $line->special_code == $this->module_number) { |
603 | 603 | |
604 | - if($line->qty>=90) { |
|
605 | - $line->modsubtotal_total = 1; |
|
606 | - } |
|
607 | - else{ |
|
608 | - $line->modsubtotal_title = 1; |
|
609 | - } |
|
604 | + if($line->qty>=90) { |
|
605 | + $line->modsubtotal_total = 1; |
|
606 | + } |
|
607 | + else{ |
|
608 | + $line->modsubtotal_title = 1; |
|
609 | + } |
|
610 | 610 | |
611 | 611 | $line->total_ht = $this->getTotalLineFromObject($object, $line, ''); |
612 | 612 | } |
613 | - } |
|
614 | - } |
|
613 | + } |
|
614 | + } |
|
615 | 615 | |
616 | 616 | } |
617 | 617 | else if($action === 'confirm_delete_all_lines' && GETPOST('confirm')=='yes') { |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | */ |
629 | 629 | else if($object->element=='invoice_supplier') |
630 | 630 | { |
631 | - $object->deleteline($idLine); |
|
631 | + $object->deleteline($idLine); |
|
632 | 632 | } |
633 | 633 | /** |
634 | 634 | * @var $object Propal |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | */ |
652 | 652 | else if($object->element=='order_supplier') |
653 | 653 | { |
654 | - $object->deleteline($idLine); |
|
654 | + $object->deleteline($idLine); |
|
655 | 655 | } |
656 | 656 | /** |
657 | 657 | * @var $object Facturerec |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | |
696 | 696 | foreach($object->lines as $l) { |
697 | 697 | |
698 | - $lid = (!empty($l->rowid) ? $l->rowid : $l->id); |
|
698 | + $lid = (!empty($l->rowid) ? $l->rowid : $l->id); |
|
699 | 699 | if($lid == $lineid) { |
700 | 700 | |
701 | 701 | $found = true; |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | |
705 | 705 | if($found) { |
706 | 706 | |
707 | - $Tab[] = (!empty($l->rowid) ? $l->rowid : $l->id); |
|
707 | + $Tab[] = (!empty($l->rowid) ? $l->rowid : $l->id); |
|
708 | 708 | |
709 | 709 | if($l->special_code==$this->module_number && (($l->qty==99 && $qty_line==1) || ($l->qty==98 && $qty_line==2)) ) { |
710 | 710 | break; // end of story |
@@ -783,17 +783,17 @@ discard block |
||
783 | 783 | if($l->rang>=$rang) { |
784 | 784 | return price($total); |
785 | 785 | } |
786 | - if (TSubtotal::isSubtotal($l)){ |
|
787 | - $total = 0; |
|
788 | - } else if ($l->situation_percent > 0 ){ |
|
786 | + if (TSubtotal::isSubtotal($l)){ |
|
787 | + $total = 0; |
|
788 | + } else if ($l->situation_percent > 0 ){ |
|
789 | 789 | |
790 | 790 | |
791 | 791 | $prev_progress = $l->get_prev_progress($object->id); |
792 | 792 | $progress = ($l->situation_percent - $prev_progress) /100; |
793 | - $total += ($l->total_ht/($l->situation_percent/100)) * $progress; |
|
793 | + $total += ($l->total_ht/($l->situation_percent/100)) * $progress; |
|
794 | 794 | |
795 | - } |
|
796 | - } |
|
795 | + } |
|
796 | + } |
|
797 | 797 | |
798 | 798 | return price($total); |
799 | 799 | } |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | if(method_exists('Closure','bind')) { |
826 | 826 | $pageBreakOriginalValue = $pdf->AcceptPageBreak(); |
827 | 827 | $sweetsThief = function ($pdf) { |
828 | - return $pdf->bMargin ; |
|
828 | + return $pdf->bMargin ; |
|
829 | 829 | }; |
830 | 830 | $sweetsThief = Closure::bind($sweetsThief, null, $pdf); |
831 | 831 | |
@@ -888,11 +888,11 @@ discard block |
||
888 | 888 | else |
889 | 889 | { |
890 | 890 | list($total, $total_tva, $total_ttc, $TTotal_tva) = $this->getTotalLineFromObject($object, $line, '', 1); |
891 | - if(get_class($object) == 'Facture' && $object->type==Facture::TYPE_SITUATION){//Facture de situation |
|
892 | - $total_to_print = $this->getTotalToPrintSituation($object, $line); |
|
893 | - } else { |
|
894 | - $total_to_print = price($total); |
|
895 | - } |
|
891 | + if(get_class($object) == 'Facture' && $object->type==Facture::TYPE_SITUATION){//Facture de situation |
|
892 | + $total_to_print = $this->getTotalToPrintSituation($object, $line); |
|
893 | + } else { |
|
894 | + $total_to_print = price($total); |
|
895 | + } |
|
896 | 896 | |
897 | 897 | $line->total_ht = $total; |
898 | 898 | $line->total = $total; |
@@ -1082,19 +1082,19 @@ discard block |
||
1082 | 1082 | } |
1083 | 1083 | } |
1084 | 1084 | if ((int)GETPOST('hideInnerLines') && !empty($conf->global->SUBTOTAL_REPLACE_WITH_VAT_IF_HIDE_INNERLINES)){ |
1085 | - if(is_array($parameters)) $i = & $parameters['i']; |
|
1086 | - else $i = (int)$parameters; |
|
1087 | - $this->resprints = price($object->lines[$i]->total_ht); |
|
1085 | + if(is_array($parameters)) $i = & $parameters['i']; |
|
1086 | + else $i = (int)$parameters; |
|
1087 | + $this->resprints = price($object->lines[$i]->total_ht); |
|
1088 | 1088 | } |
1089 | 1089 | if (!empty($hideprices) |
1090 | - || (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && (!empty($object->lines[$i]->array_options['options_subtotal_nc']) || TSubtotal::hasNcTitle($object->lines[$i])) ) |
|
1091 | - ) |
|
1090 | + || (!empty($conf->global->SUBTOTAL_MANAGE_COMPRIS_NONCOMPRIS) && (!empty($object->lines[$i]->array_options['options_subtotal_nc']) || TSubtotal::hasNcTitle($object->lines[$i])) ) |
|
1091 | + ) |
|
1092 | 1092 | { |
1093 | - if (!empty($hideprices) || !in_array(__FUNCTION__, explode(',', $conf->global->SUBTOTAL_TFIELD_TO_KEEP_WITH_NC))) |
|
1094 | - { |
|
1095 | - $this->resprints = ' '; |
|
1096 | - return 1; |
|
1097 | - } |
|
1093 | + if (!empty($hideprices) || !in_array(__FUNCTION__, explode(',', $conf->global->SUBTOTAL_TFIELD_TO_KEEP_WITH_NC))) |
|
1094 | + { |
|
1095 | + $this->resprints = ' '; |
|
1096 | + return 1; |
|
1097 | + } |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | return 0; |
@@ -1374,11 +1374,11 @@ discard block |
||
1374 | 1374 | $hidedetails = (int)GETPOST('hidedetails'); |
1375 | 1375 | |
1376 | 1376 | if ($hideInnerLines) { // si c une ligne de titre |
1377 | - $fk_parent_line=0; |
|
1377 | + $fk_parent_line=0; |
|
1378 | 1378 | $TLines =array(); |
1379 | 1379 | |
1380 | 1380 | $original_count=count($object->lines); |
1381 | - $TTvas = array(); // tableau de tva |
|
1381 | + $TTvas = array(); // tableau de tva |
|
1382 | 1382 | |
1383 | 1383 | foreach($object->lines as $k=>&$line) |
1384 | 1384 | { |
@@ -1408,48 +1408,48 @@ discard block |
||
1408 | 1408 | |
1409 | 1409 | if ($hideInnerLines) |
1410 | 1410 | { |
1411 | - if(!empty($conf->global->SUBTOTAL_REPLACE_WITH_VAT_IF_HIDE_INNERLINES)) |
|
1412 | - { |
|
1413 | - if($line->tva_tx != '0.000' && $line->product_type!=9){ |
|
1411 | + if(!empty($conf->global->SUBTOTAL_REPLACE_WITH_VAT_IF_HIDE_INNERLINES)) |
|
1412 | + { |
|
1413 | + if($line->tva_tx != '0.000' && $line->product_type!=9){ |
|
1414 | 1414 | |
1415 | - // on remplit le tableau de tva pour substituer les lignes cachées |
|
1416 | - $TTvas[$line->tva_tx]['total_tva'] += $line->total_tva; |
|
1417 | - $TTvas[$line->tva_tx]['total_ht'] += $line->total_ht; |
|
1418 | - $TTvas[$line->tva_tx]['total_ttc'] += $line->total_ttc; |
|
1419 | - } |
|
1420 | - if($line->product_type==9 && $line->rowid>0) |
|
1421 | - { |
|
1422 | - //Cas où je doit cacher les produits et afficher uniquement les sous-totaux avec les titres |
|
1423 | - // génère des lignes d'affichage des montants HT soumis à tva |
|
1424 | - $nbtva = count($TTvas); |
|
1425 | - if(!empty($nbtva)){ |
|
1426 | - foreach ($TTvas as $tx =>$val){ |
|
1427 | - $l = clone $line; |
|
1428 | - $l->product_type = 1; |
|
1429 | - $l->special_code = ''; |
|
1430 | - $l->qty = 1; |
|
1431 | - $l->desc = $langs->trans('AmountBeforeTaxesSubjectToVATX%', $langs->transnoentitiesnoconv('VAT'), price($tx)); |
|
1432 | - $l->tva_tx = $tx; |
|
1433 | - $l->total_ht = $val['total_ht']; |
|
1434 | - $l->total_tva = $val['total_tva']; |
|
1435 | - $l->total = $line->total_ht; |
|
1436 | - $l->total_ttc = $val['total_ttc']; |
|
1437 | - $TLines[] = $l; |
|
1438 | - array_shift($TTvas); |
|
1439 | - } |
|
1440 | - } |
|
1415 | + // on remplit le tableau de tva pour substituer les lignes cachées |
|
1416 | + $TTvas[$line->tva_tx]['total_tva'] += $line->total_tva; |
|
1417 | + $TTvas[$line->tva_tx]['total_ht'] += $line->total_ht; |
|
1418 | + $TTvas[$line->tva_tx]['total_ttc'] += $line->total_ttc; |
|
1419 | + } |
|
1420 | + if($line->product_type==9 && $line->rowid>0) |
|
1421 | + { |
|
1422 | + //Cas où je doit cacher les produits et afficher uniquement les sous-totaux avec les titres |
|
1423 | + // génère des lignes d'affichage des montants HT soumis à tva |
|
1424 | + $nbtva = count($TTvas); |
|
1425 | + if(!empty($nbtva)){ |
|
1426 | + foreach ($TTvas as $tx =>$val){ |
|
1427 | + $l = clone $line; |
|
1428 | + $l->product_type = 1; |
|
1429 | + $l->special_code = ''; |
|
1430 | + $l->qty = 1; |
|
1431 | + $l->desc = $langs->trans('AmountBeforeTaxesSubjectToVATX%', $langs->transnoentitiesnoconv('VAT'), price($tx)); |
|
1432 | + $l->tva_tx = $tx; |
|
1433 | + $l->total_ht = $val['total_ht']; |
|
1434 | + $l->total_tva = $val['total_tva']; |
|
1435 | + $l->total = $line->total_ht; |
|
1436 | + $l->total_ttc = $val['total_ttc']; |
|
1437 | + $TLines[] = $l; |
|
1438 | + array_shift($TTvas); |
|
1439 | + } |
|
1440 | + } |
|
1441 | 1441 | |
1442 | - // ajoute la ligne de sous-total |
|
1443 | - $TLines[] = $line; |
|
1444 | - } |
|
1445 | - } else { |
|
1442 | + // ajoute la ligne de sous-total |
|
1443 | + $TLines[] = $line; |
|
1444 | + } |
|
1445 | + } else { |
|
1446 | 1446 | |
1447 | - if($line->product_type==9 && $line->rowid>0) |
|
1448 | - { |
|
1449 | - // ajoute la ligne de sous-total |
|
1450 | - $TLines[] = $line; |
|
1451 | - } |
|
1452 | - } |
|
1447 | + if($line->product_type==9 && $line->rowid>0) |
|
1448 | + { |
|
1449 | + // ajoute la ligne de sous-total |
|
1450 | + $TLines[] = $line; |
|
1451 | + } |
|
1452 | + } |
|
1453 | 1453 | |
1454 | 1454 | |
1455 | 1455 | } |
@@ -1474,20 +1474,20 @@ discard block |
||
1474 | 1474 | $nbtva = count($TTvas); |
1475 | 1475 | if(!empty($nbtva) && $hideInnerLines && !empty($conf->global->SUBTOTAL_REPLACE_WITH_VAT_IF_HIDE_INNERLINES)) |
1476 | 1476 | { |
1477 | - foreach ($TTvas as $tx =>$val){ |
|
1478 | - $l = clone $line; |
|
1479 | - $l->product_type = 1; |
|
1480 | - $l->special_code = ''; |
|
1481 | - $l->qty = 1; |
|
1482 | - $l->desc = $langs->trans('AmountBeforeTaxesSubjectToVATX%', $langs->transnoentitiesnoconv('VAT'), price($tx)); |
|
1483 | - $l->tva_tx = $tx; |
|
1484 | - $l->total_ht = $val['total_ht']; |
|
1485 | - $l->total_tva = $val['total_tva']; |
|
1486 | - $l->total = $line->total_ht; |
|
1487 | - $l->total_ttc = $val['total_ttc']; |
|
1488 | - $TLines[] = $l; |
|
1489 | - array_shift($TTvas); |
|
1490 | - } |
|
1477 | + foreach ($TTvas as $tx =>$val){ |
|
1478 | + $l = clone $line; |
|
1479 | + $l->product_type = 1; |
|
1480 | + $l->special_code = ''; |
|
1481 | + $l->qty = 1; |
|
1482 | + $l->desc = $langs->trans('AmountBeforeTaxesSubjectToVATX%', $langs->transnoentitiesnoconv('VAT'), price($tx)); |
|
1483 | + $l->tva_tx = $tx; |
|
1484 | + $l->total_ht = $val['total_ht']; |
|
1485 | + $l->total_tva = $val['total_tva']; |
|
1486 | + $l->total = $line->total_ht; |
|
1487 | + $l->total_ttc = $val['total_ttc']; |
|
1488 | + $TLines[] = $l; |
|
1489 | + array_shift($TTvas); |
|
1490 | + } |
|
1491 | 1491 | } |
1492 | 1492 | |
1493 | 1493 | global $nblignes; |
@@ -1499,7 +1499,7 @@ discard block |
||
1499 | 1499 | $this->resprints = ''; |
1500 | 1500 | return 0; |
1501 | 1501 | } |
1502 | - } |
|
1502 | + } |
|
1503 | 1503 | |
1504 | 1504 | return 0; |
1505 | 1505 | } |
@@ -1662,18 +1662,18 @@ discard block |
||
1662 | 1662 | } |
1663 | 1663 | elseif($object->element == 'order_supplier' ) |
1664 | 1664 | { |
1665 | - $createRight = $user->rights->fournisseur->commande->creer; |
|
1665 | + $createRight = $user->rights->fournisseur->commande->creer; |
|
1666 | 1666 | } |
1667 | 1667 | elseif($object->element == 'invoice_supplier' ) |
1668 | 1668 | { |
1669 | - $createRight = $user->rights->fournisseur->facture->creer; |
|
1669 | + $createRight = $user->rights->fournisseur->facture->creer; |
|
1670 | 1670 | } |
1671 | 1671 | |
1672 | 1672 | if($line->special_code!=$this->module_number || $line->product_type!=9) { |
1673 | 1673 | null; |
1674 | 1674 | } |
1675 | 1675 | else if (in_array('invoicecard',$contexts) || in_array('invoicesuppliercard',$contexts) || in_array('propalcard',$contexts) || in_array('supplier_proposalcard',$contexts) || in_array('ordercard',$contexts) || in_array('ordersuppliercard',$contexts) || in_array('invoicereccard',$contexts)) |
1676 | - { |
|
1676 | + { |
|
1677 | 1677 | if($object->element=='facture')$idvar = 'facid'; |
1678 | 1678 | else $idvar='id'; |
1679 | 1679 | |
@@ -1720,7 +1720,7 @@ discard block |
||
1720 | 1720 | //var_dump($line); |
1721 | 1721 | |
1722 | 1722 | // HTML 5 data for js |
1723 | - $data = $this->_getHtmlData($parameters, $object, $action, $hookmanager); |
|
1723 | + $data = $this->_getHtmlData($parameters, $object, $action, $hookmanager); |
|
1724 | 1724 | |
1725 | 1725 | |
1726 | 1726 | ?> |
@@ -1778,8 +1778,8 @@ discard block |
||
1778 | 1778 | } |
1779 | 1779 | |
1780 | 1780 | if ($object->element == 'order_supplier' || $object->element == 'invoice_supplier') { |
1781 | - $line->label = !empty($line->description) ? $line->description : $line->desc; |
|
1782 | - $line->description = ''; |
|
1781 | + $line->label = !empty($line->description) ? $line->description : $line->desc; |
|
1782 | + $line->description = ''; |
|
1783 | 1783 | } |
1784 | 1784 | $newlabel = $line->label; |
1785 | 1785 | if($line->label=='' && !$isFreeText) { |
@@ -2158,80 +2158,80 @@ discard block |
||
2158 | 2158 | { |
2159 | 2159 | dol_include_once('/subtotal/class/subtotal.class.php'); |
2160 | 2160 | |
2161 | - $line = &$parameters['line']; |
|
2161 | + $line = &$parameters['line']; |
|
2162 | 2162 | |
2163 | - $ThtmlData['data-id'] = $line->id; |
|
2164 | - $ThtmlData['data-product_type'] = $line->product_type; |
|
2165 | - $ThtmlData['data-qty'] = 0; //$line->qty; |
|
2166 | - $ThtmlData['data-level'] = TSubtotal::getNiveau($line); |
|
2163 | + $ThtmlData['data-id'] = $line->id; |
|
2164 | + $ThtmlData['data-product_type'] = $line->product_type; |
|
2165 | + $ThtmlData['data-qty'] = 0; //$line->qty; |
|
2166 | + $ThtmlData['data-level'] = TSubtotal::getNiveau($line); |
|
2167 | 2167 | |
2168 | - if(TSubtotal::isTitle($line)){ |
|
2169 | - $ThtmlData['data-issubtotal'] = 'title'; |
|
2170 | - }elseif(TSubtotal::isSubtotal($line)){ |
|
2171 | - $ThtmlData['data-issubtotal'] = 'subtotal'; |
|
2172 | - } |
|
2173 | - else{ |
|
2174 | - $ThtmlData['data-issubtotal'] = 'freetext'; |
|
2175 | - } |
|
2168 | + if(TSubtotal::isTitle($line)){ |
|
2169 | + $ThtmlData['data-issubtotal'] = 'title'; |
|
2170 | + }elseif(TSubtotal::isSubtotal($line)){ |
|
2171 | + $ThtmlData['data-issubtotal'] = 'subtotal'; |
|
2172 | + } |
|
2173 | + else{ |
|
2174 | + $ThtmlData['data-issubtotal'] = 'freetext'; |
|
2175 | + } |
|
2176 | 2176 | |
2177 | 2177 | |
2178 | - // Change or add data from hooks |
|
2179 | - $parameters = array_replace($parameters , array( 'ThtmlData' => $ThtmlData ) ); |
|
2178 | + // Change or add data from hooks |
|
2179 | + $parameters = array_replace($parameters , array( 'ThtmlData' => $ThtmlData ) ); |
|
2180 | 2180 | |
2181 | - // hook |
|
2182 | - $reshook = $hookmanager->executeHooks('subtotalLineHtmlData',$parameters,$object,$action); // Note that $action and $object may have been modified by hook |
|
2183 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2184 | - if ($reshook>0) |
|
2185 | - { |
|
2186 | - $ThtmlData = $hookmanager->resArray; |
|
2187 | - } |
|
2188 | - |
|
2189 | - return $this->implodeHtmlData($ThtmlData); |
|
2181 | + // hook |
|
2182 | + $reshook = $hookmanager->executeHooks('subtotalLineHtmlData',$parameters,$object,$action); // Note that $action and $object may have been modified by hook |
|
2183 | + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2184 | + if ($reshook>0) |
|
2185 | + { |
|
2186 | + $ThtmlData = $hookmanager->resArray; |
|
2187 | + } |
|
2188 | + |
|
2189 | + return $this->implodeHtmlData($ThtmlData); |
|
2190 | 2190 | |
2191 | 2191 | } |
2192 | 2192 | |
2193 | 2193 | |
2194 | 2194 | function implodeHtmlData($ThtmlData = array()) |
2195 | 2195 | { |
2196 | - $data = ''; |
|
2197 | - foreach($ThtmlData as $k => $h ) |
|
2198 | - { |
|
2199 | - if(is_array($h)) |
|
2200 | - { |
|
2201 | - $h = json_encode($h); |
|
2202 | - } |
|
2196 | + $data = ''; |
|
2197 | + foreach($ThtmlData as $k => $h ) |
|
2198 | + { |
|
2199 | + if(is_array($h)) |
|
2200 | + { |
|
2201 | + $h = json_encode($h); |
|
2202 | + } |
|
2203 | 2203 | |
2204 | - $data .= $k . '="'.dol_htmlentities($h, ENT_QUOTES).'" '; |
|
2205 | - } |
|
2204 | + $data .= $k . '="'.dol_htmlentities($h, ENT_QUOTES).'" '; |
|
2205 | + } |
|
2206 | 2206 | |
2207 | - return $data; |
|
2207 | + return $data; |
|
2208 | 2208 | } |
2209 | 2209 | |
2210 | 2210 | function _ajax_block_order_js($object) |
2211 | 2211 | { |
2212 | - global $conf,$tagidfortablednd,$filepath,$langs; |
|
2212 | + global $conf,$tagidfortablednd,$filepath,$langs; |
|
2213 | 2213 | |
2214 | - /* |
|
2214 | + /* |
|
2215 | 2215 | * this part of js is base on dolibarr htdocs/core/tpl/ajaxrow.tpl.php |
2216 | 2216 | * for compatibility reasons we don't use tableDnD but jquery sortable |
2217 | 2217 | */ |
2218 | 2218 | |
2219 | - $id=$object->id; |
|
2220 | - $nboflines=(isset($object->lines)?count($object->lines):0); |
|
2221 | - $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; |
|
2219 | + $id=$object->id; |
|
2220 | + $nboflines=(isset($object->lines)?count($object->lines):0); |
|
2221 | + $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; |
|
2222 | 2222 | |
2223 | - $id=$object->id; |
|
2224 | - $fk_element=$object->fk_element; |
|
2225 | - $table_element_line=$object->table_element_line; |
|
2226 | - $nboflines=(isset($object->lines)?count($object->lines):(empty($nboflines)?0:$nboflines)); |
|
2227 | - $tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd); |
|
2228 | - $filepath=(empty($filepath)?'':$filepath); |
|
2223 | + $id=$object->id; |
|
2224 | + $fk_element=$object->fk_element; |
|
2225 | + $table_element_line=$object->table_element_line; |
|
2226 | + $nboflines=(isset($object->lines)?count($object->lines):(empty($nboflines)?0:$nboflines)); |
|
2227 | + $tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd); |
|
2228 | + $filepath=(empty($filepath)?'':$filepath); |
|
2229 | 2229 | |
2230 | 2230 | |
2231 | - if (GETPOST('action','aZ09') != 'editline' && $nboflines > 1) |
|
2232 | - { |
|
2231 | + if (GETPOST('action','aZ09') != 'editline' && $nboflines > 1) |
|
2232 | + { |
|
2233 | 2233 | |
2234 | - ?> |
|
2234 | + ?> |
|
2235 | 2235 | |
2236 | 2236 | |
2237 | 2237 | <script type="text/javascript"> |