@@ -42,8 +42,12 @@ |
||
42 | 42 | //if ($user->socid > 0) $socid = $user->socid; |
43 | 43 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
44 | 44 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
45 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
46 | -if (empty($permissiontoread)) accessforbidden(); |
|
45 | +if (empty($conf->hrm->enabled)) { |
|
46 | + accessforbidden(); |
|
47 | +} |
|
48 | +if (empty($permissiontoread)) { |
|
49 | + accessforbidden(); |
|
50 | +} |
|
47 | 51 | |
48 | 52 | |
49 | 53 | /* |
@@ -42,8 +42,12 @@ |
||
42 | 42 | //if ($user->socid > 0) $socid = $user->socid; |
43 | 43 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
44 | 44 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
45 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
46 | -if (empty($permissiontoread)) accessforbidden(); |
|
45 | +if (empty($conf->hrm->enabled)) { |
|
46 | + accessforbidden(); |
|
47 | +} |
|
48 | +if (empty($permissiontoread)) { |
|
49 | + accessforbidden(); |
|
50 | +} |
|
47 | 51 | |
48 | 52 | |
49 | 53 | /* |
@@ -24,7 +24,10 @@ |
||
24 | 24 | * \brief Page to edit absolute discounts for a customer |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | + define('CSRFCHECK_WITH_TOKEN', '1'); |
|
29 | +} |
|
30 | +// Force use of CSRF protection with tokens even for GET |
|
28 | 31 | |
29 | 32 | require '../main.inc.php'; |
30 | 33 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
@@ -568,7 +568,9 @@ discard block |
||
568 | 568 | |
569 | 569 | // Type |
570 | 570 | print '<td>'; |
571 | - if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
571 | + if (!empty($obj->payment_code)) { |
|
572 | + print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
573 | + } |
|
572 | 574 | print '</td>'; |
573 | 575 | if (!$i) { |
574 | 576 | $totalarray['nbfield']++; |
@@ -621,7 +623,9 @@ discard block |
||
621 | 623 | $totalarray['val']['totalttcfield'] += $obj->amount; |
622 | 624 | |
623 | 625 | print '<td class="nowrap right">'.$salstatic->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>'; |
624 | - if (!$i) $totalarray['nbfield']++; |
|
626 | + if (!$i) { |
|
627 | + $totalarray['nbfield']++; |
|
628 | + } |
|
625 | 629 | |
626 | 630 | // Extra fields |
627 | 631 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; |
@@ -481,7 +481,9 @@ discard block |
||
481 | 481 | // Type |
482 | 482 | if (!empty($arrayfields['t.fk_typepayment']['checked'])) { |
483 | 483 | print '<td>'; |
484 | - if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
484 | + if (!empty($obj->payment_code)) { |
|
485 | + print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
486 | + } |
|
485 | 487 | print '</td>'; |
486 | 488 | if (!$i) { |
487 | 489 | $totalarray['nbfield']++; |
@@ -508,7 +510,9 @@ discard block |
||
508 | 510 | print $bankstatic->getNomUrl(1); |
509 | 511 | } |
510 | 512 | print '</td>'; |
511 | - if (!$i) $totalarray['nbfield']++; |
|
513 | + if (!$i) { |
|
514 | + $totalarray['nbfield']++; |
|
515 | + } |
|
512 | 516 | } |
513 | 517 | |
514 | 518 | // Amount |
@@ -95,7 +95,9 @@ discard block |
||
95 | 95 | $sql .= " WHERE mc.fk_mailing = m.rowid AND mc.tag='".$db->escape($tag)."'"; |
96 | 96 | |
97 | 97 | $resql = $db->query($sql); |
98 | - if (!$resql) dol_print_error($db); |
|
98 | + if (!$resql) { |
|
99 | + dol_print_error($db); |
|
100 | + } |
|
99 | 101 | |
100 | 102 | $obj = $db->fetch_object($resql); |
101 | 103 | |
@@ -124,7 +126,9 @@ discard block |
||
124 | 126 | $statut = '2'; |
125 | 127 | $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".((int) $statut)." WHERE rowid = ".((int) $obj->rowid); |
126 | 128 | $resql = $db->query($sql); |
127 | - if (!$resql) dol_print_error($db); |
|
129 | + if (!$resql) { |
|
130 | + dol_print_error($db); |
|
131 | + } |
|
128 | 132 | |
129 | 133 | //Update status communication of thirdparty prospect |
130 | 134 | if ($obj->source_id > 0 && $obj->source_type == 'thirdparty' && $obj->entity) { |
@@ -152,7 +152,9 @@ |
||
152 | 152 | accessforbidden(); |
153 | 153 | } |
154 | 154 | $result = restrictedArea($user, 'eventorganization'); |
155 | -if (!$permissiontoread) accessforbidden(); |
|
155 | +if (!$permissiontoread) { |
|
156 | + accessforbidden(); |
|
157 | +} |
|
156 | 158 | |
157 | 159 | |
158 | 160 | /* |
@@ -31,7 +31,9 @@ discard block |
||
31 | 31 | require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; |
32 | 32 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
33 | 33 | require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; |
34 | -if (!empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
34 | +if (!empty($conf->banque->enabled)) { |
|
35 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
36 | +} |
|
35 | 37 | |
36 | 38 | // Load translation files required by the page |
37 | 39 | $langs->loadLangs(array('bills', 'banks', 'companies', 'salaries')); |
@@ -40,13 +42,17 @@ discard block |
||
40 | 42 | $id = GETPOST("id", 'int'); |
41 | 43 | $action = GETPOST('action', 'aZ09'); |
42 | 44 | $confirm = GETPOST('confirm'); |
43 | -if ($user->socid) $socid = $user->socid; |
|
45 | +if ($user->socid) { |
|
46 | + $socid = $user->socid; |
|
47 | +} |
|
44 | 48 | |
45 | 49 | $object = new PaymentSalary($db); |
46 | 50 | if ($id > 0) { |
47 | 51 | $result = $object->fetch($id); |
48 | - if (!$result) dol_print_error($db, 'Failed to get payment id '.$id); |
|
49 | -} |
|
52 | + if (!$result) { |
|
53 | + dol_print_error($db, 'Failed to get payment id '.$id); |
|
54 | + } |
|
55 | + } |
|
50 | 56 | restrictedArea($user, 'salaries', $object->fk_salary, 'salary', ''); // $object is payment of salary |
51 | 57 | |
52 | 58 |
@@ -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'; |