@@ -476,11 +476,11 @@ discard block |
||
476 | 476 | * |
477 | 477 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
478 | 478 | */ |
479 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
479 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
480 | 480 | /** |
481 | 481 | * @var int|string Internal to detect deprecated access |
482 | 482 | */ |
483 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
483 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
484 | 484 | |
485 | 485 | /** |
486 | 486 | * @var int Delivery address ID |
@@ -537,12 +537,12 @@ discard block |
||
537 | 537 | /** |
538 | 538 | * @var float Multicurrency total localta1 |
539 | 539 | */ |
540 | - public $multicurrency_total_localtax1; // not in database |
|
540 | + public $multicurrency_total_localtax1; // not in database |
|
541 | 541 | |
542 | 542 | /** |
543 | 543 | * @var float Multicurrency total localtax2 |
544 | 544 | */ |
545 | - public $multicurrency_total_localtax2; // not in database |
|
545 | + public $multicurrency_total_localtax2; // not in database |
|
546 | 546 | |
547 | 547 | /** |
548 | 548 | * @var string |
@@ -1027,17 +1027,17 @@ discard block |
||
1027 | 1027 | } |
1028 | 1028 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
1029 | 1029 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
1030 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
1030 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
1031 | 1031 | } else { |
1032 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
1033 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1032 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
1033 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1034 | 1034 | $count++; |
1035 | 1035 | } |
1036 | 1036 | } |
1037 | 1037 | $data['closedivextra'] = '</div>'; |
1038 | 1038 | } |
1039 | 1039 | |
1040 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1040 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1041 | 1041 | $parameters = array( |
1042 | 1042 | 'tooltipcontentarray' => &$data, |
1043 | 1043 | 'params' => $params, |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
1537 | 1537 | } |
1538 | 1538 | if ($status >= 0) { |
1539 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1539 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1540 | 1540 | } |
1541 | 1541 | if ($statusoflink >= 0) { |
1542 | 1542 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | } |
1919 | 1919 | |
1920 | 1920 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
1921 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1921 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1922 | 1922 | $sql .= " LIMIT 1"; |
1923 | 1923 | |
1924 | 1924 | $query = $this->db->query($sql); |
@@ -2210,9 +2210,9 @@ discard block |
||
2210 | 2210 | |
2211 | 2211 | $oldvalue = null; |
2212 | 2212 | if ($trigkey) { |
2213 | - $sql = "SELECT " . $field; |
|
2214 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
2215 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
2213 | + $sql = "SELECT ".$field; |
|
2214 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
2215 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
2216 | 2216 | |
2217 | 2217 | $resql = $this->db->query($sql); |
2218 | 2218 | if ($resql) { |
@@ -2592,7 +2592,7 @@ discard block |
||
2592 | 2592 | // Triggers |
2593 | 2593 | if (!$error && !$notrigger) { |
2594 | 2594 | // Call triggers |
2595 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
2595 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
2596 | 2596 | if ($result < 0) { |
2597 | 2597 | $error++; |
2598 | 2598 | } //Do also here what you must do to rollback action if trigger fail |
@@ -2958,7 +2958,7 @@ discard block |
||
2958 | 2958 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
2959 | 2959 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
2960 | 2960 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
2961 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2961 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2962 | 2962 | } |
2963 | 2963 | $sql .= ' WHERE rowid='.((int) $this->id); |
2964 | 2964 | |
@@ -3306,10 +3306,10 @@ discard block |
||
3306 | 3306 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
3307 | 3307 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3308 | 3308 | if (!$renum) { |
3309 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
3309 | + $sql .= " AND ".$fieldposition." = 0"; |
|
3310 | 3310 | } |
3311 | 3311 | if ($renum) { |
3312 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
3312 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
3313 | 3313 | } |
3314 | 3314 | |
3315 | 3315 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3330,7 +3330,7 @@ discard block |
||
3330 | 3330 | if ($fk_parent_line) { |
3331 | 3331 | $sql .= ' AND fk_parent_line IS NULL'; |
3332 | 3332 | } |
3333 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
3333 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
3334 | 3334 | |
3335 | 3335 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
3336 | 3336 | $resql = $this->db->query($sql); |
@@ -3381,7 +3381,7 @@ discard block |
||
3381 | 3381 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3382 | 3382 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3383 | 3383 | $sql .= ' AND fk_parent_line = '.((int) $id); |
3384 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
3384 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
3385 | 3385 | |
3386 | 3386 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
3387 | 3387 | |
@@ -3505,7 +3505,7 @@ discard block |
||
3505 | 3505 | |
3506 | 3506 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3507 | 3507 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3508 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
3508 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
3509 | 3509 | if ($this->db->query($sql)) { |
3510 | 3510 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
3511 | 3511 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3536,7 +3536,7 @@ discard block |
||
3536 | 3536 | |
3537 | 3537 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3538 | 3538 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3539 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
3539 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
3540 | 3540 | if ($this->db->query($sql)) { |
3541 | 3541 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
3542 | 3542 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3562,7 +3562,7 @@ discard block |
||
3562 | 3562 | $fieldposition = 'position'; |
3563 | 3563 | } |
3564 | 3564 | |
3565 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
3565 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
3566 | 3566 | $sql .= " WHERE rowid = ".((int) $rowid); |
3567 | 3567 | |
3568 | 3568 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3590,7 +3590,7 @@ discard block |
||
3590 | 3590 | |
3591 | 3591 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3592 | 3592 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3593 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
3593 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
3594 | 3594 | $resql = $this->db->query($sql); |
3595 | 3595 | if ($resql) { |
3596 | 3596 | $row = $this->db->fetch_row($resql); |
@@ -3708,7 +3708,7 @@ discard block |
||
3708 | 3708 | $newsuffix = ''; |
3709 | 3709 | } |
3710 | 3710 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
3711 | - $fieldusermod = "fk_user_mod"; |
|
3711 | + $fieldusermod = "fk_user_mod"; |
|
3712 | 3712 | } elseif ($this->table_element == 'ecm_files') { |
3713 | 3713 | $fieldusermod = "fk_user_m"; |
3714 | 3714 | } else { |
@@ -3750,7 +3750,7 @@ discard block |
||
3750 | 3750 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
3751 | 3751 | break; |
3752 | 3752 | default: |
3753 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
3753 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
3754 | 3754 | } |
3755 | 3755 | $ret = $this->call_trigger($trigger_name, $user); |
3756 | 3756 | if ($ret < 0) { |
@@ -4151,19 +4151,19 @@ discard block |
||
4151 | 4151 | $this->db->begin(); |
4152 | 4152 | $error = 0; |
4153 | 4153 | |
4154 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4154 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4155 | 4155 | $sql .= "fk_source"; |
4156 | 4156 | $sql .= ", sourcetype"; |
4157 | 4157 | $sql .= ", fk_target"; |
4158 | 4158 | $sql .= ", targettype"; |
4159 | 4159 | $sql .= ") VALUES ("; |
4160 | 4160 | $sql .= ((int) $origin_id); |
4161 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4162 | - $sql .= ", " . ((int) $this->id); |
|
4163 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4161 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4162 | + $sql .= ", ".((int) $this->id); |
|
4163 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4164 | 4164 | $sql .= ")"; |
4165 | 4165 | |
4166 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4166 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4167 | 4167 | if ($this->db->query($sql)) { |
4168 | 4168 | if (!$notrigger) { |
4169 | 4169 | // Call trigger |
@@ -4415,20 +4415,20 @@ discard block |
||
4415 | 4415 | $this->db->begin(); |
4416 | 4416 | $error = 0; |
4417 | 4417 | |
4418 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4418 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4419 | 4419 | if ($updatesource) { |
4420 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4421 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4422 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4423 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4420 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4421 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4422 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4423 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4424 | 4424 | } elseif ($updatetarget) { |
4425 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4426 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4427 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4428 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4425 | + $sql .= "fk_target = ".((int) $targetid); |
|
4426 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4427 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4428 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4429 | 4429 | } |
4430 | 4430 | |
4431 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4431 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4432 | 4432 | if ($this->db->query($sql)) { |
4433 | 4433 | if (!$notrigger) { |
4434 | 4434 | // Call trigger |
@@ -4504,25 +4504,25 @@ discard block |
||
4504 | 4504 | } |
4505 | 4505 | |
4506 | 4506 | if (!$error) { |
4507 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4507 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4508 | 4508 | $sql .= " WHERE"; |
4509 | 4509 | if ($rowid > 0) { |
4510 | - $sql .= " rowid = " . ((int) $rowid); |
|
4510 | + $sql .= " rowid = ".((int) $rowid); |
|
4511 | 4511 | } else { |
4512 | 4512 | if ($deletesource) { |
4513 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4514 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4513 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4514 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
4515 | 4515 | } elseif ($deletetarget) { |
4516 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4517 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4516 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4517 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4518 | 4518 | } else { |
4519 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
4519 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
4520 | 4520 | $sql .= " OR"; |
4521 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
4521 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
4522 | 4522 | } |
4523 | 4523 | } |
4524 | 4524 | |
4525 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4525 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4526 | 4526 | if (!$this->db->query($sql)) { |
4527 | 4527 | $this->error = $this->db->lasterror(); |
4528 | 4528 | $this->errors[] = $this->error; |
@@ -4687,14 +4687,14 @@ discard block |
||
4687 | 4687 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4688 | 4688 | } |
4689 | 4689 | $sql .= " WHERE rowid = ".((int) $elementId); |
4690 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4690 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4691 | 4691 | |
4692 | 4692 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4693 | 4693 | $resql = $this->db->query($sql); |
4694 | 4694 | if ($resql) { |
4695 | 4695 | $error = 0; |
4696 | 4696 | |
4697 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4697 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4698 | 4698 | |
4699 | 4699 | if ($nb_rows_affected > 0) { |
4700 | 4700 | if (empty($trigkey)) { |
@@ -4741,7 +4741,7 @@ discard block |
||
4741 | 4741 | if ($fieldstatus == 'tosell') { |
4742 | 4742 | $this->status = $status; |
4743 | 4743 | } elseif ($fieldstatus == 'tobuy') { |
4744 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4744 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4745 | 4745 | } else { |
4746 | 4746 | $this->status = $status; |
4747 | 4747 | } |
@@ -4849,7 +4849,7 @@ discard block |
||
4849 | 4849 | return -1; |
4850 | 4850 | } |
4851 | 4851 | |
4852 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4852 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4853 | 4853 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
4854 | 4854 | $tmparray = array_keys($this->childtables); |
4855 | 4855 | if (is_numeric($tmparray[0])) { |
@@ -5927,7 +5927,7 @@ discard block |
||
5927 | 5927 | $setsharekey = false; |
5928 | 5928 | if ($this->element == 'propal' || $this->element == 'proposal') { |
5929 | 5929 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
5930 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5930 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5931 | 5931 | } |
5932 | 5932 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
5933 | 5933 | $setsharekey = true; |
@@ -5985,7 +5985,7 @@ discard block |
||
5985 | 5985 | $ecmfile->gen_or_uploaded = 'generated'; |
5986 | 5986 | $ecmfile->description = ''; // indexed content |
5987 | 5987 | $ecmfile->keywords = ''; // keyword content |
5988 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5988 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5989 | 5989 | $ecmfile->src_object_id = $this->id; |
5990 | 5990 | |
5991 | 5991 | $result = $ecmfile->create($user); |
@@ -6037,7 +6037,7 @@ discard block |
||
6037 | 6037 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
6038 | 6038 | $maxheightmini = $tmparraysize['maxheightmini']; |
6039 | 6039 | //$quality = $tmparraysize['quality']; |
6040 | - $quality = 50; // For thumbs, we force quality to 50 |
|
6040 | + $quality = 50; // For thumbs, we force quality to 50 |
|
6041 | 6041 | |
6042 | 6042 | // Create small thumbs for company (Ratio is near 16/9) |
6043 | 6043 | // Used on logon for example |
@@ -6137,8 +6137,8 @@ discard block |
||
6137 | 6137 | // phpcs:enable |
6138 | 6138 | global $langs, $conf; |
6139 | 6139 | |
6140 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
6141 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
6140 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
6141 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
6142 | 6142 | exit; |
6143 | 6143 | } |
6144 | 6144 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6330,7 +6330,7 @@ discard block |
||
6330 | 6330 | $savDisableCompute = $conf->disable_compute; |
6331 | 6331 | $conf->disable_compute = 1; |
6332 | 6332 | |
6333 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6333 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6334 | 6334 | |
6335 | 6335 | $conf->disable_compute = $savDisableCompute; |
6336 | 6336 | |
@@ -6392,7 +6392,7 @@ discard block |
||
6392 | 6392 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6393 | 6393 | $sql = "SELECT rowid"; |
6394 | 6394 | foreach ($optionsArray as $name => $label) { |
6395 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6395 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6396 | 6396 | $sql .= ", ".$name; |
6397 | 6397 | } |
6398 | 6398 | // use geo sql fonction to read as text |
@@ -6445,7 +6445,7 @@ discard block |
||
6445 | 6445 | **/ |
6446 | 6446 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
6447 | 6447 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
6448 | - $this->array_options['options_' . $key] = null; |
|
6448 | + $this->array_options['options_'.$key] = null; |
|
6449 | 6449 | } |
6450 | 6450 | } |
6451 | 6451 | } |
@@ -6457,9 +6457,9 @@ discard block |
||
6457 | 6457 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6458 | 6458 | //var_dump($conf->disable_compute); |
6459 | 6459 | if (empty($conf->disable_compute)) { |
6460 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6461 | - $objectoffield = $this; // we can use it inside computed formula |
|
6462 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6460 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6461 | + $objectoffield = $this; // we can use it inside computed formula |
|
6462 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6463 | 6463 | } |
6464 | 6464 | } |
6465 | 6465 | } |
@@ -6640,7 +6640,7 @@ discard block |
||
6640 | 6640 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6641 | 6641 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6642 | 6642 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6643 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6643 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6644 | 6644 | } else { |
6645 | 6645 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6646 | 6646 | } |
@@ -6651,7 +6651,7 @@ discard block |
||
6651 | 6651 | // If value has changed |
6652 | 6652 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6653 | 6653 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6654 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6654 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6655 | 6655 | } else { |
6656 | 6656 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6657 | 6657 | } |
@@ -6663,7 +6663,7 @@ discard block |
||
6663 | 6663 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6664 | 6664 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6665 | 6665 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6666 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6666 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6667 | 6667 | } else { |
6668 | 6668 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6669 | 6669 | } |
@@ -7088,7 +7088,7 @@ discard block |
||
7088 | 7088 | 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. |
7089 | 7089 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7090 | 7090 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7091 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7091 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7092 | 7092 | } else { |
7093 | 7093 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7094 | 7094 | } |
@@ -7108,7 +7108,7 @@ discard block |
||
7108 | 7108 | } |
7109 | 7109 | } else { |
7110 | 7110 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7111 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7111 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7112 | 7112 | } else { |
7113 | 7113 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7114 | 7114 | } |
@@ -7636,7 +7636,7 @@ discard block |
||
7636 | 7636 | if (is_array($param['options'])) { |
7637 | 7637 | $param_list = array_keys($param['options']); |
7638 | 7638 | $InfoFieldList = explode(":", $param_list[0], 5); |
7639 | - if (! empty($InfoFieldList[4])) { |
|
7639 | + if (!empty($InfoFieldList[4])) { |
|
7640 | 7640 | $pos = 0; |
7641 | 7641 | $parenthesisopen = 0; |
7642 | 7642 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7697,8 +7697,8 @@ discard block |
||
7697 | 7697 | } |
7698 | 7698 | |
7699 | 7699 | $sqlwhere = ''; |
7700 | - $sql = "SELECT " . $keyList; |
|
7701 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7700 | + $sql = "SELECT ".$keyList; |
|
7701 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7702 | 7702 | if (!empty($InfoFieldList[4])) { |
7703 | 7703 | // can use SELECT request |
7704 | 7704 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7715,18 +7715,18 @@ discard block |
||
7715 | 7715 | // We have to join on extrafield table |
7716 | 7716 | $errstr = ''; |
7717 | 7717 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7718 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
7719 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2]; |
|
7720 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7718 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
7719 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]; |
|
7720 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7721 | 7721 | } else { |
7722 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7722 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7723 | 7723 | } |
7724 | 7724 | } else { |
7725 | 7725 | $sqlwhere .= ' WHERE 1=1'; |
7726 | 7726 | } |
7727 | 7727 | // Some tables may have field, some other not. For the moment we disable it. |
7728 | 7728 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7729 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7729 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7730 | 7730 | } |
7731 | 7731 | $sql .= $sqlwhere; |
7732 | 7732 | //print $sql; |
@@ -7738,7 +7738,7 @@ discard block |
||
7738 | 7738 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
7739 | 7739 | } |
7740 | 7740 | |
7741 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
7741 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
7742 | 7742 | $resql = $this->db->query($sql); |
7743 | 7743 | if ($resql) { |
7744 | 7744 | $out .= '<option value="0"> </option>'; |
@@ -7754,7 +7754,7 @@ discard block |
||
7754 | 7754 | if (count($fields_label) > 1) { |
7755 | 7755 | $notrans = true; |
7756 | 7756 | foreach ($fields_label as $field_toshow) { |
7757 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7757 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7758 | 7758 | } |
7759 | 7759 | } else { |
7760 | 7760 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7765,12 +7765,12 @@ discard block |
||
7765 | 7765 | foreach ($fields_label as $field_toshow) { |
7766 | 7766 | $translabel = $langs->trans($obj->$field_toshow); |
7767 | 7767 | if ($translabel != $obj->$field_toshow) { |
7768 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
7768 | + $labeltoshow = dol_trunc($translabel).' '; |
|
7769 | 7769 | } else { |
7770 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
7770 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
7771 | 7771 | } |
7772 | 7772 | } |
7773 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7773 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7774 | 7774 | } else { |
7775 | 7775 | if (!$notrans) { |
7776 | 7776 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7784,34 +7784,34 @@ discard block |
||
7784 | 7784 | $labeltoshow = '(not defined)'; |
7785 | 7785 | } |
7786 | 7786 | if ($value == $obj->rowid) { |
7787 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7787 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7788 | 7788 | } |
7789 | 7789 | |
7790 | 7790 | if (!empty($InfoFieldList[3]) && $parentField) { |
7791 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7791 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7792 | 7792 | $isDependList = 1; |
7793 | 7793 | } |
7794 | 7794 | |
7795 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
7795 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
7796 | 7796 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
7797 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
7798 | - $out .= '>' . $labeltoshow . '</option>'; |
|
7797 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
7798 | + $out .= '>'.$labeltoshow.'</option>'; |
|
7799 | 7799 | } |
7800 | 7800 | |
7801 | 7801 | $i++; |
7802 | 7802 | } |
7803 | 7803 | $this->db->free($resql); |
7804 | 7804 | } else { |
7805 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7805 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7806 | 7806 | } |
7807 | 7807 | } else { |
7808 | 7808 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7809 | 7809 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7810 | 7810 | $out .= '<option value="0"> </option>'; |
7811 | 7811 | foreach ($data as $data_key => $data_value) { |
7812 | - $out .= '<option value="' . $data_key . '"'; |
|
7812 | + $out .= '<option value="'.$data_key.'"'; |
|
7813 | 7813 | $out .= ($value == $data_key ? ' selected' : ''); |
7814 | - $out .= '>' . $data_value . '</option>'; |
|
7814 | + $out .= '>'.$data_value.'</option>'; |
|
7815 | 7815 | } |
7816 | 7816 | } |
7817 | 7817 | } |
@@ -7878,8 +7878,8 @@ discard block |
||
7878 | 7878 | } |
7879 | 7879 | |
7880 | 7880 | $sqlwhere = ''; |
7881 | - $sql = "SELECT " . $keyList; |
|
7882 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
7881 | + $sql = "SELECT ".$keyList; |
|
7882 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
7883 | 7883 | if (!empty($InfoFieldList[4])) { |
7884 | 7884 | // can use SELECT request |
7885 | 7885 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7895,23 +7895,23 @@ discard block |
||
7895 | 7895 | |
7896 | 7896 | // We have to join on extrafield table |
7897 | 7897 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7898 | - $sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra'; |
|
7899 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
7898 | + $sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra'; |
|
7899 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
7900 | 7900 | } else { |
7901 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
7901 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
7902 | 7902 | } |
7903 | 7903 | } else { |
7904 | 7904 | $sqlwhere .= ' WHERE 1=1'; |
7905 | 7905 | } |
7906 | 7906 | // Some tables may have field, some other not. For the moment we disable it. |
7907 | 7907 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7908 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7908 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7909 | 7909 | } |
7910 | 7910 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
7911 | 7911 | // print $sql; |
7912 | 7912 | |
7913 | 7913 | $sql .= $sqlwhere; |
7914 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
7914 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
7915 | 7915 | $resql = $this->db->query($sql); |
7916 | 7916 | if ($resql) { |
7917 | 7917 | $num = $this->db->num_rows($resql); |
@@ -7929,7 +7929,7 @@ discard block |
||
7929 | 7929 | if (count($fields_label) > 1) { |
7930 | 7930 | $notrans = true; |
7931 | 7931 | foreach ($fields_label as $field_toshow) { |
7932 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7932 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7933 | 7933 | } |
7934 | 7934 | } else { |
7935 | 7935 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7940,9 +7940,9 @@ discard block |
||
7940 | 7940 | foreach ($fields_label as $field_toshow) { |
7941 | 7941 | $translabel = $langs->trans($obj->$field_toshow); |
7942 | 7942 | if ($translabel != $obj->$field_toshow) { |
7943 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
7943 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
7944 | 7944 | } else { |
7945 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
7945 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
7946 | 7946 | } |
7947 | 7947 | } |
7948 | 7948 | |
@@ -7965,7 +7965,7 @@ discard block |
||
7965 | 7965 | } |
7966 | 7966 | |
7967 | 7967 | if (!empty($InfoFieldList[3]) && $parentField) { |
7968 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7968 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7969 | 7969 | $isDependList = 1; |
7970 | 7970 | } |
7971 | 7971 | |
@@ -7976,14 +7976,14 @@ discard block |
||
7976 | 7976 | } |
7977 | 7977 | $this->db->free($resql); |
7978 | 7978 | |
7979 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7979 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7980 | 7980 | } else { |
7981 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7981 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7982 | 7982 | } |
7983 | 7983 | } else { |
7984 | 7984 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7985 | 7985 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7986 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7986 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7987 | 7987 | } |
7988 | 7988 | } |
7989 | 7989 | } elseif ($type == 'link') { |
@@ -8214,7 +8214,7 @@ discard block |
||
8214 | 8214 | $value = $this->getLibStatut(3); |
8215 | 8215 | } elseif ($type == 'date') { |
8216 | 8216 | if (!empty($value)) { |
8217 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8217 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8218 | 8218 | } else { |
8219 | 8219 | $value = ''; |
8220 | 8220 | } |
@@ -8259,7 +8259,7 @@ discard block |
||
8259 | 8259 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8260 | 8260 | if (strpos($value, "|") !== false) { |
8261 | 8261 | $value = $langs->trans(explode('|', $value)[0]); |
8262 | - } elseif (! is_numeric($value)) { |
|
8262 | + } elseif (!is_numeric($value)) { |
|
8263 | 8263 | $value = $langs->trans($value); |
8264 | 8264 | } |
8265 | 8265 | } elseif ($type == 'sellist') { |
@@ -8321,9 +8321,9 @@ discard block |
||
8321 | 8321 | $translabel = $langs->trans($obj->$field_toshow); |
8322 | 8322 | } |
8323 | 8323 | if ($translabel != $field_toshow) { |
8324 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8324 | + $value .= dol_trunc($translabel, 18).' '; |
|
8325 | 8325 | } else { |
8326 | - $value .= $obj->$field_toshow . ' '; |
|
8326 | + $value .= $obj->$field_toshow.' '; |
|
8327 | 8327 | } |
8328 | 8328 | } |
8329 | 8329 | } else { |
@@ -8339,7 +8339,7 @@ discard block |
||
8339 | 8339 | } |
8340 | 8340 | } |
8341 | 8341 | } else { |
8342 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8342 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8343 | 8343 | |
8344 | 8344 | $toprint = array(); |
8345 | 8345 | $obj = $this->db->fetch_object($resql); |
@@ -8347,7 +8347,7 @@ discard block |
||
8347 | 8347 | $c->fetch($obj->rowid); |
8348 | 8348 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8349 | 8349 | foreach ($ways as $way) { |
8350 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8350 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8351 | 8351 | } |
8352 | 8352 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8353 | 8353 | } |
@@ -8363,11 +8363,11 @@ discard block |
||
8363 | 8363 | $toprint = array(); |
8364 | 8364 | foreach ($value_arr as $keyval => $valueval) { |
8365 | 8365 | if (!empty($valueval)) { |
8366 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8366 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8367 | 8367 | } |
8368 | 8368 | } |
8369 | 8369 | if (!empty($toprint)) { |
8370 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8370 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8371 | 8371 | } |
8372 | 8372 | } |
8373 | 8373 | } elseif ($type == 'chkbxlst') { |
@@ -8422,9 +8422,9 @@ discard block |
||
8422 | 8422 | $translabel = $langs->trans($obj->$field_toshow); |
8423 | 8423 | } |
8424 | 8424 | if ($translabel != $field_toshow) { |
8425 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8425 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8426 | 8426 | } else { |
8427 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8427 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8428 | 8428 | } |
8429 | 8429 | } |
8430 | 8430 | } else { |
@@ -8433,15 +8433,15 @@ discard block |
||
8433 | 8433 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8434 | 8434 | } |
8435 | 8435 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8436 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8436 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8437 | 8437 | } else { |
8438 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8438 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8439 | 8439 | } |
8440 | 8440 | } |
8441 | 8441 | } |
8442 | 8442 | } |
8443 | 8443 | } else { |
8444 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8444 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8445 | 8445 | |
8446 | 8446 | $toprint = array(); |
8447 | 8447 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8450,7 +8450,7 @@ discard block |
||
8450 | 8450 | $c->fetch($obj->rowid); |
8451 | 8451 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8452 | 8452 | foreach ($ways as $way) { |
8453 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8453 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8454 | 8454 | } |
8455 | 8455 | } |
8456 | 8456 | } |
@@ -8617,7 +8617,7 @@ discard block |
||
8617 | 8617 | global $langs; |
8618 | 8618 | |
8619 | 8619 | if (!class_exists('Validate')) { |
8620 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
8620 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
8621 | 8621 | } |
8622 | 8622 | |
8623 | 8623 | $this->clearFieldError($fieldKey); |
@@ -8856,7 +8856,7 @@ discard block |
||
8856 | 8856 | $out .= "\n"; |
8857 | 8857 | |
8858 | 8858 | $nbofextrafieldsshown = 0; |
8859 | - $e = 0; // var to manage the modulo (odd/even) |
|
8859 | + $e = 0; // var to manage the modulo (odd/even) |
|
8860 | 8860 | |
8861 | 8861 | $lastseparatorkeyfound = ''; |
8862 | 8862 | $extrafields_collapse_num = ''; |
@@ -9948,7 +9948,7 @@ discard block |
||
9948 | 9948 | continue; |
9949 | 9949 | } |
9950 | 9950 | } |
9951 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
9951 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
9952 | 9952 | } |
9953 | 9953 | return implode(',', $keys_with_alias); |
9954 | 9954 | } else { |
@@ -10083,7 +10083,7 @@ discard block |
||
10083 | 10083 | if (!$error) { |
10084 | 10084 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
10085 | 10085 | $sql .= " (".implode(", ", $keys).')'; |
10086 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10086 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10087 | 10087 | |
10088 | 10088 | $res = $this->db->query($sql); |
10089 | 10089 | if (!$res) { |
@@ -10385,7 +10385,7 @@ discard block |
||
10385 | 10385 | |
10386 | 10386 | // Update extrafield |
10387 | 10387 | if (!$error) { |
10388 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10388 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10389 | 10389 | if ($result < 0) { |
10390 | 10390 | $error++; |
10391 | 10391 | } |
@@ -10587,12 +10587,12 @@ discard block |
||
10587 | 10587 | $error++; |
10588 | 10588 | } else { |
10589 | 10589 | while ($obj = $this->db->fetch_object($resql)) { |
10590 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10590 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10591 | 10591 | if ($result < 0) { |
10592 | 10592 | $error++; |
10593 | 10593 | $this->errors[] = $this->error; |
10594 | 10594 | } else { |
10595 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
10595 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
10596 | 10596 | if ($result < 0) { |
10597 | 10597 | $error++; |
10598 | 10598 | $this->errors[] = $this->error; |
@@ -10758,7 +10758,7 @@ discard block |
||
10758 | 10758 | ); |
10759 | 10759 | foreach ($fields as $key => $value) { |
10760 | 10760 | if (array_key_exists($key, $this->fields)) { |
10761 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
10761 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
10762 | 10762 | } |
10763 | 10763 | } |
10764 | 10764 |