@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | * |
478 | 478 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
479 | 479 | */ |
480 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
480 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
481 | 481 | /** |
482 | 482 | * @var int|string Internal to detect deprecated access |
483 | 483 | */ |
484 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
484 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
485 | 485 | |
486 | 486 | /** |
487 | 487 | * @var int Delivery address ID |
@@ -538,12 +538,12 @@ discard block |
||
538 | 538 | /** |
539 | 539 | * @var float|string Multicurrency total localtax1 |
540 | 540 | */ |
541 | - public $multicurrency_total_localtax1; // not in database |
|
541 | + public $multicurrency_total_localtax1; // not in database |
|
542 | 542 | |
543 | 543 | /** |
544 | 544 | * @var float|string Multicurrency total localtax2 |
545 | 545 | */ |
546 | - public $multicurrency_total_localtax2; // not in database |
|
546 | + public $multicurrency_total_localtax2; // not in database |
|
547 | 547 | |
548 | 548 | /** |
549 | 549 | * @var string |
@@ -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, |
@@ -1538,7 +1538,7 @@ discard block |
||
1538 | 1538 | $sql .= " AND ec.fk_c_type_contact IN (".$this->db->sanitize(implode(',', $arrayoftcids)).")"; |
1539 | 1539 | } |
1540 | 1540 | if ($status >= 0) { |
1541 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1541 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_user or llx_socpeople |
|
1542 | 1542 | } |
1543 | 1543 | if ($statusoflink >= 0) { |
1544 | 1544 | $sql .= " AND ec.statut = ".((int) $statusoflink); |
@@ -1920,7 +1920,7 @@ discard block |
||
1920 | 1920 | } |
1921 | 1921 | |
1922 | 1922 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
1923 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1923 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1924 | 1924 | $sql .= " LIMIT 1"; |
1925 | 1925 | |
1926 | 1926 | $query = $this->db->query($sql); |
@@ -2227,9 +2227,9 @@ discard block |
||
2227 | 2227 | |
2228 | 2228 | $oldvalue = null; |
2229 | 2229 | if ($trigkey) { |
2230 | - $sql = "SELECT " . $field; |
|
2231 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
2232 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
2230 | + $sql = "SELECT ".$field; |
|
2231 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
2232 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
2233 | 2233 | |
2234 | 2234 | $resql = $this->db->query($sql); |
2235 | 2235 | if ($resql) { |
@@ -2609,7 +2609,7 @@ discard block |
||
2609 | 2609 | // Triggers |
2610 | 2610 | if (!$error && !$notrigger) { |
2611 | 2611 | // Call triggers |
2612 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
2612 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
2613 | 2613 | if ($result < 0) { |
2614 | 2614 | $error++; |
2615 | 2615 | } //Do also here what you must do to rollback action if trigger fail |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
2988 | 2988 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
2989 | 2989 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
2990 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2990 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2991 | 2991 | } |
2992 | 2992 | $sql .= ' WHERE rowid='.((int) $this->id); |
2993 | 2993 | |
@@ -3335,10 +3335,10 @@ discard block |
||
3335 | 3335 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
3336 | 3336 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3337 | 3337 | if (!$renum) { |
3338 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
3338 | + $sql .= " AND ".$fieldposition." = 0"; |
|
3339 | 3339 | } |
3340 | 3340 | if ($renum) { |
3341 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
3341 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
3342 | 3342 | } |
3343 | 3343 | |
3344 | 3344 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3359,7 +3359,7 @@ discard block |
||
3359 | 3359 | if ($fk_parent_line) { |
3360 | 3360 | $sql .= ' AND fk_parent_line IS NULL'; |
3361 | 3361 | } |
3362 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
3362 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
3363 | 3363 | |
3364 | 3364 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
3365 | 3365 | $resql = $this->db->query($sql); |
@@ -3411,7 +3411,7 @@ discard block |
||
3411 | 3411 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3412 | 3412 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3413 | 3413 | $sql .= ' AND fk_parent_line = '.((int) $id); |
3414 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
3414 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
3415 | 3415 | |
3416 | 3416 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
3417 | 3417 | |
@@ -3535,7 +3535,7 @@ discard block |
||
3535 | 3535 | |
3536 | 3536 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3537 | 3537 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3538 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
3538 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
3539 | 3539 | if ($this->db->query($sql)) { |
3540 | 3540 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
3541 | 3541 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3566,7 +3566,7 @@ discard block |
||
3566 | 3566 | |
3567 | 3567 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3568 | 3568 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3569 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
3569 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
3570 | 3570 | if ($this->db->query($sql)) { |
3571 | 3571 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
3572 | 3572 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3592,7 +3592,7 @@ discard block |
||
3592 | 3592 | $fieldposition = 'position'; |
3593 | 3593 | } |
3594 | 3594 | |
3595 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
3595 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
3596 | 3596 | $sql .= " WHERE rowid = ".((int) $rowid); |
3597 | 3597 | |
3598 | 3598 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3620,7 +3620,7 @@ discard block |
||
3620 | 3620 | |
3621 | 3621 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3622 | 3622 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3623 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
3623 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
3624 | 3624 | $resql = $this->db->query($sql); |
3625 | 3625 | if ($resql) { |
3626 | 3626 | $row = $this->db->fetch_row($resql); |
@@ -3739,7 +3739,7 @@ discard block |
||
3739 | 3739 | $newsuffix = ''; |
3740 | 3740 | } |
3741 | 3741 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
3742 | - $fieldusermod = "fk_user_mod"; |
|
3742 | + $fieldusermod = "fk_user_mod"; |
|
3743 | 3743 | } elseif ($this->table_element == 'ecm_files') { |
3744 | 3744 | $fieldusermod = "fk_user_m"; |
3745 | 3745 | } else { |
@@ -3781,7 +3781,7 @@ discard block |
||
3781 | 3781 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
3782 | 3782 | break; |
3783 | 3783 | default: |
3784 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
3784 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
3785 | 3785 | } |
3786 | 3786 | $ret = $this->call_trigger($trigger_name, $user); |
3787 | 3787 | if ($ret < 0) { |
@@ -4079,7 +4079,7 @@ discard block |
||
4079 | 4079 | // Situations totals |
4080 | 4080 | 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 |
4081 | 4081 | '@phan-var-force Facture $this'; |
4082 | - 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 |
|
4082 | + 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 |
|
4083 | 4083 | if ($this->type != Facture::TYPE_CREDIT_NOTE) { // @phpstan-ignore-line |
4084 | 4084 | if (getDolGlobalInt('INVOICE_USE_SITUATION') != 2) { |
4085 | 4085 | $prev_sits = $this->get_prev_sits(); |
@@ -4201,19 +4201,19 @@ discard block |
||
4201 | 4201 | $this->db->begin(); |
4202 | 4202 | $error = 0; |
4203 | 4203 | |
4204 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4204 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4205 | 4205 | $sql .= "fk_source"; |
4206 | 4206 | $sql .= ", sourcetype"; |
4207 | 4207 | $sql .= ", fk_target"; |
4208 | 4208 | $sql .= ", targettype"; |
4209 | 4209 | $sql .= ") VALUES ("; |
4210 | 4210 | $sql .= ((int) $origin_id); |
4211 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4212 | - $sql .= ", " . ((int) $this->id); |
|
4213 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4211 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4212 | + $sql .= ", ".((int) $this->id); |
|
4213 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4214 | 4214 | $sql .= ")"; |
4215 | 4215 | |
4216 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4216 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4217 | 4217 | if ($this->db->query($sql)) { |
4218 | 4218 | if (!$notrigger) { |
4219 | 4219 | // Call trigger |
@@ -4466,20 +4466,20 @@ discard block |
||
4466 | 4466 | $this->db->begin(); |
4467 | 4467 | $error = 0; |
4468 | 4468 | |
4469 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4469 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4470 | 4470 | if ($updatesource) { |
4471 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4472 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4473 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4474 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4471 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4472 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4473 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4474 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4475 | 4475 | } elseif ($updatetarget) { |
4476 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4477 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4478 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4479 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4476 | + $sql .= "fk_target = ".((int) $targetid); |
|
4477 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4478 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4479 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4480 | 4480 | } |
4481 | 4481 | |
4482 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4482 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4483 | 4483 | if ($this->db->query($sql)) { |
4484 | 4484 | if (!$notrigger) { |
4485 | 4485 | // Call trigger |
@@ -4555,25 +4555,25 @@ discard block |
||
4555 | 4555 | } |
4556 | 4556 | |
4557 | 4557 | if (!$error) { |
4558 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4558 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4559 | 4559 | $sql .= " WHERE"; |
4560 | 4560 | if ($rowid > 0) { |
4561 | - $sql .= " rowid = " . ((int) $rowid); |
|
4561 | + $sql .= " rowid = ".((int) $rowid); |
|
4562 | 4562 | } else { |
4563 | 4563 | if ($deletesource) { |
4564 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4565 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4564 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4565 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
4566 | 4566 | } elseif ($deletetarget) { |
4567 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4568 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4567 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4568 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4569 | 4569 | } else { |
4570 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
4570 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
4571 | 4571 | $sql .= " OR"; |
4572 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
4572 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
4573 | 4573 | } |
4574 | 4574 | } |
4575 | 4575 | |
4576 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4576 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4577 | 4577 | if (!$this->db->query($sql)) { |
4578 | 4578 | $this->error = $this->db->lasterror(); |
4579 | 4579 | $this->errors[] = $this->error; |
@@ -4738,14 +4738,14 @@ discard block |
||
4738 | 4738 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4739 | 4739 | } |
4740 | 4740 | $sql .= " WHERE rowid = ".((int) $elementId); |
4741 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4741 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4742 | 4742 | |
4743 | 4743 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4744 | 4744 | $resql = $this->db->query($sql); |
4745 | 4745 | if ($resql) { |
4746 | 4746 | $error = 0; |
4747 | 4747 | |
4748 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4748 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4749 | 4749 | |
4750 | 4750 | if ($nb_rows_affected > 0) { |
4751 | 4751 | if (empty($trigkey)) { |
@@ -4792,7 +4792,7 @@ discard block |
||
4792 | 4792 | if ($fieldstatus == 'tosell') { |
4793 | 4793 | $this->status = $status; |
4794 | 4794 | } elseif ($fieldstatus == 'tobuy') { |
4795 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4795 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4796 | 4796 | } else { |
4797 | 4797 | $this->status = $status; |
4798 | 4798 | } |
@@ -4900,7 +4900,7 @@ discard block |
||
4900 | 4900 | return -1; |
4901 | 4901 | } |
4902 | 4902 | |
4903 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4903 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4904 | 4904 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
4905 | 4905 | $tmparray = array_keys($this->childtables); |
4906 | 4906 | if (is_numeric($tmparray[0])) { |
@@ -5994,7 +5994,7 @@ discard block |
||
5994 | 5994 | $setsharekey = false; |
5995 | 5995 | if ($this->element == 'propal' || $this->element == 'proposal') { |
5996 | 5996 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
5997 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5997 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5998 | 5998 | } |
5999 | 5999 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
6000 | 6000 | $setsharekey = true; |
@@ -6054,7 +6054,7 @@ discard block |
||
6054 | 6054 | $ecmfile->gen_or_uploaded = 'generated'; |
6055 | 6055 | $ecmfile->description = ''; // indexed content |
6056 | 6056 | $ecmfile->keywords = ''; // keyword content |
6057 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6057 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
6058 | 6058 | $ecmfile->src_object_id = $this->id; |
6059 | 6059 | |
6060 | 6060 | $result = $ecmfile->create($user); |
@@ -6106,7 +6106,7 @@ discard block |
||
6106 | 6106 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
6107 | 6107 | $maxheightmini = $tmparraysize['maxheightmini']; |
6108 | 6108 | //$quality = $tmparraysize['quality']; |
6109 | - $quality = 50; // For thumbs, we force quality to 50 |
|
6109 | + $quality = 50; // For thumbs, we force quality to 50 |
|
6110 | 6110 | |
6111 | 6111 | // Create small thumbs for company (Ratio is near 16/9) |
6112 | 6112 | // Used on logon for example |
@@ -6206,8 +6206,8 @@ discard block |
||
6206 | 6206 | // phpcs:enable |
6207 | 6207 | global $langs, $conf; |
6208 | 6208 | |
6209 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
6210 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
6209 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
6210 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
6211 | 6211 | exit; |
6212 | 6212 | } |
6213 | 6213 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6399,7 +6399,7 @@ discard block |
||
6399 | 6399 | $savDisableCompute = $conf->disable_compute; |
6400 | 6400 | $conf->disable_compute = 1; |
6401 | 6401 | |
6402 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6402 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6403 | 6403 | |
6404 | 6404 | $conf->disable_compute = $savDisableCompute; |
6405 | 6405 | |
@@ -6461,7 +6461,7 @@ discard block |
||
6461 | 6461 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6462 | 6462 | $sql = "SELECT rowid"; |
6463 | 6463 | foreach ($optionsArray as $name => $label) { |
6464 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6464 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6465 | 6465 | $sql .= ", ".$name; |
6466 | 6466 | } |
6467 | 6467 | // use geo sql fonction to read as text |
@@ -6514,7 +6514,7 @@ discard block |
||
6514 | 6514 | **/ |
6515 | 6515 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
6516 | 6516 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
6517 | - $this->array_options['options_' . $key] = null; |
|
6517 | + $this->array_options['options_'.$key] = null; |
|
6518 | 6518 | } |
6519 | 6519 | } |
6520 | 6520 | } |
@@ -6526,9 +6526,9 @@ discard block |
||
6526 | 6526 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6527 | 6527 | //var_dump($conf->disable_compute); |
6528 | 6528 | if (empty($conf->disable_compute)) { |
6529 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6530 | - $objectoffield = $this; // we can use it inside computed formula |
|
6531 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6529 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6530 | + $objectoffield = $this; // we can use it inside computed formula |
|
6531 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6532 | 6532 | } |
6533 | 6533 | } |
6534 | 6534 | } |
@@ -6709,7 +6709,7 @@ discard block |
||
6709 | 6709 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6710 | 6710 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6711 | 6711 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6712 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6712 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6713 | 6713 | } else { |
6714 | 6714 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6715 | 6715 | } |
@@ -6720,7 +6720,7 @@ discard block |
||
6720 | 6720 | // If value has changed |
6721 | 6721 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6722 | 6722 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6723 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6723 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6724 | 6724 | } else { |
6725 | 6725 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6726 | 6726 | } |
@@ -6732,7 +6732,7 @@ discard block |
||
6732 | 6732 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6733 | 6733 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6734 | 6734 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6735 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6735 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6736 | 6736 | } else { |
6737 | 6737 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6738 | 6738 | } |
@@ -7158,7 +7158,7 @@ discard block |
||
7158 | 7158 | 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. |
7159 | 7159 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7160 | 7160 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7161 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7161 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7162 | 7162 | } else { |
7163 | 7163 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7164 | 7164 | } |
@@ -7178,7 +7178,7 @@ discard block |
||
7178 | 7178 | } |
7179 | 7179 | } else { |
7180 | 7180 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7181 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7181 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7182 | 7182 | } else { |
7183 | 7183 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7184 | 7184 | } |
@@ -7762,7 +7762,7 @@ discard block |
||
7762 | 7762 | // 7 : sort field |
7763 | 7763 | |
7764 | 7764 | // If there is filter |
7765 | - if (! empty($InfoFieldList[4])) { |
|
7765 | + if (!empty($InfoFieldList[4])) { |
|
7766 | 7766 | $pos = 0; |
7767 | 7767 | $parenthesisopen = 0; |
7768 | 7768 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7826,8 +7826,8 @@ discard block |
||
7826 | 7826 | } |
7827 | 7827 | |
7828 | 7828 | $sqlwhere = ''; |
7829 | - $sql = "SELECT " . $keyList; |
|
7830 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7829 | + $sql = "SELECT ".$keyList; |
|
7830 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7831 | 7831 | |
7832 | 7832 | if (!empty($InfoFieldList[4])) { |
7833 | 7833 | // can use SELECT request |
@@ -7845,11 +7845,11 @@ discard block |
||
7845 | 7845 | // We have to join on extrafield table |
7846 | 7846 | $errstr = ''; |
7847 | 7847 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7848 | - $sql .= " as main, " . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . "_extrafields as extra"; |
|
7849 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
7850 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7848 | + $sql .= " as main, ".$this->db->sanitize($this->db->prefix().$InfoFieldList[0])."_extrafields as extra"; |
|
7849 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
7850 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7851 | 7851 | } else { |
7852 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7852 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7853 | 7853 | } |
7854 | 7854 | } else { |
7855 | 7855 | $sqlwhere .= ' WHERE 1=1'; |
@@ -7870,7 +7870,7 @@ discard block |
||
7870 | 7870 | |
7871 | 7871 | // Some tables may have field, some other not. For the moment we disable it. |
7872 | 7872 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7873 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7873 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7874 | 7874 | } |
7875 | 7875 | $sql .= $sqlwhere; |
7876 | 7876 | |
@@ -7881,7 +7881,7 @@ discard block |
||
7881 | 7881 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
7882 | 7882 | } |
7883 | 7883 | |
7884 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
7884 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
7885 | 7885 | $resql = $this->db->query($sql); |
7886 | 7886 | if ($resql) { |
7887 | 7887 | $out .= '<option value="0"> </option>'; |
@@ -7897,7 +7897,7 @@ discard block |
||
7897 | 7897 | if (count($fields_label) > 1) { |
7898 | 7898 | $notrans = true; |
7899 | 7899 | foreach ($fields_label as $field_toshow) { |
7900 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7900 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7901 | 7901 | } |
7902 | 7902 | } else { |
7903 | 7903 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7908,12 +7908,12 @@ discard block |
||
7908 | 7908 | foreach ($fields_label as $field_toshow) { |
7909 | 7909 | $translabel = $langs->trans($obj->$field_toshow); |
7910 | 7910 | if ($translabel != $obj->$field_toshow) { |
7911 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
7911 | + $labeltoshow = dol_trunc($translabel).' '; |
|
7912 | 7912 | } else { |
7913 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
7913 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
7914 | 7914 | } |
7915 | 7915 | } |
7916 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7916 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7917 | 7917 | } else { |
7918 | 7918 | if (!$notrans) { |
7919 | 7919 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7927,34 +7927,34 @@ discard block |
||
7927 | 7927 | $labeltoshow = '(not defined)'; |
7928 | 7928 | } |
7929 | 7929 | if ($value == $obj->rowid) { |
7930 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7930 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7931 | 7931 | } |
7932 | 7932 | |
7933 | 7933 | if (!empty($InfoFieldList[3]) && $parentField) { |
7934 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7934 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7935 | 7935 | $isDependList = 1; |
7936 | 7936 | } |
7937 | 7937 | |
7938 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
7938 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
7939 | 7939 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
7940 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
7941 | - $out .= '>' . $labeltoshow . '</option>'; |
|
7940 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
7941 | + $out .= '>'.$labeltoshow.'</option>'; |
|
7942 | 7942 | } |
7943 | 7943 | |
7944 | 7944 | $i++; |
7945 | 7945 | } |
7946 | 7946 | $this->db->free($resql); |
7947 | 7947 | } else { |
7948 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7948 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7949 | 7949 | } |
7950 | 7950 | } else { |
7951 | 7951 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7952 | 7952 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7953 | 7953 | $out .= '<option value="0"> </option>'; |
7954 | 7954 | foreach ($data as $data_key => $data_value) { |
7955 | - $out .= '<option value="' . $data_key . '"'; |
|
7955 | + $out .= '<option value="'.$data_key.'"'; |
|
7956 | 7956 | $out .= ($value == $data_key ? ' selected' : ''); |
7957 | - $out .= '>' . $data_value . '</option>'; |
|
7957 | + $out .= '>'.$data_value.'</option>'; |
|
7958 | 7958 | } |
7959 | 7959 | } |
7960 | 7960 | } |
@@ -7994,7 +7994,7 @@ discard block |
||
7994 | 7994 | // 7 : sort field |
7995 | 7995 | |
7996 | 7996 | // If there is a filter |
7997 | - if (! empty($InfoFieldList[4])) { |
|
7997 | + if (!empty($InfoFieldList[4])) { |
|
7998 | 7998 | $pos = 0; |
7999 | 7999 | $parenthesisopen = 0; |
8000 | 8000 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -8060,8 +8060,8 @@ discard block |
||
8060 | 8060 | } |
8061 | 8061 | |
8062 | 8062 | $sqlwhere = ''; |
8063 | - $sql = "SELECT " . $keyList; |
|
8064 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
8063 | + $sql = "SELECT ".$keyList; |
|
8064 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
8065 | 8065 | |
8066 | 8066 | if (!empty($InfoFieldList[4])) { |
8067 | 8067 | // can use SELECT request |
@@ -8079,11 +8079,11 @@ discard block |
||
8079 | 8079 | // We have to join on extrafield table |
8080 | 8080 | $errstr = ''; |
8081 | 8081 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
8082 | - $sql .= ' as main, ' . $this->db->sanitize($this->db->prefix() . $InfoFieldList[0]) . '_extrafields as extra'; |
|
8083 | - $sqlwhere .= " WHERE extra.fk_object = main." . $this->db->sanitize($InfoFieldList[2]); |
|
8084 | - $sqlwhere .= " AND " . $InfoFieldList[4]; |
|
8082 | + $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
|
8083 | + $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
|
8084 | + $sqlwhere .= " AND ".$InfoFieldList[4]; |
|
8085 | 8085 | } else { |
8086 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
8086 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
8087 | 8087 | } |
8088 | 8088 | } else { |
8089 | 8089 | $sqlwhere .= ' WHERE 1=1'; |
@@ -8104,14 +8104,14 @@ discard block |
||
8104 | 8104 | |
8105 | 8105 | // Some tables may have field, some other not. For the moment we disable it. |
8106 | 8106 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
8107 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
8107 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
8108 | 8108 | } |
8109 | 8109 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
8110 | 8110 | // print $sql; |
8111 | 8111 | |
8112 | 8112 | $sql .= $sqlwhere; |
8113 | 8113 | |
8114 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
8114 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
8115 | 8115 | |
8116 | 8116 | $resql = $this->db->query($sql); |
8117 | 8117 | if ($resql) { |
@@ -8130,7 +8130,7 @@ discard block |
||
8130 | 8130 | if (count($fields_label) > 1) { |
8131 | 8131 | $notrans = true; |
8132 | 8132 | foreach ($fields_label as $field_toshow) { |
8133 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
8133 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
8134 | 8134 | } |
8135 | 8135 | } else { |
8136 | 8136 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -8141,9 +8141,9 @@ discard block |
||
8141 | 8141 | foreach ($fields_label as $field_toshow) { |
8142 | 8142 | $translabel = $langs->trans($obj->$field_toshow); |
8143 | 8143 | if ($translabel != $obj->$field_toshow) { |
8144 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
8144 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
8145 | 8145 | } else { |
8146 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
8146 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
8147 | 8147 | } |
8148 | 8148 | } |
8149 | 8149 | |
@@ -8166,7 +8166,7 @@ discard block |
||
8166 | 8166 | } |
8167 | 8167 | |
8168 | 8168 | if (!empty($InfoFieldList[3]) && $parentField) { |
8169 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
8169 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
8170 | 8170 | $isDependList = 1; |
8171 | 8171 | } |
8172 | 8172 | |
@@ -8177,14 +8177,14 @@ discard block |
||
8177 | 8177 | } |
8178 | 8178 | $this->db->free($resql); |
8179 | 8179 | |
8180 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8180 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8181 | 8181 | } else { |
8182 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
8182 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
8183 | 8183 | } |
8184 | 8184 | } else { |
8185 | 8185 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
8186 | 8186 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[(int) $InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
8187 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8187 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
8188 | 8188 | } |
8189 | 8189 | } |
8190 | 8190 | } elseif ($type == 'link') { |
@@ -8419,7 +8419,7 @@ discard block |
||
8419 | 8419 | $value = $this->getLibStatut(3); |
8420 | 8420 | } elseif ($type == 'date') { |
8421 | 8421 | if (!empty($value)) { |
8422 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8422 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8423 | 8423 | } else { |
8424 | 8424 | $value = ''; |
8425 | 8425 | } |
@@ -8520,7 +8520,7 @@ discard block |
||
8520 | 8520 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8521 | 8521 | if (strpos($value, "|") !== false) { |
8522 | 8522 | $value = $langs->trans(explode('|', $value)[0]); |
8523 | - } elseif (! is_numeric($value)) { |
|
8523 | + } elseif (!is_numeric($value)) { |
|
8524 | 8524 | $value = $langs->trans($value); |
8525 | 8525 | } |
8526 | 8526 | } elseif ($type == 'sellist') { |
@@ -8582,9 +8582,9 @@ discard block |
||
8582 | 8582 | $translabel = $langs->trans($obj->$field_toshow); |
8583 | 8583 | } |
8584 | 8584 | if ($translabel != $field_toshow) { |
8585 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8585 | + $value .= dol_trunc($translabel, 18).' '; |
|
8586 | 8586 | } else { |
8587 | - $value .= $obj->$field_toshow . ' '; |
|
8587 | + $value .= $obj->$field_toshow.' '; |
|
8588 | 8588 | } |
8589 | 8589 | } |
8590 | 8590 | } else { |
@@ -8600,7 +8600,7 @@ discard block |
||
8600 | 8600 | } |
8601 | 8601 | } |
8602 | 8602 | } else { |
8603 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8603 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8604 | 8604 | |
8605 | 8605 | $toprint = array(); |
8606 | 8606 | $obj = $this->db->fetch_object($resql); |
@@ -8608,7 +8608,7 @@ discard block |
||
8608 | 8608 | $c->fetch($obj->rowid); |
8609 | 8609 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8610 | 8610 | foreach ($ways as $way) { |
8611 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8611 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8612 | 8612 | } |
8613 | 8613 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8614 | 8614 | } |
@@ -8624,11 +8624,11 @@ discard block |
||
8624 | 8624 | $toprint = array(); |
8625 | 8625 | foreach ($value_arr as $keyval => $valueval) { |
8626 | 8626 | if (!empty($valueval)) { |
8627 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8627 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8628 | 8628 | } |
8629 | 8629 | } |
8630 | 8630 | if (!empty($toprint)) { |
8631 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8631 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8632 | 8632 | } |
8633 | 8633 | } |
8634 | 8634 | } elseif ($type == 'chkbxlst') { |
@@ -8683,9 +8683,9 @@ discard block |
||
8683 | 8683 | $translabel = $langs->trans($obj->$field_toshow); |
8684 | 8684 | } |
8685 | 8685 | if ($translabel != $field_toshow) { |
8686 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8686 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8687 | 8687 | } else { |
8688 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8688 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8689 | 8689 | } |
8690 | 8690 | } |
8691 | 8691 | } else { |
@@ -8694,15 +8694,15 @@ discard block |
||
8694 | 8694 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8695 | 8695 | } |
8696 | 8696 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8697 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8697 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8698 | 8698 | } else { |
8699 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8699 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8700 | 8700 | } |
8701 | 8701 | } |
8702 | 8702 | } |
8703 | 8703 | } |
8704 | 8704 | } else { |
8705 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8705 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8706 | 8706 | |
8707 | 8707 | $toprint = array(); |
8708 | 8708 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8711,7 +8711,7 @@ discard block |
||
8711 | 8711 | $c->fetch($obj->rowid); |
8712 | 8712 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8713 | 8713 | foreach ($ways as $way) { |
8714 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8714 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8715 | 8715 | } |
8716 | 8716 | } |
8717 | 8717 | } |
@@ -8881,7 +8881,7 @@ discard block |
||
8881 | 8881 | global $langs; |
8882 | 8882 | |
8883 | 8883 | if (!class_exists('Validate')) { |
8884 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
8884 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
8885 | 8885 | } |
8886 | 8886 | |
8887 | 8887 | $this->clearFieldError($fieldKey); |
@@ -9120,7 +9120,7 @@ discard block |
||
9120 | 9120 | $out .= "\n"; |
9121 | 9121 | |
9122 | 9122 | $nbofextrafieldsshown = 0; |
9123 | - $e = 0; // var to manage the modulo (odd/even) |
|
9123 | + $e = 0; // var to manage the modulo (odd/even) |
|
9124 | 9124 | |
9125 | 9125 | $lastseparatorkeyfound = ''; |
9126 | 9126 | $extrafields_collapse_num = ''; |
@@ -10226,7 +10226,7 @@ discard block |
||
10226 | 10226 | continue; |
10227 | 10227 | } |
10228 | 10228 | } |
10229 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
10229 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
10230 | 10230 | } |
10231 | 10231 | return implode(',', $keys_with_alias); |
10232 | 10232 | } else { |
@@ -10361,7 +10361,7 @@ discard block |
||
10361 | 10361 | if (!$error) { |
10362 | 10362 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
10363 | 10363 | $sql .= " (".implode(", ", $keys).')'; |
10364 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10364 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
10365 | 10365 | |
10366 | 10366 | $res = $this->db->query($sql); |
10367 | 10367 | if (!$res) { |
@@ -10664,7 +10664,7 @@ discard block |
||
10664 | 10664 | |
10665 | 10665 | // Update extrafield |
10666 | 10666 | if (!$error) { |
10667 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10667 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10668 | 10668 | if ($result < 0) { |
10669 | 10669 | $error++; |
10670 | 10670 | } |
@@ -10866,12 +10866,12 @@ discard block |
||
10866 | 10866 | $error++; |
10867 | 10867 | } else { |
10868 | 10868 | while ($obj = $this->db->fetch_object($resql)) { |
10869 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10869 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10870 | 10870 | if ($result < 0) { |
10871 | 10871 | $error++; |
10872 | 10872 | $this->errors[] = $this->error; |
10873 | 10873 | } else { |
10874 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
10874 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
10875 | 10875 | if ($result < 0) { |
10876 | 10876 | $error++; |
10877 | 10877 | $this->errors[] = $this->error; |
@@ -11037,7 +11037,7 @@ discard block |
||
11037 | 11037 | ); |
11038 | 11038 | foreach ($fields as $key => $value) { |
11039 | 11039 | if (array_key_exists($key, $this->fields)) { |
11040 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
11040 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
11041 | 11041 | } |
11042 | 11042 | } |
11043 | 11043 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $title = $langs->trans("QuickAdd"); |
88 | 88 | |
89 | 89 | // URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests |
90 | -$head = '<!-- Quick add -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
90 | +$head = '<!-- Quick add -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
91 | 91 | $arrayofjs = array(); |
92 | 92 | $arrayofcss = array(); |
93 | 93 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -347,7 +347,7 @@ |
||
347 | 347 | $part1 = $reg[1]; |
348 | 348 | |
349 | 349 | //$modName = ucfirst($reg[1]); |
350 | - $modName = 'mailing_'.$reg[1]; // name of selector submodule |
|
350 | + $modName = 'mailing_'.$reg[1]; // name of selector submodule |
|
351 | 351 | //print "file=$file modName=$modName"; exit; |
352 | 352 | if (in_array($modName, $modules)) { |
353 | 353 | $langs->load("errors"); |
@@ -24,12 +24,12 @@ |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | /** |
27 | - * @var CommonObject $object |
|
28 | - * @var Conf $conf |
|
29 | - * @var Translate $langs |
|
30 | - * @var string $action |
|
31 | - * @var array<string,mixed> $parameters |
|
32 | - */ |
|
27 | + * @var CommonObject $object |
|
28 | + * @var Conf $conf |
|
29 | + * @var Translate $langs |
|
30 | + * @var string $action |
|
31 | + * @var array<string,mixed> $parameters |
|
32 | + */ |
|
33 | 33 | |
34 | 34 | // Protection to avoid direct call of template |
35 | 35 | if (empty($conf) || !is_object($conf)) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | // Set a cookie to transfer rollback page information |
166 | 166 | $prefix = dol_getprefix(''); |
167 | 167 | if (empty($_COOKIE["DOL_rollback_url_$prefix"])) { |
168 | - setcookie('DOL_rollback_url_' . $prefix, $_SERVER['REQUEST_URI'], time() + 3600, '/'); |
|
168 | + setcookie('DOL_rollback_url_'.$prefix, $_SERVER['REQUEST_URI'], time() + 3600, '/'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | // Auto redirect if OpenID Connect is the only authentication |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | // Avoid redirection hell |
174 | 174 | if (empty(GETPOST('openid_mode'))) { |
175 | 175 | dol_include_once('/core/lib/openid_connect.lib.php'); |
176 | - header("Location: " . openid_connect_get_url(), true, 302); |
|
176 | + header("Location: ".openid_connect_get_url(), true, 302); |
|
177 | 177 | } elseif (!empty($_SESSION['dol_loginmesg'])) { |
178 | 178 | // Show login error without the login form |
179 | - print '<div class="center login_main_message"><div class="error">' . dol_escape_htmltag($_SESSION['dol_loginmesg']) . '</div></div>'; |
|
179 | + print '<div class="center login_main_message"><div class="error">'.dol_escape_htmltag($_SESSION['dol_loginmesg']).'</div></div>'; |
|
180 | 180 | } |
181 | 181 | // We shouldn't continue executing this page |
182 | 182 | exit(); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | if (!getDolGlobalString("MAIN_AUTHENTICATION_OPENID_URL")) { |
441 | 441 | $url = openid_connect_get_url(); |
442 | 442 | } else { |
443 | - $url = getDolGlobalString('MAIN_AUTHENTICATION_OPENID_URL').'&state=' . openid_connect_get_state(); |
|
443 | + $url = getDolGlobalString('MAIN_AUTHENTICATION_OPENID_URL').'&state='.openid_connect_get_state(); |
|
444 | 444 | } |
445 | 445 | if (!empty($url)) { |
446 | 446 | print '<a class="alogin" href="'.$url.'">'.$langs->trans("LoginUsingOpenID").'</a>'; |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $message = ''; |
500 | 500 | // Show error message if defined |
501 | 501 | if (!empty($_SESSION['dol_loginmesg'])) { |
502 | - $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
502 | + $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
503 | 503 | } |
504 | 504 | if (!empty($message)) { |
505 | 505 | if (!empty($conf->use_javascript_ajax)) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $help_url = ''; |
119 | 119 | |
120 | 120 | // URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests |
121 | -$head = '<!-- Upload file -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
121 | +$head = '<!-- Upload file -->'."\n"; // This is used by DoliDroid to know page is a search page |
|
122 | 122 | $arrayofjs = array(); |
123 | 123 | $arrayofcss = array(); |
124 | 124 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
206 | 206 | $out = ''; |
207 | 207 | if ($maxmin > 0) { |
208 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
208 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
209 | 209 | } |
210 | 210 | $out .= '<input class="hideobject" type="file" id="fileInput"'; |
211 | 211 | // @phpstan-ignore-next-line |
@@ -69,10 +69,10 @@ |
||
69 | 69 | // Special case to force bank account |
70 | 70 | if (GETPOSTINT('fk_bank')) { |
71 | 71 | // this field may come from an external module |
72 | - $object->fk_bank = GETPOSTINT('fk_bank'); // For compatibility |
|
72 | + $object->fk_bank = GETPOSTINT('fk_bank'); // For compatibility |
|
73 | 73 | $object->fk_account = GETPOSTINT('fk_bank'); |
74 | 74 | } elseif (!empty($object->fk_account)) { |
75 | - $object->fk_bank = $object->fk_account; // For compatibility |
|
75 | + $object->fk_bank = $object->fk_account; // For compatibility |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $outputlangs = $langs; |