@@ -231,7 +231,9 @@ discard block |
||
231 | 231 | $arrayOfValidPaymentModes[] = $obj; |
232 | 232 | } |
233 | 233 | if (!isModEnabled('banque')) { |
234 | - if ($paycode == 'CASH' || $paycode == 'CB') $arrayOfValidPaymentModes[] = $obj; |
|
234 | + if ($paycode == 'CASH' || $paycode == 'CB') { |
|
235 | + $arrayOfValidPaymentModes[] = $obj; |
|
236 | + } |
|
235 | 237 | } |
236 | 238 | } |
237 | 239 | } |
@@ -338,7 +340,9 @@ discard block |
||
338 | 340 | const bodyContent = JSON.stringify({ amount : amount, invoiceid : invoiceid }); |
339 | 341 | <?php |
340 | 342 | $urlpaymentintent = DOL_URL_ROOT.'/stripe/ajax/ajax.php?action=createPaymentIntent&token='.newToken().'&servicestatus='.$servicestatus; |
341 | - if (!empty($stripeacc)) $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
343 | + if (!empty($stripeacc)) { |
|
344 | + $urlpaymentintent .= '&stripeacc='.$stripeacc; |
|
345 | + } |
|
342 | 346 | ?> |
343 | 347 | return fetch('<?php echo $urlpaymentintent; ?>', { |
344 | 348 | method: "POST", |
@@ -668,7 +672,9 @@ discard block |
||
668 | 672 | |
669 | 673 | $parameters = array(); |
670 | 674 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $invoice, $action); // Note that $action and $object may have been modified by hook |
671 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
675 | +if ($reshook < 0) { |
|
676 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
677 | +} |
|
672 | 678 | |
673 | 679 | $class = ($i == 3) ? "calcbutton3" : "calcbutton2"; |
674 | 680 | foreach ($action_buttons as $button) { |
@@ -83,10 +83,18 @@ |
||
83 | 83 | //if ($user->socid > 0) accessforbidden(); |
84 | 84 | //if ($user->socid > 0) $socid = $user->socid; |
85 | 85 | //$result = restrictedArea($user, 'partnership', $object->id); |
86 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
87 | -if (empty($permissiontoread)) accessforbidden(); |
|
88 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
89 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
86 | +if (empty($conf->partnership->enabled)) { |
|
87 | + accessforbidden(); |
|
88 | +} |
|
89 | +if (empty($permissiontoread)) { |
|
90 | + accessforbidden(); |
|
91 | +} |
|
92 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
93 | + accessforbidden(); |
|
94 | +} |
|
95 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
96 | + accessforbidden(); |
|
97 | +} |
|
90 | 98 | |
91 | 99 | |
92 | 100 |
@@ -66,10 +66,18 @@ |
||
66 | 66 | //if ($user->socid > 0) accessforbidden(); |
67 | 67 | //if ($user->socid > 0) $socid = $user->socid; |
68 | 68 | //$result = restrictedArea($user, 'partnership', $object->id); |
69 | -if (empty($conf->partnership->enabled)) accessforbidden(); |
|
70 | -if (empty($permissiontoread)) accessforbidden(); |
|
71 | -if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden(); |
|
72 | -if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden(); |
|
69 | +if (empty($conf->partnership->enabled)) { |
|
70 | + accessforbidden(); |
|
71 | +} |
|
72 | +if (empty($permissiontoread)) { |
|
73 | + accessforbidden(); |
|
74 | +} |
|
75 | +if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') { |
|
76 | + accessforbidden(); |
|
77 | +} |
|
78 | +if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') { |
|
79 | + accessforbidden(); |
|
80 | +} |
|
73 | 81 | |
74 | 82 | |
75 | 83 | /* |
@@ -118,7 +118,9 @@ discard block |
||
118 | 118 | |
119 | 119 | $obj = $this->db->fetch_object($resql); |
120 | 120 | if ($obj) { |
121 | - if (!empty($partnershipsprocessed[$obj->rowid])) continue; |
|
121 | + if (!empty($partnershipsprocessed[$obj->rowid])) { |
|
122 | + continue; |
|
123 | + } |
|
122 | 124 | |
123 | 125 | if ($somethingdoneonpartnership >= $MAXPERCALL) { |
124 | 126 | dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doCancelStatusOfMemberPartnership to avoid to reach email quota.", LOG_WARNING); |
@@ -140,8 +142,11 @@ discard block |
||
140 | 142 | $error++; |
141 | 143 | $this->error = $object->error; |
142 | 144 | if (is_array($object->errors) && count($object->errors)) { |
143 | - if (is_array($this->errors)) $this->errors = array_merge($this->errors, $object->errors); |
|
144 | - else $this->errors = $object->errors; |
|
145 | + if (is_array($this->errors)) { |
|
146 | + $this->errors = array_merge($this->errors, $object->errors); |
|
147 | + } else { |
|
148 | + $this->errors = $object->errors; |
|
149 | + } |
|
145 | 150 | } |
146 | 151 | } else { |
147 | 152 | $partnershipsprocessed[$object->id] = $object->ref; |
@@ -159,7 +164,9 @@ discard block |
||
159 | 164 | // Define output language |
160 | 165 | $outputlangs = $langs; |
161 | 166 | $newlang = ''; |
162 | - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); |
|
167 | + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { |
|
168 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
169 | + } |
|
163 | 170 | if (!empty($newlang)) { |
164 | 171 | $outputlangs = new Translate("", $conf); |
165 | 172 | $outputlangs->setDefaultLang($newlang); |
@@ -184,7 +191,9 @@ discard block |
||
184 | 191 | if (!$result || $cmail->error) { |
185 | 192 | $erroremail .= ($erroremail ? ', ' : '').$cmail->error; |
186 | 193 | $this->errors[] = $cmail->error; |
187 | - if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; |
|
194 | + if (is_array($cmail->errors) && count($cmail->errors) > 0) { |
|
195 | + $this->errors += $cmail->errors; |
|
196 | + } |
|
188 | 197 | } |
189 | 198 | } |
190 | 199 | } |
@@ -198,12 +207,16 @@ discard block |
||
198 | 207 | if (!$error) { |
199 | 208 | $this->db->commit(); |
200 | 209 | $this->output = $numofexpiredmembers.' expired partnership members found'."\n"; |
201 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
210 | + if ($erroremail) { |
|
211 | + $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
212 | + } |
|
202 | 213 | } else { |
203 | 214 | $this->db->rollback(); |
204 | 215 | $this->output = "Rollback after error\n"; |
205 | 216 | $this->output .= $numofexpiredmembers.' expired partnership members found'."\n"; |
206 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
217 | + if ($erroremail) { |
|
218 | + $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
219 | + } |
|
207 | 220 | } |
208 | 221 | |
209 | 222 | return ($error ? 1 : 0); |
@@ -280,7 +293,9 @@ discard block |
||
280 | 293 | |
281 | 294 | $obj = $this->db->fetch_object($resql); |
282 | 295 | if ($obj) { |
283 | - if (!empty($partnershipsprocessed[$obj->rowid])) continue; |
|
296 | + if (!empty($partnershipsprocessed[$obj->rowid])) { |
|
297 | + continue; |
|
298 | + } |
|
284 | 299 | |
285 | 300 | if ($somethingdoneonpartnership >= $MAXPERCALL) { |
286 | 301 | dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doWarningOfPartnershipIfDolibarrBacklinkNotfound to avoid to reach email quota.", LOG_WARNING); |
@@ -325,7 +340,9 @@ discard block |
||
325 | 340 | // Define output language |
326 | 341 | $outputlangs = $langs; |
327 | 342 | $newlang = ''; |
328 | - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); |
|
343 | + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { |
|
344 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
345 | + } |
|
329 | 346 | if (!empty($newlang)) { |
330 | 347 | $outputlangs = new Translate("", $conf); |
331 | 348 | $outputlangs->setDefaultLang($newlang); |
@@ -348,7 +365,9 @@ discard block |
||
348 | 365 | if (!$result || $cmail->error) { |
349 | 366 | $erroremail .= ($erroremail ? ', ' : '').$cmail->error; |
350 | 367 | $this->errors[] = $cmail->error; |
351 | - if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; |
|
368 | + if (is_array($cmail->errors) && count($cmail->errors) > 0) { |
|
369 | + $this->errors += $cmail->errors; |
|
370 | + } |
|
352 | 371 | } |
353 | 372 | } |
354 | 373 | } elseif ($tmpcount > 4) { // Cancel Partnership |
@@ -377,16 +396,28 @@ discard block |
||
377 | 396 | if (!$error) { |
378 | 397 | $this->db->commit(); |
379 | 398 | $this->output = $numofexpiredmembers.' partnership checked'."\n"; |
380 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
381 | - if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
382 | - if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
399 | + if ($erroremail) { |
|
400 | + $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
401 | + } |
|
402 | + if ($emailnotfound) { |
|
403 | + $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
404 | + } |
|
405 | + if ($websitenotfound) { |
|
406 | + $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
407 | + } |
|
383 | 408 | } else { |
384 | 409 | $this->db->rollback(); |
385 | 410 | $this->output = "Rollback after error\n"; |
386 | 411 | $this->output .= $numofexpiredmembers.' partnership checked'."\n"; |
387 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
388 | - if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
389 | - if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
412 | + if ($erroremail) { |
|
413 | + $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
414 | + } |
|
415 | + if ($emailnotfound) { |
|
416 | + $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
417 | + } |
|
418 | + if ($websitenotfound) { |
|
419 | + $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
420 | + } |
|
390 | 421 | } |
391 | 422 | |
392 | 423 | return ($error ? 1 : 0); |
@@ -97,7 +97,9 @@ |
||
97 | 97 | if (!isModEnabled("hrm")) { |
98 | 98 | accessforbidden(); |
99 | 99 | } |
100 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
100 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
101 | + accessforbidden(); |
|
102 | +} |
|
101 | 103 | |
102 | 104 | |
103 | 105 | /* |
@@ -78,9 +78,15 @@ discard block |
||
78 | 78 | $permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
79 | 79 | |
80 | 80 | // Security check (enable the most restrictive one) |
81 | -if ($user->socid > 0) accessforbidden(); |
|
82 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
83 | -if (!$permissiontoread) accessforbidden(); |
|
81 | +if ($user->socid > 0) { |
|
82 | + accessforbidden(); |
|
83 | +} |
|
84 | +if (empty($conf->hrm->enabled)) { |
|
85 | + accessforbidden(); |
|
86 | +} |
|
87 | +if (!$permissiontoread) { |
|
88 | + accessforbidden(); |
|
89 | +} |
|
84 | 90 | |
85 | 91 | |
86 | 92 | /* |
@@ -123,10 +129,14 @@ discard block |
||
123 | 129 | $skillAdded->fk_object = $id; |
124 | 130 | $skillAdded->objecttype = $objecttype; |
125 | 131 | $ret = $skillAdded->create($user); |
126 | - if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors'); |
|
132 | + if ($ret < 0) { |
|
133 | + setEventMessages($skillAdded->error, null, 'errors'); |
|
134 | + } |
|
127 | 135 | //else unset($TSkillsToAdd); |
128 | 136 | } |
129 | - if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null); |
|
137 | + if ($ret > 0) { |
|
138 | + setEventMessages($langs->trans("SaveAddSkill"), null); |
|
139 | + } |
|
130 | 140 | } |
131 | 141 | } elseif ($action == 'saveSkill') { |
132 | 142 | if (!empty($TNote)) { |
@@ -383,9 +393,13 @@ discard block |
||
383 | 393 | } |
384 | 394 | |
385 | 395 | print '</table>'; |
386 | - if ($objecttype != 'user' && $permissiontoadd) print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
396 | + if ($objecttype != 'user' && $permissiontoadd) { |
|
397 | + print '<td><input class="button pull-right" type="submit" value="' . $langs->trans('SaveRank') . '"></td>'; |
|
398 | + } |
|
387 | 399 | print '</div>'; |
388 | - if ($objecttype != 'user' && $permissiontoadd) print '</form>'; |
|
400 | + if ($objecttype != 'user' && $permissiontoadd) { |
|
401 | + print '</form>'; |
|
402 | + } |
|
389 | 403 | |
390 | 404 | |
391 | 405 | // liste des compétences liées |
@@ -46,8 +46,12 @@ |
||
46 | 46 | //if ($user->socid > 0) $socid = $user->socid; |
47 | 47 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
48 | 48 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
49 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
50 | -if (empty($permissiontoread)) accessforbidden(); |
|
49 | +if (!isModEnabled('hrm')) { |
|
50 | + accessforbidden(); |
|
51 | +} |
|
52 | +if (empty($permissiontoread)) { |
|
53 | + accessforbidden(); |
|
54 | +} |
|
51 | 55 | |
52 | 56 | |
53 | 57 | /* |
@@ -40,8 +40,12 @@ |
||
40 | 40 | //if ($user->socid > 0) $socid = $user->socid; |
41 | 41 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
42 | 42 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); |
43 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
44 | -if (empty($permissiontoread)) accessforbidden(); |
|
43 | +if (!isModEnabled('hrm')) { |
|
44 | + accessforbidden(); |
|
45 | +} |
|
46 | +if (empty($permissiontoread)) { |
|
47 | + accessforbidden(); |
|
48 | +} |
|
45 | 49 | |
46 | 50 | $sortorder = GETPOST('sortorder', 'aZ09comma'); |
47 | 51 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -86,8 +86,12 @@ |
||
86 | 86 | //if ($user->socid > 0) $socid = $user->socid; |
87 | 87 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
88 | 88 | //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft); |
89 | -if (!isModEnabled('hrm')) accessforbidden(); |
|
90 | -if (empty($permissiontoread)) accessforbidden(); |
|
89 | +if (!isModEnabled('hrm')) { |
|
90 | + accessforbidden(); |
|
91 | +} |
|
92 | +if (empty($permissiontoread)) { |
|
93 | + accessforbidden(); |
|
94 | +} |
|
91 | 95 | |
92 | 96 | |
93 | 97 | /* |