@@ -82,7 +82,7 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // Security check |
85 | -$socid =0; |
|
85 | +$socid = 0; |
|
86 | 86 | if ($user->socid) { |
87 | 87 | $socid = $user->socid; |
88 | 88 | } |
@@ -602,11 +602,11 @@ discard block |
||
602 | 602 | $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); |
603 | 603 | $this->job = $obj->job; |
604 | 604 | $this->signature = $obj->signature; |
605 | - $this->admin = $obj->admin; |
|
605 | + $this->admin = $obj->admin; |
|
606 | 606 | $this->note_public = $obj->note_public; |
607 | 607 | $this->note_private = $obj->note_private; |
608 | 608 | |
609 | - $this->statut = $obj->status; // deprecated |
|
609 | + $this->statut = $obj->status; // deprecated |
|
610 | 610 | $this->status = $obj->status; |
611 | 611 | |
612 | 612 | $this->photo = $obj->photo; |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php'; |
736 | 736 | |
737 | 737 | $defaultValues = new DefaultValues($this->db); |
738 | - $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
738 | + $result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined) |
|
739 | 739 | //$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity))); // User 0 (all) + me (if defined) |
740 | 740 | |
741 | 741 | if (!is_array($result) && $result < 0) { |
@@ -849,16 +849,16 @@ discard block |
||
849 | 849 | // Special case for external user |
850 | 850 | if (!empty($this->socid)) { |
851 | 851 | if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) { |
852 | - return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
852 | + return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself) |
|
853 | 853 | } |
854 | 854 | if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') { |
855 | - return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
855 | + return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself) |
|
856 | 856 | } |
857 | 857 | if ($module == 'societe' && $permlevel1 == 'export') { |
858 | - return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
858 | + return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself) |
|
859 | 859 | } |
860 | 860 | if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) { |
861 | - return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
861 | + return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself) |
|
862 | 862 | } |
863 | 863 | } |
864 | 864 | |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
1007 | 1007 | $sql .= " WHERE entity = ".((int) $entity); |
1008 | 1008 | if (!empty($whereforadd) && $whereforadd != 'allmodules') { |
1009 | - $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
1009 | + $sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | $sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights"; |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | $sql .= " FROM ".$this->db->prefix()."rights_def"; |
1143 | 1143 | $sql .= " WHERE entity = ".((int) $entity); |
1144 | 1144 | if (!empty($wherefordel) && $wherefordel != 'allmodules') { |
1145 | - $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
1145 | + $sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | // avoid admin can remove his own important rights |
@@ -1316,12 +1316,12 @@ discard block |
||
1316 | 1316 | $sql .= " AND r.entity = ".((int) $conf->entity); |
1317 | 1317 | } |
1318 | 1318 | } else { |
1319 | - $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
1319 | + $sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity |
|
1320 | 1320 | // The entity on the table usergroup_user should be useless and should never be used because it is already into gr and r. |
1321 | 1321 | // but when using MULTICOMPANY_TRANSVERSE_MODE, we may insert record that make rubbish result due to duplicate record of |
1322 | 1322 | // other entities, so we are forced to add a filter here |
1323 | 1323 | $sql .= " AND gu.entity IN (0,".$conf->entity.")"; |
1324 | - $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
1324 | + $sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity |
|
1325 | 1325 | } |
1326 | 1326 | // End of strange business rule |
1327 | 1327 | $sql .= " AND gr.fk_usergroup = gu.fk_usergroup"; |
@@ -1871,7 +1871,7 @@ discard block |
||
1871 | 1871 | $this->civility_code = $member->civility_code; |
1872 | 1872 | $this->lastname = $member->lastname; |
1873 | 1873 | $this->firstname = $member->firstname; |
1874 | - $this->gender = $member->gender; |
|
1874 | + $this->gender = $member->gender; |
|
1875 | 1875 | $this->email = $member->email; |
1876 | 1876 | $this->fk_member = $member->id; |
1877 | 1877 | $this->address = $member->address; |
@@ -2009,44 +2009,44 @@ discard block |
||
2009 | 2009 | $this->lastname = trim((string) $this->lastname); |
2010 | 2010 | $this->firstname = trim((string) $this->firstname); |
2011 | 2011 | $this->ref_employee = trim((string) $this->ref_employee); |
2012 | - $this->national_registration_number = trim((string) $this->national_registration_number); |
|
2012 | + $this->national_registration_number = trim((string) $this->national_registration_number); |
|
2013 | 2013 | $this->employee = ($this->employee > 0 ? $this->employee : 0); |
2014 | 2014 | $this->login = trim((string) $this->login); |
2015 | - $this->gender = trim((string) $this->gender); |
|
2015 | + $this->gender = trim((string) $this->gender); |
|
2016 | 2016 | |
2017 | 2017 | $this->pass = trim((string) $this->pass); |
2018 | - $this->api_key = trim((string) $this->api_key); |
|
2019 | - $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
2020 | - $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
2018 | + $this->api_key = trim((string) $this->api_key); |
|
2019 | + $this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity; |
|
2020 | + $this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity; |
|
2021 | 2021 | |
2022 | - $this->address = trim((string) $this->address); |
|
2023 | - $this->zip = trim((string) $this->zip); |
|
2024 | - $this->town = trim((string) $this->town); |
|
2022 | + $this->address = trim((string) $this->address); |
|
2023 | + $this->zip = trim((string) $this->zip); |
|
2024 | + $this->town = trim((string) $this->town); |
|
2025 | 2025 | |
2026 | - $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
2026 | + $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); |
|
2027 | 2027 | $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); |
2028 | - $this->office_phone = trim((string) $this->office_phone); |
|
2028 | + $this->office_phone = trim((string) $this->office_phone); |
|
2029 | 2029 | $this->office_fax = trim((string) $this->office_fax); |
2030 | - $this->user_mobile = trim((string) $this->user_mobile); |
|
2031 | - $this->personal_mobile = trim((string) $this->personal_mobile); |
|
2032 | - $this->email = trim((string) $this->email); |
|
2033 | - $this->personal_email = trim((string) $this->personal_email); |
|
2034 | - |
|
2035 | - $this->job = trim((string) $this->job); |
|
2036 | - $this->signature = trim((string) $this->signature); |
|
2037 | - $this->note_public = trim((string) $this->note_public); |
|
2038 | - $this->note_private = trim((string) $this->note_private); |
|
2039 | - $this->openid = trim((string) $this->openid); |
|
2030 | + $this->user_mobile = trim((string) $this->user_mobile); |
|
2031 | + $this->personal_mobile = trim((string) $this->personal_mobile); |
|
2032 | + $this->email = trim((string) $this->email); |
|
2033 | + $this->personal_email = trim((string) $this->personal_email); |
|
2034 | + |
|
2035 | + $this->job = trim((string) $this->job); |
|
2036 | + $this->signature = trim((string) $this->signature); |
|
2037 | + $this->note_public = trim((string) $this->note_public); |
|
2038 | + $this->note_private = trim((string) $this->note_private); |
|
2039 | + $this->openid = trim((string) $this->openid); |
|
2040 | 2040 | $this->admin = ($this->admin > 0 ? $this->admin : 0); |
2041 | 2041 | |
2042 | 2042 | $this->accountancy_code = trim((string) $this->accountancy_code); |
2043 | 2043 | $this->color = trim((string) $this->color); |
2044 | - $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
2044 | + $this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment; |
|
2045 | 2045 | $this->dateemploymentend = empty($this->dateemploymentend) ? '' : $this->dateemploymentend; |
2046 | 2046 | |
2047 | - $this->birth = empty($this->birth) ? '' : $this->birth; |
|
2048 | - $this->fk_warehouse = (int) $this->fk_warehouse; |
|
2049 | - $this->fk_establishment = (int) $this->fk_establishment; |
|
2047 | + $this->birth = empty($this->birth) ? '' : $this->birth; |
|
2048 | + $this->fk_warehouse = (int) $this->fk_warehouse; |
|
2049 | + $this->fk_establishment = (int) $this->fk_establishment; |
|
2050 | 2050 | |
2051 | 2051 | $this->setUpperOrLowerCase(); |
2052 | 2052 | |
@@ -2801,7 +2801,7 @@ discard block |
||
2801 | 2801 | $sql .= " WHERE fk_user = ".((int) $this->id); |
2802 | 2802 | $sql .= " AND fk_usergroup = ".((int) $group); |
2803 | 2803 | if (empty($entity)) { |
2804 | - $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
2804 | + $sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1. |
|
2805 | 2805 | } else { |
2806 | 2806 | $sql .= " AND entity = ".((int) $entity); |
2807 | 2807 | } |
@@ -3063,7 +3063,7 @@ discard block |
||
3063 | 3063 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
3064 | 3064 | } |
3065 | 3065 | $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
3066 | - $linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
3066 | + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
|
3067 | 3067 | } else { |
3068 | 3068 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
3069 | 3069 | } |
@@ -3143,7 +3143,7 @@ discard block |
||
3143 | 3143 | |
3144 | 3144 | if ($option == 'xxx') { |
3145 | 3145 | $linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; |
3146 | - $linkend = '</a>'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
3146 | + $linkend = '</a>'; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
3147 | 3147 | } |
3148 | 3148 | |
3149 | 3149 | if ($option == 'nolink') { |
@@ -3302,11 +3302,11 @@ discard block |
||
3302 | 3302 | global $conf; |
3303 | 3303 | $dn = ''; |
3304 | 3304 | if ($mode == 0) { |
3305 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN'); |
|
3305 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN'); |
|
3306 | 3306 | } elseif ($mode == 1) { |
3307 | 3307 | $dn = getDolGlobalString('LDAP_USER_DN'); |
3308 | 3308 | } elseif ($mode == 2) { |
3309 | - $dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
3309 | + $dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')]; |
|
3310 | 3310 | } |
3311 | 3311 | return $dn; |
3312 | 3312 | } |
@@ -3521,7 +3521,7 @@ discard block |
||
3521 | 3521 | $this->iplastlogin = '127.0.0.1'; |
3522 | 3522 | $this->datepreviouslogin = $now; |
3523 | 3523 | $this->ippreviouslogin = '127.0.0.1'; |
3524 | - $this->statut = 1; // deprecated |
|
3524 | + $this->statut = 1; // deprecated |
|
3525 | 3525 | $this->status = 1; |
3526 | 3526 | |
3527 | 3527 | $this->entity = 1; |
@@ -474,11 +474,11 @@ discard block |
||
474 | 474 | * |
475 | 475 | * Note: cond_reglement can not be aliased to cond_reglement!!! |
476 | 476 | */ |
477 | - private $cond_reglement; // Private to call DolDeprecationHandler |
|
477 | + private $cond_reglement; // Private to call DolDeprecationHandler |
|
478 | 478 | /** |
479 | 479 | * @var int|string Internal to detect deprecated access |
480 | 480 | */ |
481 | - protected $depr_cond_reglement; // Internal value for deprecation |
|
481 | + protected $depr_cond_reglement; // Internal value for deprecation |
|
482 | 482 | |
483 | 483 | /** |
484 | 484 | * @var int Delivery address ID |
@@ -535,12 +535,12 @@ discard block |
||
535 | 535 | /** |
536 | 536 | * @var float Multicurrency total localta1 |
537 | 537 | */ |
538 | - public $multicurrency_total_localtax1; // not in database |
|
538 | + public $multicurrency_total_localtax1; // not in database |
|
539 | 539 | |
540 | 540 | /** |
541 | 541 | * @var float Multicurrency total localtax2 |
542 | 542 | */ |
543 | - public $multicurrency_total_localtax2; // not in database |
|
543 | + public $multicurrency_total_localtax2; // not in database |
|
544 | 544 | |
545 | 545 | /** |
546 | 546 | * @var string |
@@ -1015,17 +1015,17 @@ discard block |
||
1015 | 1015 | } |
1016 | 1016 | $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); |
1017 | 1017 | if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { |
1018 | - $data[$key] = '<br><b><u>'. $labelextra . '</u></b>'; |
|
1018 | + $data[$key] = '<br><b><u>'.$labelextra.'</u></b>'; |
|
1019 | 1019 | } else { |
1020 | - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); |
|
1021 | - $data[$key] = '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1020 | + $value = (empty($this->array_options['options_'.$key]) ? '' : $this->array_options['options_'.$key]); |
|
1021 | + $data[$key] = '<br><b>'.$labelextra.':</b> '.$extrafields->showOutputField($key, $value, '', $this->table_element); |
|
1022 | 1022 | $count++; |
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | $data['closedivextra'] = '</div>'; |
1026 | 1026 | } |
1027 | 1027 | |
1028 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1028 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1029 | 1029 | $parameters = array( |
1030 | 1030 | 'tooltipcontentarray' => &$data, |
1031 | 1031 | 'params' => $params, |
@@ -1516,7 +1516,7 @@ discard block |
||
1516 | 1516 | if ($source == 'external' || $source == 'thirdparty') { |
1517 | 1517 | $sql .= " AND tc.source = 'external'"; |
1518 | 1518 | if ($status >= 0) { |
1519 | - $sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople |
|
1519 | + $sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople |
|
1520 | 1520 | } |
1521 | 1521 | } |
1522 | 1522 | $sql .= " AND tc.active = 1"; |
@@ -1899,7 +1899,7 @@ discard block |
||
1899 | 1899 | } |
1900 | 1900 | |
1901 | 1901 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element; |
1902 | - $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1902 | + $sql .= " WHERE ".$this->table_ref_field." LIKE '".$this->db->escape($ref)."'"; // no escapeforlike here |
|
1903 | 1903 | $sql .= " LIMIT 1"; |
1904 | 1904 | |
1905 | 1905 | $query = $this->db->query($sql); |
@@ -2191,9 +2191,9 @@ discard block |
||
2191 | 2191 | |
2192 | 2192 | $oldvalue = null; |
2193 | 2193 | if ($trigkey) { |
2194 | - $sql = "SELECT " . $field; |
|
2195 | - $sql .= " FROM " . MAIN_DB_PREFIX . $table; |
|
2196 | - $sql .= " WHERE " . $id_field . " = " . ((int) $id); |
|
2194 | + $sql = "SELECT ".$field; |
|
2195 | + $sql .= " FROM ".MAIN_DB_PREFIX.$table; |
|
2196 | + $sql .= " WHERE ".$id_field." = ".((int) $id); |
|
2197 | 2197 | |
2198 | 2198 | $resql = $this->db->query($sql); |
2199 | 2199 | if ($resql) { |
@@ -2572,7 +2572,7 @@ discard block |
||
2572 | 2572 | // Triggers |
2573 | 2573 | if (!$error && !$notrigger) { |
2574 | 2574 | // Call triggers |
2575 | - $result = $this->call_trigger(strtoupper($this->element) . '_MODIFY', $user); |
|
2575 | + $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); |
|
2576 | 2576 | if ($result < 0) { |
2577 | 2577 | $error++; |
2578 | 2578 | } //Do also here what you must do to rollback action if trigger fail |
@@ -2938,7 +2938,7 @@ discard block |
||
2938 | 2938 | $sql = 'UPDATE '.$this->db->prefix().$this->table_element; |
2939 | 2939 | $sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL'); |
2940 | 2940 | if (in_array($this->table_element, array('propal', 'commande', 'societe'))) { |
2941 | - $sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2941 | + $sql .= " , deposit_percent = ".(empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'"); |
|
2942 | 2942 | } |
2943 | 2943 | $sql .= ' WHERE rowid='.((int) $this->id); |
2944 | 2944 | |
@@ -3286,10 +3286,10 @@ discard block |
||
3286 | 3286 | $sql = "SELECT count(rowid) FROM ".$this->db->prefix().$this->table_element_line; |
3287 | 3287 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3288 | 3288 | if (!$renum) { |
3289 | - $sql .= " AND " . $fieldposition . " = 0"; |
|
3289 | + $sql .= " AND ".$fieldposition." = 0"; |
|
3290 | 3290 | } |
3291 | 3291 | if ($renum) { |
3292 | - $sql .= " AND " . $fieldposition . " <> 0"; |
|
3292 | + $sql .= " AND ".$fieldposition." <> 0"; |
|
3293 | 3293 | } |
3294 | 3294 | |
3295 | 3295 | dol_syslog(get_class($this)."::line_order", LOG_DEBUG); |
@@ -3310,7 +3310,7 @@ discard block |
||
3310 | 3310 | if ($fk_parent_line) { |
3311 | 3311 | $sql .= ' AND fk_parent_line IS NULL'; |
3312 | 3312 | } |
3313 | - $sql .= " ORDER BY " . $fieldposition . " ASC, rowid " . $rowidorder; |
|
3313 | + $sql .= " ORDER BY ".$fieldposition." ASC, rowid ".$rowidorder; |
|
3314 | 3314 | |
3315 | 3315 | dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); |
3316 | 3316 | $resql = $this->db->query($sql); |
@@ -3361,7 +3361,7 @@ discard block |
||
3361 | 3361 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3362 | 3362 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3363 | 3363 | $sql .= ' AND fk_parent_line = '.((int) $id); |
3364 | - $sql .= " ORDER BY " . $fieldposition . " ASC"; |
|
3364 | + $sql .= " ORDER BY ".$fieldposition." ASC"; |
|
3365 | 3365 | |
3366 | 3366 | dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id, LOG_DEBUG); |
3367 | 3367 | $resql = $this->db->query($sql); |
@@ -3484,7 +3484,7 @@ discard block |
||
3484 | 3484 | |
3485 | 3485 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3486 | 3486 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3487 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang - 1)); |
|
3487 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang - 1)); |
|
3488 | 3488 | if ($this->db->query($sql)) { |
3489 | 3489 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang - 1)); |
3490 | 3490 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3515,7 +3515,7 @@ discard block |
||
3515 | 3515 | |
3516 | 3516 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) $rang); |
3517 | 3517 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3518 | - $sql .= " AND " . $fieldposition . " = " . ((int) ($rang + 1)); |
|
3518 | + $sql .= " AND ".$fieldposition." = ".((int) ($rang + 1)); |
|
3519 | 3519 | if ($this->db->query($sql)) { |
3520 | 3520 | $sql = "UPDATE ".$this->db->prefix().$this->table_element_line." SET ".$fieldposition." = ".((int) ($rang + 1)); |
3521 | 3521 | $sql .= ' WHERE rowid = '.((int) $rowid); |
@@ -3541,7 +3541,7 @@ discard block |
||
3541 | 3541 | $fieldposition = 'position'; |
3542 | 3542 | } |
3543 | 3543 | |
3544 | - $sql = "SELECT " . $fieldposition . " FROM ".$this->db->prefix().$this->table_element_line; |
|
3544 | + $sql = "SELECT ".$fieldposition." FROM ".$this->db->prefix().$this->table_element_line; |
|
3545 | 3545 | $sql .= " WHERE rowid = ".((int) $rowid); |
3546 | 3546 | |
3547 | 3547 | dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); |
@@ -3569,7 +3569,7 @@ discard block |
||
3569 | 3569 | |
3570 | 3570 | $sql = "SELECT rowid FROM ".$this->db->prefix().$this->table_element_line; |
3571 | 3571 | $sql .= " WHERE ".$this->fk_element." = ".((int) $this->id); |
3572 | - $sql .= " AND " . $fieldposition . " = ".((int) $rang); |
|
3572 | + $sql .= " AND ".$fieldposition." = ".((int) $rang); |
|
3573 | 3573 | $resql = $this->db->query($sql); |
3574 | 3574 | if ($resql) { |
3575 | 3575 | $row = $this->db->fetch_row($resql); |
@@ -3687,7 +3687,7 @@ discard block |
||
3687 | 3687 | $newsuffix = ''; |
3688 | 3688 | } |
3689 | 3689 | if (in_array($this->table_element, array('actioncomm', 'adherent', 'advtargetemailing', 'cronjob', 'establishment'))) { |
3690 | - $fieldusermod = "fk_user_mod"; |
|
3690 | + $fieldusermod = "fk_user_mod"; |
|
3691 | 3691 | } elseif ($this->table_element == 'ecm_files') { |
3692 | 3692 | $fieldusermod = "fk_user_m"; |
3693 | 3693 | } else { |
@@ -3729,7 +3729,7 @@ discard block |
||
3729 | 3729 | $trigger_name = 'EXPENSE_REPORT_MODIFY'; |
3730 | 3730 | break; |
3731 | 3731 | default: |
3732 | - $trigger_name = strtoupper($this->element) . '_MODIFY'; |
|
3732 | + $trigger_name = strtoupper($this->element).'_MODIFY'; |
|
3733 | 3733 | } |
3734 | 3734 | $ret = $this->call_trigger($trigger_name, $user); |
3735 | 3735 | if ($ret < 0) { |
@@ -4106,19 +4106,19 @@ discard block |
||
4106 | 4106 | $this->db->begin(); |
4107 | 4107 | $error = 0; |
4108 | 4108 | |
4109 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4109 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4110 | 4110 | $sql .= "fk_source"; |
4111 | 4111 | $sql .= ", sourcetype"; |
4112 | 4112 | $sql .= ", fk_target"; |
4113 | 4113 | $sql .= ", targettype"; |
4114 | 4114 | $sql .= ") VALUES ("; |
4115 | 4115 | $sql .= ((int) $origin_id); |
4116 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4117 | - $sql .= ", " . ((int) $this->id); |
|
4118 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4116 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4117 | + $sql .= ", ".((int) $this->id); |
|
4118 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4119 | 4119 | $sql .= ")"; |
4120 | 4120 | |
4121 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4121 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4122 | 4122 | if ($this->db->query($sql)) { |
4123 | 4123 | if (!$notrigger) { |
4124 | 4124 | // Call trigger |
@@ -4370,20 +4370,20 @@ discard block |
||
4370 | 4370 | $this->db->begin(); |
4371 | 4371 | $error = 0; |
4372 | 4372 | |
4373 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4373 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4374 | 4374 | if ($updatesource) { |
4375 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4376 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4377 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4378 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4375 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4376 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4377 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4378 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4379 | 4379 | } elseif ($updatetarget) { |
4380 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4381 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4382 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4383 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4380 | + $sql .= "fk_target = ".((int) $targetid); |
|
4381 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4382 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4383 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4384 | 4384 | } |
4385 | 4385 | |
4386 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4386 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4387 | 4387 | if ($this->db->query($sql)) { |
4388 | 4388 | if (!$notrigger) { |
4389 | 4389 | // Call trigger |
@@ -4459,25 +4459,25 @@ discard block |
||
4459 | 4459 | } |
4460 | 4460 | |
4461 | 4461 | if (!$error) { |
4462 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4462 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4463 | 4463 | $sql .= " WHERE"; |
4464 | 4464 | if ($rowid > 0) { |
4465 | - $sql .= " rowid = " . ((int) $rowid); |
|
4465 | + $sql .= " rowid = ".((int) $rowid); |
|
4466 | 4466 | } else { |
4467 | 4467 | if ($deletesource) { |
4468 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4469 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4468 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4469 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
4470 | 4470 | } elseif ($deletetarget) { |
4471 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4472 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4471 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4472 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4473 | 4473 | } else { |
4474 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
4474 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
4475 | 4475 | $sql .= " OR"; |
4476 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
4476 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
4477 | 4477 | } |
4478 | 4478 | } |
4479 | 4479 | |
4480 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4480 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4481 | 4481 | if (!$this->db->query($sql)) { |
4482 | 4482 | $this->error = $this->db->lasterror(); |
4483 | 4483 | $this->errors[] = $this->error; |
@@ -4642,14 +4642,14 @@ discard block |
||
4642 | 4642 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4643 | 4643 | } |
4644 | 4644 | $sql .= " WHERE rowid = ".((int) $elementId); |
4645 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4645 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4646 | 4646 | |
4647 | 4647 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4648 | 4648 | $resql = $this->db->query($sql); |
4649 | 4649 | if ($resql) { |
4650 | 4650 | $error = 0; |
4651 | 4651 | |
4652 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4652 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4653 | 4653 | |
4654 | 4654 | if ($nb_rows_affected > 0) { |
4655 | 4655 | if (empty($trigkey)) { |
@@ -4694,7 +4694,7 @@ discard block |
||
4694 | 4694 | if ($fieldstatus == 'tosell') { |
4695 | 4695 | $this->status = $status; |
4696 | 4696 | } elseif ($fieldstatus == 'tobuy') { |
4697 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4697 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4698 | 4698 | } else { |
4699 | 4699 | $this->status = $status; |
4700 | 4700 | } |
@@ -4802,7 +4802,7 @@ discard block |
||
4802 | 4802 | return -1; |
4803 | 4803 | } |
4804 | 4804 | |
4805 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4805 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4806 | 4806 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
4807 | 4807 | $tmparray = array_keys($this->childtables); |
4808 | 4808 | if (is_numeric($tmparray[0])) { |
@@ -5872,7 +5872,7 @@ discard block |
||
5872 | 5872 | $setsharekey = false; |
5873 | 5873 | if ($this->element == 'propal' || $this->element == 'proposal') { |
5874 | 5874 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
5875 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5875 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5876 | 5876 | } |
5877 | 5877 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
5878 | 5878 | $setsharekey = true; |
@@ -5930,7 +5930,7 @@ discard block |
||
5930 | 5930 | $ecmfile->gen_or_uploaded = 'generated'; |
5931 | 5931 | $ecmfile->description = ''; // indexed content |
5932 | 5932 | $ecmfile->keywords = ''; // keyword content |
5933 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5933 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5934 | 5934 | $ecmfile->src_object_id = $this->id; |
5935 | 5935 | |
5936 | 5936 | $result = $ecmfile->create($user); |
@@ -5982,7 +5982,7 @@ discard block |
||
5982 | 5982 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
5983 | 5983 | $maxheightmini = $tmparraysize['maxheightmini']; |
5984 | 5984 | //$quality = $tmparraysize['quality']; |
5985 | - $quality = 50; // For thumbs, we force quality to 50 |
|
5985 | + $quality = 50; // For thumbs, we force quality to 50 |
|
5986 | 5986 | |
5987 | 5987 | // Create small thumbs for company (Ratio is near 16/9) |
5988 | 5988 | // Used on logon for example |
@@ -6082,8 +6082,8 @@ discard block |
||
6082 | 6082 | // phpcs:enable |
6083 | 6083 | global $langs, $conf; |
6084 | 6084 | |
6085 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
6086 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
6085 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
6086 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
6087 | 6087 | exit; |
6088 | 6088 | } |
6089 | 6089 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6275,7 +6275,7 @@ discard block |
||
6275 | 6275 | $savDisableCompute = $conf->disable_compute; |
6276 | 6276 | $conf->disable_compute = 1; |
6277 | 6277 | |
6278 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6278 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6279 | 6279 | |
6280 | 6280 | $conf->disable_compute = $savDisableCompute; |
6281 | 6281 | |
@@ -6337,7 +6337,7 @@ discard block |
||
6337 | 6337 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6338 | 6338 | $sql = "SELECT rowid"; |
6339 | 6339 | foreach ($optionsArray as $name => $label) { |
6340 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6340 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6341 | 6341 | $sql .= ", ".$name; |
6342 | 6342 | } |
6343 | 6343 | // use geo sql fonction to read as text |
@@ -6392,9 +6392,9 @@ discard block |
||
6392 | 6392 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6393 | 6393 | //var_dump($conf->disable_compute); |
6394 | 6394 | if (empty($conf->disable_compute)) { |
6395 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6396 | - $objectoffield = $this; // we can use it inside computed formula |
|
6397 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6395 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6396 | + $objectoffield = $this; // we can use it inside computed formula |
|
6397 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6398 | 6398 | } |
6399 | 6399 | } |
6400 | 6400 | } |
@@ -6575,7 +6575,7 @@ discard block |
||
6575 | 6575 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6576 | 6576 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6577 | 6577 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6578 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6578 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6579 | 6579 | } else { |
6580 | 6580 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6581 | 6581 | } |
@@ -6586,7 +6586,7 @@ discard block |
||
6586 | 6586 | // If value has changed |
6587 | 6587 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6588 | 6588 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6589 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6589 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6590 | 6590 | } else { |
6591 | 6591 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6592 | 6592 | } |
@@ -6598,7 +6598,7 @@ discard block |
||
6598 | 6598 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6599 | 6599 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6600 | 6600 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6601 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6601 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6602 | 6602 | } else { |
6603 | 6603 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6604 | 6604 | } |
@@ -7023,7 +7023,7 @@ discard block |
||
7023 | 7023 | 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. |
7024 | 7024 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7025 | 7025 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7026 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7026 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7027 | 7027 | } else { |
7028 | 7028 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7029 | 7029 | } |
@@ -7043,7 +7043,7 @@ discard block |
||
7043 | 7043 | } |
7044 | 7044 | } else { |
7045 | 7045 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7046 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7046 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7047 | 7047 | } else { |
7048 | 7048 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7049 | 7049 | } |
@@ -7436,7 +7436,7 @@ discard block |
||
7436 | 7436 | } |
7437 | 7437 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> '; |
7438 | 7438 | } elseif ($type == 'select') { // combo list |
7439 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7439 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7440 | 7440 | if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) { |
7441 | 7441 | include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7442 | 7442 | $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0); |
@@ -7468,7 +7468,7 @@ discard block |
||
7468 | 7468 | $out .= $tmpselect; |
7469 | 7469 | $out .= '</select>'; |
7470 | 7470 | } elseif ($type == 'sellist') { |
7471 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7471 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7472 | 7472 | if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) { |
7473 | 7473 | include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7474 | 7474 | $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0); |
@@ -7478,7 +7478,7 @@ discard block |
||
7478 | 7478 | if (is_array($param['options'])) { |
7479 | 7479 | $param_list = array_keys($param['options']); |
7480 | 7480 | $InfoFieldList = explode(":", $param_list[0], 5); |
7481 | - if (! empty($InfoFieldList[4])) { |
|
7481 | + if (!empty($InfoFieldList[4])) { |
|
7482 | 7482 | $pos = 0; |
7483 | 7483 | $parenthesisopen = 0; |
7484 | 7484 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7539,8 +7539,8 @@ discard block |
||
7539 | 7539 | } |
7540 | 7540 | |
7541 | 7541 | $sqlwhere = ''; |
7542 | - $sql = "SELECT " . $keyList; |
|
7543 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7542 | + $sql = "SELECT ".$keyList; |
|
7543 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7544 | 7544 | if (!empty($InfoFieldList[4])) { |
7545 | 7545 | // can use SELECT request |
7546 | 7546 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7557,18 +7557,18 @@ discard block |
||
7557 | 7557 | // We have to join on extrafield table |
7558 | 7558 | $errstr = ''; |
7559 | 7559 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7560 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
7561 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2]; |
|
7562 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7560 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
7561 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]; |
|
7562 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7563 | 7563 | } else { |
7564 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7564 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7565 | 7565 | } |
7566 | 7566 | } else { |
7567 | 7567 | $sqlwhere .= ' WHERE 1=1'; |
7568 | 7568 | } |
7569 | 7569 | // Some tables may have field, some other not. For the moment we disable it. |
7570 | 7570 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7571 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7571 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7572 | 7572 | } |
7573 | 7573 | $sql .= $sqlwhere; |
7574 | 7574 | //print $sql; |
@@ -7580,7 +7580,7 @@ discard block |
||
7580 | 7580 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
7581 | 7581 | } |
7582 | 7582 | |
7583 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
7583 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
7584 | 7584 | $resql = $this->db->query($sql); |
7585 | 7585 | if ($resql) { |
7586 | 7586 | $out .= '<option value="0"> </option>'; |
@@ -7596,7 +7596,7 @@ discard block |
||
7596 | 7596 | if (count($fields_label) > 1) { |
7597 | 7597 | $notrans = true; |
7598 | 7598 | foreach ($fields_label as $field_toshow) { |
7599 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7599 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7600 | 7600 | } |
7601 | 7601 | } else { |
7602 | 7602 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7607,12 +7607,12 @@ discard block |
||
7607 | 7607 | foreach ($fields_label as $field_toshow) { |
7608 | 7608 | $translabel = $langs->trans($obj->$field_toshow); |
7609 | 7609 | if ($translabel != $obj->$field_toshow) { |
7610 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
7610 | + $labeltoshow = dol_trunc($translabel).' '; |
|
7611 | 7611 | } else { |
7612 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
7612 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
7613 | 7613 | } |
7614 | 7614 | } |
7615 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7615 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7616 | 7616 | } else { |
7617 | 7617 | if (!$notrans) { |
7618 | 7618 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7626,34 +7626,34 @@ discard block |
||
7626 | 7626 | $labeltoshow = '(not defined)'; |
7627 | 7627 | } |
7628 | 7628 | if ($value == $obj->rowid) { |
7629 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7629 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7630 | 7630 | } |
7631 | 7631 | |
7632 | 7632 | if (!empty($InfoFieldList[3]) && $parentField) { |
7633 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7633 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7634 | 7634 | $isDependList = 1; |
7635 | 7635 | } |
7636 | 7636 | |
7637 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
7637 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
7638 | 7638 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
7639 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
7640 | - $out .= '>' . $labeltoshow . '</option>'; |
|
7639 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
7640 | + $out .= '>'.$labeltoshow.'</option>'; |
|
7641 | 7641 | } |
7642 | 7642 | |
7643 | 7643 | $i++; |
7644 | 7644 | } |
7645 | 7645 | $this->db->free($resql); |
7646 | 7646 | } else { |
7647 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7647 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7648 | 7648 | } |
7649 | 7649 | } else { |
7650 | 7650 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7651 | 7651 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7652 | 7652 | $out .= '<option value="0"> </option>'; |
7653 | 7653 | foreach ($data as $data_key => $data_value) { |
7654 | - $out .= '<option value="' . $data_key . '"'; |
|
7654 | + $out .= '<option value="'.$data_key.'"'; |
|
7655 | 7655 | $out .= ($value == $data_key ? ' selected' : ''); |
7656 | - $out .= '>' . $data_value . '</option>'; |
|
7656 | + $out .= '>'.$data_value.'</option>'; |
|
7657 | 7657 | } |
7658 | 7658 | } |
7659 | 7659 | } |
@@ -7662,7 +7662,7 @@ discard block |
||
7662 | 7662 | $value_arr = explode(',', $value); |
7663 | 7663 | $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, 0, 0, $morecss, 0, '100%'); |
7664 | 7664 | } elseif ($type == 'radio') { |
7665 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7665 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7666 | 7666 | foreach ($param['options'] as $keyopt => $valopt) { |
7667 | 7667 | $out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : ''); |
7668 | 7668 | $out .= ' value="'.$keyopt.'"'; |
@@ -7720,8 +7720,8 @@ discard block |
||
7720 | 7720 | } |
7721 | 7721 | |
7722 | 7722 | $sqlwhere = ''; |
7723 | - $sql = "SELECT " . $keyList; |
|
7724 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
7723 | + $sql = "SELECT ".$keyList; |
|
7724 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
7725 | 7725 | if (!empty($InfoFieldList[4])) { |
7726 | 7726 | // can use SELECT request |
7727 | 7727 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7737,23 +7737,23 @@ discard block |
||
7737 | 7737 | |
7738 | 7738 | // We have to join on extrafield table |
7739 | 7739 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7740 | - $sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra'; |
|
7741 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
7740 | + $sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra'; |
|
7741 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
7742 | 7742 | } else { |
7743 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
7743 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
7744 | 7744 | } |
7745 | 7745 | } else { |
7746 | 7746 | $sqlwhere .= ' WHERE 1=1'; |
7747 | 7747 | } |
7748 | 7748 | // Some tables may have field, some other not. For the moment we disable it. |
7749 | 7749 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7750 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7750 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7751 | 7751 | } |
7752 | 7752 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
7753 | 7753 | // print $sql; |
7754 | 7754 | |
7755 | 7755 | $sql .= $sqlwhere; |
7756 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
7756 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
7757 | 7757 | $resql = $this->db->query($sql); |
7758 | 7758 | if ($resql) { |
7759 | 7759 | $num = $this->db->num_rows($resql); |
@@ -7771,7 +7771,7 @@ discard block |
||
7771 | 7771 | if (count($fields_label) > 1) { |
7772 | 7772 | $notrans = true; |
7773 | 7773 | foreach ($fields_label as $field_toshow) { |
7774 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7774 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7775 | 7775 | } |
7776 | 7776 | } else { |
7777 | 7777 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7782,9 +7782,9 @@ discard block |
||
7782 | 7782 | foreach ($fields_label as $field_toshow) { |
7783 | 7783 | $translabel = $langs->trans($obj->$field_toshow); |
7784 | 7784 | if ($translabel != $obj->$field_toshow) { |
7785 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
7785 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
7786 | 7786 | } else { |
7787 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
7787 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
7788 | 7788 | } |
7789 | 7789 | } |
7790 | 7790 | |
@@ -7807,7 +7807,7 @@ discard block |
||
7807 | 7807 | } |
7808 | 7808 | |
7809 | 7809 | if (!empty($InfoFieldList[3]) && $parentField) { |
7810 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7810 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7811 | 7811 | $isDependList = 1; |
7812 | 7812 | } |
7813 | 7813 | |
@@ -7818,14 +7818,14 @@ discard block |
||
7818 | 7818 | } |
7819 | 7819 | $this->db->free($resql); |
7820 | 7820 | |
7821 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7821 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7822 | 7822 | } else { |
7823 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7823 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7824 | 7824 | } |
7825 | 7825 | } else { |
7826 | 7826 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7827 | 7827 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7828 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7828 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7829 | 7829 | } |
7830 | 7830 | } |
7831 | 7831 | } elseif ($type == 'link') { |
@@ -7883,7 +7883,7 @@ discard block |
||
7883 | 7883 | $newval = $val; |
7884 | 7884 | $newval['type'] = 'varchar(256)'; |
7885 | 7885 | |
7886 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7886 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7887 | 7887 | if (!empty($value)) { |
7888 | 7888 | foreach ($value as $option) { |
7889 | 7889 | $out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> '; |
@@ -8050,7 +8050,7 @@ discard block |
||
8050 | 8050 | $value = $this->getLibStatut(3); |
8051 | 8051 | } elseif ($type == 'date') { |
8052 | 8052 | if (!empty($value)) { |
8053 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8053 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8054 | 8054 | } else { |
8055 | 8055 | $value = ''; |
8056 | 8056 | } |
@@ -8095,7 +8095,7 @@ discard block |
||
8095 | 8095 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8096 | 8096 | if (strpos($value, "|") !== false) { |
8097 | 8097 | $value = $langs->trans(explode('|', $value)[0]); |
8098 | - } elseif (! is_numeric($value)) { |
|
8098 | + } elseif (!is_numeric($value)) { |
|
8099 | 8099 | $value = $langs->trans($value); |
8100 | 8100 | } |
8101 | 8101 | } elseif ($type == 'sellist') { |
@@ -8157,9 +8157,9 @@ discard block |
||
8157 | 8157 | $translabel = $langs->trans($obj->$field_toshow); |
8158 | 8158 | } |
8159 | 8159 | if ($translabel != $field_toshow) { |
8160 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8160 | + $value .= dol_trunc($translabel, 18).' '; |
|
8161 | 8161 | } else { |
8162 | - $value .= $obj->$field_toshow . ' '; |
|
8162 | + $value .= $obj->$field_toshow.' '; |
|
8163 | 8163 | } |
8164 | 8164 | } |
8165 | 8165 | } else { |
@@ -8175,7 +8175,7 @@ discard block |
||
8175 | 8175 | } |
8176 | 8176 | } |
8177 | 8177 | } else { |
8178 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8178 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8179 | 8179 | |
8180 | 8180 | $toprint = array(); |
8181 | 8181 | $obj = $this->db->fetch_object($resql); |
@@ -8183,7 +8183,7 @@ discard block |
||
8183 | 8183 | $c->fetch($obj->rowid); |
8184 | 8184 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8185 | 8185 | foreach ($ways as $way) { |
8186 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8186 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8187 | 8187 | } |
8188 | 8188 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8189 | 8189 | } |
@@ -8199,11 +8199,11 @@ discard block |
||
8199 | 8199 | $toprint = array(); |
8200 | 8200 | foreach ($value_arr as $keyval => $valueval) { |
8201 | 8201 | if (!empty($valueval)) { |
8202 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8202 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8203 | 8203 | } |
8204 | 8204 | } |
8205 | 8205 | if (!empty($toprint)) { |
8206 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8206 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8207 | 8207 | } |
8208 | 8208 | } |
8209 | 8209 | } elseif ($type == 'chkbxlst') { |
@@ -8258,9 +8258,9 @@ discard block |
||
8258 | 8258 | $translabel = $langs->trans($obj->$field_toshow); |
8259 | 8259 | } |
8260 | 8260 | if ($translabel != $field_toshow) { |
8261 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8261 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8262 | 8262 | } else { |
8263 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8263 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8264 | 8264 | } |
8265 | 8265 | } |
8266 | 8266 | } else { |
@@ -8269,15 +8269,15 @@ discard block |
||
8269 | 8269 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8270 | 8270 | } |
8271 | 8271 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8272 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8272 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8273 | 8273 | } else { |
8274 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8274 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8275 | 8275 | } |
8276 | 8276 | } |
8277 | 8277 | } |
8278 | 8278 | } |
8279 | 8279 | } else { |
8280 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8280 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8281 | 8281 | |
8282 | 8282 | $toprint = array(); |
8283 | 8283 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8286,7 +8286,7 @@ discard block |
||
8286 | 8286 | $c->fetch($obj->rowid); |
8287 | 8287 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8288 | 8288 | foreach ($ways as $way) { |
8289 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8289 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8290 | 8290 | } |
8291 | 8291 | } |
8292 | 8292 | } |
@@ -8439,7 +8439,7 @@ discard block |
||
8439 | 8439 | global $langs; |
8440 | 8440 | |
8441 | 8441 | if (!class_exists('Validate')) { |
8442 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
8442 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
8443 | 8443 | } |
8444 | 8444 | |
8445 | 8445 | $this->clearFieldError($fieldKey); |
@@ -8671,7 +8671,7 @@ discard block |
||
8671 | 8671 | $out .= "\n"; |
8672 | 8672 | |
8673 | 8673 | $nbofextrafieldsshown = 0; |
8674 | - $e = 0; // var to manage the modulo (odd/even) |
|
8674 | + $e = 0; // var to manage the modulo (odd/even) |
|
8675 | 8675 | |
8676 | 8676 | $lastseparatorkeyfound = ''; |
8677 | 8677 | $extrafields_collapse_num = ''; |
@@ -9191,13 +9191,13 @@ discard block |
||
9191 | 9191 | if (!empty($this->photo)) { |
9192 | 9192 | if (dolIsAllowedForPreview($this->photo)) { |
9193 | 9193 | if ((string) $imagesize == 'mini') { |
9194 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini')); |
|
9194 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini')); |
|
9195 | 9195 | } elseif ((string) $imagesize == 'small') { |
9196 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small')); |
|
9196 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small')); |
|
9197 | 9197 | } else { |
9198 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo); |
|
9198 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo); |
|
9199 | 9199 | } |
9200 | - $originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo); |
|
9200 | + $originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo); |
|
9201 | 9201 | } |
9202 | 9202 | } |
9203 | 9203 | |
@@ -9773,7 +9773,7 @@ discard block |
||
9773 | 9773 | continue; |
9774 | 9774 | } |
9775 | 9775 | } |
9776 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
9776 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
9777 | 9777 | } |
9778 | 9778 | return implode(',', $keys_with_alias); |
9779 | 9779 | } else { |
@@ -9908,7 +9908,7 @@ discard block |
||
9908 | 9908 | if (!$error) { |
9909 | 9909 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
9910 | 9910 | $sql .= " (".implode(", ", $keys).')'; |
9911 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
9911 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
9912 | 9912 | |
9913 | 9913 | $res = $this->db->query($sql); |
9914 | 9914 | if (!$res) { |
@@ -10205,7 +10205,7 @@ discard block |
||
10205 | 10205 | |
10206 | 10206 | // Update extrafield |
10207 | 10207 | if (!$error) { |
10208 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10208 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10209 | 10209 | if ($result < 0) { |
10210 | 10210 | $error++; |
10211 | 10211 | } |
@@ -10407,12 +10407,12 @@ discard block |
||
10407 | 10407 | $error++; |
10408 | 10408 | } else { |
10409 | 10409 | while ($obj = $this->db->fetch_object($resql)) { |
10410 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10410 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10411 | 10411 | if ($result < 0) { |
10412 | 10412 | $error++; |
10413 | 10413 | $this->errors[] = $this->error; |
10414 | 10414 | } else { |
10415 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
10415 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
10416 | 10416 | if ($result < 0) { |
10417 | 10417 | $error++; |
10418 | 10418 | $this->errors[] = $this->error; |
@@ -10628,7 +10628,7 @@ discard block |
||
10628 | 10628 | ); |
10629 | 10629 | foreach ($fields as $key => $value) { |
10630 | 10630 | if (array_key_exists($key, $this->fields)) { |
10631 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
10631 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
10632 | 10632 | } |
10633 | 10633 | } |
10634 | 10634 |