@@ -148,20 +148,20 @@ discard block |
||
148 | 148 | $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
149 | 149 | $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
150 | 150 | $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
151 | -$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
151 | +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
152 | 152 | $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
153 | 153 | $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
154 | 154 | $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
155 | -$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
155 | +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
156 | 156 | |
157 | 157 | $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); |
158 | 158 | $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); |
159 | 159 | $search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); |
160 | -$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
160 | +$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
161 | 161 | $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); |
162 | 162 | $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); |
163 | 163 | $search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); |
164 | -$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
164 | +$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
165 | 165 | |
166 | 166 | $type = GETPOST('type', 'alpha'); |
167 | 167 | $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | } |
632 | 632 | // Search on sale representative |
633 | 633 | if (!empty($search_sale) && $search_sale != '-1') { |
634 | - $search_sale_req = array_filter($search_sale, function (string $value): bool { |
|
634 | + $search_sale_req = array_filter($search_sale, function(string $value): bool { |
|
635 | 635 | $value = intval($value); |
636 | 636 | return $value >= 0; |
637 | 637 | }); |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | if ($searchCategoryCustomerOperator == 0) { |
660 | 660 | $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")"; |
661 | 661 | } else { |
662 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); |
|
662 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer); |
|
663 | 663 | } |
664 | 664 | } |
665 | 665 | } |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | if ($searchCategorySupplierOperator == 0) { |
689 | 689 | $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")"; |
690 | 690 | } else { |
691 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); |
|
691 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier); |
|
692 | 692 | } |
693 | 693 | } |
694 | 694 | } |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | } |
975 | 975 | if (is_array($search_sale)) { |
976 | 976 | foreach ($search_sale as $sale_id) { |
977 | - $param .= '&search_sale[]=' . urlencode($sale_id); |
|
977 | + $param .= '&search_sale[]='.urlencode($sale_id); |
|
978 | 978 | } |
979 | 979 | } |
980 | 980 | if ($search_id > 0) { |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); |
1136 | 1136 | } |
1137 | 1137 | if ($search_date_modif_end) { |
1138 | - $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); |
|
1138 | + $param .= '&search_date_modif_end='.urlencode($search_date_modif_end); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | // Add $param from extra fields |
@@ -1312,7 +1312,7 @@ discard block |
||
1312 | 1312 | $moreforfilter .= '<div class="divsearchfield">'; |
1313 | 1313 | $tmptitle = $langs->trans('SalesRepresentatives'); |
1314 | 1314 | $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"'); |
1315 | - $moreforfilter .= $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1); |
|
1315 | + $moreforfilter .= $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1); |
|
1316 | 1316 | $moreforfilter .= '</div>'; |
1317 | 1317 | } |
1318 | 1318 | if (!empty($moreforfilter)) { |
@@ -1325,7 +1325,7 @@ discard block |
||
1325 | 1325 | } |
1326 | 1326 | |
1327 | 1327 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
1328 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1328 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
1329 | 1329 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
1330 | 1330 | $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1331 | 1331 | |
@@ -1797,20 +1797,20 @@ discard block |
||
1797 | 1797 | // IP Address |
1798 | 1798 | if (!empty($arrayfields['s.ip']['checked'])) { |
1799 | 1799 | print_liste_field_titre($arrayfields['s.ip']['label'], $_SERVER["PHP_SELF"], "s.ip", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
1800 | - $totalarray['nbfield']++; // For the column action |
|
1800 | + $totalarray['nbfield']++; // For the column action |
|
1801 | 1801 | } |
1802 | 1802 | // Date creation |
1803 | 1803 | if (!empty($arrayfields['s.datec']['checked'])) { |
1804 | 1804 | print_liste_field_titre($arrayfields['s.datec']['label'], $_SERVER["PHP_SELF"], "s.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
1805 | - $totalarray['nbfield']++; // For the column action |
|
1805 | + $totalarray['nbfield']++; // For the column action |
|
1806 | 1806 | } |
1807 | 1807 | if (!empty($arrayfields['s.tms']['checked'])) { |
1808 | 1808 | print_liste_field_titre($arrayfields['s.tms']['label'], $_SERVER["PHP_SELF"], "s.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
1809 | - $totalarray['nbfield']++; // For the column action |
|
1809 | + $totalarray['nbfield']++; // For the column action |
|
1810 | 1810 | } |
1811 | 1811 | if (!empty($arrayfields['s.status']['checked'])) { |
1812 | 1812 | print_liste_field_titre($arrayfields['s.status']['label'], $_SERVER["PHP_SELF"], "s.status", "", $param, '', $sortfield, $sortorder, 'center '); |
1813 | - $totalarray['nbfield']++; // For the column action |
|
1813 | + $totalarray['nbfield']++; // For the column action |
|
1814 | 1814 | } |
1815 | 1815 | if (!empty($arrayfields['s.note_public']['checked'])) { |
1816 | 1816 | print_liste_field_titre($arrayfields['s.note_public']['label'], $_SERVER["PHP_SELF"], "s.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); |
@@ -1822,7 +1822,7 @@ discard block |
||
1822 | 1822 | } |
1823 | 1823 | if (!empty($arrayfields['s.import_key']['checked'])) { |
1824 | 1824 | print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center '); |
1825 | - $totalarray['nbfield']++; // For the column action |
|
1825 | + $totalarray['nbfield']++; // For the column action |
|
1826 | 1826 | } |
1827 | 1827 | // Action column |
1828 | 1828 | if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
@@ -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') : 'invoicetemplatelist'; // 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')); |
@@ -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 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
257 | 257 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
258 | - $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
258 | + $object->fk_societe_rib = GETPOSTINT('accountcustomerid'); |
|
259 | 259 | $object->rule_for_lines_dates = GETPOST('rule_for_lines_dates', 'alpha'); |
260 | 260 | |
261 | 261 | $object->frequency = $frequency; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | setEventMessages($line->error, $line->errors, 'errors'); |
479 | 479 | } |
480 | 480 | } elseif ($action == 'update_extras' && $usercancreate) { |
481 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
481 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
482 | 482 | |
483 | 483 | // Fill array 'array_options' with data from update form |
484 | 484 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | // Define special_code for special lines |
858 | 858 | $special_code = GETPOSTINT('special_code'); |
859 | 859 | if ($special_code == 3) { |
860 | - $special_code = 0; // Options should not exists on invoices |
|
860 | + $special_code = 0; // Options should not exists on invoices |
|
861 | 861 | } |
862 | 862 | |
863 | 863 | /*$line = new FactureLigne($db); |
@@ -1133,11 +1133,11 @@ discard block |
||
1133 | 1133 | |
1134 | 1134 | print '<script> |
1135 | 1135 | $(document).ready(function() { |
1136 | - if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB . '") { |
|
1136 | + if($("#selectmode_reglement_id option:selected").data("code") != "' . $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1137 | 1137 | hideselectfksocieterib(); |
1138 | 1138 | } |
1139 | 1139 | $("#selectmode_reglement_id").change(function() { |
1140 | - if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB .'") { |
|
1140 | + if($("#selectmode_reglement_id option:selected").data("code") != "'. $factureRec::PAYMENTCODETOEDITSOCIETERIB.'") { |
|
1141 | 1141 | hideselectfksocieterib(1); |
1142 | 1142 | } else { |
1143 | 1143 | showselectfksocieterib(); |
@@ -1484,15 +1484,15 @@ discard block |
||
1484 | 1484 | print '<td>'; |
1485 | 1485 | |
1486 | 1486 | if (($action != 'editbankaccountcustomer') && $user->hasRight('facture', 'creer') && $object->statut == FactureRec::STATUS_DRAFT) { |
1487 | - 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>'; |
|
1487 | + 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>'; |
|
1488 | 1488 | } |
1489 | 1489 | print '</tr></table>'; |
1490 | 1490 | print '</td><td>'; |
1491 | 1491 | |
1492 | 1492 | if ($action == 'editbankaccountcustomer') { |
1493 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1493 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_societe_rib, 'accountcustomerid', 'fk_soc='.$object->socid, 1, 1); |
|
1494 | 1494 | } else { |
1495 | - $form->formRib($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_societe_rib, 'none', '', 0, 1); |
|
1495 | + $form->formRib($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_societe_rib, 'none', '', 0, 1); |
|
1496 | 1496 | } |
1497 | 1497 | print "</td>"; |
1498 | 1498 | print '</tr>'; |
@@ -1729,10 +1729,10 @@ discard block |
||
1729 | 1729 | |
1730 | 1730 | // Lines |
1731 | 1731 | print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOSTINT('lineid')).'" method="POST">'; |
1732 | - print '<input type="hidden" name="token" value="' . newToken().'">'; |
|
1733 | - print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1732 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1733 | + print '<input type="hidden" name="action" value="'.(($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1734 | 1734 | print '<input type="hidden" name="mode" value="">'; |
1735 | - print '<input type="hidden" name="id" value="' . $object->id.'">'; |
|
1735 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
1736 | 1736 | print '<input type="hidden" name="page_y" value="">'; |
1737 | 1737 | |
1738 | 1738 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
@@ -1787,16 +1787,16 @@ discard block |
||
1787 | 1787 | if (empty($object->suspended)) { |
1788 | 1788 | if ($user->hasRight('facture', 'creer')) { |
1789 | 1789 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
1790 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1790 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1791 | 1791 | } else { |
1792 | 1792 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
1793 | - 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>'; |
|
1793 | + 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>'; |
|
1794 | 1794 | } else { |
1795 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1795 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1796 | 1796 | } |
1797 | 1797 | } |
1798 | 1798 | } else { |
1799 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1799 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
1800 | 1800 | } |
1801 | 1801 | } |
1802 | 1802 | |
@@ -1809,7 +1809,7 @@ discard block |
||
1809 | 1809 | } |
1810 | 1810 | |
1811 | 1811 | // Delete |
1812 | - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1812 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->hasRight('facture', 'supprimer')); |
|
1813 | 1813 | } |
1814 | 1814 | print '</div>'; |
1815 | 1815 |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | $this->titre = $obj->title; // deprecated |
672 | 672 | $this->title = $obj->title; |
673 | 673 | $this->ref = $obj->title; |
674 | - $this->subtype = $obj->subtype; |
|
674 | + $this->subtype = $obj->subtype; |
|
675 | 675 | $this->suspended = $obj->suspended; |
676 | 676 | $this->total_ht = $obj->total_ht; |
677 | 677 | $this->total_tva = $obj->total_tva; |
@@ -692,13 +692,13 @@ discard block |
||
692 | 692 | $this->fk_societe_rib = $obj->fk_societe_rib; |
693 | 693 | $this->note_private = $obj->note_private; |
694 | 694 | $this->note_public = $obj->note_public; |
695 | - $this->user_author = $obj->fk_user_author; // deprecated |
|
695 | + $this->user_author = $obj->fk_user_author; // deprecated |
|
696 | 696 | $this->user_creation_id = $obj->fk_user_author; |
697 | 697 | $this->model_pdf = $obj->model_pdf; |
698 | 698 | //$this->special_code = $obj->special_code; |
699 | 699 | $this->frequency = $obj->frequency; |
700 | 700 | $this->unit_frequency = $obj->unit_frequency; |
701 | - $this->rule_for_lines_dates = $obj->rule_for_lines_dates; |
|
701 | + $this->rule_for_lines_dates = $obj->rule_for_lines_dates; |
|
702 | 702 | $this->date_when = $this->db->jdate($obj->date_when); |
703 | 703 | $this->date_last_gen = $this->db->jdate($obj->date_last_gen); |
704 | 704 | $this->nb_gen_done = $obj->nb_gen_done; |
@@ -792,35 +792,35 @@ discard block |
||
792 | 792 | $objp = $this->db->fetch_object($result); |
793 | 793 | $line = new FactureLigneRec($this->db); |
794 | 794 | |
795 | - $line->id = $objp->rowid; |
|
795 | + $line->id = $objp->rowid; |
|
796 | 796 | $line->rowid = $objp->rowid; |
797 | - $line->fk_facture = $objp->fk_facture; |
|
798 | - $line->fk_parent_line = $objp->fk_parent_line; |
|
797 | + $line->fk_facture = $objp->fk_facture; |
|
798 | + $line->fk_parent_line = $objp->fk_parent_line; |
|
799 | 799 | $line->desc = $objp->description; // Description line |
800 | 800 | $line->description = $objp->description; // Description line |
801 | - $line->ref = $objp->product_ref; // Ref product |
|
801 | + $line->ref = $objp->product_ref; // Ref product |
|
802 | 802 | $line->product_ref = $objp->product_ref; // Ref product |
803 | - $line->libelle = $objp->product_label; // deprecated |
|
803 | + $line->libelle = $objp->product_label; // deprecated |
|
804 | 804 | $line->product_label = $objp->product_label; // Label product |
805 | 805 | $line->product_desc = $objp->product_desc; // Description product |
806 | 806 | $line->product_type = $objp->product_type; // Type of line |
807 | - $line->fk_product_type = $objp->fk_product_type; // Type of product |
|
807 | + $line->fk_product_type = $objp->fk_product_type; // Type of product |
|
808 | 808 | $line->qty = $objp->qty; |
809 | - $line->subprice = $objp->subprice; |
|
809 | + $line->subprice = $objp->subprice; |
|
810 | 810 | |
811 | 811 | $line->label = $objp->custom_label; // @deprecated |
812 | 812 | |
813 | 813 | $line->vat_src_code = $objp->vat_src_code; |
814 | - $line->tva_tx = $objp->tva_tx; |
|
814 | + $line->tva_tx = $objp->tva_tx; |
|
815 | 815 | $line->localtax1_tx = $objp->localtax1_tx; |
816 | 816 | $line->localtax2_tx = $objp->localtax2_tx; |
817 | 817 | $line->localtax1_type = $objp->localtax1_type; |
818 | 818 | $line->localtax2_type = $objp->localtax2_type; |
819 | 819 | $line->remise_percent = $objp->remise_percent; |
820 | 820 | //$line->fk_remise_except = $objp->fk_remise_except; |
821 | - $line->fk_product = $objp->fk_product; |
|
822 | - $line->date_start_fill = $objp->date_start_fill; |
|
823 | - $line->date_end_fill = $objp->date_end_fill; |
|
821 | + $line->fk_product = $objp->fk_product; |
|
822 | + $line->date_start_fill = $objp->date_start_fill; |
|
823 | + $line->date_end_fill = $objp->date_end_fill; |
|
824 | 824 | $line->info_bits = $objp->info_bits; |
825 | 825 | $line->total_ht = $objp->total_ht; |
826 | 826 | $line->total_tva = $objp->total_tva; |
@@ -836,15 +836,15 @@ discard block |
||
836 | 836 | $line->marge_tx = (string) $marginInfos[1]; |
837 | 837 | $line->marque_tx = (string) $marginInfos[2]; |
838 | 838 | $line->rang = $objp->rang; |
839 | - $line->special_code = $objp->special_code; |
|
840 | - $line->fk_unit = $objp->fk_unit; |
|
841 | - $line->fk_contract_line = $objp->fk_contract_line; |
|
839 | + $line->special_code = $objp->special_code; |
|
840 | + $line->fk_unit = $objp->fk_unit; |
|
841 | + $line->fk_contract_line = $objp->fk_contract_line; |
|
842 | 842 | |
843 | 843 | $line->extraparams = !empty($objp->extraparams) ? (array) json_decode($objp->extraparams, true) : array(); |
844 | 844 | |
845 | 845 | // Ne plus utiliser |
846 | - $line->price = $objp->price; |
|
847 | - $line->remise = $objp->remise; |
|
846 | + $line->price = $objp->price; |
|
847 | + $line->remise = $objp->remise; |
|
848 | 848 | |
849 | 849 | $line->fetch_optionals(); |
850 | 850 | |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | |
1438 | 1438 | $facture->type = self::TYPE_STANDARD; |
1439 | 1439 | $facture->subtype = $facturerec->subtype; |
1440 | - $facture->statut = self::STATUS_DRAFT; // deprecated |
|
1440 | + $facture->statut = self::STATUS_DRAFT; // deprecated |
|
1441 | 1441 | $facture->status = self::STATUS_DRAFT; |
1442 | 1442 | $facture->date = (empty($facturerec->date_when) ? $now : $facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. |
1443 | 1443 | $facture->socid = $facturerec->socid; |
@@ -1589,7 +1589,7 @@ discard block |
||
1589 | 1589 | } |
1590 | 1590 | $result .= $linkend; |
1591 | 1591 | global $action; |
1592 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1592 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1593 | 1593 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1594 | 1594 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1595 | 1595 | if ($reshook > 0) { |
@@ -1849,7 +1849,7 @@ discard block |
||
1849 | 1849 | |
1850 | 1850 | if (empty($option) || $option != 'nolines') { |
1851 | 1851 | // Lines |
1852 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
1852 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
1853 | 1853 | $xnbp = 0; |
1854 | 1854 | while ($xnbp < $nbp) { |
1855 | 1855 | $line = new FactureLigne($this->db); |
@@ -2041,7 +2041,7 @@ discard block |
||
2041 | 2041 | $resSuspend = $this->setValueFrom('suspended', 1); |
2042 | 2042 | |
2043 | 2043 | if ($resSuspend <= 0) { |
2044 | - dol_syslog(__METHOD__ . '::setValueFrom Error : ' . $this->error, LOG_ERR); |
|
2044 | + dol_syslog(__METHOD__.'::setValueFrom Error : '.$this->error, LOG_ERR); |
|
2045 | 2045 | return -1; |
2046 | 2046 | } |
2047 | 2047 | } |
@@ -2381,9 +2381,9 @@ discard block |
||
2381 | 2381 | if ($result) { |
2382 | 2382 | $objp = $this->db->fetch_object($result); |
2383 | 2383 | |
2384 | - $this->id = $objp->rowid; |
|
2385 | - $this->fk_facture = $objp->fk_facture; |
|
2386 | - $this->fk_parent_line = $objp->fk_parent_line; |
|
2384 | + $this->id = $objp->rowid; |
|
2385 | + $this->fk_facture = $objp->fk_facture; |
|
2386 | + $this->fk_parent_line = $objp->fk_parent_line; |
|
2387 | 2387 | $this->label = $objp->custom_label; // Label line |
2388 | 2388 | $this->desc = $objp->description; // Description line |
2389 | 2389 | $this->description = $objp->description; // Description line |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | function getArrayOfEmoji() |
63 | 63 | { |
64 | 64 | $arrayofcommonemoji = array( |
65 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
66 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
67 | - '????' => array('9989', '9989'), // Variation Selectors |
|
68 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
69 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
70 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
71 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
72 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
73 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
65 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
66 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
67 | + '????' => array('9989', '9989'), // Variation Selectors |
|
68 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
69 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
70 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
71 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
72 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
73 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | return $arrayofcommonemoji; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | //print "before decoding $val\n"; |
133 | 133 | do { |
134 | 134 | $oldval = $val; |
135 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
135 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
136 | 136 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
137 | 137 | $val = preg_replace_callback( |
138 | 138 | '/&#(x?[0-9][0-9a-f]+;?)/i', |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param string[] $m |
141 | 141 | * @return string |
142 | 142 | */ |
143 | - static function ($m) { |
|
143 | + static function($m) { |
|
144 | 144 | // Decode 'n', ... |
145 | 145 | return realCharForNumericEntities($m); |
146 | 146 | }, |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
182 | 182 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
183 | 183 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
184 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
184 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
185 | 185 | $inj += preg_match('/union.+select/i', $val); |
186 | 186 | } |
187 | 187 | if ($type == 3) { |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | session_set_cookie_params($sessioncookieparams); |
423 | 423 | } |
424 | 424 | session_name($sessionname); |
425 | - dol_session_start(); // This call the open and read of session handler |
|
425 | + dol_session_start(); // This call the open and read of session handler |
|
426 | 426 | //exit; // this exist generates a call to write and close |
427 | 427 | } |
428 | 428 | |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | if (!$ok) { |
451 | 451 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
452 | 452 | print 'Sorry, your application is offline.'."\n"; |
453 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
453 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
454 | 454 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
455 | 455 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
456 | 456 | } else { |
457 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
457 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
458 | 458 | $nexturl = DOL_URL_ROOT.'/'; |
459 | 459 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
460 | 460 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
671 | 671 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
672 | 672 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
673 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
673 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
674 | 674 | } |
675 | 675 | print " into setup).\n"; |
676 | 676 | } |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | unset($_GET['action']); |
699 | 699 | unset($_GET['confirmmassaction']); |
700 | 700 | unset($_GET['massaction']); |
701 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
701 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
702 | 702 | if (isset($savid)) { |
703 | 703 | $_POST['id'] = ((int) $savid); |
704 | 704 | } |
@@ -720,18 +720,18 @@ discard block |
||
720 | 720 | foreach ($disabled_modules as $module) { |
721 | 721 | if ($module) { |
722 | 722 | if (empty($conf->$module)) { |
723 | - $conf->$module = new stdClass(); // To avoid warnings |
|
723 | + $conf->$module = new stdClass(); // To avoid warnings |
|
724 | 724 | } |
725 | 725 | |
726 | - $conf->$module->enabled = false; // Old usage |
|
726 | + $conf->$module->enabled = false; // Old usage |
|
727 | 727 | unset($conf->modules[$module]); |
728 | 728 | |
729 | 729 | foreach ($modulepartkeys as $modulepartkey) { |
730 | 730 | unset($conf->modules_parts[$modulepartkey][$module]); |
731 | 731 | } |
732 | 732 | if ($module == 'fournisseur') { // Special case |
733 | - $conf->supplier_order->enabled = 0; // Old usage |
|
734 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
733 | + $conf->supplier_order->enabled = 0; // Old usage |
|
734 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
735 | 735 | unset($conf->modules['supplier_order']); |
736 | 736 | unset($conf->modules['supplier_invoice']); |
737 | 737 | } |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
868 | 868 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
869 | 869 | } else { |
870 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
870 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
871 | 871 | $test = false; |
872 | 872 | $error++; |
873 | 873 | } |
874 | 874 | } else { |
875 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
875 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
876 | 876 | $test = false; |
877 | 877 | $error++; |
878 | 878 | } |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | |
917 | 917 | $allowedmethodtopostusername = 3; |
918 | 918 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
919 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
919 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
920 | 920 | } |
921 | 921 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
922 | 922 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | // Show login form |
1061 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
1061 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
1062 | 1062 | } |
1063 | 1063 | exit; |
1064 | 1064 | } |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | } else { |
1417 | 1417 | // We may have NOLOGIN set, but NOREQUIREUSER not |
1418 | 1418 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
1419 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1419 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1420 | 1420 | } |
1421 | 1421 | } |
1422 | 1422 | |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | $conf->dol_optimize_smallscreen = 1; |
1480 | 1480 | |
1481 | 1481 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
1482 | - $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1482 | + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
1483 | 1483 | } |
1484 | 1484 | } |
1485 | 1485 | // Replace themes bugged with jmobile with eldy |
@@ -1608,7 +1608,7 @@ discard block |
||
1608 | 1608 | |
1609 | 1609 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
1610 | 1610 | $message = GETPOST('seteventmessages', 'alpha'); |
1611 | - $messages = explode(',', $message); |
|
1611 | + $messages = explode(',', $message); |
|
1612 | 1612 | foreach ($messages as $key => $msg) { |
1613 | 1613 | $tmp = explode(':', $msg); |
1614 | 1614 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | } |
1920 | 1920 | |
1921 | 1921 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
1922 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1922 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1923 | 1923 | } |
1924 | 1924 | |
1925 | 1925 | // Auto refresh page |
@@ -2007,9 +2007,9 @@ discard block |
||
2007 | 2007 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
2008 | 2008 | } |
2009 | 2009 | if (constant('JS_JQUERY_UI')) { |
2010 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery |
|
2010 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // Forced JQuery |
|
2011 | 2011 | } else { |
2012 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css' . ($ext ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
2012 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
2013 | 2013 | } |
2014 | 2014 | } |
2015 | 2015 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
@@ -2042,7 +2042,7 @@ discard block |
||
2042 | 2042 | |
2043 | 2043 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
2044 | 2044 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
2045 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
2045 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
2046 | 2046 | } |
2047 | 2047 | |
2048 | 2048 | if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { |
@@ -2113,9 +2113,9 @@ discard block |
||
2113 | 2113 | } |
2114 | 2114 | if (!defined('DISABLE_JQUERY_UI')) { |
2115 | 2115 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
2116 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
2116 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
2117 | 2117 | } else { |
2118 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
2118 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
2119 | 2119 | } |
2120 | 2120 | } |
2121 | 2121 | // jQuery jnotify |
@@ -2210,7 +2210,7 @@ discard block |
||
2210 | 2210 | // Global js function |
2211 | 2211 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
2212 | 2212 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
2213 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n"; |
|
2213 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
2214 | 2214 | } |
2215 | 2215 | |
2216 | 2216 | // Leaflet |
@@ -2261,7 +2261,7 @@ discard block |
||
2261 | 2261 | print $head."\n"; |
2262 | 2262 | } |
2263 | 2263 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
2264 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
2264 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
2265 | 2265 | } |
2266 | 2266 | |
2267 | 2267 | $parameters = array(); |
@@ -2404,7 +2404,7 @@ discard block |
||
2404 | 2404 | |
2405 | 2405 | $toprightmenu .= '</div>'; |
2406 | 2406 | |
2407 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2407 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
2408 | 2408 | |
2409 | 2409 | |
2410 | 2410 | // Add block for other tools |
@@ -3155,7 +3155,7 @@ discard block |
||
3155 | 3155 | $langs->load(explode('@', $item['name'])[1]); |
3156 | 3156 | $dropDownQuickAddHtml .= ' |
3157 | 3157 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
3158 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
3158 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
3159 | 3159 | '; |
3160 | 3160 | } |
3161 | 3161 | |
@@ -3274,7 +3274,7 @@ discard block |
||
3274 | 3274 | */ |
3275 | 3275 | function top_menu_search() |
3276 | 3276 | { |
3277 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
3277 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
3278 | 3278 | |
3279 | 3279 | $html = ''; |
3280 | 3280 | |
@@ -4040,7 +4040,7 @@ discard block |
||
4040 | 4040 | $forceping = GETPOST('forceping', 'alpha'); |
4041 | 4041 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
4042 | 4042 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
4043 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
4043 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
4044 | 4044 | |
4045 | 4045 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
4046 | 4046 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $object = new Contrat($db); |
103 | 103 | $extrafields = new ExtraFields($db); |
104 | 104 | $ret = 0; |
105 | -$pu_ht = null; // Init for static analysis |
|
106 | -$pu_ttc = null; // Init for static analysis |
|
105 | +$pu_ht = null; // Init for static analysis |
|
106 | +$pu_ttc = null; // Init for static analysis |
|
107 | 107 | |
108 | 108 | // Load object |
109 | 109 | if ($id > 0 || !empty($ref) && $action != 'add') { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php |
126 | 126 | $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php |
127 | 127 | $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); |
128 | -$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
128 | +$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
|
129 | 129 | $permissiontoedit = $permissiontoadd; |
130 | 130 | $permissiontoactivate = $user->hasRight('contrat', 'activer'); |
131 | 131 | $error = 0; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once' |
177 | 177 | |
178 | - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
178 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once' |
|
179 | 179 | |
180 | 180 | if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { |
181 | 181 | $date_start = ''; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
199 | 199 | $result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY'); |
200 | 200 | if ($result >= 0) { |
201 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
201 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
202 | 202 | exit; |
203 | 203 | } else { |
204 | 204 | $mesg = $object->error; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) { |
207 | 207 | $result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY'); |
208 | 208 | if ($result >= 0) { |
209 | - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); |
|
209 | + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); |
|
210 | 210 | exit; |
211 | 211 | } else { |
212 | 212 | $mesg = $object->error; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | $classname = ucfirst($subelement); |
339 | 339 | $srcobject = new $classname($db); |
340 | - '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
340 | + '@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic |
|
341 | 341 | |
342 | 342 | dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); |
343 | 343 | $result = $srcobject->fetch($object->origin_id); |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | } |
766 | 766 | $objectline->fetch_optionals(); |
767 | 767 | |
768 | - $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
768 | + $objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
769 | 769 | } else { |
770 | 770 | $objectline = null; |
771 | 771 | } |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | // update price_ht with discount |
815 | 815 | // TODO Use object->updateline instead objectline->update |
816 | 816 | |
817 | - $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
817 | + $price_ht = price2num(GETPOST('elprice'), 'MU'); |
|
818 | 818 | $remise_percent = price2num(GETPOST('elremise_percent'), '', 2); |
819 | 819 | if ($remise_percent > 0) { |
820 | 820 | $remise = round(((float) $price_ht * (float) $remise_percent / 100), 2); |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | } elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { |
922 | 922 | $date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear')); |
923 | 923 | $date_end = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear')); |
924 | - $comment = GETPOST('comment', 'alpha'); |
|
924 | + $comment = GETPOST('comment', 'alpha'); |
|
925 | 925 | $result = $object->activateAll($user, $date_start, 0, $comment, $date_end); |
926 | 926 | if ($result < 0) { |
927 | 927 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | $morehtmlref .= '<div class="refidno">'; |
1484 | 1484 | // Ref customer |
1485 | 1485 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
1486 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1486 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef'); |
|
1487 | 1487 | // Ref supplier |
1488 | 1488 | $morehtmlref .= '<br>'; |
1489 | 1489 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1); |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | } |
1578 | 1578 | |
1579 | 1579 | |
1580 | - $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1580 | + $arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error |
|
1581 | 1581 | |
1582 | 1582 | /* |
1583 | 1583 | * Lines of contracts |
@@ -1705,7 +1705,7 @@ discard block |
||
1705 | 1705 | $description = $objp->description; |
1706 | 1706 | |
1707 | 1707 | if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { |
1708 | - print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '') . $text; |
|
1708 | + print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '').$text; |
|
1709 | 1709 | if (!getDolGlobalInt('PRODUIT_DESC_IN_FORM')) { |
1710 | 1710 | print $form->textwithpicto('', $description); |
1711 | 1711 | } |
@@ -1847,7 +1847,7 @@ discard block |
||
1847 | 1847 | print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; |
1848 | 1848 | print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">'; |
1849 | 1849 | } else { |
1850 | - $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1850 | + $senderissupplier = 0; // @TODO Option to allow purchased products ? |
|
1851 | 1851 | if (empty($senderissupplier)) { |
1852 | 1852 | if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { |
1853 | 1853 | $filtertype = ''; |
@@ -2349,9 +2349,9 @@ discard block |
||
2349 | 2349 | // Sign |
2350 | 2350 | if ($object->status > Contrat::STATUS_DRAFT) { |
2351 | 2351 | if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) { |
2352 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>'; |
|
2352 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>'; |
|
2353 | 2353 | } else { |
2354 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>'; |
|
2354 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>'; |
|
2355 | 2355 | } |
2356 | 2356 | } |
2357 | 2357 |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | if (getDolGlobalString('CONTRACT_ADDON')) { |
324 | 324 | $mybool = false; |
325 | 325 | |
326 | - $file = getDolGlobalString('CONTRACT_ADDON') . ".php"; |
|
326 | + $file = getDolGlobalString('CONTRACT_ADDON').".php"; |
|
327 | 327 | $classname = getDolGlobalString('CONTRACT_ADDON'); |
328 | 328 | |
329 | 329 | // Include file with class |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | if ($contratline->statut != ContratLigne::STATUS_OPEN) { |
434 | 434 | $contratline->context = $this->context; |
435 | 435 | |
436 | - $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
436 | + $result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE |
|
437 | 437 | if ($result < 0) { |
438 | 438 | $error++; |
439 | 439 | $this->error = $contratline->error; |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | // Close lines not already closed |
484 | 484 | if ($contratline->statut != ContratLigne::STATUS_CLOSED) { |
485 | 485 | $contratline->date_end_real = $now; |
486 | - $contratline->date_cloture = $now; // For backward compatibility |
|
486 | + $contratline->date_cloture = $now; // For backward compatibility |
|
487 | 487 | $contratline->user_closing_id = $user->id; |
488 | 488 | $contratline->statut = ContratLigne::STATUS_CLOSED; |
489 | 489 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | if (!$error) { |
624 | 624 | $this->ref = $num; |
625 | 625 | $this->status = self::STATUS_VALIDATED; |
626 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
626 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
627 | 627 | $this->date_validation = $now; |
628 | 628 | } |
629 | 629 | } else { |
@@ -898,10 +898,10 @@ discard block |
||
898 | 898 | $line->localtax2_tx = $objp->localtax2_tx; |
899 | 899 | $line->localtax1_type = $objp->localtax1_type; |
900 | 900 | $line->localtax2_type = $objp->localtax2_type; |
901 | - $line->subprice = $objp->subprice; |
|
901 | + $line->subprice = $objp->subprice; |
|
902 | 902 | $line->statut = $objp->status; |
903 | 903 | $line->status = $objp->status; |
904 | - $line->remise_percent = $objp->remise_percent; |
|
904 | + $line->remise_percent = $objp->remise_percent; |
|
905 | 905 | $line->price_ht = $objp->price_ht; |
906 | 906 | $line->price = $objp->price_ht; // For backward compatibility |
907 | 907 | $line->total_ht = $objp->total_ht; |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | //$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); |
947 | 947 | //$line->date_fin_reel = $this->db->jdate($objp->date_cloture); |
948 | 948 | |
949 | - $line->rang = $objp->rang; |
|
949 | + $line->rang = $objp->rang; |
|
950 | 950 | |
951 | 951 | // Retrieve all extrafields for contract line |
952 | 952 | // fetch optionals attributes and labels |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | } |
1422 | 1422 | |
1423 | 1423 | if (!$error) { |
1424 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
1424 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
1425 | 1425 | if ($result < 0) { |
1426 | 1426 | $error++; |
1427 | 1427 | } |
@@ -2064,7 +2064,7 @@ discard block |
||
2064 | 2064 | } |
2065 | 2065 | $datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1); |
2066 | 2066 | } |
2067 | - $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer; |
|
2067 | + $datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer; |
|
2068 | 2068 | if (!$nofetch) { |
2069 | 2069 | $langs->load('project'); |
2070 | 2070 | if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | $this->note_public = 'This is a comment (public)'; |
2489 | 2489 | $this->fk_project = 0; |
2490 | 2490 | // Lines |
2491 | - $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
2491 | + $nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000) |
|
2492 | 2492 | $xnbp = 0; |
2493 | 2493 | while ($xnbp < $nbp) { |
2494 | 2494 | $line = new ContratLigne($this->db); |
@@ -2534,7 +2534,7 @@ discard block |
||
2534 | 2534 | global $user; |
2535 | 2535 | |
2536 | 2536 | $ticket = new Ticket($this->db); |
2537 | - $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id)); |
|
2537 | + $nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id)); |
|
2538 | 2538 | |
2539 | 2539 | return ($nbTicket < 0 ? $nbTicket : $ticket->lines); |
2540 | 2540 | } |
@@ -2556,7 +2556,7 @@ discard block |
||
2556 | 2556 | global $conf, $langs; |
2557 | 2557 | |
2558 | 2558 | if (!dol_strlen($modele)) { |
2559 | - $modele = ''; // No doc template/generation by default |
|
2559 | + $modele = ''; // No doc template/generation by default |
|
2560 | 2560 | |
2561 | 2561 | if (!empty($this->model_pdf)) { |
2562 | 2562 | $modele = $this->model_pdf; |
@@ -2653,14 +2653,14 @@ discard block |
||
2653 | 2653 | } |
2654 | 2654 | } |
2655 | 2655 | |
2656 | - if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
2656 | + if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) { |
|
2657 | 2657 | $this->error = 'ErrorSetupNotComplete'; |
2658 | 2658 | dol_syslog($this->error); |
2659 | 2659 | return -1; |
2660 | 2660 | } |
2661 | 2661 | |
2662 | 2662 | // Set ref |
2663 | - require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
2663 | + require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php'; |
|
2664 | 2664 | $obj = getDolGlobalString('CONTRACT_ADDON'); |
2665 | 2665 | $modContract = new $obj(); |
2666 | 2666 | '@phan-var-force ModelNumRefContracts $modContract'; |
@@ -2783,7 +2783,7 @@ discard block |
||
2783 | 2783 | |
2784 | 2784 | // Load contract |
2785 | 2785 | $object = new Contrat($this->db); |
2786 | - $object->fetch($obj->rowid); // fetch also lines |
|
2786 | + $object->fetch($obj->rowid); // fetch also lines |
|
2787 | 2787 | //$object->fetch_thirdparty(); |
2788 | 2788 | |
2789 | 2789 | if ($object->id <= 0) { |
@@ -2830,7 +2830,7 @@ discard block |
||
2830 | 2830 | if ($expirationdate && $expirationdate < $enddatetoscan) { |
2831 | 2831 | dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate); |
2832 | 2832 | $newdate = $expirationdate; |
2833 | - $protecti = 0; // $protecti is to avoid infinite loop |
|
2833 | + $protecti = 0; // $protecti is to avoid infinite loop |
|
2834 | 2834 | while ($newdate < $enddatetoscan && $protecti < 1000) { |
2835 | 2835 | $newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit); |
2836 | 2836 | $protecti++; |
@@ -2858,21 +2858,21 @@ discard block |
||
2858 | 2858 | |
2859 | 2859 | // Create an event |
2860 | 2860 | $actioncomm = new ActionComm($this->db); |
2861 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2861 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
|
2862 | 2862 | $actioncomm->code = 'AC_'.$actioncode; |
2863 | 2863 | $actioncomm->label = $label; |
2864 | 2864 | $actioncomm->datep = $now; |
2865 | 2865 | $actioncomm->datef = $now; |
2866 | - $actioncomm->percentage = -1; // Not applicable |
|
2866 | + $actioncomm->percentage = -1; // Not applicable |
|
2867 | 2867 | $actioncomm->socid = $object->socid; |
2868 | - $actioncomm->authorid = $user->id; // User saving action |
|
2869 | - $actioncomm->userownerid = $user->id; // Owner of action |
|
2868 | + $actioncomm->authorid = $user->id; // User saving action |
|
2869 | + $actioncomm->userownerid = $user->id; // Owner of action |
|
2870 | 2870 | $actioncomm->fk_element = $object->id; |
2871 | 2871 | $actioncomm->elementid = $object->id; |
2872 | 2872 | $actioncomm->elementtype = 'contract'; |
2873 | 2873 | $actioncomm->note_private = $comment; |
2874 | 2874 | |
2875 | - $ret = $actioncomm->create($user); // User creating action |
|
2875 | + $ret = $actioncomm->create($user); // User creating action |
|
2876 | 2876 | } else { |
2877 | 2877 | $contracterror[$object->id] = $object->ref; |
2878 | 2878 | |
@@ -2881,7 +2881,7 @@ discard block |
||
2881 | 2881 | $this->error = $this->db->lasterror(); |
2882 | 2882 | } |
2883 | 2883 | |
2884 | - if (! $errorforlocaltransaction) { |
|
2884 | + if (!$errorforlocaltransaction) { |
|
2885 | 2885 | $this->db->commit(); |
2886 | 2886 | } else { |
2887 | 2887 | $this->db->rollback(); |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | $httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword); |
203 | 203 | } |
204 | 204 | |
205 | - $url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource; |
|
205 | + $url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource; |
|
206 | 206 | |
207 | 207 | $options['apikey'] = $this->dolistore_api_key; |
208 | 208 | |
209 | 209 | if ($options) { |
210 | - $url .= '?' . http_build_query($options); |
|
210 | + $url .= '?'.http_build_query($options); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $url .= (preg_match('/\?/', $url) ? '&' : '?').'apikey='.$this->dolistore_api_key; |
@@ -235,13 +235,13 @@ discard block |
||
235 | 235 | $modules = array(); |
236 | 236 | |
237 | 237 | if (!empty($this->cache_file) && file_exists($this->cache_file)) { |
238 | - dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG); |
|
238 | + dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG); |
|
239 | 239 | |
240 | 240 | $content = file_get_contents($this->cache_file); |
241 | 241 | if ($content !== false) { |
242 | 242 | $modules = $this->readYaml($content); |
243 | 243 | } else { |
244 | - dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR); |
|
244 | + dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -269,20 +269,20 @@ discard block |
||
269 | 269 | if (isset($resCategories['response']) && is_array($resCategories['response'])) { |
270 | 270 | $organized_tree = $resCategories['response']; |
271 | 271 | } else { |
272 | - return $html ; |
|
272 | + return $html; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | $html = ''; |
276 | 276 | foreach ($organized_tree as $key => $value) { |
277 | 277 | if ($value['label'] != "Versions" && $value['label'] != "Specials") { |
278 | - $html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>'; |
|
279 | - $html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>'; |
|
278 | + $html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>'; |
|
279 | + $html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>'; |
|
280 | 280 | if (isset($value['children'])) { |
281 | 281 | $html .= '<ul>'; |
282 | 282 | usort($value['children'], $this->buildSorter('position')); |
283 | 283 | foreach ($value['children'] as $key_children => $value_children) { |
284 | - $html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>'; |
|
285 | - $html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>'; |
|
284 | + $html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>'; |
|
285 | + $html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>'; |
|
286 | 286 | $html .= '</li>'; |
287 | 287 | } |
288 | 288 | $html .= '</ul>'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | $html = ""; |
306 | 306 | $last_month = dol_now() - (30 * 24 * 60 * 60); |
307 | - $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
307 | + $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
308 | 308 | |
309 | 309 | $this->products = array(); |
310 | 310 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $this->no_page = $options['no_page'] ?? 1; |
314 | 314 | $this->search = $options['search'] ?? ''; |
315 | 315 | |
316 | - $this->per_page = 11; // We fix number of products per page to 11 |
|
316 | + $this->per_page = 11; // We fix number of products per page to 11 |
|
317 | 317 | |
318 | 318 | // Length of $search must be at least 2 characters |
319 | 319 | if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $fileProducts = array(); |
355 | 355 | $fileProductsTotal = 0; |
356 | 356 | if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { |
357 | - $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
357 | + $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
358 | 358 | |
359 | 359 | $fileProducts = $this->adaptData($fileProducts, 'githubcommunity'); |
360 | 360 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @param array<string, mixed> $b Second product for comparison. |
384 | 384 | * @return int |
385 | 385 | */ |
386 | - static function ($a, $b) { |
|
386 | + static function($a, $b) { |
|
387 | 387 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
388 | 388 | } |
389 | 389 | ); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | if ($product['source'] === 'githubcommunity') { |
423 | 423 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$product["link"].'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
424 | 424 | if (!empty($product['direct-download']) && $product['direct-download'] == 'yes') { |
425 | - $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
425 | + $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
426 | 426 | $reg = array(); |
427 | 427 | if (preg_match('/https:.*\?id=(\d+)$/', $urldownload, $reg)) { |
428 | 428 | $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$reg[1]; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | } |
433 | 433 | |
434 | 434 | if ($product['source'] === 'dolistore') { |
435 | - $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id']; |
|
435 | + $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id']; |
|
436 | 436 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
437 | 437 | $download_link .= '<a class="paddingleft paddingright" target="_blank" href="'.$urldownload.'" rel="noopener noreferrer"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/Download-128.png" /></a>'; |
438 | 438 | } |
@@ -474,12 +474,12 @@ discard block |
||
474 | 474 | //output template |
475 | 475 | $html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">'; |
476 | 476 | $html .= '<td class="center" width="160"><div class="newAppParent">'; |
477 | - $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
477 | + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
478 | 478 | $html .= '</div></td>'; |
479 | 479 | $html .= '<td class="margeCote"><h2 class="appTitle">'; |
480 | 480 | $html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"])); |
481 | 481 | $html .= '<br><small>'; |
482 | - $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
482 | + $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
483 | 483 | $html .= '</small></h2>'; |
484 | 484 | $html .= '<small> '; |
485 | 485 | if (empty($product['tms'])) { |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | |
513 | 513 | $this->numberOfProducts = count($this->products); |
514 | 514 | |
515 | - return $html ; |
|
515 | + return $html; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | /** |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * @param array<string, mixed> $b |
530 | 530 | * @return int |
531 | 531 | */ |
532 | - function (array $a, array $b) use ($key) { |
|
532 | + function(array $a, array $b) use ($key) { |
|
533 | 533 | $valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : ''; |
534 | 534 | $valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : ''; |
535 | 535 | |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $pagelist .= '<li class="pagination">'; |
683 | 683 | $pagelist .= '<label for="page_input">Page </label>'; |
684 | 684 | if ($this->categorie != 0) { |
685 | - $pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">'; |
|
685 | + $pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">'; |
|
686 | 686 | } |
687 | 687 | $pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">'; |
688 | 688 | $pagelist .= ' / '.$nbpages; |
@@ -732,12 +732,12 @@ discard block |
||
732 | 732 | } |
733 | 733 | |
734 | 734 | // Get the predefined error message or use a default one |
735 | - $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code']; |
|
735 | + $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code']; |
|
736 | 736 | |
737 | 737 | // Append error details if available |
738 | 738 | if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) { |
739 | 739 | foreach ($request['response']['errors'] as $error) { |
740 | - $error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message']; |
|
740 | + $error_message .= ' - (Code '.$error['code'].'): '.$error['message']; |
|
741 | 741 | } |
742 | 742 | } |
743 | 743 | |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | * |
964 | 964 | * @return int |
965 | 965 | */ |
966 | - static function ($a, $b) { |
|
966 | + static function($a, $b) { |
|
967 | 967 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
968 | 968 | } |
969 | 969 | ); |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | * |
979 | 979 | * @return bool |
980 | 980 | */ |
981 | - static function ($package) use ($options) { |
|
981 | + static function($package) use ($options) { |
|
982 | 982 | return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false; |
983 | 983 | } |
984 | 984 | ); |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | * |
995 | 995 | * @return bool |
996 | 996 | */ |
997 | - static function ($package) use ($options) { |
|
997 | + static function($package) use ($options) { |
|
998 | 998 | return in_array($options['categorieid'], $package['category']); |
999 | 999 | } |
1000 | 1000 | ); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); |
88 | 88 | $options['search'] = GETPOST('search_keyword', 'alpha'); |
89 | 89 | |
90 | -$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE'); |
|
91 | -$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY'); |
|
90 | +$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE'); |
|
91 | +$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY'); |
|
92 | 92 | |
93 | 93 | //$remotestore = new Dolistore(false); |
94 | 94 | $remotestore = new ExternalModules(); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | //var_dump($modulenamearrays);exit; |
318 | 318 | |
319 | 319 | // Lop on each packages (can have several if package is a metapackage) |
320 | - if (! $error) { |
|
320 | + if (!$error) { |
|
321 | 321 | foreach ($modulenamearrays as $modulenameval) { |
322 | 322 | if (strpos($modulenameval, '#') === 0) { |
323 | 323 | continue; // Discard comments |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | 'search_version' => '-1' |
387 | 387 | ); |
388 | 388 | $queryString = http_build_query($searchParams); |
389 | - $redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString; |
|
389 | + $redirectUrl = DOL_URL_ROOT.'/admin/modules.php?'.$queryString; |
|
390 | 390 | |
391 | 391 | $message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")); |
392 | 392 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } else { |
588 | 588 | $familykey = $objMod->family; |
589 | 589 | } |
590 | - '@phan-var-force string $familykey'; // if not, phan considers $familykey may be null |
|
590 | + '@phan-var-force string $familykey'; // if not, phan considers $familykey may be null |
|
591 | 591 | |
592 | 592 | $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); |
593 | 593 | if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) { |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); |
694 | 694 | |
695 | 695 | // Start to show page |
696 | -$deschelp = ''; |
|
696 | +$deschelp = ''; |
|
697 | 697 | if ($mode == 'common' || $mode == 'commonkanban') { |
698 | 698 | $desc = $langs->trans("ModulesDesc", '{picto}'); |
699 | 699 | $desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}'); |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | } |
981 | 981 | |
982 | 982 | if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) { |
983 | - $checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law |
|
983 | + $checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law |
|
984 | 984 | if (!is_numeric($checkRes) && $checkRes != '') { |
985 | 985 | $langs->load("errors"); |
986 | 986 | setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors'); |
@@ -1328,7 +1328,7 @@ discard block |
||
1328 | 1328 | |
1329 | 1329 | print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>'; |
1330 | 1330 | |
1331 | - $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories |
|
1331 | + $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories |
|
1332 | 1332 | |
1333 | 1333 | $products_list = $remotestore->getProducts($options); |
1334 | 1334 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
44 | 44 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
45 | 45 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
46 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
46 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
47 | 47 | if (isModEnabled('invoice')) { |
48 | 48 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
49 | 49 | require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | if ($action == 'update_extras' && $user->hasRight('societe', 'creer')) { |
305 | 305 | $object->fetch($id); |
306 | 306 | |
307 | - $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
307 | + $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
308 | 308 | |
309 | 309 | // Fill array 'array_options' with data from update form |
310 | 310 | $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | if ($object->accountancy_code_customer_general > 0) { |
408 | 408 | print ' - '; |
409 | 409 | } |
410 | - $accountingAccountByDefault = '<span class="opacitymedium">' . $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')) . '</span>'; |
|
410 | + $accountingAccountByDefault = '<span class="opacitymedium">'.$langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).'</span>'; |
|
411 | 411 | print $accountingAccountByDefault; |
412 | 412 | } |
413 | 413 | } |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | print '<td class="nowraponall">'; |
916 | 916 | $propal_static->id = $objp->propalid; |
917 | 917 | $propal_static->ref = $objp->ref; |
918 | - $propal_static->ref_client = $objp->ref_client; // deprecated |
|
918 | + $propal_static->ref_client = $objp->ref_client; // deprecated |
|
919 | 919 | $propal_static->ref_customer = $objp->ref_client; |
920 | 920 | $propal_static->fk_project = $objp->fk_projet; |
921 | 921 | $propal_static->total_ht = $objp->total_ht; |