@@ -311,14 +311,14 @@ |
||
311 | 311 | $importcsv = new ImportCsv($db, 'massstocklist'); |
312 | 312 | //print $importcsv->separator; |
313 | 313 | |
314 | - $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1; |
|
314 | + $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath) - 1; |
|
315 | 315 | $importcsv->import_open_file($fullpath); |
316 | 316 | $labelsrecord = $importcsv->import_read_record(); |
317 | 317 | |
318 | 318 | if ($nblinesrecord < 1) { |
319 | 319 | setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); |
320 | 320 | } else { |
321 | - $i=0; |
|
321 | + $i = 0; |
|
322 | 322 | $data = array(); |
323 | 323 | $productstatic = new Product($db); |
324 | 324 | $warehousestatics = new Entrepot($db); |
@@ -286,19 +286,19 @@ |
||
286 | 286 | |
287 | 287 | // sort list |
288 | 288 | if ($sortfield == "name" && $sortorder == "asc") { |
289 | - usort($moduleList, function (stdClass $a, stdClass $b) { |
|
289 | + usort($moduleList, function(stdClass $a, stdClass $b) { |
|
290 | 290 | return strcasecmp($a->name, $b->name); |
291 | 291 | }); |
292 | 292 | } elseif ($sortfield == "name" && $sortorder == "desc") { |
293 | - usort($moduleList, function (stdClass $a, stdClass $b) { |
|
293 | + usort($moduleList, function(stdClass $a, stdClass $b) { |
|
294 | 294 | return strcasecmp($b->name, $a->name); |
295 | 295 | }); |
296 | 296 | } elseif ($sortfield == "version" && $sortorder == "asc") { |
297 | - usort($moduleList, function (stdClass $a, stdClass $b) { |
|
297 | + usort($moduleList, function(stdClass $a, stdClass $b) { |
|
298 | 298 | return strcasecmp($a->version, $b->version); |
299 | 299 | }); |
300 | 300 | } elseif ($sortfield == "version" && $sortorder == "desc") { |
301 | - usort($moduleList, function (stdClass $a, stdClass $b) { |
|
301 | + usort($moduleList, function(stdClass $a, stdClass $b) { |
|
302 | 302 | return strcasecmp($b->version, $a->version); |
303 | 303 | }); |
304 | 304 | } elseif ($sortfield == "id" && $sortorder == "asc") { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | return $solde; |
417 | 417 | } |
418 | 418 | |
419 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
419 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
420 | 420 | /** |
421 | 421 | * Total of the VAT from invoices emitted by the thirdparty. |
422 | 422 | * |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public function tva_sum_collectee($year = 0) |
427 | 427 | { |
428 | - // phpcs:enable |
|
428 | + // phpcs:enable |
|
429 | 429 | |
430 | 430 | $sql = "SELECT sum(f.total_tva) as amount"; |
431 | 431 | $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | } |
452 | 452 | |
453 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
453 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
454 | 454 | /** |
455 | 455 | * VAT payed |
456 | 456 | * |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | */ |
460 | 460 | public function tva_sum_payee($year = 0) |
461 | 461 | { |
462 | - // phpcs:enable |
|
462 | + // phpcs:enable |
|
463 | 463 | |
464 | 464 | $sql = "SELECT sum(f.total_tva) as total_tva"; |
465 | 465 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | } |
486 | 486 | |
487 | 487 | |
488 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
488 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
489 | 489 | /** |
490 | 490 | * Total of the VAT payed |
491 | 491 | * |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | */ |
495 | 495 | public function tva_sum_reglee($year = 0) |
496 | 496 | { |
497 | - // phpcs:enable |
|
497 | + // phpcs:enable |
|
498 | 498 | |
499 | 499 | $sql = "SELECT sum(f.amount) as amount"; |
500 | 500 | $sql .= " FROM ".MAIN_DB_PREFIX."tva as f"; |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | } |
666 | 666 | } |
667 | 667 | |
668 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
668 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
669 | 669 | /** |
670 | 670 | * Update link between payment tva and line generate into llx_bank |
671 | 671 | * |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | */ |
675 | 675 | public function update_fk_bank($id_bank) |
676 | 676 | { |
677 | - // phpcs:enable |
|
677 | + // phpcs:enable |
|
678 | 678 | $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.(int) $id_bank; |
679 | 679 | $sql .= ' WHERE rowid = '.(int) $this->id; |
680 | 680 | $result = $this->db->query($sql); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * \brief Popup screen to validate VAT |
22 | 22 | */ |
23 | 23 | |
24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
24 | +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
25 | 25 | |
26 | 26 | require "../../main.inc.php"; |
27 | 27 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
@@ -21,7 +21,10 @@ |
||
21 | 21 | * \brief Popup screen to validate VAT |
22 | 22 | */ |
23 | 23 | |
24 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
24 | +if (! defined('NOTOKENRENEWAL')) { |
|
25 | + define('NOTOKENRENEWAL', '1'); |
|
26 | +} |
|
27 | +// Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) |
|
25 | 28 | |
26 | 29 | require "../../main.inc.php"; |
27 | 30 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; |
60 | 60 | |
61 | 61 | // Is the login API disabled ? The token must be generated from backoffice only. |
62 | - if (! empty($conf->global->API_DISABLE_LOGIN_API)) { |
|
62 | + if (!empty($conf->global->API_DISABLE_LOGIN_API)) { |
|
63 | 63 | dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING); |
64 | 64 | throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice."); |
65 | 65 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
94 | - $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
94 | + $login = checkLoginPassEntity($login, $password, $entity, $authmode, 'api'); // Check credentials. |
|
95 | 95 | if (empty($login)) { |
96 | 96 | throw new RestException(403, 'Access denied'); |
97 | 97 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | // Generate token for user |
115 | - $token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY)?'':$conf->global->MAIN_API_KEY), 1); |
|
115 | + $token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY) ? '' : $conf->global->MAIN_API_KEY), 1); |
|
116 | 116 | |
117 | 117 | // We store API token into database |
118 | 118 | $sql = "UPDATE ".MAIN_DB_PREFIX."user"; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | $socid = $user->socid; |
80 | 80 | } |
81 | 81 | |
82 | -$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known |
|
82 | +$result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, because there is no particular shipment on this tab, only id of order is known |
|
83 | 83 | |
84 | 84 | |
85 | 85 |
@@ -264,17 +264,17 @@ |
||
264 | 264 | $r = 0; |
265 | 265 | // Add here entries to declare new permissions |
266 | 266 | /* BEGIN MODULEBUILDER PERMISSIONS */ |
267 | - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
267 | + $this->rights[$r][0] = $this->numero.sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
268 | 268 | $this->rights[$r][1] = 'Read objects of MyModule'; // Permission label |
269 | 269 | $this->rights[$r][4] = 'myobject'; |
270 | 270 | $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->read) |
271 | 271 | $r++; |
272 | - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
272 | + $this->rights[$r][0] = $this->numero.sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
273 | 273 | $this->rights[$r][1] = 'Create/Update objects of MyModule'; // Permission label |
274 | 274 | $this->rights[$r][4] = 'myobject'; |
275 | 275 | $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->write) |
276 | 276 | $r++; |
277 | - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
277 | + $this->rights[$r][0] = $this->numero.sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
278 | 278 | $this->rights[$r][1] = 'Delete objects of MyModule'; // Permission label |
279 | 279 | $this->rights[$r][4] = 'myobject'; |
280 | 280 | $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mymodule->myobject->delete) |
@@ -51,10 +51,10 @@ |
||
51 | 51 | $constantes = array( |
52 | 52 | 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), |
53 | 53 | 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', |
54 | - 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_AUTOREGISTER_MAIL |
|
55 | - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID |
|
56 | - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS |
|
57 | - 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_RESIL |
|
54 | + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_AUTOREGISTER_MAIL |
|
55 | + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID |
|
56 | + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS |
|
57 | + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_RESIL |
|
58 | 58 | 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member', |
59 | 59 | 'ADHERENT_MAIL_FROM' =>'string', |
60 | 60 | 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>'string', |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | if (empty($reshook)) { |
154 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
154 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
155 | 155 | |
156 | 156 | // Purge search criteria |
157 | 157 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $objectclass = 'Account'; |
166 | 166 | $objectlabel = 'FinancialAccount'; |
167 | 167 | $uploaddir = $conf->banque->dir_output; |
168 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
168 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /* |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | if ($user->rights->banque->modifier) { |
305 | 305 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); |
306 | 306 | } |
307 | -if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
|
307 | +if (in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { |
|
308 | 308 | $arrayofmassactions = array(); |
309 | 309 | } |
310 | 310 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |