@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); |
96 | 96 | $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); |
97 | 97 | |
98 | -$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
98 | +$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
99 | 99 | $pastmonthyear = null; |
100 | 100 | |
101 | 101 | if (empty($date_startmonth)) { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $tabpay[$obj->rowid] = array( |
171 | 171 | 'id' => $obj->rowid, |
172 | 172 | 'date' => $db->jdate($obj->do), |
173 | - 'type_payment' => $obj->fk_type,// CHQ, VIR, LIQ, CB, ... |
|
173 | + 'type_payment' => $obj->fk_type, // CHQ, VIR, LIQ, CB, ... |
|
174 | 174 | 'ref' => $obj->label, // by default, not unique. May be changed later |
175 | 175 | 'fk_bank_account' => $obj->fk_account, |
176 | 176 | 'objects' => array(), |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $sql .= " AND fd.product_type IN (0,1)"; |
232 | 232 | $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".(!getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS') ? Facture::TYPE_DEPOSIT."," : "").Facture::TYPE_SITUATION.")"; |
233 | 233 | $sql .= " AND bu.fk_bank IN (".$db->sanitize(implode(',', $ids)).")"; |
234 | - $sql .= " GROUP BY fd.rowid, bu.fk_bank, pf.amount, bu.url_id"; // TODO Must never have a GROUP BY on a field if field is not inside an aggregate function. |
|
234 | + $sql .= " GROUP BY fd.rowid, bu.fk_bank, pf.amount, bu.url_id"; // TODO Must never have a GROUP BY on a field if field is not inside an aggregate function. |
|
235 | 235 | $sql .= " ORDER BY aa.account_number"; |
236 | 236 | |
237 | 237 | $resql = $db->query($sql); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $static_invoice->ref = $obj->ref; |
268 | 268 | $tabobject[$object_key] = array( |
269 | 269 | 'id' => $obj->rowid, |
270 | - 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
270 | + 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
271 | 271 | 'total_ht' => $obj->invoice_total_ht, |
272 | 272 | 'total_ttc' => $obj->invoice_total_ttc, |
273 | 273 | 'url' => $static_invoice->getNomUrl(1), |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $static_supplier_invoice->ref = $obj->ref; |
381 | 381 | $tabobject[$object_key] = array( |
382 | 382 | 'id' => $obj->rowid, |
383 | - 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
383 | + 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
384 | 384 | 'total_ht' => -$obj->supplier_invoice_total_ht, |
385 | 385 | 'total_ttc' => -$obj->supplier_invoice_total_ttc, |
386 | 386 | 'url' => $static_supplier_invoice->getNomUrl(1), |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | } else { |
914 | 914 | $sql .= " LEFT JOIN ".$db->prefix()."accounting_bookkeeping as ab ON ab.fk_doc=bu.fk_bank AND ab.fk_docdet=pv.rowid"; |
915 | 915 | } |
916 | - $sql .= " WHERE pv.entity IN (".getEntity('payment_various', 0).')'; // We don't share object for accountancy, we use source object sharing |
|
916 | + $sql .= " WHERE pv.entity IN (".getEntity('payment_various', 0).')'; // We don't share object for accountancy, we use source object sharing |
|
917 | 917 | $sql .= " AND bu.fk_bank IN (".$db->sanitize(implode(',', $ids)).")"; |
918 | 918 | // Not already in bookkeeping |
919 | 919 | if ($in_bookkeeping == 'notyet') { |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | $error++; |
1304 | 1304 | |
1305 | 1305 | if ($error >= $MAXNBERRORS) { |
1306 | - break; // Break in the foreach |
|
1306 | + break; // Break in the foreach |
|
1307 | 1307 | } |
1308 | 1308 | } |
1309 | 1309 | } |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | $MAXNBERRORS = 5; |
1318 | 1318 | if ($error >= $MAXNBERRORS) { |
1319 | 1319 | setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors'); |
1320 | - break; // Break in the foreach |
|
1320 | + break; // Break in the foreach |
|
1321 | 1321 | } |
1322 | 1322 | } |
1323 | 1323 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); |
122 | 122 | $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); |
123 | 123 | |
124 | -$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
124 | +$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
125 | 125 | $pastmonthyear = null; |
126 | 126 | |
127 | 127 | if (empty($date_startmonth)) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $sql .= " LEFT JOIN ".$db->prefix()."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'"; |
172 | 172 | $sql .= " LEFT JOIN ".$db->prefix()."societe as soc on bu1.url_id=soc.rowid"; |
173 | 173 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
174 | - $sql .= " LEFT JOIN " . $db->prefix() . "societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = " . ((int) $conf->entity); |
|
174 | + $sql .= " LEFT JOIN ".$db->prefix()."societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = ".((int) $conf->entity); |
|
175 | 175 | } |
176 | 176 | $sql .= " LEFT JOIN ".$db->prefix()."user as u on bu2.url_id=u.rowid"; |
177 | 177 | $sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal); |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | if ($mt) { |
701 | 701 | if (empty($conf->cache['accountingaccountincurrententity'][$k])) { |
702 | 702 | $accountingaccount = new AccountingAccount($db); |
703 | - $accountingaccount->fetch(0, $k, true); // $k is accounting account of the bank. |
|
703 | + $accountingaccount->fetch(0, $k, true); // $k is accounting account of the bank. |
|
704 | 704 | $conf->cache['accountingaccountincurrententity'][$k] = $accountingaccount; |
705 | 705 | } else { |
706 | 706 | $accountingaccount = $conf->cache['accountingaccountincurrententity'][$k]; |
@@ -821,43 +821,43 @@ discard block |
||
821 | 821 | } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution |
822 | 822 | $bookkeeping->subledger_account = ''; |
823 | 823 | $bookkeeping->subledger_label = ''; |
824 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
824 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
825 | 825 | $bookkeeping->numero_compte = $k; |
826 | 826 | $bookkeeping->label_compte = $accountingaccount->label; |
827 | 827 | } elseif ($tabtype[$key] == 'payment_vat') { |
828 | 828 | $bookkeeping->subledger_account = ''; |
829 | 829 | $bookkeeping->subledger_label = ''; |
830 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
830 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
831 | 831 | $bookkeeping->numero_compte = $k; |
832 | 832 | $bookkeeping->label_compte = $accountingaccount->label; |
833 | 833 | } elseif ($tabtype[$key] == 'payment_donation') { |
834 | 834 | $bookkeeping->subledger_account = ''; |
835 | 835 | $bookkeeping->subledger_label = ''; |
836 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
836 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
837 | 837 | $bookkeeping->numero_compte = $k; |
838 | 838 | $bookkeeping->label_compte = $accountingaccount->label; |
839 | 839 | } elseif ($tabtype[$key] == 'member') { |
840 | 840 | $bookkeeping->subledger_account = ''; |
841 | 841 | $bookkeeping->subledger_label = ''; |
842 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
842 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
843 | 843 | $bookkeeping->numero_compte = $k; |
844 | 844 | $bookkeeping->label_compte = $accountingaccount->label; |
845 | 845 | } elseif ($tabtype[$key] == 'payment_loan') { |
846 | 846 | $bookkeeping->subledger_account = ''; |
847 | 847 | $bookkeeping->subledger_label = ''; |
848 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
848 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
849 | 849 | $bookkeeping->numero_compte = $k; |
850 | 850 | $bookkeeping->label_compte = $accountingaccount->label; |
851 | 851 | } elseif ($tabtype[$key] == 'payment_various') { |
852 | 852 | $bookkeeping->subledger_account = $k; |
853 | 853 | $bookkeeping->subledger_label = $tabcompany[$key]['name']; |
854 | - $accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
854 | + $accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
855 | 855 | $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; |
856 | 856 | $bookkeeping->label_compte = $accountingaccount->label; |
857 | 857 | } elseif ($tabtype[$key] == 'banktransfert') { |
858 | 858 | $bookkeeping->subledger_account = ''; |
859 | 859 | $bookkeeping->subledger_label = ''; |
860 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
860 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache |
|
861 | 861 | $bookkeeping->numero_compte = $k; |
862 | 862 | $bookkeeping->label_compte = $accountingaccount->label; |
863 | 863 | } else { |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | } |
889 | 889 | } else { |
890 | 890 | if ($lettering && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
891 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; |
|
891 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; |
|
892 | 892 | $lettering_static = new Lettering($db); |
893 | 893 | $nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id)); |
894 | 894 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | 1 => $langs->trans("TransfertAllBankLines"), |
1150 | 1150 | 2 => $langs->trans("TransfertOnlyConciliatedBankLine") |
1151 | 1151 | ); |
1152 | - $moreoptions = [ "BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)]; |
|
1152 | + $moreoptions = ["BankLineConciliated" => $form->selectarray('only_rappro', $listofchoices, $only_rappro)]; |
|
1153 | 1153 | |
1154 | 1154 | journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink, $moreoptions); |
1155 | 1155 | |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | |
1310 | 1310 | // Label operation |
1311 | 1311 | print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">'; |
1312 | - print $reflabel; // This is already html escaped content |
|
1312 | + print $reflabel; // This is already html escaped content |
|
1313 | 1313 | print "</td>"; |
1314 | 1314 | |
1315 | 1315 | print '<td class="center">'.$val["type_payment"]."</td>"; |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | } |
1404 | 1404 | } |
1405 | 1405 | print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
1406 | - print $accounttoshow; // This is a HTML string |
|
1406 | + print $accounttoshow; // This is a HTML string |
|
1407 | 1407 | print "</td>"; |
1408 | 1408 | |
1409 | 1409 | // Subledger account |
@@ -1431,12 +1431,12 @@ discard block |
||
1431 | 1431 | } |
1432 | 1432 | } |
1433 | 1433 | print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp" title="'.dolPrintHTMLForAttribute(dol_string_nohtmltag($accounttoshowsubledger)).'">'; |
1434 | - print $accounttoshowsubledger; // This is a html string |
|
1434 | + print $accounttoshowsubledger; // This is a html string |
|
1435 | 1435 | print "</td>"; |
1436 | 1436 | |
1437 | 1437 | // Label operation |
1438 | 1438 | print '<td class="nopaddingtopimpo paddingbottomimp">'; |
1439 | - print $reflabel; // This is a html string |
|
1439 | + print $reflabel; // This is a html string |
|
1440 | 1440 | print "</td>"; |
1441 | 1441 | |
1442 | 1442 | print '<td class="center">'.$val["type_payment"]."</td>"; |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "orders", "bills")); |
52 | 52 | |
53 | 53 | // Get Parameters |
54 | -$action = GETPOST('action', 'aZ09'); |
|
54 | +$action = GETPOST('action', 'aZ09'); |
|
55 | 55 | $massaction = GETPOST('massaction', 'alpha'); |
56 | -$confirm = GETPOST('confirm', 'alpha'); |
|
56 | +$confirm = GETPOST('confirm', 'alpha'); |
|
57 | 57 | $cancel = GETPOST('cancel', 'alpha'); |
58 | -$toselect = GETPOST('toselect', 'array'); |
|
58 | +$toselect = GETPOST('toselect', 'array'); |
|
59 | 59 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search |
60 | 60 | $optioncss = GETPOST('optioncss', 'alpha'); |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $mode = GETPOST('mode', 'aZ09'); |
66 | 66 | if (empty($mode) && preg_match('/show_/', $action)) { |
67 | - $mode = $action; // For backward compatibility |
|
67 | + $mode = $action; // For backward compatibility |
|
68 | 68 | } |
69 | 69 | $resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); |
70 | 70 | $pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | if (isModEnabled('category') && $user->hasRight('agenda', 'myactions', 'create')) { |
422 | 422 | $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); |
423 | 423 | } |
424 | -if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { |
|
424 | +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { |
|
425 | 425 | $arrayofmassactions = array(); |
426 | 426 | } |
427 | 427 | $massactionbutton = $form->selectMassAction('', $arrayofmassactions); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | } else { |
500 | 500 | if (is_array($actioncode)) { |
501 | 501 | // Remove all -1 values |
502 | - $actioncode = array_filter($actioncode, function ($value) { |
|
502 | + $actioncode = array_filter($actioncode, function($value) { |
|
503 | 503 | return ((string) $value !== '-1'); |
504 | 504 | }); |
505 | 505 | if (count($actioncode)) { |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | $event_owner_style = ''; |
1009 | 1009 | // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) |
1010 | 1010 | if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color != '') { |
1011 | - $event_owner_style .= 'border-left: #' . $cache_user_list[$obj->fk_user_action]->color . ' 5px solid;'; |
|
1011 | + $event_owner_style .= 'border-left: #'.$cache_user_list[$obj->fk_user_action]->color.' 5px solid;'; |
|
1012 | 1012 | } |
1013 | 1013 | |
1014 | 1014 | // get event style for start and end date |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | } |
1044 | 1044 | $event_start_date_css = $event_end_date_css = $event_more_class; |
1045 | 1045 | |
1046 | - print '<tr class="oddeven' . ($event_more_class != '' ? ' '.$event_more_class : '') . '">'; |
|
1046 | + print '<tr class="oddeven'.($event_more_class != '' ? ' '.$event_more_class : '').'">'; |
|
1047 | 1047 | // Action column |
1048 | 1048 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
1049 | 1049 | print '<td class="nowrap center">'; |
@@ -470,11 +470,11 @@ discard block |
||
470 | 470 | * |
471 | 471 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
472 | 472 | */ |
473 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
473 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
474 | 474 | /** |
475 | 475 | * @var int|string Internal to detect deprecated access |
476 | 476 | */ |
477 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
477 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
478 | 478 | |
479 | 479 | /** |
480 | 480 | * @var int Delivery address ID |
@@ -526,12 +526,12 @@ discard block |
||
526 | 526 | /** |
527 | 527 | * @var float|string Multicurrency total localtax1 |
528 | 528 | */ |
529 | - public $multicurrency_total_localtax1; // not in database |
|
529 | + public $multicurrency_total_localtax1; // not in database |
|
530 | 530 | |
531 | 531 | /** |
532 | 532 | * @var float|string Multicurrency total localtax2 |
533 | 533 | */ |
534 | - public $multicurrency_total_localtax2; // not in database |
|
534 | + public $multicurrency_total_localtax2; // not in database |
|
535 | 535 | |
536 | 536 | /** |
537 | 537 | * @var float Multicurrency total amount including taxes (TTC = "Toutes Taxes Comprises" in French) |
@@ -1028,17 +1028,17 @@ discard block |
||
1028 | 1028 | } |
1029 | 1029 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
1030 | 1030 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
1031 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
1031 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
1032 | 1032 | } else { |
1033 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
1034 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1033 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
1034 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1035 | 1035 | $count++; |
1036 | 1036 | } |
1037 | 1037 | } |
1038 | 1038 | $data['closedivextra'] = '</div>'; |
1039 | 1039 | } |
1040 | 1040 | |
1041 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1041 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1042 | 1042 | $parameters = array( |
1043 | 1043 | 'tooltipcontentarray' => &$data, |
1044 | 1044 | 'params' => $params, |
@@ -1258,8 +1258,8 @@ discard block |
||
1258 | 1258 | |
1259 | 1259 | if ($this->restrictiononfksoc && property_exists($this, 'socid') && !empty($this->socid) && !$user->hasRight('societe', 'client', 'voir')) { |
1260 | 1260 | $sql_allowed_contacts = 'SELECT COUNT(*) as cnt FROM '.$this->db->prefix().'societe_commerciaux as sc'; |
1261 | - $sql_allowed_contacts.= ' WHERE sc.fk_soc = '.(int) $this->socid; |
|
1262 | - $sql_allowed_contacts.= ' AND sc.fk_user = '.(int) $user->id; |
|
1261 | + $sql_allowed_contacts .= ' WHERE sc.fk_soc = '.(int) $this->socid; |
|
1262 | + $sql_allowed_contacts .= ' AND sc.fk_user = '.(int) $user->id; |
|
1263 | 1263 | |
1264 | 1264 | $resql_allowed_contacts = $this->db->query($sql_allowed_contacts); |
1265 | 1265 | |
@@ -1558,7 +1558,7 @@ discard block |
||
1558 | 1558 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
1559 | 1559 | } |
1560 | 1560 | if ($status >= 0) { |
1561 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1561 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1562 | 1562 | } |
1563 | 1563 | if ($statusoflink >= 0) { |
1564 | 1564 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | } |
1948 | 1948 | |
1949 | 1949 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
1950 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1950 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1951 | 1951 | $sql .= " LIMIT 1"; |
1952 | 1952 | |
1953 | 1953 | $query = $this->db->query($sql); |
@@ -2266,9 +2266,9 @@ discard block |
||
2266 | 2266 | |
2267 | 2267 | $oldvalue = null; |
2268 | 2268 | if ($trigkey) { |
2269 | - $sql = "SELECT " . $field; |
|
2270 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
2271 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
2269 | + $sql = "SELECT ".$field; |
|
2270 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
2271 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
2272 | 2272 | |
2273 | 2273 | $resql = $this->db->query($sql); |
2274 | 2274 | if ($resql) { |
@@ -2648,7 +2648,7 @@ discard block |
||
2648 | 2648 | // Triggers |
2649 | 2649 | if (!$error && !$notrigger) { |
2650 | 2650 | // Call triggers |
2651 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
2651 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
2652 | 2652 | if ($result < 0) { |
2653 | 2653 | $error++; |
2654 | 2654 | } //Do also here what you must do to rollback action if trigger fail |
@@ -3027,7 +3027,7 @@ discard block |
||
3027 | 3027 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
3028 | 3028 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
3029 | 3029 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
3030 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'"); |
|
3030 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape((string) $deposit_percent)."'"); |
|
3031 | 3031 | } |
3032 | 3032 | $sql .= ' WHERE rowid='.((int) $this->id); |
3033 | 3033 | |
@@ -3375,10 +3375,10 @@ discard block |
||
3375 | 3375 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
3376 | 3376 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3377 | 3377 | if (!$renum) { |
3378 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
3378 | + $sql .= " AND ".$fieldposition." = 0"; |
|
3379 | 3379 | } |
3380 | 3380 | if ($renum) { |
3381 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
3381 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
3382 | 3382 | } |
3383 | 3383 | |
3384 | 3384 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3399,7 +3399,7 @@ discard block |
||
3399 | 3399 | if ($fk_parent_line) { |
3400 | 3400 | $sql .= ' AND fk_parent_line IS NULL'; |
3401 | 3401 | } |
3402 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
3402 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
3403 | 3403 | |
3404 | 3404 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
3405 | 3405 | $resql = $this->db->query($sql); |
@@ -3453,7 +3453,7 @@ discard block |
||
3453 | 3453 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3454 | 3454 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3455 | 3455 | $sql .= ' AND fk_parent_line = '.((int) $id); |
3456 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
3456 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
3457 | 3457 | |
3458 | 3458 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
3459 | 3459 | |
@@ -3577,7 +3577,7 @@ discard block |
||
3577 | 3577 | |
3578 | 3578 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3579 | 3579 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3580 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
3580 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
3581 | 3581 | if ($this->db->query($sql)) { |
3582 | 3582 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
3583 | 3583 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3608,7 +3608,7 @@ discard block |
||
3608 | 3608 | |
3609 | 3609 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3610 | 3610 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3611 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
3611 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
3612 | 3612 | if ($this->db->query($sql)) { |
3613 | 3613 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
3614 | 3614 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3634,7 +3634,7 @@ discard block |
||
3634 | 3634 | $fieldposition = 'position'; |
3635 | 3635 | } |
3636 | 3636 | |
3637 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
3637 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
3638 | 3638 | $sql .= " WHERE rowid = ".((int) $rowid); |
3639 | 3639 | |
3640 | 3640 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3662,7 +3662,7 @@ discard block |
||
3662 | 3662 | |
3663 | 3663 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3664 | 3664 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3665 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
3665 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
3666 | 3666 | $resql = $this->db->query($sql); |
3667 | 3667 | if ($resql) { |
3668 | 3668 | $row = $this->db->fetch_row($resql); |
@@ -3781,7 +3781,7 @@ discard block |
||
3781 | 3781 | $newsuffix = ''; |
3782 | 3782 | } |
3783 | 3783 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
3784 | - $fieldusermod = "fk_user_mod"; |
|
3784 | + $fieldusermod = "fk_user_mod"; |
|
3785 | 3785 | } elseif ($this->table_element == 'ecm_files') { |
3786 | 3786 | $fieldusermod = "fk_user_m"; |
3787 | 3787 | } else { |
@@ -3823,7 +3823,7 @@ discard block |
||
3823 | 3823 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
3824 | 3824 | break; |
3825 | 3825 | default: |
3826 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
3826 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
3827 | 3827 | } |
3828 | 3828 | $ret = $this->call_trigger($trigger_name, $user); |
3829 | 3829 | if ($ret < 0) { |
@@ -4121,7 +4121,7 @@ discard block |
||
4121 | 4121 | // Situations totals |
4122 | 4122 | if (!empty($this->situation_cycle_ref) && !empty($this->situation_counter) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) { // @phan-suppress-current-line PhanUndeclaredProperty |
4123 | 4123 | '@phan-var-force Facture $this'; |
4124 | - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
4124 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Note: possibly useless as $this is normally already Facture, so the class file should be loaded |
|
4125 | 4125 | if ($this->type != Facture::TYPE_CREDIT_NOTE) { // @phpstan-ignore-line |
4126 | 4126 | if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) { |
4127 | 4127 | $prev_sits = $this->get_prev_sits(); |
@@ -4247,19 +4247,19 @@ discard block |
||
4247 | 4247 | $this->db->begin(); |
4248 | 4248 | $error = 0; |
4249 | 4249 | |
4250 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4250 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4251 | 4251 | $sql .= "fk_source"; |
4252 | 4252 | $sql .= ", sourcetype"; |
4253 | 4253 | $sql .= ", fk_target"; |
4254 | 4254 | $sql .= ", targettype"; |
4255 | 4255 | $sql .= ") VALUES ("; |
4256 | 4256 | $sql .= ((int) $origin_id); |
4257 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4258 | - $sql .= ", " . ((int) $this->id); |
|
4259 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4257 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4258 | + $sql .= ", ".((int) $this->id); |
|
4259 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4260 | 4260 | $sql .= ")"; |
4261 | 4261 | |
4262 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4262 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4263 | 4263 | if ($this->db->query($sql)) { |
4264 | 4264 | if (!$notrigger) { |
4265 | 4265 | // Call trigger |
@@ -4514,20 +4514,20 @@ discard block |
||
4514 | 4514 | $this->db->begin(); |
4515 | 4515 | $error = 0; |
4516 | 4516 | |
4517 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4517 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4518 | 4518 | if ($updatesource) { |
4519 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4520 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4521 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4522 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4519 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4520 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4521 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4522 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4523 | 4523 | } elseif ($updatetarget) { |
4524 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4525 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4526 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4527 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4524 | + $sql .= "fk_target = ".((int) $targetid); |
|
4525 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4526 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4527 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4528 | 4528 | } |
4529 | 4529 | |
4530 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4530 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4531 | 4531 | if ($this->db->query($sql)) { |
4532 | 4532 | if (!$notrigger) { |
4533 | 4533 | // Call trigger |
@@ -4604,25 +4604,25 @@ discard block |
||
4604 | 4604 | } |
4605 | 4605 | |
4606 | 4606 | if (!$error) { |
4607 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4607 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4608 | 4608 | $sql .= " WHERE"; |
4609 | 4609 | if ($rowid > 0) { |
4610 | - $sql .= " rowid = " . ((int) $rowid); |
|
4610 | + $sql .= " rowid = ".((int) $rowid); |
|
4611 | 4611 | } else { |
4612 | 4612 | if ($deletesource) { |
4613 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4614 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "'"; |
|
4613 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4614 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."'"; |
|
4615 | 4615 | } elseif ($deletetarget) { |
4616 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4617 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "'"; |
|
4616 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4617 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."'"; |
|
4618 | 4618 | } else { |
4619 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($element) . "')"; |
|
4619 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($element)."')"; |
|
4620 | 4620 | $sql .= " OR"; |
4621 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($element) . "')"; |
|
4621 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($element)."')"; |
|
4622 | 4622 | } |
4623 | 4623 | } |
4624 | 4624 | |
4625 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4625 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4626 | 4626 | if (!$this->db->query($sql)) { |
4627 | 4627 | $this->error = $this->db->lasterror(); |
4628 | 4628 | $this->errors[] = $this->error; |
@@ -4787,14 +4787,14 @@ discard block |
||
4787 | 4787 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4788 | 4788 | } |
4789 | 4789 | $sql .= " WHERE rowid = ".((int) $elementId); |
4790 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4790 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4791 | 4791 | |
4792 | 4792 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4793 | 4793 | $resql = $this->db->query($sql); |
4794 | 4794 | if ($resql) { |
4795 | 4795 | $error = 0; |
4796 | 4796 | |
4797 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4797 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4798 | 4798 | |
4799 | 4799 | if ($nb_rows_affected > 0) { |
4800 | 4800 | if (empty($trigkey)) { |
@@ -4841,9 +4841,9 @@ discard block |
||
4841 | 4841 | if ($fieldstatus == 'tosell') { |
4842 | 4842 | $this->status = $status; |
4843 | 4843 | } elseif ($fieldstatus == 'tobuy') { |
4844 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4844 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4845 | 4845 | } elseif ($fieldstatus == 'tobatch') { |
4846 | - $this->status_batch = $status; // @phpstan-ignore-line |
|
4846 | + $this->status_batch = $status; // @phpstan-ignore-line |
|
4847 | 4847 | } else { |
4848 | 4848 | $this->status = $status; |
4849 | 4849 | } |
@@ -4951,7 +4951,7 @@ discard block |
||
4951 | 4951 | return -1; |
4952 | 4952 | } |
4953 | 4953 | |
4954 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4954 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4955 | 4955 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
4956 | 4956 | $tmparray = array_keys($this->childtables); |
4957 | 4957 | if (is_numeric($tmparray[0])) { |
@@ -6000,7 +6000,7 @@ discard block |
||
6000 | 6000 | } else { |
6001 | 6001 | // TODO: Try to set type above again |
6002 | 6002 | '@phan-var-force ModeleBarCode|ModeleExports|ModeleImports|ModelePDFAsset|ModelePDFContract|ModelePDFDeliveryOrder|ModelePDFEvaluation|ModelePDFFactures|ModelePDFFicheinter|ModelePDFMo|ModelePDFMovement|ModelePDFProduct|ModelePDFProjects|ModelePDFPropales|ModelePDFRecruitmentJobPosition|ModelePDFStock|ModelePDFStockTransfer|ModelePDFSupplierProposal|ModelePDFSuppliersInvoices|ModelePDFSuppliersOrders|ModelePDFSuppliersPayments|ModelePDFTask|ModelePDFTicket|ModelePDFUser|ModelePDFUserGroup|ModelePdfExpedition|ModelePdfReception|ModeleThirdPartyDoc $obj'; |
6003 | - $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument |
|
6003 | + $resultwritefile = $obj->write_file($this, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref, $moreparams); // @phan-suppress-line-PhanTypeMismatchArgument |
|
6004 | 6004 | } |
6005 | 6005 | // After call of write_file $obj->result['fullpath'] is set with generated file. It will be used to update the ECM database index. |
6006 | 6006 | |
@@ -6073,7 +6073,7 @@ discard block |
||
6073 | 6073 | $setsharekey = false; |
6074 | 6074 | if ($this->element == 'propal' || $this->element == 'proposal') { |
6075 | 6075 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
6076 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
6076 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
6077 | 6077 | } |
6078 | 6078 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
6079 | 6079 | $setsharekey = true; |
@@ -6133,7 +6133,7 @@ discard block |
||
6133 | 6133 | $ecmfile->gen_or_uploaded = 'generated'; |
6134 | 6134 | $ecmfile->description = ''; // indexed content |
6135 | 6135 | $ecmfile->keywords = ''; // keyword content |
6136 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6136 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6137 | 6137 | $ecmfile->src_object_id = $this->id; |
6138 | 6138 | |
6139 | 6139 | $result = $ecmfile->create($user); |
@@ -6285,8 +6285,8 @@ discard block |
||
6285 | 6285 | // phpcs:enable |
6286 | 6286 | global $langs, $conf; |
6287 | 6287 | |
6288 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
6289 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
6288 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
6289 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
6290 | 6290 | exit; |
6291 | 6291 | } |
6292 | 6292 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6482,7 +6482,7 @@ discard block |
||
6482 | 6482 | $savDisableCompute = $conf->disable_compute; |
6483 | 6483 | $conf->disable_compute = 1; |
6484 | 6484 | |
6485 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6485 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6486 | 6486 | |
6487 | 6487 | $conf->disable_compute = $savDisableCompute; |
6488 | 6488 | |
@@ -6544,7 +6544,7 @@ discard block |
||
6544 | 6544 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6545 | 6545 | $sql = "SELECT rowid"; |
6546 | 6546 | foreach ($optionsArray as $name => $label) { |
6547 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6547 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6548 | 6548 | $sql .= ", ".$name; |
6549 | 6549 | } |
6550 | 6550 | // use geo sql fonction to read as text |
@@ -6589,7 +6589,7 @@ discard block |
||
6589 | 6589 | **/ |
6590 | 6590 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
6591 | 6591 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
6592 | - $this->array_options['options_' . $key] = null; |
|
6592 | + $this->array_options['options_'.$key] = null; |
|
6593 | 6593 | } |
6594 | 6594 | } |
6595 | 6595 | } |
@@ -6601,9 +6601,9 @@ discard block |
||
6601 | 6601 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6602 | 6602 | //var_dump($conf->disable_compute); |
6603 | 6603 | if (empty($conf->disable_compute)) { |
6604 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6605 | - $objectoffield = $this; // we can use it inside computed formula |
|
6606 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6604 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6605 | + $objectoffield = $this; // we can use it inside computed formula |
|
6606 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6607 | 6607 | } |
6608 | 6608 | } |
6609 | 6609 | } |
@@ -6788,7 +6788,7 @@ discard block |
||
6788 | 6788 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6789 | 6789 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6790 | 6790 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6791 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6791 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6792 | 6792 | } else { |
6793 | 6793 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6794 | 6794 | } |
@@ -6799,7 +6799,7 @@ discard block |
||
6799 | 6799 | // If value has changed |
6800 | 6800 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6801 | 6801 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6802 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6802 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6803 | 6803 | } else { |
6804 | 6804 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6805 | 6805 | } |
@@ -6811,7 +6811,7 @@ discard block |
||
6811 | 6811 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6812 | 6812 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6813 | 6813 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6814 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6814 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6815 | 6815 | } else { |
6816 | 6816 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6817 | 6817 | } |
@@ -6856,9 +6856,9 @@ discard block |
||
6856 | 6856 | |
6857 | 6857 | $sqlFetchObject = "SELECT rowid FROM ".$this->db->prefix().$object->table_element; |
6858 | 6858 | if (is_numeric($value)) { |
6859 | - $sqlFetchObject .= " WHERE rowid = " . (int) $value; |
|
6859 | + $sqlFetchObject .= " WHERE rowid = ".(int) $value; |
|
6860 | 6860 | } else { |
6861 | - $sqlFetchObject .= " WHERE ref = '" . $this->db->escape($value) . "'"; |
|
6861 | + $sqlFetchObject .= " WHERE ref = '".$this->db->escape($value)."'"; |
|
6862 | 6862 | } |
6863 | 6863 | |
6864 | 6864 | $obj = $this->db->getRow($sqlFetchObject); |
@@ -7275,7 +7275,7 @@ discard block |
||
7275 | 7275 | if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
7276 | 7276 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7277 | 7277 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7278 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7278 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7279 | 7279 | } else { |
7280 | 7280 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7281 | 7281 | } |
@@ -7295,7 +7295,7 @@ discard block |
||
7295 | 7295 | } |
7296 | 7296 | } else { |
7297 | 7297 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7298 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7298 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7299 | 7299 | } else { |
7300 | 7300 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7301 | 7301 | } |
@@ -7882,7 +7882,7 @@ discard block |
||
7882 | 7882 | // 7 : sort field |
7883 | 7883 | |
7884 | 7884 | // If there is filter |
7885 | - if (! empty($InfoFieldList[4])) { |
|
7885 | + if (!empty($InfoFieldList[4])) { |
|
7886 | 7886 | $pos = 0; |
7887 | 7887 | $parenthesisopen = 0; |
7888 | 7888 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7946,8 +7946,8 @@ discard block |
||
7946 | 7946 | } |
7947 | 7947 | |
7948 | 7948 | $sqlwhere = ''; |
7949 | - $sql = "SELECT " . $keyList; |
|
7950 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7949 | + $sql = "SELECT ".$keyList; |
|
7950 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7951 | 7951 | |
7952 | 7952 | if (!empty($InfoFieldList[4])) { |
7953 | 7953 | // can use SELECT request |
@@ -7965,11 +7965,11 @@ discard block |
||
7965 | 7965 | // We have to join on extrafield table |
7966 | 7966 | $errstr = ''; |
7967 | 7967 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7968 | - $sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra"; |
|
7969 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
7970 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7968 | + $sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra"; |
|
7969 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
7970 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7971 | 7971 | } else { |
7972 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7972 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7973 | 7973 | } |
7974 | 7974 | } else { |
7975 | 7975 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7990,7 +7990,7 @@ discard block |
||
7990 | 7990 | |
7991 | 7991 | // Some tables may have field, some other not. For the moment we disable it. |
7992 | 7992 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7993 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7993 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7994 | 7994 | } |
7995 | 7995 | $sql .= $sqlwhere; |
7996 | 7996 | |
@@ -8000,10 +8000,10 @@ discard block |
||
8000 | 8000 | } else { |
8001 | 8001 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
8002 | 8002 | } |
8003 | - $sql .= ' LIMIT ' . getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
8003 | + $sql .= ' LIMIT '.getDolGlobalInt('MAIN_EXTRAFIELDS_LIMIT_SELLIST_SQL', 1000); |
|
8004 | 8004 | // print $sql; |
8005 | 8005 | |
8006 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
8006 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
8007 | 8007 | $resql = $this->db->query($sql); |
8008 | 8008 | if ($resql) { |
8009 | 8009 | $out .= '<option value="0"> </option>'; |
@@ -8019,7 +8019,7 @@ discard block |
||
8019 | 8019 | if (count($fields_label) > 1) { |
8020 | 8020 | $notrans = true; |
8021 | 8021 | foreach ($fields_label as $field_toshow) { |
8022 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
8022 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
8023 | 8023 | } |
8024 | 8024 | } else { |
8025 | 8025 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8030,12 +8030,12 @@ discard block |
||
8030 | 8030 | foreach ($fields_label as $field_toshow) { |
8031 | 8031 | $translabel = $langs->trans($obj->$field_toshow); |
8032 | 8032 | if ($translabel != $obj->$field_toshow) { |
8033 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
8033 | + $labeltoshow = dol_trunc($translabel).' '; |
|
8034 | 8034 | } else { |
8035 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
8035 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
8036 | 8036 | } |
8037 | 8037 | } |
8038 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
8038 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
8039 | 8039 | } else { |
8040 | 8040 | if (!$notrans) { |
8041 | 8041 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -8049,25 +8049,25 @@ discard block |
||
8049 | 8049 | $labeltoshow = '(not defined)'; |
8050 | 8050 | } |
8051 | 8051 | if ($value == $obj->rowid) { |
8052 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
8052 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
8053 | 8053 | } |
8054 | 8054 | |
8055 | 8055 | if (!empty($InfoFieldList[3]) && $parentField) { |
8056 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
8056 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
8057 | 8057 | $isDependList = 1; |
8058 | 8058 | } |
8059 | 8059 | |
8060 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
8060 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
8061 | 8061 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
8062 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
8063 | - $out .= '>' . $labeltoshow . '</option>'; |
|
8062 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
8063 | + $out .= '>'.$labeltoshow.'</option>'; |
|
8064 | 8064 | } |
8065 | 8065 | |
8066 | 8066 | $i++; |
8067 | 8067 | } |
8068 | 8068 | $this->db->free($resql); |
8069 | 8069 | } else { |
8070 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
8070 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
8071 | 8071 | } |
8072 | 8072 | } else { |
8073 | 8073 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
@@ -8078,9 +8078,9 @@ discard block |
||
8078 | 8078 | $data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
8079 | 8079 | $out .= '<option value="0"> </option>'; |
8080 | 8080 | foreach ($data as $data_key => $data_value) { |
8081 | - $out .= '<option value="' . $data_key . '"'; |
|
8081 | + $out .= '<option value="'.$data_key.'"'; |
|
8082 | 8082 | $out .= ($value == $data_key ? ' selected' : ''); |
8083 | - $out .= '>' . $data_value . '</option>'; |
|
8083 | + $out .= '>'.$data_value.'</option>'; |
|
8084 | 8084 | } |
8085 | 8085 | } |
8086 | 8086 | } |
@@ -8120,7 +8120,7 @@ discard block |
||
8120 | 8120 | // 7 : sort field |
8121 | 8121 | |
8122 | 8122 | // If there is a filter |
8123 | - if (! empty($InfoFieldList[4])) { |
|
8123 | + if (!empty($InfoFieldList[4])) { |
|
8124 | 8124 | $pos = 0; |
8125 | 8125 | $parenthesisopen = 0; |
8126 | 8126 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -8186,8 +8186,8 @@ discard block |
||
8186 | 8186 | } |
8187 | 8187 | |
8188 | 8188 | $sqlwhere = ''; |
8189 | - $sql = "SELECT " . $keyList; |
|
8190 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
8189 | + $sql = "SELECT ".$keyList; |
|
8190 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
8191 | 8191 | |
8192 | 8192 | if (!empty($InfoFieldList[4])) { |
8193 | 8193 | // can use SELECT request |
@@ -8205,11 +8205,11 @@ discard block |
||
8205 | 8205 | // We have to join on extrafield table |
8206 | 8206 | $errstr = ''; |
8207 | 8207 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
8208 | - $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; |
|
8209 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
8210 | - $sqlwhere .= " AND " . $InfoFieldList[4]; |
|
8208 | + $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
|
8209 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
8210 | + $sqlwhere .= " AND ".$InfoFieldList[4]; |
|
8211 | 8211 | } else { |
8212 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
8212 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
8213 | 8213 | } |
8214 | 8214 | } else { |
8215 | 8215 | $sqlwhere .= ' WHERE 1=1'; |
@@ -8230,14 +8230,14 @@ discard block |
||
8230 | 8230 | |
8231 | 8231 | // Some tables may have field, some other not. For the moment we disable it. |
8232 | 8232 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
8233 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
8233 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
8234 | 8234 | } |
8235 | 8235 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
8236 | 8236 | // print $sql; |
8237 | 8237 | |
8238 | 8238 | $sql .= $sqlwhere; |
8239 | 8239 | |
8240 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
8240 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
8241 | 8241 | |
8242 | 8242 | $resql = $this->db->query($sql); |
8243 | 8243 | if ($resql) { |
@@ -8256,7 +8256,7 @@ discard block |
||
8256 | 8256 | if (count($fields_label) > 1) { |
8257 | 8257 | $notrans = true; |
8258 | 8258 | foreach ($fields_label as $field_toshow) { |
8259 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
8259 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
8260 | 8260 | } |
8261 | 8261 | } else { |
8262 | 8262 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8267,9 +8267,9 @@ discard block |
||
8267 | 8267 | foreach ($fields_label as $field_toshow) { |
8268 | 8268 | $translabel = $langs->trans($obj->$field_toshow); |
8269 | 8269 | if ($translabel != $obj->$field_toshow) { |
8270 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
8270 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
8271 | 8271 | } else { |
8272 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
8272 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
8273 | 8273 | } |
8274 | 8274 | } |
8275 | 8275 | |
@@ -8292,7 +8292,7 @@ discard block |
||
8292 | 8292 | } |
8293 | 8293 | |
8294 | 8294 | if (!empty($InfoFieldList[3]) && $parentField) { |
8295 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
8295 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
8296 | 8296 | $isDependList = 1; |
8297 | 8297 | } |
8298 | 8298 | |
@@ -8303,9 +8303,9 @@ discard block |
||
8303 | 8303 | } |
8304 | 8304 | $this->db->free($resql); |
8305 | 8305 | |
8306 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8306 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8307 | 8307 | } else { |
8308 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
8308 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
8309 | 8309 | } |
8310 | 8310 | } else { |
8311 | 8311 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
@@ -8314,7 +8314,7 @@ discard block |
||
8314 | 8314 | $categcode = Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]]; |
8315 | 8315 | } |
8316 | 8316 | $data = $form->select_all_categories($categcode, '', 'parent', 64, $InfoFieldList[6], 1, 1); |
8317 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8317 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8318 | 8318 | } |
8319 | 8319 | } |
8320 | 8320 | } elseif ($type == 'link') { |
@@ -8349,7 +8349,7 @@ discard block |
||
8349 | 8349 | // $val is already the record field found at same place than found by $valparent but already loaded and may have been modified by parent caller. |
8350 | 8350 | |
8351 | 8351 | //$objectfield = $valparent; |
8352 | - $objectfield = $val; // Is better than using old method $valparent |
|
8352 | + $objectfield = $val; // Is better than using old method $valparent |
|
8353 | 8353 | |
8354 | 8354 | // @phan-suppress-next-line PhanTypeMismatchArgumentNullable |
8355 | 8355 | $out = $form->selectForForms($param_list_array[0], $keyprefix.$key.$keysuffix, (int) $value, $showempty, '', '', $morecss, $moreparam, 0, (empty($val['disabled']) ? 0 : 1), '', $objectfield); |
@@ -8562,7 +8562,7 @@ discard block |
||
8562 | 8562 | $value = $this->getLibStatut(3); |
8563 | 8563 | } elseif ($type == 'date') { |
8564 | 8564 | if (!empty($value)) { |
8565 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8565 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8566 | 8566 | } else { |
8567 | 8567 | $value = ''; |
8568 | 8568 | } |
@@ -8663,7 +8663,7 @@ discard block |
||
8663 | 8663 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8664 | 8664 | if (strpos($value, "|") !== false) { |
8665 | 8665 | $value = $langs->trans(explode('|', $value)[0]); |
8666 | - } elseif (! is_numeric($value)) { |
|
8666 | + } elseif (!is_numeric($value)) { |
|
8667 | 8667 | $value = $langs->trans($value); |
8668 | 8668 | } |
8669 | 8669 | } elseif ($type == 'sellist') { |
@@ -8725,9 +8725,9 @@ discard block |
||
8725 | 8725 | $translabel = $langs->trans($obj->$field_toshow); |
8726 | 8726 | } |
8727 | 8727 | if ($translabel != $field_toshow) { |
8728 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8728 | + $value .= dol_trunc($translabel, 18).' '; |
|
8729 | 8729 | } else { |
8730 | - $value .= $obj->$field_toshow . ' '; |
|
8730 | + $value .= $obj->$field_toshow.' '; |
|
8731 | 8731 | } |
8732 | 8732 | } |
8733 | 8733 | } else { |
@@ -8743,7 +8743,7 @@ discard block |
||
8743 | 8743 | } |
8744 | 8744 | } |
8745 | 8745 | } else { |
8746 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8746 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8747 | 8747 | |
8748 | 8748 | $toprint = array(); |
8749 | 8749 | $obj = $this->db->fetch_object($resql); |
@@ -8751,7 +8751,7 @@ discard block |
||
8751 | 8751 | $c->fetch($obj->rowid); |
8752 | 8752 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8753 | 8753 | foreach ($ways as $way) { |
8754 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8754 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8755 | 8755 | } |
8756 | 8756 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8757 | 8757 | } |
@@ -8767,11 +8767,11 @@ discard block |
||
8767 | 8767 | $toprint = array(); |
8768 | 8768 | foreach ($value_arr as $keyval => $valueval) { |
8769 | 8769 | if (!empty($valueval)) { |
8770 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8770 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8771 | 8771 | } |
8772 | 8772 | } |
8773 | 8773 | if (!empty($toprint)) { |
8774 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8774 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8775 | 8775 | } |
8776 | 8776 | } |
8777 | 8777 | } elseif ($type == 'chkbxlst') { |
@@ -8826,9 +8826,9 @@ discard block |
||
8826 | 8826 | $translabel = $langs->trans($obj->$field_toshow); |
8827 | 8827 | } |
8828 | 8828 | if ($translabel != $field_toshow) { |
8829 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8829 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8830 | 8830 | } else { |
8831 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8831 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8832 | 8832 | } |
8833 | 8833 | } |
8834 | 8834 | } else { |
@@ -8837,15 +8837,15 @@ discard block |
||
8837 | 8837 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8838 | 8838 | } |
8839 | 8839 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8840 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8840 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8841 | 8841 | } else { |
8842 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8842 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8843 | 8843 | } |
8844 | 8844 | } |
8845 | 8845 | } |
8846 | 8846 | } |
8847 | 8847 | } else { |
8848 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8848 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8849 | 8849 | |
8850 | 8850 | $toprint = array(); |
8851 | 8851 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8854,7 +8854,7 @@ discard block |
||
8854 | 8854 | $c->fetch($obj->rowid); |
8855 | 8855 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8856 | 8856 | foreach ($ways as $way) { |
8857 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8857 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8858 | 8858 | } |
8859 | 8859 | } |
8860 | 8860 | } |
@@ -9024,7 +9024,7 @@ discard block |
||
9024 | 9024 | global $langs; |
9025 | 9025 | |
9026 | 9026 | if (!class_exists('Validate')) { |
9027 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
9027 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
9028 | 9028 | } |
9029 | 9029 | |
9030 | 9030 | $this->clearFieldError($fieldKey); |
@@ -9263,7 +9263,7 @@ discard block |
||
9263 | 9263 | $out .= "\n"; |
9264 | 9264 | |
9265 | 9265 | $nbofextrafieldsshown = 0; |
9266 | - $e = 0; // var to manage the modulo (odd/even) |
|
9266 | + $e = 0; // var to manage the modulo (odd/even) |
|
9267 | 9267 | |
9268 | 9268 | $lastseparatorkeyfound = ''; |
9269 | 9269 | $extrafields_collapse_num = ''; |
@@ -9301,9 +9301,9 @@ discard block |
||
9301 | 9301 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list |
9302 | 9302 | } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) { |
9303 | 9303 | // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost |
9304 | - $ef_name = 'options_' . $key; |
|
9304 | + $ef_name = 'options_'.$key; |
|
9305 | 9305 | $ef_value = $this->array_options[$ef_name]; |
9306 | - $out .= '<input type="hidden" name="' . $ef_name . '" id="' . $ef_name . '" value="' . $ef_value . '" />' . "\n"; |
|
9306 | + $out .= '<input type="hidden" name="'.$ef_name.'" id="'.$ef_name.'" value="'.$ef_value.'" />'."\n"; |
|
9307 | 9307 | continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation |
9308 | 9308 | } elseif ($mode == 'view' && empty($visibility)) { |
9309 | 9309 | continue; |
@@ -10381,7 +10381,7 @@ discard block |
||
10381 | 10381 | continue; |
10382 | 10382 | } |
10383 | 10383 | } |
10384 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
10384 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
10385 | 10385 | } |
10386 | 10386 | return implode(', ', $keys_with_alias); |
10387 | 10387 | } else { |
@@ -10522,7 +10522,7 @@ discard block |
||
10522 | 10522 | if (!$error) { |
10523 | 10523 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
10524 | 10524 | $sql .= " (".implode(", ", $keys).')'; |
10525 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10525 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10526 | 10526 | |
10527 | 10527 | $res = $this->db->query($sql); |
10528 | 10528 | if (!$res) { |
@@ -10834,7 +10834,7 @@ discard block |
||
10834 | 10834 | |
10835 | 10835 | // Update extrafield |
10836 | 10836 | if (!$error) { |
10837 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10837 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10838 | 10838 | if ($result < 0) { |
10839 | 10839 | $error++; |
10840 | 10840 | } |
@@ -11036,12 +11036,12 @@ discard block |
||
11036 | 11036 | $error++; |
11037 | 11037 | } else { |
11038 | 11038 | while ($obj = $this->db->fetch_object($resql)) { |
11039 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
11039 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
11040 | 11040 | if ($result < 0) { |
11041 | 11041 | $error++; |
11042 | 11042 | $this->errors[] = $this->error; |
11043 | 11043 | } else { |
11044 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
11044 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
11045 | 11045 | if ($result < 0) { |
11046 | 11046 | $error++; |
11047 | 11047 | $this->errors[] = $this->error; |
@@ -11207,7 +11207,7 @@ discard block |
||
11207 | 11207 | ); |
11208 | 11208 | foreach ($fields as $key => $value) { |
11209 | 11209 | if (array_key_exists($key, $this->fields)) { |
11210 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
11210 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
11211 | 11211 | } |
11212 | 11212 | } |
11213 | 11213 |