@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | $cancel = GETPOST('cancel', 'alpha'); |
65 | 65 | $toselect = GETPOST('toselect', 'array'); |
66 | 66 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search |
67 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
68 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
67 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
68 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
69 | 69 | |
70 | 70 | |
71 | 71 | $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if ($ret < 0) { |
109 | 109 | dol_print_error($db, $object->error, $object->errors); |
110 | 110 | exit; |
111 | - } elseif (! $ret) { |
|
111 | + } elseif (!$ret) { |
|
112 | 112 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
113 | 113 | } |
114 | 114 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | |
264 | 264 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
265 | 265 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
266 | - $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
266 | + $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
267 | 267 | $object->rule_for_lines_dates = GETPOST('rule_for_lines_dates', 'alpha'); |
268 | 268 | |
269 | 269 | $object->frequency = $frequency; |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | setEventMessages($line->error, $line->errors, 'errors'); |
488 | 488 | } |
489 | 489 | } elseif ($action == 'update_extras' && $permissiontoeditextra) { |
490 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
490 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
491 | 491 | |
492 | 492 | $attribute_name = GETPOST('attribute', 'aZ09'); |
493 | 493 | |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | $date_end_fill = GETPOSTINT('date_end_fill'); |
716 | 716 | |
717 | 717 | // Margin |
718 | - $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
718 | + $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
719 | 719 | $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
720 | 720 | |
721 | 721 | // Local Taxes |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | // Define special_code for special lines |
863 | 863 | $special_code = GETPOSTINT('special_code'); |
864 | 864 | if ($special_code == 3) { |
865 | - $special_code = 0; // Options should not exists on invoices |
|
865 | + $special_code = 0; // Options should not exists on invoices |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | /*$line = new FactureLigne($db); |
@@ -1138,11 +1138,11 @@ discard block |
||
1138 | 1138 | |
1139 | 1139 | print '<script> |
1140 | 1140 | $(document).ready(function() { |
1141 | - if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB . '") { |
|
1141 | + if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1142 | 1142 | hideselectfksocieterib(); |
1143 | 1143 | } |
1144 | 1144 | $("#selectmode_reglement_id").change(function() { |
1145 | - if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB .'") { |
|
1145 | + if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1146 | 1146 | hideselectfksocieterib(1); |
1147 | 1147 | } else { |
1148 | 1148 | showselectfksocieterib(); |
@@ -1466,15 +1466,15 @@ discard block |
||
1466 | 1466 | print '<td>'; |
1467 | 1467 | |
1468 | 1468 | if (($action != 'editbankaccountcustomer') && $user->hasRight('facture', 'creer') && $object->statut == FactureRec::STATUS_DRAFT) { |
1469 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccountcustomer&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetDebitBankAccount'), 1) . '</a></td>'; |
|
1469 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccountcustomer&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDebitBankAccount'), 1).'</a></td>'; |
|
1470 | 1470 | } |
1471 | 1471 | print '</tr></table>'; |
1472 | 1472 | print '</td><td>'; |
1473 | 1473 | |
1474 | 1474 | if ($action == 'editbankaccountcustomer') { |
1475 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1475 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1476 | 1476 | } else { |
1477 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_societe_rib, 'none', '', 0, 1); |
|
1477 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_societe_rib, 'none', '', 0, 1); |
|
1478 | 1478 | } |
1479 | 1479 | print "</td>"; |
1480 | 1480 | print '</tr>'; |
@@ -1732,10 +1732,10 @@ discard block |
||
1732 | 1732 | |
1733 | 1733 | // Lines |
1734 | 1734 | print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST">'; |
1735 | - print '<input type="hidden" name="token" value="' . newToken().'">'; |
|
1736 | - print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1735 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1736 | + print '<input type="hidden" name="action" value="'.(($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1737 | 1737 | print '<input type="hidden" name="mode" value="">'; |
1738 | - print '<input type="hidden" name="id" value="' . $object->id.'">'; |
|
1738 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
1739 | 1739 | print '<input type="hidden" name="page_y" value="">'; |
1740 | 1740 | |
1741 | 1741 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
@@ -1790,16 +1790,16 @@ discard block |
||
1790 | 1790 | if (empty($object->suspended)) { |
1791 | 1791 | if ($user->hasRight('facture', 'creer')) { |
1792 | 1792 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
1793 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1793 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1794 | 1794 | } else { |
1795 | 1795 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
1796 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1796 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1797 | 1797 | } else { |
1798 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1798 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1799 | 1799 | } |
1800 | 1800 | } |
1801 | 1801 | } else { |
1802 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1802 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
1803 | 1803 | } |
1804 | 1804 | } |
1805 | 1805 | |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | } |
1813 | 1813 | |
1814 | 1814 | // Delete |
1815 | - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1815 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1816 | 1816 | } |
1817 | 1817 | print '</div>'; |
1818 | 1818 |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | |
35 | 35 | // Load Dolibarr environment |
36 | 36 | require '../../main.inc.php'; |
37 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
41 | 41 | if (isModEnabled('project')) { |
42 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
42 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
43 | 43 | } |
44 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
45 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
46 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; |
|
47 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
44 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
45 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
46 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; |
|
47 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @var Conf $conf |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | $cancel = GETPOST('cancel', 'alpha'); |
66 | 66 | $toselect = GETPOST('toselect', 'array'); |
67 | 67 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierinvoicetemplatelist'; // To manage different context of search |
68 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
69 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
68 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
69 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
70 | 70 | |
71 | 71 | |
72 | 72 | $id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | $page = 0; |
96 | 96 | } // If $page is not defined, or '' or -1 |
97 | 97 | $offset = $limit * $page; |
98 | -if (! $sortorder) { |
|
98 | +if (!$sortorder) { |
|
99 | 99 | $sortorder = 'DESC'; |
100 | 100 | } |
101 | -if (! $sortfield) { |
|
101 | +if (!$sortfield) { |
|
102 | 102 | $sortfield = 'f.titre'; |
103 | 103 | } |
104 | 104 | $pageprev = $page - 1; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $object = new FactureFournisseurRec($db); |
108 | 108 | if (($id > 0 || $ref) && $action != 'create' && $action != 'add') { |
109 | 109 | $ret = $object->fetch($id, $ref); |
110 | - if (! $ret) { |
|
110 | + if (!$ret) { |
|
111 | 111 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
112 | 112 | } |
113 | 113 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $now = dol_now(); |
147 | 147 | |
148 | 148 | $error = 0; |
149 | -$predef = ''; // Legacy? Used in several cards, always '' |
|
149 | +$predef = ''; // Legacy? Used in several cards, always '' |
|
150 | 150 | |
151 | 151 | // Security check |
152 | 152 | $result = restrictedArea($user, 'supplier_invoicerec', $object->id, $objecttype); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $cancel = ''; |
166 | 166 | } |
167 | 167 | } |
168 | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
168 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
169 | 169 | $massaction = ''; |
170 | 170 | } |
171 | 171 | |
@@ -181,18 +181,18 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | // Selection of new fields |
184 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
184 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
185 | 185 | |
186 | 186 | // Set note |
187 | - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
187 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' |
|
188 | 188 | |
189 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
189 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
|
190 | 190 | |
191 | - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
191 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
192 | 192 | |
193 | 193 | // Create predefined invoice |
194 | 194 | if ($action == 'add' && $permissiontoadd) { |
195 | - if (! GETPOST('title', 'alphanohtml')) { |
|
195 | + if (!GETPOST('title', 'alphanohtml')) { |
|
196 | 196 | setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); |
197 | 197 | $action = "create"; |
198 | 198 | $error++; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | - if (! $error) { |
|
218 | + if (!$error) { |
|
219 | 219 | $object->subtype = GETPOSTINT('subtype'); |
220 | 220 | $object->title = GETPOST('title', 'alphanohtml'); |
221 | 221 | $object->ref = GETPOST('title', 'alphanohtml'); |
@@ -266,10 +266,10 @@ discard block |
||
266 | 266 | $action = "create"; |
267 | 267 | } |
268 | 268 | |
269 | - if (! $error) { |
|
269 | + if (!$error) { |
|
270 | 270 | $db->commit(); |
271 | 271 | |
272 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); |
|
272 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); |
|
273 | 273 | exit; |
274 | 274 | } else { |
275 | 275 | $db->rollback(); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $permissiontodelete) { |
284 | 284 | $object->delete($user); |
285 | 285 | |
286 | - header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php'); |
|
286 | + header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php'); |
|
287 | 287 | exit; |
288 | 288 | } |
289 | 289 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $error++; |
360 | 360 | } |
361 | 361 | |
362 | - if (! $error) { |
|
362 | + if (!$error) { |
|
363 | 363 | $db->commit(); |
364 | 364 | } else { |
365 | 365 | $db->rollback(); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $error++; |
379 | 379 | } |
380 | 380 | |
381 | - if (! $error) { |
|
381 | + if (!$error) { |
|
382 | 382 | $db->commit(); |
383 | 383 | } else { |
384 | 384 | $db->rollback(); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | setEventMessages($line->error, $line->errors, 'errors'); |
423 | 423 | } |
424 | 424 | } elseif ($action == 'update_extras' && $permissiontoeditextra) { |
425 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
425 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
426 | 426 | |
427 | 427 | $attribute_name = GETPOST('attribute', 'aZ09'); |
428 | 428 | |
@@ -465,9 +465,9 @@ discard block |
||
465 | 465 | $tva_tx = ''; |
466 | 466 | } |
467 | 467 | |
468 | - $qty = GETPOST('qty' . $predef, 'alpha'); |
|
469 | - $qty = ($qty === '') ? '' : (float) price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); |
|
470 | - $remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2); |
|
468 | + $qty = GETPOST('qty'.$predef, 'alpha'); |
|
469 | + $qty = ($qty === '') ? '' : (float) price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); |
|
470 | + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); |
|
471 | 471 | |
472 | 472 | // Extrafields |
473 | 473 | $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | if (is_array($extralabelsline)) { |
477 | 477 | // Get extra fields |
478 | 478 | foreach ($extralabelsline as $key => $value) { |
479 | - unset($_POST["options_" . $key . $predef]); |
|
479 | + unset($_POST["options_".$key.$predef]); |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); |
489 | 489 | $error++; |
490 | 490 | } |
491 | - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
491 | + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
492 | 492 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); |
493 | 493 | $error++; |
494 | 494 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | } |
540 | 540 | |
541 | - if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
541 | + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
542 | 542 | $ret = $object->fetch($id); |
543 | 543 | if ($ret < 0) { |
544 | 544 | dol_print_error($db, $object->error); |
@@ -547,8 +547,8 @@ discard block |
||
547 | 547 | $ret = $object->fetch_thirdparty(); |
548 | 548 | |
549 | 549 | // Clean parameters |
550 | - $date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year')); |
|
551 | - $date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year')); |
|
550 | + $date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year')); |
|
551 | + $date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year')); |
|
552 | 552 | $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); |
553 | 553 | |
554 | 554 | // Define special_code for special lines |
@@ -634,23 +634,23 @@ discard block |
||
634 | 634 | // Define output language |
635 | 635 | if (getDolGlobalInt('MAIN_MULTILANGS') && getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
636 | 636 | if (!empty($prod->customcode)) { |
637 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
637 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
638 | 638 | } |
639 | 639 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
640 | 640 | $tmptxt .= ' - '; |
641 | 641 | } |
642 | 642 | if (!empty($prod->country_code)) { |
643 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
643 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0); |
|
644 | 644 | } |
645 | 645 | } else { |
646 | 646 | if (!empty($prod->customcode)) { |
647 | - $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode; |
|
647 | + $tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode; |
|
648 | 648 | } |
649 | 649 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
650 | 650 | $tmptxt .= ' - '; |
651 | 651 | } |
652 | 652 | if (!empty($prod->country_code)) { |
653 | - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0); |
|
653 | + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | $tmptxt .= ')'; |
@@ -676,8 +676,8 @@ discard block |
||
676 | 676 | $date_end_fill = GETPOSTINT('date_end_fill'); |
677 | 677 | |
678 | 678 | // Margin |
679 | - $fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
680 | - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value |
|
679 | + $fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only |
|
680 | + $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
|
681 | 681 | |
682 | 682 | // Local Taxes |
683 | 683 | $localtax1_tx = get_localtax((string) $tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); |
@@ -744,8 +744,8 @@ discard block |
||
744 | 744 | $action = ''; |
745 | 745 | } |
746 | 746 | } |
747 | - } elseif ($action == 'updateline' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) { |
|
748 | - if (! $object->fetch($id) > 0) { |
|
747 | + } elseif ($action == 'updateline' && $permissiontoadd && !GETPOST('cancel', 'alpha')) { |
|
748 | + if (!$object->fetch($id) > 0) { |
|
749 | 749 | dol_print_error($db); |
750 | 750 | } |
751 | 751 | $object->fetch_thirdparty(); |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $objectline->array_options = $array_options; |
782 | 782 | $result = $objectline->insertExtraFields(); |
783 | 783 | if ($result < 0) { |
784 | - setEventMessages($langs->trans('Error') . $result, null, 'errors'); |
|
784 | + setEventMessages($langs->trans('Error').$result, null, 'errors'); |
|
785 | 785 | } |
786 | 786 | } |
787 | 787 | |
@@ -791,13 +791,13 @@ discard block |
||
791 | 791 | if (is_array($extralabelsline)) { |
792 | 792 | // Get extra fields |
793 | 793 | foreach ($extralabelsline as $key => $value) { |
794 | - unset($_POST["options_" . $key]); |
|
794 | + unset($_POST["options_".$key]); |
|
795 | 795 | } |
796 | 796 | } |
797 | 797 | |
798 | 798 | // Define special_code for special lines |
799 | 799 | $special_code = GETPOSTINT('special_code'); |
800 | - if (! GETPOST('qty', 'alpha')) { |
|
800 | + if (!GETPOST('qty', 'alpha')) { |
|
801 | 801 | $special_code = 3; |
802 | 802 | } |
803 | 803 | |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | $date_end_fill = GETPOSTINT('date_end_fill'); |
844 | 844 | |
845 | 845 | // Update line |
846 | - if (! $error) { |
|
846 | + if (!$error) { |
|
847 | 847 | $result = $object->updateline(GETPOSTINT('lineid'), GETPOSTINT('productid'), $ref_fourn, $label, $description, (float) $pu_ht, (float) $qty, $remise_percent, (float) $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); |
848 | 848 | if ($result >= 0) { |
849 | 849 | $object->fetch($object->id); // Reload lines |
@@ -920,10 +920,10 @@ discard block |
||
920 | 920 | if ($object->fetch($id, $ref) > 0) { |
921 | 921 | $result = $object->fetch_lines(); |
922 | 922 | |
923 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
924 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
923 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
924 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
925 | 925 | print '<input type="hidden" name="action" value="add">'; |
926 | - print '<input type="hidden" name="facid" value="' . $object->id . '">'; |
|
926 | + print '<input type="hidden" name="facid" value="'.$object->id.'">'; |
|
927 | 927 | |
928 | 928 | print dol_get_fiche_head([], '', '', 0); |
929 | 929 | |
@@ -940,17 +940,17 @@ discard block |
||
940 | 940 | $object->fetch_thirdparty(); |
941 | 941 | |
942 | 942 | // Title |
943 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>'; |
|
944 | - print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>'; |
|
943 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>'; |
|
944 | + print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>'; |
|
945 | 945 | print '</td></tr>'; |
946 | 946 | |
947 | 947 | // Ref supplier |
948 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>'; |
|
949 | - print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">'; |
|
948 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>'; |
|
949 | + print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">'; |
|
950 | 950 | print '</td></tr>'; |
951 | 951 | |
952 | 952 | // Third party |
953 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Supplier") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'supplier') . '</td>'; |
|
953 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Supplier").'</td><td>'.$object->thirdparty->getNomUrl(1, 'supplier').'</td>'; |
|
954 | 954 | print '</tr>'; |
955 | 955 | |
956 | 956 | // Invoice subtype |
@@ -966,42 +966,42 @@ discard block |
||
966 | 966 | // Help for substitution key |
967 | 967 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
968 | 968 | |
969 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; |
|
970 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')'; |
|
971 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')'; |
|
972 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')'; |
|
973 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')'; |
|
974 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')'; |
|
975 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')'; |
|
976 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')'; |
|
977 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')'; |
|
969 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')'; |
|
970 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')'; |
|
971 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')'; |
|
972 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')'; |
|
973 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')'; |
|
974 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; |
|
975 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')'; |
|
976 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; |
|
977 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; |
|
978 | 978 | // Only on template invoices |
979 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : ''); |
|
980 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : ''); |
|
979 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : ''); |
|
980 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : ''); |
|
981 | 981 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); |
982 | 982 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); |
983 | 983 | |
984 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
984 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
985 | 985 | foreach ($substitutionarray as $key => $val) { |
986 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
986 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
987 | 987 | } |
988 | 988 | $htmltext .= '</i>'; |
989 | 989 | |
990 | 990 | // Label |
991 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>'; |
|
992 | - print '<input class="flat quatrevingtpercent" type="text" name="label" value="' . $object->label . '">'; |
|
991 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>'; |
|
992 | + print '<input class="flat quatrevingtpercent" type="text" name="label" value="'.$object->label.'">'; |
|
993 | 993 | print '</td></tr>'; |
994 | 994 | |
995 | 995 | // Author |
996 | - print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>"; |
|
996 | + print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>"; |
|
997 | 997 | |
998 | 998 | // Payment term |
999 | - print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>"; |
|
999 | + print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>"; |
|
1000 | 1000 | print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $object->cond_reglement_id, 'cond_reglement_id', -1, 0, 0, ''); |
1001 | 1001 | print "</td></tr>"; |
1002 | 1002 | |
1003 | 1003 | // Payment mode |
1004 | - print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>"; |
|
1004 | + print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; |
|
1005 | 1005 | print img_picto('', 'payment', 'class="pictofixedwidth"'); |
1006 | 1006 | print $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $object->mode_reglement_id, 'mode_reglement_id', '', 0, 1, 0, 0, 1, '', 1); |
1007 | 1007 | print "</td></tr>"; |
@@ -1010,16 +1010,16 @@ discard block |
||
1010 | 1010 | if (isModEnabled('project') && $formproject !== null && is_object($object->thirdparty) && $object->thirdparty->id > 0) { |
1011 | 1011 | $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; |
1012 | 1012 | $langs->load('projects'); |
1013 | - print '<tr><td>' . $langs->trans('Project') . '</td><td>'; |
|
1013 | + print '<tr><td>'.$langs->trans('Project').'</td><td>'; |
|
1014 | 1014 | $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); |
1015 | - print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>'; |
|
1015 | + print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>'; |
|
1016 | 1016 | print '</td></tr>'; |
1017 | 1017 | } |
1018 | 1018 | |
1019 | 1019 | // Bank account |
1020 | 1020 | if ($object->fk_account > 0) { |
1021 | - print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>"; |
|
1022 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none'); |
|
1021 | + print "<tr><td>".$langs->trans('BankAccount')."</td><td>"; |
|
1022 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); |
|
1023 | 1023 | print "</td></tr>"; |
1024 | 1024 | } |
1025 | 1025 | |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | print $object->showOptionals($extrafields, 'create', $parameters); |
1037 | 1037 | |
1038 | 1038 | // Model pdf |
1039 | - print "<tr><td>" . $langs->trans('Model') . "</td><td>"; |
|
1040 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1039 | + print "<tr><td>".$langs->trans('Model')."</td><td>"; |
|
1040 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1041 | 1041 | $list = ModelePDFSuppliersInvoices::liste_modeles($db); |
1042 | 1042 | print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF); |
1043 | 1043 | print "</td></tr>"; |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | |
1070 | 1070 | // Autogeneration |
1071 | 1071 | $title = $langs->trans("Recurrence"); |
1072 | - print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', ''); |
|
1072 | + print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', ''); |
|
1073 | 1073 | |
1074 | 1074 | print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>'; |
1075 | 1075 | |
@@ -1078,30 +1078,30 @@ discard block |
||
1078 | 1078 | print '<table class="border centpercent">'; |
1079 | 1079 | |
1080 | 1080 | // Frequency + unit |
1081 | - print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>"; |
|
1082 | - print "<input type='text' class='width50' name='frequency' value='" . GETPOSTINT('frequency') . "' size='4' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
1081 | + print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>"; |
|
1082 | + print "<input type='text' class='width50' name='frequency' value='".GETPOSTINT('frequency')."' size='4' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
1083 | 1083 | print "</td></tr>"; |
1084 | 1084 | |
1085 | 1085 | // Date next run |
1086 | - print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>"; |
|
1086 | + print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; |
|
1087 | 1087 | $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOSTINT('remonth') ? dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')) : -1); |
1088 | 1088 | print $form->selectDate($date_next_execution, '', 1, 1, 0, "add", 1, 1); |
1089 | 1089 | print "</td></tr>"; |
1090 | 1090 | |
1091 | 1091 | // Number max of generation |
1092 | - print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>"; |
|
1093 | - print '<input type="text" class="width50" name="nb_gen_max" value="' . GETPOSTINT('nb_gen_max') . '">'; |
|
1092 | + print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>"; |
|
1093 | + print '<input type="text" class="width50" name="nb_gen_max" value="'.GETPOSTINT('nb_gen_max').'">'; |
|
1094 | 1094 | print "</td></tr>"; |
1095 | 1095 | |
1096 | 1096 | // Auto validate the invoice |
1097 | - print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedInvoices") . "</td><td>"; |
|
1097 | + print "<tr><td>".$langs->trans("StatusOfAutoGeneratedInvoices")."</td><td>"; |
|
1098 | 1098 | $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); |
1099 | 1099 | print $form->selectarray('auto_validate', $select, GETPOSTINT('auto_validate')); |
1100 | 1100 | print "</td></tr>"; |
1101 | 1101 | |
1102 | 1102 | // Auto generate document |
1103 | 1103 | if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { |
1104 | - print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>"; |
|
1104 | + print "<tr><td>".$langs->trans("StatusOfGeneratedDocuments")."</td><td>"; |
|
1105 | 1105 | $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); |
1106 | 1106 | print $form->selectarray('generate_pdf', $select, GETPOSTINT('generate_pdf')); |
1107 | 1107 | print "</td></tr>"; |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | |
1145 | 1145 | print "</form>\n"; |
1146 | 1146 | } else { |
1147 | - dol_print_error(null, "Error, no invoice " . $object->id); |
|
1147 | + dol_print_error(null, "Error, no invoice ".$object->id); |
|
1148 | 1148 | } |
1149 | 1149 | } else { |
1150 | 1150 | // View mode |
@@ -1156,12 +1156,12 @@ discard block |
||
1156 | 1156 | |
1157 | 1157 | // Confirmation of deletion of product line |
1158 | 1158 | if ($action == 'ask_deleteline') { |
1159 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
1159 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | // Confirm delete of repeatable invoice |
1163 | 1163 | if ($action == 'ask_deleteinvoice') { |
1164 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
1164 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | print $formconfirm; |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | // Recurring invoice content |
1177 | 1177 | |
1178 | - $linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>'; |
|
1178 | + $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>'; |
|
1179 | 1179 | |
1180 | 1180 | $morehtmlref = ''; |
1181 | 1181 | if ($action != 'edittitle') { |
@@ -1188,33 +1188,33 @@ discard block |
||
1188 | 1188 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, (int) $usercancreate, 'string', '', 0, 1); |
1189 | 1189 | $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); |
1190 | 1190 | // Thirdparty |
1191 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); |
|
1191 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); |
|
1192 | 1192 | |
1193 | 1193 | // Project |
1194 | 1194 | if (isModEnabled('project') && $formproject !== null) { |
1195 | 1195 | $langs->load('projects'); |
1196 | - $morehtmlref .= '<br>' . $langs->trans('Project') . ' '; |
|
1196 | + $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
|
1197 | 1197 | if ($usercancreate) { |
1198 | 1198 | if ($action != 'classify') { |
1199 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
1199 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : '; |
|
1200 | 1200 | } |
1201 | 1201 | if ($action == 'classify') { |
1202 | - $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
1202 | + $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
1203 | 1203 | $morehtmlref .= '<input type="hidden" name="action" value="classin">'; |
1204 | - $morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1204 | + $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1205 | 1205 | $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
1206 | - $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
1206 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
1207 | 1207 | $morehtmlref .= '</form>'; |
1208 | 1208 | } else { |
1209 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
1209 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
1210 | 1210 | } |
1211 | 1211 | } else { |
1212 | 1212 | if (!empty($object->fk_project)) { |
1213 | 1213 | $project = new Project($db); |
1214 | 1214 | $project->fetch($object->fk_project); |
1215 | - $morehtmlref .= ' : ' . $project->getNomUrl(1); |
|
1215 | + $morehtmlref .= ' : '.$project->getNomUrl(1); |
|
1216 | 1216 | if ($project->title) { |
1217 | - $morehtmlref .= ' - ' . $project->title; |
|
1217 | + $morehtmlref .= ' - '.$project->title; |
|
1218 | 1218 | } |
1219 | 1219 | } else { |
1220 | 1220 | $morehtmlref .= ''; |
@@ -1241,14 +1241,14 @@ discard block |
||
1241 | 1241 | } |
1242 | 1242 | |
1243 | 1243 | // Author |
1244 | - print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>'; |
|
1244 | + print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>'; |
|
1245 | 1245 | print $author->getNomUrl(-1); |
1246 | 1246 | print "</td></tr>"; |
1247 | 1247 | |
1248 | 1248 | // Label |
1249 | 1249 | print '<tr>'; |
1250 | - print '<td>' . $form->editfieldkey("Label", 'label', $object->label, $object, (int) $usercancreate) . '</td>'; |
|
1251 | - print '<td>' . $form->editfieldval("Label", 'label', $object->label, $object, $usercancreate) . '</td>'; |
|
1250 | + print '<td>'.$form->editfieldkey("Label", 'label', $object->label, $object, (int) $usercancreate).'</td>'; |
|
1251 | + print '<td>'.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).'</td>'; |
|
1252 | 1252 | print '</tr>'; |
1253 | 1253 | |
1254 | 1254 | // Payment term |
@@ -1257,14 +1257,14 @@ discard block |
||
1257 | 1257 | print $langs->trans('PaymentConditionsShort'); |
1258 | 1258 | print '</td>'; |
1259 | 1259 | if ($action != 'editconditions' && $usercancreate) { |
1260 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; |
|
1260 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; |
|
1261 | 1261 | } |
1262 | 1262 | print '</tr></table>'; |
1263 | 1263 | print '</td><td>'; |
1264 | 1264 | if ($action == 'editconditions') { |
1265 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id'); |
|
1265 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id'); |
|
1266 | 1266 | } else { |
1267 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->cond_reglement_id, 'none'); |
|
1267 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->cond_reglement_id, 'none'); |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | print '</td></tr>'; |
@@ -1275,14 +1275,14 @@ discard block |
||
1275 | 1275 | print $langs->trans('PaymentMode'); |
1276 | 1276 | print '</td>'; |
1277 | 1277 | if ($action != 'editmode' && $usercancreate) { |
1278 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>'; |
|
1278 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
1279 | 1279 | } |
1280 | 1280 | print '</tr></table>'; |
1281 | 1281 | print '</td><td>'; |
1282 | 1282 | if ($action == 'editmode') { |
1283 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
1283 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
1284 | 1284 | } else { |
1285 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, (string) $object->mode_reglement_id, 'none'); |
|
1285 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, (string) $object->mode_reglement_id, 'none'); |
|
1286 | 1286 | } |
1287 | 1287 | print '</td></tr>'; |
1288 | 1288 | |
@@ -1292,14 +1292,14 @@ discard block |
||
1292 | 1292 | print $langs->trans('BankAccount'); |
1293 | 1293 | print '<td>'; |
1294 | 1294 | if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
1295 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>'; |
|
1295 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
1296 | 1296 | } |
1297 | 1297 | print '</tr></table>'; |
1298 | 1298 | print '</td><td>'; |
1299 | 1299 | if ($action == 'editbankaccount') { |
1300 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1); |
|
1300 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1); |
|
1301 | 1301 | } else { |
1302 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none'); |
|
1302 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none'); |
|
1303 | 1303 | } |
1304 | 1304 | print "</td>"; |
1305 | 1305 | print '</tr>'; |
@@ -1313,18 +1313,18 @@ discard block |
||
1313 | 1313 | print $langs->trans('Model'); |
1314 | 1314 | print '<td>'; |
1315 | 1315 | if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
1316 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>'; |
|
1316 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>'; |
|
1317 | 1317 | } |
1318 | 1318 | print '</tr></table>'; |
1319 | 1319 | print '</td><td>'; |
1320 | 1320 | if ($action == 'editmodelpdf') { |
1321 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1321 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1322 | 1322 | $list = array(); |
1323 | 1323 | $models = ModelePDFSuppliersInvoices::liste_modeles($db); |
1324 | 1324 | foreach ($models as $k => $model) { |
1325 | - $list[] = str_replace(':', '|', $k) . ':' . $model; |
|
1325 | + $list[] = str_replace(':', '|', $k).':'.$model; |
|
1326 | 1326 | } |
1327 | - $select = 'select;' . implode(',', $list); |
|
1327 | + $select = 'select;'.implode(',', $list); |
|
1328 | 1328 | //TODO : Droits |
1329 | 1329 | print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select); |
1330 | 1330 | } else { |
@@ -1353,28 +1353,28 @@ discard block |
||
1353 | 1353 | include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php'; |
1354 | 1354 | |
1355 | 1355 | // Amount (excl. tax) |
1356 | - print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; |
|
1357 | - print '<td>' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1356 | + print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
|
1357 | + print '<td>'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1358 | 1358 | print '</tr>'; |
1359 | 1359 | |
1360 | - print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1360 | + print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1361 | 1361 | print '</tr>'; |
1362 | 1362 | |
1363 | 1363 | // Amount Local Taxes |
1364 | 1364 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 |
1365 | - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
1366 | - print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
1365 | + print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
1366 | + print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
1367 | 1367 | } |
1368 | 1368 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 |
1369 | - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
1370 | - print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
1369 | + print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
1370 | + print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | - print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1373 | + print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1374 | 1374 | print '</tr>'; |
1375 | 1375 | |
1376 | 1376 | |
1377 | - print '<tr class="liste_titre"><td colspan="2" class="liste_titre">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>'; |
|
1377 | + print '<tr class="liste_titre"><td colspan="2" class="liste_titre">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>'; |
|
1378 | 1378 | |
1379 | 1379 | // if "frequency" is empty or = 0, the recurrence is disabled |
1380 | 1380 | print '<tr><td style="width: 50%">'; |
@@ -1382,23 +1382,23 @@ discard block |
||
1382 | 1382 | print $langs->trans('Frequency'); |
1383 | 1383 | print '</td>'; |
1384 | 1384 | if ($action != 'editfrequency' && $usercancreate) { |
1385 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; |
|
1385 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>'; |
|
1386 | 1386 | } |
1387 | 1387 | print '</tr></table>'; |
1388 | 1388 | print '</td><td>'; |
1389 | 1389 | if ($action == 'editfrequency') { |
1390 | - print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">'; |
|
1390 | + print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">'; |
|
1391 | 1391 | print '<input type="hidden" name="action" value="setfrequency">'; |
1392 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1392 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1393 | 1393 | print '<table class="nobordernopadding">'; |
1394 | 1394 | print '<tr><td>'; |
1395 | - print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
1395 | + print "<input type='text' name='frequency' value='".$object->frequency."' size='5' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
1396 | 1396 | print '</td>'; |
1397 | - print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>'; |
|
1397 | + print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>'; |
|
1398 | 1398 | print '</tr></table></form>'; |
1399 | 1399 | } else { |
1400 | 1400 | if ($object->frequency > 0) { |
1401 | - print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency); |
|
1401 | + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); |
|
1402 | 1402 | } else { |
1403 | 1403 | print '<span class="opacitymedium">'.$langs->trans("NotARecurringInvoiceTemplate").'</span>'; |
1404 | 1404 | } |
@@ -1418,8 +1418,8 @@ discard block |
||
1418 | 1418 | print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); |
1419 | 1419 | } |
1420 | 1420 | //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); |
1421 | - if (! $object->isMaxNbGenReached()) { |
|
1422 | - if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1421 | + if (!$object->isMaxNbGenReached()) { |
|
1422 | + if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1423 | 1423 | print img_warning($langs->trans("Late")); |
1424 | 1424 | } |
1425 | 1425 | } else { |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | print $langs->trans("StatusOfAutoGeneratedInvoices"); |
1453 | 1453 | } |
1454 | 1454 | print '</td><td>'; |
1455 | - $select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); |
|
1455 | + $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); |
|
1456 | 1456 | if ($action == 'auto_validate' || $object->frequency > 0) { |
1457 | 1457 | print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); |
1458 | 1458 | } |
@@ -1468,7 +1468,7 @@ discard block |
||
1468 | 1468 | } |
1469 | 1469 | print '</td>'; |
1470 | 1470 | print '<td>'; |
1471 | - $select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc'); |
|
1471 | + $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); |
|
1472 | 1472 | if ($action == 'generate_pdf' || $object->frequency > 0) { |
1473 | 1473 | print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select); |
1474 | 1474 | } |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | print '<table class="border centpercent tableforfield">'; |
1494 | 1494 | |
1495 | 1495 | // Nb of generation already done |
1496 | - print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>'; |
|
1496 | + print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; |
|
1497 | 1497 | print '<td>'; |
1498 | 1498 | print $object->nb_gen_done ? $object->nb_gen_done : '0'; |
1499 | 1499 | print '</td>'; |
@@ -1518,15 +1518,15 @@ discard block |
||
1518 | 1518 | print '<div class="clearboth"></div><br>'; |
1519 | 1519 | |
1520 | 1520 | // Lines |
1521 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOSTINT('lineid')) . '" method="POST"> |
|
1522 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
1523 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
1521 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST"> |
|
1522 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
1523 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
1524 | 1524 | <input type="hidden" name="mode" value=""> |
1525 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
1525 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
1526 | 1526 | '; |
1527 | 1527 | |
1528 | 1528 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
1529 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
1529 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | print '<div class="div-table-responsive-no-min">'; |
@@ -1583,24 +1583,24 @@ discard block |
||
1583 | 1583 | if (empty($object->suspended)) { |
1584 | 1584 | if ($usercancreate) { |
1585 | 1585 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
1586 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1586 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1587 | 1587 | } else { |
1588 | 1588 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
1589 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1589 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1590 | 1590 | } else { |
1591 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1591 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1592 | 1592 | } |
1593 | 1593 | } |
1594 | 1594 | } else { |
1595 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1595 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
1596 | 1596 | } |
1597 | 1597 | } |
1598 | 1598 | |
1599 | 1599 | if ($usercancreate) { |
1600 | 1600 | if (empty($object->suspended)) { |
1601 | - print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>'; |
|
1601 | + print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>'; |
|
1602 | 1602 | } else { |
1603 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>'; |
|
1603 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>'; |
|
1604 | 1604 | } |
1605 | 1605 | } |
1606 | 1606 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // Generate list of companies |
98 | -if (! $socid) { |
|
98 | +if (!$socid) { |
|
99 | 99 | echo json_encode(array('nom' => 'ErrorBadParameter', 'label' => 'ErrorBadParameter', 'key' => 'ErrorBadParameter', 'value' => 'ErrorBadParameter')); |
100 | 100 | exit; |
101 | 101 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | // user right to see all companies |
132 | 132 | if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) { |
133 | - $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id .")"; |
|
133 | + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = s.rowid AND sc.fk_user = ".(int) $user->id.")"; |
|
134 | 134 | } |
135 | 135 | // Protection for external user access |
136 | 136 | if ($user->socid > 0) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $nbContact = $obj->nb; |
84 | 84 | } |
85 | 85 | |
86 | - dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
86 | + dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } else { |
182 | 182 | dol_print_error($db); |
183 | 183 | } |
184 | - dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
184 | + dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
185 | 185 | } |
186 | 186 | $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; |
187 | 187 | $head[$h][1] = $langs->trans("Projects"); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | } else { |
346 | 346 | dol_print_error($db); |
347 | 347 | } |
348 | - dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
348 | + dol_setcache($cachekey, $nbTicket, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | $head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?socid='.urlencode((string) ($object->id)); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | } else { |
392 | 392 | dol_print_error($db); |
393 | 393 | } |
394 | - dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
394 | + dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode((string) ($object->id)); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
435 | 435 | $nbLinks = Link::count($db, $object->element, $object->id); |
436 | 436 | $totalAttached = $nbFiles + $nbLinks; |
437 | - dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
437 | + dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | } else { |
469 | 469 | dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
470 | 470 | } |
471 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
471 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | $head[$h][1] .= '/'; |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | return false; |
870 | 870 | } |
871 | 871 | |
872 | - $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
872 | + $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
873 | 873 | |
874 | 874 | //print "dd".$object->country_code; |
875 | 875 | return in_array($object->country_code, $country_code_in_EEC); |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | return false; |
925 | 925 | } |
926 | 926 | |
927 | - $country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA'] |
|
927 | + $country_code_in_SEPA = getCountriesInSEPA(); // This make a database call but there is a cache done into $conf->cache['country_code_in_SEPA'] |
|
928 | 928 | |
929 | 929 | //print "dd".$object->country_code; |
930 | 930 | return in_array($object->country_code, $country_code_in_SEPA); |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | $mode = 'view'; |
1370 | 1370 | |
1371 | 1371 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1372 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1372 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1373 | 1373 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1374 | 1374 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1375 | 1375 | |
@@ -1419,7 +1419,7 @@ discard block |
||
1419 | 1419 | $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; |
1420 | 1420 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; |
1421 | 1421 | $sql .= " WHERE t.fk_soc = ".((int) $object->id); |
1422 | - $sql .= " AND t.entity IN (" .getEntity('socpeople') .")"; |
|
1422 | + $sql .= " AND t.entity IN (".getEntity('socpeople').")"; |
|
1423 | 1423 | $sql .= " AND ((t.fk_user_creat = ".((int) $user->id)." AND t.priv = 1) OR t.priv = 0)"; |
1424 | 1424 | if ($search_rowid) { |
1425 | 1425 | $sql .= natural_search('t.rowid', $search_rowid); |
@@ -1848,7 +1848,7 @@ discard block |
||
1848 | 1848 | $tms_start = ''; |
1849 | 1849 | $tms_end = ''; |
1850 | 1850 | } |
1851 | - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; |
|
1851 | + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
|
1852 | 1852 | |
1853 | 1853 | // Check parameters |
1854 | 1854 | if (!is_object($filterobj) && !is_object($objcon)) { |
@@ -1912,7 +1912,7 @@ discard block |
||
1912 | 1912 | |
1913 | 1913 | // Fields from hook |
1914 | 1914 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
1915 | - $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
1915 | + $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
1916 | 1916 | if (!empty($hookmanager->resPrint)) { |
1917 | 1917 | $sql .= $hookmanager->resPrint; |
1918 | 1918 | } |
@@ -1936,7 +1936,7 @@ discard block |
||
1936 | 1936 | |
1937 | 1937 | // Fields from hook |
1938 | 1938 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
1939 | - $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1939 | + $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
1940 | 1940 | if (!empty($hookmanager->resPrint)) { |
1941 | 1941 | $sql .= $hookmanager->resPrint; |
1942 | 1942 | } |
@@ -2033,7 +2033,7 @@ discard block |
||
2033 | 2033 | } |
2034 | 2034 | } else { |
2035 | 2035 | if (is_object($filterobj) && $filterobj->id > 0 && get_class($filterobj) == 'User') { |
2036 | - $sql .= " AND (u.rowid = ". ((int) $filterobj->id).' OR '; |
|
2036 | + $sql .= " AND (u.rowid = ".((int) $filterobj->id).' OR '; |
|
2037 | 2037 | $sql .= " EXISTS (SELECT r.rowid FROM ".MAIN_DB_PREFIX."actioncomm_resources as r WHERE a.id = r.fk_actioncomm"; |
2038 | 2038 | $sql .= " AND r.element_type = '".$db->escape($filterobj->table_element)."' AND r.fk_element = ".((int) $filterobj->id).')'; |
2039 | 2039 | $sql .= ")"; |
@@ -2079,7 +2079,7 @@ discard block |
||
2079 | 2079 | |
2080 | 2080 | // Fields from hook |
2081 | 2081 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module); |
2082 | - $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2082 | + $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
2083 | 2083 | if (!empty($hookmanager->resPrint)) { |
2084 | 2084 | $sql .= $hookmanager->resPrint; |
2085 | 2085 | } |
@@ -2806,7 +2806,7 @@ discard block |
||
2806 | 2806 | // Add an optional image under the ban with logo/title |
2807 | 2807 | if (getDolGlobalString($subimageconst)) { |
2808 | 2808 | print '<div class="backimagepublicsubimage">'; |
2809 | - print '<img id="id'.$subimageconst.'" src="' . getDolGlobalString($subimageconst).'">'; |
|
2809 | + print '<img id="id'.$subimageconst.'" src="'.getDolGlobalString($subimageconst).'">'; |
|
2810 | 2810 | print '</div>'; |
2811 | 2811 | } |
2812 | 2812 | |
@@ -2891,14 +2891,14 @@ discard block |
||
2891 | 2891 | $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; |
2892 | 2892 | if (getDolGlobalString($parammessageform) !== '') { |
2893 | 2893 | print $langs->transnoentities(getDolGlobalString($parammessageform)); |
2894 | - } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') { |
|
2894 | + } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM') !== '') { |
|
2895 | 2895 | print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORM')); |
2896 | 2896 | } |
2897 | 2897 | |
2898 | 2898 | // Add other message if VAT exists |
2899 | 2899 | if (!empty($object->total_vat) || !empty($object->total_tva)) { |
2900 | 2900 | $parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; |
2901 | - if (getDolGlobalString($parammessageform) !== '') { |
|
2901 | + if (getDolGlobalString($parammessageform) !== '') { |
|
2902 | 2902 | print $langs->transnoentities(getDolGlobalString($parammessageform)); |
2903 | 2903 | } elseif (getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT') !== '') { |
2904 | 2904 | print $langs->transnoentities(getDolGlobalString('ONLINE_PAYMENT_MESSAGE_FORMIFVAT')); |
@@ -742,8 +742,8 @@ |
||
742 | 742 | $tabMenu[$b]['type'] = $menu['type']; |
743 | 743 | $tabMenu[$b]['fk_mainmenu'] = $menu['fk_mainmenu']; |
744 | 744 | $tabMenu[$b]['fk_leftmenu'] = $menu['fk_leftmenu']; |
745 | - $tabMenu[$b]['position'] = (int) $menu['position']; |
|
746 | - $tabMenu[$b]['showtopmenuinframe'] = (int) $menu['showtopmenuinframe']; |
|
745 | + $tabMenu[$b]['position'] = (int) $menu['position']; |
|
746 | + $tabMenu[$b]['showtopmenuinframe'] = (int) $menu['showtopmenuinframe']; |
|
747 | 747 | |
748 | 748 | $b++; |
749 | 749 | } |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | 'start' => isset($value['start']) ? $value['start'] : '', |
1191 | 1191 | 'end' => isset($value['end']) ? $value['end'] : '' |
1192 | 1192 | ); |
1193 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1193 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1194 | 1194 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
1195 | 1195 | $out .= '</div><div class="nowrap">'; |
1196 | 1196 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | 'start' => isset($value['start']) ? $value['start'] : '', |
1216 | 1216 | 'end' => isset($value['end']) ? $value['end'] : '' |
1217 | 1217 | ); |
1218 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1218 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1219 | 1219 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
1220 | 1220 | $out .= '</div><div class="nowrap">'; |
1221 | 1221 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | } else { |
1286 | 1286 | $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno'); |
1287 | 1287 | } |
1288 | - $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1288 | + $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
1289 | 1289 | } elseif ($type == 'price') { |
1290 | 1290 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
1291 | 1291 | $value = price($value); |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | $out .= $form->selectCurrency($currency, $keyprefix.$key.$keysuffix.'currency_id'); |
1304 | 1304 | } elseif ($type == 'duration') { |
1305 | 1305 | $value = intval($value); |
1306 | - $out = $form->select_duration($keyprefix . $key, $value, 0, 'text', 0, 1); |
|
1306 | + $out = $form->select_duration($keyprefix.$key, $value, 0, 'text', 0, 1); |
|
1307 | 1307 | } elseif ($type == 'double') { |
1308 | 1308 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
1309 | 1309 | $value = price($value); |
@@ -1420,8 +1420,8 @@ discard block |
||
1420 | 1420 | // 7 : sort field (not used here but used into format for commobject) |
1421 | 1421 | |
1422 | 1422 | // If there is a filter, we extract it by taking all content inside parenthesis. |
1423 | - if (! empty($InfoFieldList[4])) { |
|
1424 | - $pos = 0; // $pos will be position of ending filter |
|
1423 | + if (!empty($InfoFieldList[4])) { |
|
1424 | + $pos = 0; // $pos will be position of ending filter |
|
1425 | 1425 | $parenthesisopen = 0; |
1426 | 1426 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
1427 | 1427 | if (substr($InfoFieldList[4], $pos, 1) == '(') { |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | // can use filter on any field of object |
1524 | 1524 | if (is_object($object)) { |
1525 | 1525 | $tags = []; |
1526 | - preg_match_all('/\$(.*?)\$/', $InfoFieldList[4], $tags); // Example: $InfoFieldList[4] is ($dateadh$:<=:CURRENT_DATE) |
|
1526 | + preg_match_all('/\$(.*?)\$/', $InfoFieldList[4], $tags); // Example: $InfoFieldList[4] is ($dateadh$:<=:CURRENT_DATE) |
|
1527 | 1527 | foreach ($tags[0] as $keytag => $valuetag) { |
1528 | 1528 | $property = preg_replace('/[^a-z0-9_]/', '', strtolower($tags[1][$keytag])); |
1529 | 1529 | if (strpos($InfoFieldList[4], $valuetag) !== false && property_exists($object, $property) && !empty($object->$property)) { |
@@ -1539,9 +1539,9 @@ discard block |
||
1539 | 1539 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
1540 | 1540 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
1541 | 1541 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
1542 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1542 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1543 | 1543 | } else { |
1544 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1544 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1545 | 1545 | } |
1546 | 1546 | } else { |
1547 | 1547 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1567,7 +1567,7 @@ discard block |
||
1567 | 1567 | $sql .= $sqlwhere; |
1568 | 1568 | |
1569 | 1569 | $sql .= $this->db->order(implode(', ', $fields_label)); |
1570 | - $sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
1570 | + $sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
1571 | 1571 | //print $sql; |
1572 | 1572 | |
1573 | 1573 | dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | // 7 : sort field (not used here but used into format for commobject) |
1683 | 1683 | |
1684 | 1684 | // If there is a filter, we extract it by taking all content inside parenthesis. |
1685 | - if (! empty($InfoFieldList[4])) { |
|
1685 | + if (!empty($InfoFieldList[4])) { |
|
1686 | 1686 | $pos = 0; |
1687 | 1687 | $parenthesisopen = 0; |
1688 | 1688 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -1779,9 +1779,9 @@ discard block |
||
1779 | 1779 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
1780 | 1780 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
1781 | 1781 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
1782 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1782 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1783 | 1783 | } else { |
1784 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1784 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
1785 | 1785 | } |
1786 | 1786 | } else { |
1787 | 1787 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | |
1901 | 1901 | $tmparray = explode(':', $param_list[0]); |
1902 | 1902 | |
1903 | - $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1903 | + $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
1904 | 1904 | if ($element == 'socpeople') { |
1905 | 1905 | $element = 'contact'; |
1906 | 1906 | } elseif ($element == 'projet') { |
@@ -1908,8 +1908,8 @@ discard block |
||
1908 | 1908 | } |
1909 | 1909 | |
1910 | 1910 | //$objectdesc = $param_list[0]; // Example: 'ObjectName:classPath:1:(status:=:1)' Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF |
1911 | - $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
1912 | - $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1911 | + $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
1912 | + $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
1913 | 1913 | |
1914 | 1914 | $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield); |
1915 | 1915 | } elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) { |
@@ -2020,7 +2020,7 @@ discard block |
||
2020 | 2020 | |
2021 | 2021 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
2022 | 2022 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
2023 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
2023 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
2024 | 2024 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
2025 | 2025 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
2026 | 2026 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -2051,7 +2051,7 @@ discard block |
||
2051 | 2051 | if ($type == 'date') { |
2052 | 2052 | $showsize = 10; |
2053 | 2053 | if ($value !== '') { |
2054 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
2054 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
2055 | 2055 | } |
2056 | 2056 | } elseif ($type == 'datetime') { |
2057 | 2057 | $showsize = 19; |
@@ -2182,9 +2182,9 @@ discard block |
||
2182 | 2182 | $translabel = $outputlangs->trans($obj->$field_toshow); |
2183 | 2183 | |
2184 | 2184 | if ($translabel != $obj->$field_toshow) { |
2185 | - $value .= dol_trunc($translabel, 24) . ' '; |
|
2185 | + $value .= dol_trunc($translabel, 24).' '; |
|
2186 | 2186 | } else { |
2187 | - $value .= $obj->$field_toshow . ' '; |
|
2187 | + $value .= $obj->$field_toshow.' '; |
|
2188 | 2188 | } |
2189 | 2189 | } |
2190 | 2190 | } |
@@ -2205,13 +2205,13 @@ discard block |
||
2205 | 2205 | $toprint = array(); |
2206 | 2206 | $obj = $this->db->fetch_object($resql); |
2207 | 2207 | if ($obj->rowid) { |
2208 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2208 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
2209 | 2209 | $c = new Categorie($this->db); |
2210 | 2210 | $result = $c->fetch($obj->rowid); |
2211 | 2211 | if ($result > 0) { |
2212 | 2212 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
2213 | 2213 | foreach ($ways as $way) { |
2214 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
2214 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
2215 | 2215 | } |
2216 | 2216 | } |
2217 | 2217 | } |
@@ -2353,7 +2353,7 @@ discard block |
||
2353 | 2353 | if (get_class($tmpobject) == 'Categorie') { |
2354 | 2354 | // For category object, rendering must use the same method than the one deinfed into showCategories() |
2355 | 2355 | $color = $tmpobject->color; |
2356 | - $sfortag = '<span class="noborderoncategories"' . ($color ? ' style="background: #' . $color . ';"' : ' style="background: #bbb"') . '>'; |
|
2356 | + $sfortag = '<span class="noborderoncategories"'.($color ? ' style="background: #'.$color.';"' : ' style="background: #bbb"').'>'; |
|
2357 | 2357 | $sfortag .= $tmpobject->getNomUrl(3); |
2358 | 2358 | $sfortag .= '</span>'; |
2359 | 2359 | $value = $sfortag; |
@@ -2565,12 +2565,12 @@ discard block |
||
2565 | 2565 | if ($mode == 'create') { |
2566 | 2566 | // On create mode, force separator group to not be collapsible |
2567 | 2567 | $extrafield_collapse_display_value = 1; |
2568 | - $expand_display = true; // We force group to be shown expanded |
|
2568 | + $expand_display = true; // We force group to be shown expanded |
|
2569 | 2569 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
2570 | 2570 | } |
2571 | 2571 | |
2572 | 2572 | $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
2573 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>'; |
|
2573 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
2574 | 2574 | // Some js code will be injected here to manage the collapsing of extrafields |
2575 | 2575 | // Output the picto |
2576 | 2576 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2652,7 +2652,7 @@ discard block |
||
2652 | 2652 | continue; |
2653 | 2653 | } |
2654 | 2654 | |
2655 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon', 'duration')))) { |
|
2655 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon', 'duration')))) { |
|
2656 | 2656 | //when unticking boolean field, it's not set in POST |
2657 | 2657 | continue; |
2658 | 2658 | } |
@@ -2681,7 +2681,7 @@ discard block |
||
2681 | 2681 | $onlykey === '@GETPOSTISSET' |
2682 | 2682 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2683 | 2683 | && in_array(abs($enabled), array(2, 5)) |
2684 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2684 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
2685 | 2685 | ) |
2686 | 2686 | ) { |
2687 | 2687 | continue; |
@@ -2725,8 +2725,8 @@ discard block |
||
2725 | 2725 | // Clean parameters |
2726 | 2726 | $value_key = dol_mktime(GETPOSTINT("options_".$key."hour"), GETPOSTINT("options_".$key."min"), GETPOSTINT("options_".$key."sec"), GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year"), 'gmt'); |
2727 | 2727 | } elseif (in_array($key_type, array('duration'))) { |
2728 | - $value_hours = GETPOSTINT("options_" . $key . "hour"); |
|
2729 | - $value_minutes = GETPOSTINT("options_" . $key . "min"); |
|
2728 | + $value_hours = GETPOSTINT("options_".$key."hour"); |
|
2729 | + $value_minutes = GETPOSTINT("options_".$key."min"); |
|
2730 | 2730 | $value_key = $value_hours * 3600 + $value_minutes * 60; |
2731 | 2731 | } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { |
2732 | 2732 | $value_arr = GETPOST("options_".$key, 'array'); // check if an array |
@@ -2822,17 +2822,17 @@ discard block |
||
2822 | 2822 | } |
2823 | 2823 | |
2824 | 2824 | if (in_array($key_type, array('date'))) { |
2825 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
2826 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
2825 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
2826 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
2827 | 2827 | |
2828 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
2828 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
2829 | 2829 | $value_key = array(); |
2830 | 2830 | // values provided as a component year, month, day, etc. |
2831 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2832 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); |
|
2831 | + if (GETPOST($dateparamname_start.'year')) { |
|
2832 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year')); |
|
2833 | 2833 | } |
2834 | - if (GETPOST($dateparamname_end . 'year')) { |
|
2835 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); |
|
2834 | + if (GETPOST($dateparamname_end.'year')) { |
|
2835 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year')); |
|
2836 | 2836 | } |
2837 | 2837 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
2838 | 2838 | // Clean parameters |
@@ -2841,26 +2841,26 @@ discard block |
||
2841 | 2841 | continue; // Value was not provided, we should not set it. |
2842 | 2842 | } |
2843 | 2843 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
2844 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
2845 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
2844 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
2845 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
2846 | 2846 | |
2847 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
2847 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
2848 | 2848 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
2849 | - $dateparamname_start_hour = GETPOSTINT($dateparamname_start . 'hour') != '-1' ? GETPOSTINT($dateparamname_start . 'hour') : '00'; |
|
2850 | - $dateparamname_start_min = GETPOSTINT($dateparamname_start . 'min') != '-1' ? GETPOSTINT($dateparamname_start . 'min') : '00'; |
|
2851 | - $dateparamname_start_sec = GETPOSTINT($dateparamname_start . 'sec') != '-1' ? GETPOSTINT($dateparamname_start . 'sec') : '00'; |
|
2852 | - $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; |
|
2853 | - $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; |
|
2854 | - $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; |
|
2849 | + $dateparamname_start_hour = GETPOSTINT($dateparamname_start.'hour') != '-1' ? GETPOSTINT($dateparamname_start.'hour') : '00'; |
|
2850 | + $dateparamname_start_min = GETPOSTINT($dateparamname_start.'min') != '-1' ? GETPOSTINT($dateparamname_start.'min') : '00'; |
|
2851 | + $dateparamname_start_sec = GETPOSTINT($dateparamname_start.'sec') != '-1' ? GETPOSTINT($dateparamname_start.'sec') : '00'; |
|
2852 | + $dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23'; |
|
2853 | + $dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59'; |
|
2854 | + $dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59'; |
|
2855 | 2855 | if ($key_type == 'datetimegmt') { |
2856 | 2856 | $value_key = array( |
2857 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), |
|
2858 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') |
|
2857 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'), |
|
2858 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt') |
|
2859 | 2859 | ); |
2860 | 2860 | } else { |
2861 | 2861 | $value_key = array( |
2862 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), |
|
2863 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') |
|
2862 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'), |
|
2863 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel') |
|
2864 | 2864 | ); |
2865 | 2865 | } |
2866 | 2866 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
@@ -2987,6 +2987,6 @@ discard block |
||
2987 | 2987 | if ($type == 'sellist') { |
2988 | 2988 | return ($v == '0'); |
2989 | 2989 | } |
2990 | - return empty($v); // Note empty('0') is also true, tested 7.0 up to 8.3.12 |
|
2990 | + return empty($v); // Note empty('0') is also true, tested 7.0 up to 8.3.12 |
|
2991 | 2991 | } |
2992 | 2992 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | $head = ''; |
240 | 240 | if (getDolGlobalString('MAIN_SIGN_CSS_URL')) { |
241 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_SIGN_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
241 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('MAIN_SIGN_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $conf->dol_hide_topmenu = 1; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | if ($source == 'proposal' && getDolGlobalString('PROPOSAL_IMAGE_PUBLIC_SIGN')) { |
284 | 284 | print '<div class="backimagepublicproposalsign">'; |
285 | - print '<img id="idPROPOSAL_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('PROPOSAL_IMAGE_PUBLIC_SIGN').'">'; |
|
285 | + print '<img id="idPROPOSAL_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('PROPOSAL_IMAGE_PUBLIC_SIGN').'">'; |
|
286 | 286 | print '</div>'; |
287 | 287 | } |
288 | 288 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | if (preg_match('/^\((.*)\)$/', $conf->global->ONLINE_SIGN_NEWFORM_TEXT, $reg)) { |
296 | 296 | $text .= $langs->trans($reg[1])."<br>\n"; |
297 | 297 | } else { |
298 | - $text .= getDolGlobalString('ONLINE_SIGN_NEWFORM_TEXT') . "<br>\n"; |
|
298 | + $text .= getDolGlobalString('ONLINE_SIGN_NEWFORM_TEXT')."<br>\n"; |
|
299 | 299 | } |
300 | 300 | $text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n"; |
301 | 301 | } |
@@ -387,12 +387,12 @@ discard block |
||
387 | 387 | $last_main_doc_file = $object->last_main_doc; |
388 | 388 | |
389 | 389 | if ($object->status == $object::STATUS_VALIDATED) { |
390 | - $object->last_main_doc = preg_replace('/_signed-(\d+)/', '', $object->last_main_doc); // We want to be sure to not work on the signed version |
|
390 | + $object->last_main_doc = preg_replace('/_signed-(\d+)/', '', $object->last_main_doc); // We want to be sure to not work on the signed version |
|
391 | 391 | |
392 | 392 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { |
393 | 393 | // It seems document has never been generated, or was generated and then deleted. |
394 | 394 | // So we try to regenerate it with its default template. |
395 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
395 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
396 | 396 | $object->generateDocument($defaulttemplate, $langs); |
397 | 397 | } |
398 | 398 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { |
464 | 464 | // It seems document has never been generated, or was generated and then deleted. |
465 | 465 | // So we try to regenerate it with its default template. |
466 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
466 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
467 | 467 | $object->generateDocument($defaulttemplate, $langs); |
468 | 468 | } |
469 | 469 | |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { |
515 | 515 | // It seems document has never been generated, or was generated and then deleted. |
516 | 516 | // So we try to regenerate it with its default template. |
517 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
517 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
518 | 518 | $object->generateDocument($defaulttemplate, $langs); |
519 | 519 | } |
520 | 520 | |
@@ -538,24 +538,24 @@ discard block |
||
538 | 538 | $result = $object->fetch_thirdparty(); |
539 | 539 | |
540 | 540 | // Proposer |
541 | - print '<tr class="CTableRow2"><td class="CTableRow2">' . $langs->trans("Proposer"); |
|
541 | + print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Proposer"); |
|
542 | 542 | print '</td><td class="CTableRow2">'; |
543 | 543 | print img_picto('', 'company', 'class="pictofixedwidth"'); |
544 | - print '<b>' . $creditor . '</b>'; |
|
545 | - print '<input type="hidden" name="creditor" value="' . $creditor . '">'; |
|
546 | - print '</td></tr>' . "\n"; |
|
544 | + print '<b>'.$creditor.'</b>'; |
|
545 | + print '<input type="hidden" name="creditor" value="'.$creditor.'">'; |
|
546 | + print '</td></tr>'."\n"; |
|
547 | 547 | |
548 | 548 | // Target |
549 | - print '<tr class="CTableRow2"><td class="CTableRow2">' . $langs->trans("ThirdParty"); |
|
549 | + print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("ThirdParty"); |
|
550 | 550 | print '</td><td class="CTableRow2">'; |
551 | 551 | print img_picto('', 'company', 'class="pictofixedwidth"'); |
552 | - print '<b>' . $object->thirdparty->name . '</b>'; |
|
553 | - print '</td></tr>' . "\n"; |
|
552 | + print '<b>'.$object->thirdparty->name.'</b>'; |
|
553 | + print '</td></tr>'."\n"; |
|
554 | 554 | |
555 | 555 | // Object |
556 | - $text = '<b>' . $langs->trans("Signature" . dol_ucfirst($source) . "Ref", $object->ref) . '</b>'; |
|
557 | - print '<tr class="CTableRow2"><td class="CTableRow2">' . $langs->trans("Designation"); |
|
558 | - print '</td><td class="CTableRow2">' . $text; |
|
556 | + $text = '<b>'.$langs->trans("Signature".dol_ucfirst($source)."Ref", $object->ref).'</b>'; |
|
557 | + print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Designation"); |
|
558 | + print '</td><td class="CTableRow2">'.$text; |
|
559 | 559 | |
560 | 560 | $last_main_doc_file = $object->last_main_doc; |
561 | 561 | $diroutput = $conf->societe->multidir_output[$object->thirdparty->entity].'/' |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { |
619 | 619 | // It seems document has never been generated, or was generated and then deleted. |
620 | 620 | // So we try to regenerate it with its default template. |
621 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
621 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
622 | 622 | $object->generateDocument($defaulttemplate, $langs); |
623 | 623 | } |
624 | 624 | $directdownloadlink = $object->getLastMainDocLink('', 0, 0); |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { |
668 | 668 | // It seems document has never been generated, or was generated and then deleted. |
669 | 669 | // So we try to regenerate it with its default template. |
670 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
670 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
671 | 671 | $object->generateDocument($defaulttemplate, $langs); |
672 | 672 | } |
673 | 673 | |
@@ -727,8 +727,8 @@ discard block |
||
727 | 727 | print '</div>'; |
728 | 728 | |
729 | 729 | // Define $urlwithroot |
730 | - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
|
731 | - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
730 | + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
|
731 | + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
732 | 732 | //$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. |
733 | 733 | // TODO Replace DOL_URL_ROOT with $urlwithroot ? |
734 | 734 |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $to = $adh->makeSubstitution($conf->global->MAIN_INFO_SOCIETE_MAIL); |
396 | 396 | $from = getDolGlobalString('ADHERENT_MAIL_FROM'); |
397 | 397 | $mailfile = new CMailFile( |
398 | - '['.$appli.'] ' . getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'), |
|
398 | + '['.$appli.'] '.getDolGlobalString('ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'), |
|
399 | 399 | $to, |
400 | 400 | $from, |
401 | 401 | $adh->makeSubstitution($conf->global->ADHERENT_AUTOREGISTER_NOTIF_MAIL), |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | print '</td></tr>'."\n"; |
582 | 582 | } else { |
583 | 583 | $adht->fetch(getDolGlobalInt('MEMBER_NEWFORM_FORCETYPE')); |
584 | - print '<input type="hidden" id="typeid" name="typeid" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCETYPE').'">'; |
|
584 | + print '<input type="hidden" id="typeid" name="typeid" value="'.getDolGlobalString('MEMBER_NEWFORM_FORCETYPE').'">'; |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | // Moral/Physic attribute |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | print '</td></tr>'."\n"; |
595 | 595 | } else { |
596 | 596 | //print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; |
597 | - print '<input type="hidden" id="morphy" name="morphy" value="' . getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY').'">'; |
|
597 | + print '<input type="hidden" id="morphy" name="morphy" value="'.getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY').'">'; |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | // Company // TODO : optional hide |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | } |
693 | 693 | |
694 | 694 | // Other attributes |
695 | - $parameters['tpl_context'] = 'public'; // define template context to public |
|
695 | + $parameters['tpl_context'] = 'public'; // define template context to public |
|
696 | 696 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
697 | 697 | |
698 | 698 | // Comments |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | $adht = new AdherentType($db); |
754 | 754 | $adht->fetch($typeid); |
755 | 755 | $caneditamount = $adht->caneditamount; |
756 | - $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
756 | + $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
757 | 757 | |
758 | 758 | // Set amount for the subscription from the the type and options: |
759 | 759 | // - First check the amount of the member type. |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' |
776 | 776 | print '<tr><td>'.$langs->trans("Subscription"); |
777 | 777 | if (getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO')) { |
778 | - print ' - <a href="' . getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
778 | + print ' - <a href="'.getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO').'" rel="external" target="_blank" rel="noopener noreferrer">'.$langs->trans("SeeHere").'</a>'; |
|
779 | 779 | } |
780 | 780 | print '</td><td class="nowrap">'; |
781 | 781 | |
@@ -871,10 +871,10 @@ discard block |
||
871 | 871 | |
872 | 872 | $i = 0; |
873 | 873 | while ($i < $num) { |
874 | - $objp = $db->fetch_object($result); // Load the member type and information on it |
|
874 | + $objp = $db->fetch_object($result); // Load the member type and information on it |
|
875 | 875 | |
876 | 876 | $caneditamount = $objp->caneditamount; |
877 | - $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
877 | + $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
878 | 878 | |
879 | 879 | print '<tr class="oddeven">'; |
880 | 880 | // Label |
@@ -274,8 +274,8 @@ |
||
274 | 274 | |
275 | 275 | |
276 | 276 | // Define $urlwithroot |
277 | -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
|
278 | -$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
277 | +$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); |
|
278 | +$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file |
|
279 | 279 | //$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. |
280 | 280 | // TODO Replace DOL_URL_ROOT with $urlwithroot ? |
281 | 281 |