@@ -31,7 +31,9 @@ |
||
31 | 31 | $langs->loadLangs(array('banks', 'categories')); |
32 | 32 | |
33 | 33 | // Security check |
34 | -if ($user->socid) $socid = $user->socid; |
|
34 | +if ($user->socid) { |
|
35 | + $socid = $user->socid; |
|
36 | +} |
|
35 | 37 | $result = restrictedArea($user, 'banque'); |
36 | 38 | |
37 | 39 |
@@ -32,8 +32,9 @@ |
||
32 | 32 | // Load translation files required by the page |
33 | 33 | $langs->load("admin"); |
34 | 34 | |
35 | -if (!$user->admin) |
|
35 | +if (!$user->admin) { |
|
36 | 36 | accessforbidden(); |
37 | +} |
|
37 | 38 | |
38 | 39 | $action = GETPOST('action', 'aZ09'); |
39 | 40 |
@@ -59,9 +59,15 @@ |
||
59 | 59 | |
60 | 60 | $out = ''; |
61 | 61 | |
62 | - if ($action == 'view') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress")); |
|
63 | - if ($action == 'edit') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress")); |
|
64 | - if ($action == 'create') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); |
|
62 | + if ($action == 'view') { |
|
63 | + $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress")); |
|
64 | + } |
|
65 | + if ($action == 'edit') { |
|
66 | + $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress")); |
|
67 | + } |
|
68 | + if ($action == 'create') { |
|
69 | + $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); |
|
70 | + } |
|
65 | 71 | |
66 | 72 | return $out; |
67 | 73 | } |
@@ -36,7 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | // Security check |
38 | 38 | $id = GETPOST('id', 'int'); |
39 | -if ($user->socid) $socid = $user->socid; |
|
39 | +if ($user->socid) { |
|
40 | + $socid = $user->socid; |
|
41 | +} |
|
40 | 42 | $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); |
41 | 43 | |
42 | 44 | $object = new Contact($db); |
@@ -146,7 +148,9 @@ discard block |
||
146 | 148 | |
147 | 149 | print "</div>\n"; |
148 | 150 | |
149 | -if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "<br>\n"; |
|
151 | +if (!empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') { |
|
152 | + print "<br>\n"; |
|
153 | +} |
|
150 | 154 | |
151 | 155 | |
152 | 156 |
@@ -20,10 +20,19 @@ discard block |
||
20 | 20 | * \brief File to build ecm database |
21 | 21 | */ |
22 | 22 | |
23 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal |
|
24 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); |
|
25 | -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
26 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
23 | +if (!defined('NOTOKENRENEWAL')) { |
|
24 | + define('NOTOKENRENEWAL', '1'); |
|
25 | +} |
|
26 | +// Disables token renewal |
|
27 | +if (!defined('NOREQUIREMENU')) { |
|
28 | + define('NOREQUIREMENU', '1'); |
|
29 | +} |
|
30 | +if (!defined('NOREQUIREAJAX')) { |
|
31 | + define('NOREQUIREAJAX', '1'); |
|
32 | +} |
|
33 | +if (!defined('NOREQUIRESOC')) { |
|
34 | + define('NOREQUIRESOC', '1'); |
|
35 | +} |
|
27 | 36 | |
28 | 37 | require '../../main.inc.php'; |
29 | 38 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
@@ -68,9 +77,12 @@ discard block |
||
68 | 77 | // Now we compare both trees to complete missing trees into database |
69 | 78 | //var_dump($disktree); |
70 | 79 | //var_dump($sqltree); |
71 | - foreach ($disktree as $dirdesc) // Loop on tree onto disk |
|
80 | + foreach ($disktree as $dirdesc) { |
|
81 | + // Loop on tree onto disk |
|
72 | 82 | { |
73 | - set_time_limit(0); // To force restarts the timeout counter from zero |
|
83 | + set_time_limit(0); |
|
84 | + } |
|
85 | + // To force restarts the timeout counter from zero |
|
74 | 86 | |
75 | 87 | $dirisindatabase = 0; |
76 | 88 | foreach ($sqltree as $dirsqldesc) |
@@ -92,10 +104,11 @@ discard block |
||
92 | 104 | $relativepathmissing = str_replace($diroutputslash, '', $dirdesc['fullname']); |
93 | 105 | $relativepathtosearchparent = $relativepathmissing; |
94 | 106 | //dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent); |
95 | - if (preg_match('/\//', $relativepathtosearchparent)) |
|
96 | - //while (preg_match('/\//',$relativepathtosearchparent)) |
|
107 | + if (preg_match('/\//', $relativepathtosearchparent)) { |
|
108 | + //while (preg_match('/\//',$relativepathtosearchparent)) |
|
97 | 109 | { |
98 | 110 | $relativepathtosearchparent = preg_replace('/\/[^\/]*$/', '', $relativepathtosearchparent); |
111 | + } |
|
99 | 112 | $txt = "Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?"; |
100 | 113 | dol_syslog($txt); |
101 | 114 | //print $txt." -> "; |
@@ -156,9 +169,11 @@ discard block |
||
156 | 169 | } |
157 | 170 | |
158 | 171 | // Loop now on each sql tree to check if dir exists |
159 | - foreach ($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk |
|
172 | + foreach ($sqltree as $dirdesc) { |
|
173 | + // Loop on each sqltree to check dir is on disk |
|
160 | 174 | { |
161 | 175 | $dirtotest = $conf->$element->dir_output.'/'.$dirdesc['fullrelativename']; |
176 | + } |
|
162 | 177 | if (!dol_is_dir($dirtotest)) |
163 | 178 | { |
164 | 179 | $mesg .= $dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n"; |
@@ -62,7 +62,9 @@ discard block |
||
62 | 62 | global $conf, $langs; |
63 | 63 | $langs->load("ecm"); |
64 | 64 | |
65 | - if ($select_name == '') $select_name = "catParent"; |
|
65 | + if ($select_name == '') { |
|
66 | + $select_name = "catParent"; |
|
67 | + } |
|
66 | 68 | |
67 | 69 | $cate_arbo = null; |
68 | 70 | if ($module == 'ecm') |
@@ -79,8 +81,9 @@ discard block |
||
79 | 81 | $output = '<select class="flat minwidth100 maxwidth500" id="'.$select_name.'" name="'.$select_name.'">'; |
80 | 82 | if (is_array($cate_arbo)) |
81 | 83 | { |
82 | - if (!count($cate_arbo)) $output .= '<option value="-1" disabled>'.$langs->trans("NoDirectoriesFound").'</option>'; |
|
83 | - else { |
|
84 | + if (!count($cate_arbo)) { |
|
85 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoDirectoriesFound").'</option>'; |
|
86 | + } else { |
|
84 | 87 | $output .= '<option value="-1"> </option>'; |
85 | 88 | foreach ($cate_arbo as $key => $value) |
86 | 89 | { |
@@ -32,13 +32,19 @@ discard block |
||
32 | 32 | $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); |
33 | 33 | $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); |
34 | 34 | |
35 | -$userid = GETPOST('userid', 'int'); if ($userid < 0) $userid = 0; |
|
36 | -$socid = GETPOST('socid', 'int'); if ($socid < 0) $socid = 0; |
|
35 | +$userid = GETPOST('userid', 'int'); if ($userid < 0) { |
|
36 | + $userid = 0; |
|
37 | +} |
|
38 | +$socid = GETPOST('socid', 'int'); if ($socid < 0) { |
|
39 | + $socid = 0; |
|
40 | +} |
|
37 | 41 | $id = GETPOST('id', 'int'); |
38 | 42 | |
39 | 43 | // Security check |
40 | 44 | $socid = GETPOST("socid", "int"); |
41 | -if ($user->socid) $socid = $user->socid; |
|
45 | +if ($user->socid) { |
|
46 | + $socid = $user->socid; |
|
47 | +} |
|
42 | 48 | $result = restrictedArea($user, 'salaries', '', '', ''); |
43 | 49 | |
44 | 50 | $nowyear = strftime("%Y", dol_now()); |
@@ -173,7 +179,9 @@ discard block |
||
173 | 179 | foreach ($data as $val) { |
174 | 180 | $arrayyears[$val['year']] = $val['year']; |
175 | 181 | } |
176 | -if (!count($arrayyears)) $arrayyears[$nowyear] = $nowyear; |
|
182 | +if (!count($arrayyears)) { |
|
183 | + $arrayyears[$nowyear] = $nowyear; |
|
184 | +} |
|
177 | 185 | |
178 | 186 | |
179 | 187 | $h = 0; |
@@ -203,7 +211,9 @@ discard block |
||
203 | 211 | print '</td></tr>'; |
204 | 212 | // Year |
205 | 213 | print '<tr><td>'.$langs->trans("Year").'</td><td>'; |
206 | -if (!in_array($year, $arrayyears)) $arrayyears[$year] = $year; |
|
214 | +if (!in_array($year, $arrayyears)) { |
|
215 | + $arrayyears[$year] = $year; |
|
216 | +} |
|
207 | 217 | arsort($arrayyears); |
208 | 218 | print $form->selectarray('year', $arrayyears, $year, 0); |
209 | 219 | print '</td></tr>'; |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | // Security check |
47 | 47 | $socid = GETPOST("socid", "int"); |
48 | -if ($user->socid) $socid = $user->socid; |
|
48 | +if ($user->socid) { |
|
49 | + $socid = $user->socid; |
|
50 | +} |
|
49 | 51 | $result = restrictedArea($user, 'salaries', '', '', ''); |
50 | 52 | |
51 | 53 | |
@@ -58,8 +60,12 @@ discard block |
||
58 | 60 | $offset = $limit * $page; |
59 | 61 | $pageprev = $page - 1; |
60 | 62 | $pagenext = $page + 1; |
61 | -if (!$sortorder) $sortorder = "ASC"; |
|
62 | -if (!$sortfield) $sortfield = "name"; |
|
63 | +if (!$sortorder) { |
|
64 | + $sortorder = "ASC"; |
|
65 | +} |
|
66 | +if (!$sortfield) { |
|
67 | + $sortfield = "name"; |
|
68 | +} |
|
63 | 69 | |
64 | 70 | |
65 | 71 | $object = new PaymentSalary($db); |
@@ -26,14 +26,18 @@ |
||
26 | 26 | * \brief Page de configuration du module externalsite |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check anti CSRF attack test |
|
29 | +if (!defined('NOSCANPOSTFORINJECTION')) { |
|
30 | + define('NOSCANPOSTFORINJECTION', '1'); |
|
31 | +} |
|
32 | +// Do not check anti CSRF attack test |
|
30 | 33 | |
31 | 34 | require '../../main.inc.php'; |
32 | 35 | require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; |
33 | 36 | |
34 | 37 | |
35 | -if (!$user->admin) |
|
38 | +if (!$user->admin) { |
|
36 | 39 | accessforbidden(); |
40 | +} |
|
37 | 41 | |
38 | 42 | // Load translation files required by the page |
39 | 43 | $langs->loadLangs(array('admin', 'other', 'externalsite')); |