@@ -213,9 +213,10 @@ discard block |
||
213 | 213 | if ($action == 'setmode' && $permissiontoadd) { |
214 | 214 | $object->fetch($id); |
215 | 215 | $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); |
216 | - if ($result < 0) |
|
217 | - setEventMessages($object->error, $object->errors, 'errors'); |
|
218 | -} |
|
216 | + if ($result < 0) { |
|
217 | + setEventMessages($object->error, $object->errors, 'errors'); |
|
218 | + } |
|
219 | + } |
|
219 | 220 | |
220 | 221 | // bank account |
221 | 222 | if ($action == 'setbankaccount' && $permissiontoadd) { |
@@ -229,7 +230,9 @@ discard block |
||
229 | 230 | if ($action == 'add' && empty($cancel)) { |
230 | 231 | $error = 0; |
231 | 232 | |
232 | - if (empty($datev)) $datev = $datep; |
|
233 | + if (empty($datev)) { |
|
234 | + $datev = $datep; |
|
235 | + } |
|
233 | 236 | |
234 | 237 | $type_payment = GETPOST("paymenttype", 'alpha'); |
235 | 238 | $amount = price2num(GETPOST("amount", 'alpha'), 'MT', 2); |
@@ -412,8 +415,12 @@ discard block |
||
412 | 415 | $newdatestart = dol_mktime(0, 0, 0, GETPOST('clone_date_startmonth', 'int'), GETPOST('clone_date_startday', 'int'), GETPOST('clone_date_startyear', 'int')); |
413 | 416 | $newdateend = dol_mktime(0, 0, 0, GETPOST('clone_date_endmonth', 'int'), GETPOST('clone_date_endday', 'int'), GETPOST('clone_date_endyear', 'int')); |
414 | 417 | |
415 | - if ($newdatestart) $object->datesp = $newdatestart; |
|
416 | - if ($newdateend) $object->dateep = $newdateend; |
|
418 | + if ($newdatestart) { |
|
419 | + $object->datesp = $newdatestart; |
|
420 | + } |
|
421 | + if ($newdateend) { |
|
422 | + $object->dateep = $newdateend; |
|
423 | + } |
|
417 | 424 | |
418 | 425 | $id = $object->create($user); |
419 | 426 | if ($id > 0) { |
@@ -465,7 +472,9 @@ discard block |
||
465 | 472 | |
466 | 473 | $form = new Form($db); |
467 | 474 | $formfile = new FormFile($db); |
468 | -if (isModEnabled('project')) $formproject = new FormProjets($db); |
|
475 | +if (isModEnabled('project')) { |
|
476 | + $formproject = new FormProjets($db); |
|
477 | +} |
|
469 | 478 | |
470 | 479 | $title = $langs->trans('Salary')." - ".$object->ref; |
471 | 480 | if ($action == 'create') { |
@@ -918,8 +927,9 @@ discard block |
||
918 | 927 | print '<table class="nobordernopadding" width="100%"><tr><td>'; |
919 | 928 | print $langs->trans('DefaultPaymentMode'); |
920 | 929 | print '</td>'; |
921 | - if ($action != 'editmode') |
|
922 | - print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
930 | + if ($action != 'editmode') { |
|
931 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
932 | + } |
|
923 | 933 | print '</tr></table>'; |
924 | 934 | print '</td><td>'; |
925 | 935 | |
@@ -1025,8 +1035,9 @@ discard block |
||
1025 | 1035 | } |
1026 | 1036 | |
1027 | 1037 | print '<td class="right">'; |
1028 | - if ($bankaccountstatic->id) |
|
1029 | - print $bankaccountstatic->getNomUrl(1, 'transactions'); |
|
1038 | + if ($bankaccountstatic->id) { |
|
1039 | + print $bankaccountstatic->getNomUrl(1, 'transactions'); |
|
1040 | + } |
|
1030 | 1041 | print '</td>'; |
1031 | 1042 | } |
1032 | 1043 | print '<td class="right nowrap amountcard">'.price($objp->amount)."</td>\n"; |
@@ -109,7 +109,9 @@ |
||
109 | 109 | */ |
110 | 110 | |
111 | 111 | $form = new Form($db); |
112 | -if (isModEnabled('project')) $formproject = new FormProjets($db); |
|
112 | +if (isModEnabled('project')) { |
|
113 | + $formproject = new FormProjets($db); |
|
114 | +} |
|
113 | 115 | |
114 | 116 | $title = $langs->trans('Salary')." - ".$langs->trans('Info'); |
115 | 117 | $help_url = ""; |