@@ -110,7 +110,9 @@ |
||
110 | 110 | accessforbidden(); |
111 | 111 | } |
112 | 112 | //$result = restrictedArea($user, 'productbatch'); |
113 | -if (!$permissiontoread) accessforbidden(); |
|
113 | +if (!$permissiontoread) { |
|
114 | + accessforbidden(); |
|
115 | +} |
|
114 | 116 | |
115 | 117 | |
116 | 118 | /* |
@@ -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 | /* |
@@ -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'; |
@@ -820,7 +820,9 @@ |
||
820 | 820 | } |
821 | 821 | |
822 | 822 | $statusType = 'status'.$status; |
823 | - if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; |
|
823 | + if ($status == self::STATUS_VALIDATED) { |
|
824 | + $statusType = 'status4'; |
|
825 | + } |
|
824 | 826 | if ($status == self::STATUS_CANCELED) { |
825 | 827 | $statusType = 'status6'; |
826 | 828 | } |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | define('NOSTYLECHECK', 1); |
27 | 27 | define('USEDOLIBARREDITOR', 1); |
28 | 28 | define('FORCE_CKEDITOR', 1); // We need CKEditor, even if module is off. |
29 | -if (!defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1); |
|
29 | +if (!defined('DISABLE_JS_GRAHP')) { |
|
30 | + define('DISABLE_JS_GRAPH', 1); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | //header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. |
32 | 34 | |
@@ -592,7 +594,9 @@ discard block |
||
592 | 594 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
593 | 595 | foreach ($arrayotherlang as $key => $val) { |
594 | 596 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
595 | - if (empty(trim($val))) continue; |
|
597 | + if (empty(trim($val))) { |
|
598 | + continue; |
|
599 | + } |
|
596 | 600 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
597 | 601 | } |
598 | 602 | |
@@ -1336,7 +1340,9 @@ discard block |
||
1336 | 1340 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
1337 | 1341 | foreach ($arrayotherlang as $key => $val) { |
1338 | 1342 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
1339 | - if (empty(trim($val))) continue; |
|
1343 | + if (empty(trim($val))) { |
|
1344 | + continue; |
|
1345 | + } |
|
1340 | 1346 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
1341 | 1347 | } |
1342 | 1348 | |
@@ -1793,7 +1799,9 @@ discard block |
||
1793 | 1799 | // Under certain conditions $sublang can be an empty string |
1794 | 1800 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
1795 | 1801 | // if is the case we try to re-delete the main alias file. Avoid it. |
1796 | - if (empty(trim($sublang))) continue; |
|
1802 | + if (empty(trim($sublang))) { |
|
1803 | + continue; |
|
1804 | + } |
|
1797 | 1805 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
1798 | 1806 | dol_delete_file($fileoldaliassub); |
1799 | 1807 | } |
@@ -1816,7 +1824,9 @@ discard block |
||
1816 | 1824 | // Under certain conditions $ sublang can be an empty string |
1817 | 1825 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
1818 | 1826 | // if is the case we try to re-delete the main alias file. Avoid it. |
1819 | - if (empty(trim($sublang))) continue; |
|
1827 | + if (empty(trim($sublang))) { |
|
1828 | + continue; |
|
1829 | + } |
|
1820 | 1830 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
1821 | 1831 | dol_delete_file($fileoldaliassub); |
1822 | 1832 | } |
@@ -2903,7 +2913,9 @@ discard block |
||
2903 | 2913 | $onlylang[$website->lang] = $website->lang.' ('.$langs->trans("Default").')'; |
2904 | 2914 | } |
2905 | 2915 | foreach (explode(',', $website->otherlang) as $langkey) { |
2906 | - if (empty(trim($langkey))) continue; |
|
2916 | + if (empty(trim($langkey))) { |
|
2917 | + continue; |
|
2918 | + } |
|
2907 | 2919 | $onlylang[$langkey] = $langkey; |
2908 | 2920 | } |
2909 | 2921 | $textifempty = $langs->trans("Default"); |
@@ -1984,9 +1984,12 @@ |
||
1984 | 1984 | |
1985 | 1985 | $parameters = array(); |
1986 | 1986 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1987 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1988 | - if (empty($reshook)) |
|
1989 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
1987 | + if ($reshook < 0) { |
|
1988 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1989 | + } |
|
1990 | + if (empty($reshook)) { |
|
1991 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
1992 | + } |
|
1990 | 1993 | } |
1991 | 1994 | |
1992 | 1995 | print '</table>'; |
@@ -118,7 +118,9 @@ |
||
118 | 118 | |
119 | 119 | if ($year) { |
120 | 120 | if (is_dir($dir.'/'.$year)) { |
121 | - if (!empty($year_dirs)) print '<br>'; |
|
121 | + if (!empty($year_dirs)) { |
|
122 | + print '<br>'; |
|
123 | + } |
|
122 | 124 | print '<br>'; |
123 | 125 | print '<table width="100%" class="noborder">'; |
124 | 126 | print '<tr class="liste_titre">'; |
@@ -1623,9 +1623,13 @@ |
||
1623 | 1623 | |
1624 | 1624 | $parameters = array(); |
1625 | 1625 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1626 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1627 | - if (empty($reshook)) |
|
1628 | - $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice |
|
1626 | + if ($reshook < 0) { |
|
1627 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1628 | + } |
|
1629 | + if (empty($reshook)) { |
|
1630 | + $object->formAddObjectLine(0, $mysoc, $object->thirdparty); |
|
1631 | + } |
|
1632 | + // No date selector for template invoice |
|
1629 | 1633 | } |
1630 | 1634 | } |
1631 | 1635 |
@@ -1776,9 +1776,12 @@ |
||
1776 | 1776 | |
1777 | 1777 | $parameters = array(); |
1778 | 1778 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1779 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1780 | - if (empty($reshook)) |
|
1781 | - $object->formAddObjectLine($dateSelector, $soc, $mysoc); |
|
1779 | + if ($reshook < 0) { |
|
1780 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1781 | + } |
|
1782 | + if (empty($reshook)) { |
|
1783 | + $object->formAddObjectLine($dateSelector, $soc, $mysoc); |
|
1784 | + } |
|
1782 | 1785 | } |
1783 | 1786 | } |
1784 | 1787 |