@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | const KEY_ID = 0; |
142 | 142 | const KEY_LABEL = 1; |
143 | - const KEY_TYPE = 2; // deprecated |
|
143 | + const KEY_TYPE = 2; // deprecated |
|
144 | 144 | const KEY_DEFAULT = 3; |
145 | 145 | const KEY_FIRST_LEVEL = 4; |
146 | 146 | const KEY_SECOND_LEVEL = 5; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $moduleNameInConf = 'supplier_proposal'; |
625 | 625 | } |
626 | 626 | |
627 | - unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
627 | + unset($conf->modules[$moduleNameInConf]); // Add this module in list of enabled modules so isModEnabled() will work (conf->module->enabled must no more be used) |
|
628 | 628 | |
629 | 629 | return 1; |
630 | 630 | } else { |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | $pathoffile = $this->getDescLongReadmeFound(); |
721 | 721 | |
722 | 722 | if ($pathoffile) { // Mostly for external modules |
723 | - $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
723 | + $content = file_get_contents($pathoffile, false, null, 0, 1024 * 1024); // Max size loaded 1Mb |
|
724 | 724 | |
725 | 725 | if ((float) DOL_VERSION >= 6.0) { |
726 | 726 | @include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; |
@@ -1485,7 +1485,7 @@ discard block |
||
1485 | 1485 | |
1486 | 1486 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; |
1487 | 1487 | $sql .= " WHERE file = '".$this->db->escape($file)."'"; |
1488 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1488 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1489 | 1489 | |
1490 | 1490 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); |
1491 | 1491 | $resql = $this->db->query($sql); |
@@ -1908,9 +1908,9 @@ discard block |
||
1908 | 1908 | |
1909 | 1909 | // If the module is active |
1910 | 1910 | foreach ($this->rights as $key => $value) { |
1911 | - $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
1911 | + $r_id = $this->rights[$key][self::KEY_ID]; // permission id in llx_rights_def (not unique because primary key is couple id-entity) |
|
1912 | 1912 | $r_label = $this->rights[$key][self::KEY_LABEL]; |
1913 | - $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
1913 | + $r_type = $this->rights[$key][self::KEY_TYPE] ?? 'w'; // TODO deprecated |
|
1914 | 1914 | $r_default = $this->rights[$key][self::KEY_DEFAULT] ?? 0; |
1915 | 1915 | $r_perms = $this->rights[$key][self::KEY_FIRST_LEVEL] ?? ''; |
1916 | 1916 | $r_subperms = $this->rights[$key][self::KEY_SECOND_LEVEL] ?? ''; |
@@ -1934,7 +1934,7 @@ discard block |
||
1934 | 1934 | } |
1935 | 1935 | |
1936 | 1936 | // condition to show or hide a user right (default: 1) (eg isModEnabled('anothermodule') or ($conf->global->MAIN_FEATURES_LEVEL > 0) or etc..) |
1937 | - $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
1937 | + $r_enabled = $this->rights[$key][self::KEY_ENABLED] ?? '1'; |
|
1938 | 1938 | |
1939 | 1939 | // Search if perm already present |
1940 | 1940 | $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def"; |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | $sql .= ", libelle"; |
1952 | 1952 | $sql .= ", module"; |
1953 | 1953 | $sql .= ", module_origin"; |
1954 | - $sql .= ", type"; // TODO deprecated |
|
1954 | + $sql .= ", type"; // TODO deprecated |
|
1955 | 1955 | $sql .= ", bydefault"; |
1956 | 1956 | $sql .= ", perms"; |
1957 | 1957 | $sql .= ", subperms"; |
@@ -1962,12 +1962,12 @@ discard block |
||
1962 | 1962 | $sql .= ", '".$this->db->escape($r_label)."'"; |
1963 | 1963 | $sql .= ", '".$this->db->escape($r_module)."'"; |
1964 | 1964 | $sql .= ", '".$this->db->escape($r_module_origin)."'"; |
1965 | - $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated |
|
1965 | + $sql .= ", '".$this->db->escape($r_type)."'"; // TODO deprecated |
|
1966 | 1966 | $sql .= ", ".((int) $r_default); |
1967 | 1967 | $sql .= ", '".$this->db->escape($r_perms)."'"; |
1968 | 1968 | $sql .= ", '".$this->db->escape($r_subperms)."'"; |
1969 | 1969 | $sql .= ", '".$this->db->escape($r_enabled)."'"; |
1970 | - $sql.= ")"; |
|
1970 | + $sql .= ")"; |
|
1971 | 1971 | |
1972 | 1972 | $resqlinsert = $this->db->query($sql, 1); |
1973 | 1973 | |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | |
2185 | 2185 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; |
2186 | 2186 | $sql .= " WHERE module = '".$this->db->escape($module)."'"; |
2187 | - $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
2187 | + $sql .= " AND menu_handler = 'all'"; // We delete only lines that were added manually or by the module activation. We keep entry added by menuhandler like 'auguria' |
|
2188 | 2188 | $sql .= " AND entity IN (0, ".$conf->entity.")"; |
2189 | 2189 | |
2190 | 2190 | dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG); |
@@ -2568,36 +2568,36 @@ discard block |
||
2568 | 2568 | } |
2569 | 2569 | |
2570 | 2570 | if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { |
2571 | - $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
2571 | + $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); |
|
2572 | 2572 | if ($this->needUpdate) { |
2573 | 2573 | $versionTitle .= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; |
2574 | 2574 | } |
2575 | 2575 | |
2576 | - $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
2577 | - $return .= $this->getVersion(1); |
|
2578 | - $return .= '</span>'; |
|
2576 | + $return .= '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >'; |
|
2577 | + $return .= $this->getVersion(1); |
|
2578 | + $return .= '</span>'; |
|
2579 | 2579 | } |
2580 | 2580 | |
2581 | - $return .= '</div> |
|
2581 | + $return .= '</div> |
|
2582 | 2582 | <div class="info-box-content info-box-text-module'.(!getDolGlobalString($const_name) ? '' : ' info-box-module-enabled'.($versiontrans ? ' info-box-content-warning' : '')).'"> |
2583 | 2583 | <span class="info-box-title">'.$this->getName().'</span> |
2584 | 2584 | <span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>'; |
2585 | 2585 | |
2586 | - $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
2586 | + $return .= '<div class="valignmiddle inline-block info-box-more">'; |
|
2587 | 2587 | //if ($versiontrans) print img_warning($langs->trans("Version").' '.$this->getVersion(1)).' '; |
2588 | - $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
2589 | - $return .= '</div><br>'; |
|
2590 | - |
|
2591 | - $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
2592 | - $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
2593 | - $return .= $codetoconfig; |
|
2594 | - $return .= '</div>'; |
|
2595 | - $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
2596 | - $return .= $codeenabledisable; |
|
2597 | - $return .= '</div>'; |
|
2598 | - $return .= '</div>'; |
|
2599 | - |
|
2600 | - $return .= ' |
|
2588 | + $return .= '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.((int) $this->numero).'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule").' - ' : '').$langs->trans("ClickToShowDescription"), $imginfo).'</a>'; |
|
2589 | + $return .= '</div><br>'; |
|
2590 | + |
|
2591 | + $return .= '<div class="valignmiddle inline-block info-box-actions">'; |
|
2592 | + $return .= '<div class="valignmiddle inline-block info-box-setup">'; |
|
2593 | + $return .= $codetoconfig; |
|
2594 | + $return .= '</div>'; |
|
2595 | + $return .= '<div class="valignmiddle inline-block marginleftonly marginrightonly">'; |
|
2596 | + $return .= $codeenabledisable; |
|
2597 | + $return .= '</div>'; |
|
2598 | + $return .= '</div>'; |
|
2599 | + |
|
2600 | + $return .= ' |
|
2601 | 2601 | </div><!-- /.info-box-content --> |
2602 | 2602 | </div><!-- /.info-box --> |
2603 | 2603 | </div>'; |
@@ -2616,7 +2616,7 @@ discard block |
||
2616 | 2616 | { |
2617 | 2617 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
2618 | 2618 | if (!empty($this->url_last_version)) { |
2619 | - $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2619 | + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only |
|
2620 | 2620 | if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) { |
2621 | 2621 | // Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . - |
2622 | 2622 | $this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']); |
@@ -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) { |
@@ -4108,19 +4108,19 @@ discard block |
||
4108 | 4108 | $this->db->begin(); |
4109 | 4109 | $error = 0; |
4110 | 4110 | |
4111 | - $sql = "INSERT INTO " . $this->db->prefix() . "element_element ("; |
|
4111 | + $sql = "INSERT INTO ".$this->db->prefix()."element_element ("; |
|
4112 | 4112 | $sql .= "fk_source"; |
4113 | 4113 | $sql .= ", sourcetype"; |
4114 | 4114 | $sql .= ", fk_target"; |
4115 | 4115 | $sql .= ", targettype"; |
4116 | 4116 | $sql .= ") VALUES ("; |
4117 | 4117 | $sql .= ((int) $origin_id); |
4118 | - $sql .= ", '" . $this->db->escape($origin) . "'"; |
|
4119 | - $sql .= ", " . ((int) $this->id); |
|
4120 | - $sql .= ", '" . $this->db->escape($targettype) . "'"; |
|
4118 | + $sql .= ", '".$this->db->escape($origin)."'"; |
|
4119 | + $sql .= ", ".((int) $this->id); |
|
4120 | + $sql .= ", '".$this->db->escape($targettype)."'"; |
|
4121 | 4121 | $sql .= ")"; |
4122 | 4122 | |
4123 | - dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG); |
|
4123 | + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); |
|
4124 | 4124 | if ($this->db->query($sql)) { |
4125 | 4125 | if (!$notrigger) { |
4126 | 4126 | // Call trigger |
@@ -4372,20 +4372,20 @@ discard block |
||
4372 | 4372 | $this->db->begin(); |
4373 | 4373 | $error = 0; |
4374 | 4374 | |
4375 | - $sql = "UPDATE " . $this->db->prefix() . "element_element SET "; |
|
4375 | + $sql = "UPDATE ".$this->db->prefix()."element_element SET "; |
|
4376 | 4376 | if ($updatesource) { |
4377 | - $sql .= "fk_source = " . ((int) $sourceid); |
|
4378 | - $sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4379 | - $sql .= " WHERE fk_target = " . ((int) $this->id); |
|
4380 | - $sql .= " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4377 | + $sql .= "fk_source = ".((int) $sourceid); |
|
4378 | + $sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4379 | + $sql .= " WHERE fk_target = ".((int) $this->id); |
|
4380 | + $sql .= " AND targettype = '".$this->db->escape($this->element)."'"; |
|
4381 | 4381 | } elseif ($updatetarget) { |
4382 | - $sql .= "fk_target = " . ((int) $targetid); |
|
4383 | - $sql .= ", targettype = '" . $this->db->escape($targettype) . "'"; |
|
4384 | - $sql .= " WHERE fk_source = " . ((int) $this->id); |
|
4385 | - $sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4382 | + $sql .= "fk_target = ".((int) $targetid); |
|
4383 | + $sql .= ", targettype = '".$this->db->escape($targettype)."'"; |
|
4384 | + $sql .= " WHERE fk_source = ".((int) $this->id); |
|
4385 | + $sql .= " AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4386 | 4386 | } |
4387 | 4387 | |
4388 | - dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG); |
|
4388 | + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); |
|
4389 | 4389 | if ($this->db->query($sql)) { |
4390 | 4390 | if (!$notrigger) { |
4391 | 4391 | // Call trigger |
@@ -4461,25 +4461,25 @@ discard block |
||
4461 | 4461 | } |
4462 | 4462 | |
4463 | 4463 | if (!$error) { |
4464 | - $sql = "DELETE FROM " . $this->db->prefix() . "element_element"; |
|
4464 | + $sql = "DELETE FROM ".$this->db->prefix()."element_element"; |
|
4465 | 4465 | $sql .= " WHERE"; |
4466 | 4466 | if ($rowid > 0) { |
4467 | - $sql .= " rowid = " . ((int) $rowid); |
|
4467 | + $sql .= " rowid = ".((int) $rowid); |
|
4468 | 4468 | } else { |
4469 | 4469 | if ($deletesource) { |
4470 | - $sql .= " fk_source = " . ((int) $sourceid) . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'"; |
|
4471 | - $sql .= " AND fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "'"; |
|
4470 | + $sql .= " fk_source = ".((int) $sourceid)." AND sourcetype = '".$this->db->escape($sourcetype)."'"; |
|
4471 | + $sql .= " AND fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."'"; |
|
4472 | 4472 | } elseif ($deletetarget) { |
4473 | - $sql .= " fk_target = " . ((int) $targetid) . " AND targettype = '" . $this->db->escape($targettype) . "'"; |
|
4474 | - $sql .= " AND fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "'"; |
|
4473 | + $sql .= " fk_target = ".((int) $targetid)." AND targettype = '".$this->db->escape($targettype)."'"; |
|
4474 | + $sql .= " AND fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."'"; |
|
4475 | 4475 | } else { |
4476 | - $sql .= " (fk_source = " . ((int) $this->id) . " AND sourcetype = '" . $this->db->escape($this->element) . "')"; |
|
4476 | + $sql .= " (fk_source = ".((int) $this->id)." AND sourcetype = '".$this->db->escape($this->element)."')"; |
|
4477 | 4477 | $sql .= " OR"; |
4478 | - $sql .= " (fk_target = " . ((int) $this->id) . " AND targettype = '" . $this->db->escape($this->element) . "')"; |
|
4478 | + $sql .= " (fk_target = ".((int) $this->id)." AND targettype = '".$this->db->escape($this->element)."')"; |
|
4479 | 4479 | } |
4480 | 4480 | } |
4481 | 4481 | |
4482 | - dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG); |
|
4482 | + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); |
|
4483 | 4483 | if (!$this->db->query($sql)) { |
4484 | 4484 | $this->error = $this->db->lasterror(); |
4485 | 4485 | $this->errors[] = $this->error; |
@@ -4644,14 +4644,14 @@ discard block |
||
4644 | 4644 | $sql .= ", date_validation = '".$this->db->idate(dol_now())."'"; |
4645 | 4645 | } |
4646 | 4646 | $sql .= " WHERE rowid = ".((int) $elementId); |
4647 | - $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4647 | + $sql .= " AND ".$fieldstatus." <> ".((int) $status); // We avoid update if status already correct |
|
4648 | 4648 | |
4649 | 4649 | dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); |
4650 | 4650 | $resql = $this->db->query($sql); |
4651 | 4651 | if ($resql) { |
4652 | 4652 | $error = 0; |
4653 | 4653 | |
4654 | - $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4654 | + $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct |
|
4655 | 4655 | |
4656 | 4656 | if ($nb_rows_affected > 0) { |
4657 | 4657 | if (empty($trigkey)) { |
@@ -4696,7 +4696,7 @@ discard block |
||
4696 | 4696 | if ($fieldstatus == 'tosell') { |
4697 | 4697 | $this->status = $status; |
4698 | 4698 | } elseif ($fieldstatus == 'tobuy') { |
4699 | - $this->status_buy = $status; // @phpstan-ignore-line |
|
4699 | + $this->status_buy = $status; // @phpstan-ignore-line |
|
4700 | 4700 | } else { |
4701 | 4701 | $this->status = $status; |
4702 | 4702 | } |
@@ -4804,7 +4804,7 @@ discard block |
||
4804 | 4804 | return -1; |
4805 | 4805 | } |
4806 | 4806 | |
4807 | - $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4807 | + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) |
|
4808 | 4808 | // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) |
4809 | 4809 | $tmparray = array_keys($this->childtables); |
4810 | 4810 | if (is_numeric($tmparray[0])) { |
@@ -5874,7 +5874,7 @@ discard block |
||
5874 | 5874 | $setsharekey = false; |
5875 | 5875 | if ($this->element == 'propal' || $this->element == 'proposal') { |
5876 | 5876 | if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { |
5877 | - $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5877 | + $setsharekey = true; // feature to make online signature is not set or set to on (default) |
|
5878 | 5878 | } |
5879 | 5879 | if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { |
5880 | 5880 | $setsharekey = true; |
@@ -5932,7 +5932,7 @@ discard block |
||
5932 | 5932 | $ecmfile->gen_or_uploaded = 'generated'; |
5933 | 5933 | $ecmfile->description = ''; // indexed content |
5934 | 5934 | $ecmfile->keywords = ''; // keyword content |
5935 | - $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5935 | + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. |
|
5936 | 5936 | $ecmfile->src_object_id = $this->id; |
5937 | 5937 | |
5938 | 5938 | $result = $ecmfile->create($user); |
@@ -5984,7 +5984,7 @@ discard block |
||
5984 | 5984 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
5985 | 5985 | $maxheightmini = $tmparraysize['maxheightmini']; |
5986 | 5986 | //$quality = $tmparraysize['quality']; |
5987 | - $quality = 50; // For thumbs, we force quality to 50 |
|
5987 | + $quality = 50; // For thumbs, we force quality to 50 |
|
5988 | 5988 | |
5989 | 5989 | // Create small thumbs for company (Ratio is near 16/9) |
5990 | 5990 | // Used on logon for example |
@@ -6084,8 +6084,8 @@ discard block |
||
6084 | 6084 | // phpcs:enable |
6085 | 6085 | global $langs, $conf; |
6086 | 6086 | |
6087 | - if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { |
|
6088 | - dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); |
|
6087 | + if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX.'_') !== 0) { |
|
6088 | + dol_print_error(null, 'The trigger "'.$triggerName.'" does not start with "'.self::TRIGGER_PREFIX.'_" as required.'); |
|
6089 | 6089 | exit; |
6090 | 6090 | } |
6091 | 6091 | if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). |
@@ -6277,7 +6277,7 @@ discard block |
||
6277 | 6277 | $savDisableCompute = $conf->disable_compute; |
6278 | 6278 | $conf->disable_compute = 1; |
6279 | 6279 | |
6280 | - $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6280 | + $ret = $this->fetch($id); /* @phpstan-ignore-line */ |
|
6281 | 6281 | |
6282 | 6282 | $conf->disable_compute = $savDisableCompute; |
6283 | 6283 | |
@@ -6339,7 +6339,7 @@ discard block |
||
6339 | 6339 | if (is_array($optionsArray) && count($optionsArray) > 0) { |
6340 | 6340 | $sql = "SELECT rowid"; |
6341 | 6341 | foreach ($optionsArray as $name => $label) { |
6342 | - if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) { |
|
6342 | + if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg', 'polygon']))) { |
|
6343 | 6343 | $sql .= ", ".$name; |
6344 | 6344 | } |
6345 | 6345 | // use geo sql fonction to read as text |
@@ -6392,7 +6392,7 @@ discard block |
||
6392 | 6392 | **/ |
6393 | 6393 | if (is_array($extrafields->attributes[$this->table_element]['label'])) { |
6394 | 6394 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
6395 | - $this->array_options['options_' . $key] = null; |
|
6395 | + $this->array_options['options_'.$key] = null; |
|
6396 | 6396 | } |
6397 | 6397 | } |
6398 | 6398 | } |
@@ -6404,9 +6404,9 @@ discard block |
||
6404 | 6404 | if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { |
6405 | 6405 | //var_dump($conf->disable_compute); |
6406 | 6406 | if (empty($conf->disable_compute)) { |
6407 | - global $objectoffield; // We set a global variable to $objectoffield so |
|
6408 | - $objectoffield = $this; // we can use it inside computed formula |
|
6409 | - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6407 | + global $objectoffield; // We set a global variable to $objectoffield so |
|
6408 | + $objectoffield = $this; // we can use it inside computed formula |
|
6409 | + $this->array_options['options_'.$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); |
|
6410 | 6410 | } |
6411 | 6411 | } |
6412 | 6412 | } |
@@ -6587,7 +6587,7 @@ discard block |
||
6587 | 6587 | // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. |
6588 | 6588 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6589 | 6589 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
6590 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6590 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6591 | 6591 | } else { |
6592 | 6592 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6593 | 6593 | } |
@@ -6598,7 +6598,7 @@ discard block |
||
6598 | 6598 | // If value has changed |
6599 | 6599 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
6600 | 6600 | if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { |
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 | } |
@@ -6610,7 +6610,7 @@ discard block |
||
6610 | 6610 | //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); |
6611 | 6611 | // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value |
6612 | 6612 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption |
6613 | - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6613 | + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master |
|
6614 | 6614 | } else { |
6615 | 6615 | $new_array_options[$key] = $this->array_options[$key]; // Value is kept |
6616 | 6616 | } |
@@ -7035,7 +7035,7 @@ discard block |
||
7035 | 7035 | 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. |
7036 | 7036 | if ($algo == 'dolcrypt') { // dolibarr reversible encryption |
7037 | 7037 | if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { |
7038 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7038 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7039 | 7039 | } else { |
7040 | 7040 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7041 | 7041 | } |
@@ -7055,7 +7055,7 @@ discard block |
||
7055 | 7055 | } |
7056 | 7056 | } else { |
7057 | 7057 | if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption |
7058 | - $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7058 | + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master |
|
7059 | 7059 | } else { |
7060 | 7060 | $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept |
7061 | 7061 | } |
@@ -7465,7 +7465,7 @@ discard block |
||
7465 | 7465 | } |
7466 | 7466 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> '; |
7467 | 7467 | } elseif ($type == 'select') { // combo list |
7468 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7468 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7469 | 7469 | if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) { |
7470 | 7470 | include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7471 | 7471 | $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0); |
@@ -7497,7 +7497,7 @@ discard block |
||
7497 | 7497 | $out .= $tmpselect; |
7498 | 7498 | $out .= '</select>'; |
7499 | 7499 | } elseif ($type == 'sellist') { |
7500 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7500 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7501 | 7501 | if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_EXTRAFIELDS_DISABLE_SELECT2')) { |
7502 | 7502 | include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7503 | 7503 | $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0); |
@@ -7507,7 +7507,7 @@ discard block |
||
7507 | 7507 | if (is_array($param['options'])) { |
7508 | 7508 | $param_list = array_keys($param['options']); |
7509 | 7509 | $InfoFieldList = explode(":", $param_list[0], 5); |
7510 | - if (! empty($InfoFieldList[4])) { |
|
7510 | + if (!empty($InfoFieldList[4])) { |
|
7511 | 7511 | $pos = 0; |
7512 | 7512 | $parenthesisopen = 0; |
7513 | 7513 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -7568,8 +7568,8 @@ discard block |
||
7568 | 7568 | } |
7569 | 7569 | |
7570 | 7570 | $sqlwhere = ''; |
7571 | - $sql = "SELECT " . $keyList; |
|
7572 | - $sql .= " FROM " . $this->db->prefix() . $InfoFieldList[0]; |
|
7571 | + $sql = "SELECT ".$keyList; |
|
7572 | + $sql .= " FROM ".$this->db->prefix().$InfoFieldList[0]; |
|
7573 | 7573 | if (!empty($InfoFieldList[4])) { |
7574 | 7574 | // can use SELECT request |
7575 | 7575 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7586,18 +7586,18 @@ discard block |
||
7586 | 7586 | // We have to join on extrafield table |
7587 | 7587 | $errstr = ''; |
7588 | 7588 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7589 | - $sql .= " as main, " . $this->db->prefix() . $InfoFieldList[0] . "_extrafields as extra"; |
|
7590 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2]; |
|
7591 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7589 | + $sql .= " as main, ".$this->db->prefix().$InfoFieldList[0]."_extrafields as extra"; |
|
7590 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]; |
|
7591 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7592 | 7592 | } else { |
7593 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7593 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
7594 | 7594 | } |
7595 | 7595 | } else { |
7596 | 7596 | $sqlwhere .= ' WHERE 1=1'; |
7597 | 7597 | } |
7598 | 7598 | // Some tables may have field, some other not. For the moment we disable it. |
7599 | 7599 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7600 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7600 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7601 | 7601 | } |
7602 | 7602 | $sql .= $sqlwhere; |
7603 | 7603 | //print $sql; |
@@ -7609,7 +7609,7 @@ discard block |
||
7609 | 7609 | $sql .= " ORDER BY ".$this->db->sanitize(implode(', ', $fields_label)); |
7610 | 7610 | } |
7611 | 7611 | |
7612 | - dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG); |
|
7612 | + dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); |
|
7613 | 7613 | $resql = $this->db->query($sql); |
7614 | 7614 | if ($resql) { |
7615 | 7615 | $out .= '<option value="0"> </option>'; |
@@ -7625,7 +7625,7 @@ discard block |
||
7625 | 7625 | if (count($fields_label) > 1) { |
7626 | 7626 | $notrans = true; |
7627 | 7627 | foreach ($fields_label as $field_toshow) { |
7628 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7628 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7629 | 7629 | } |
7630 | 7630 | } else { |
7631 | 7631 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7636,12 +7636,12 @@ discard block |
||
7636 | 7636 | foreach ($fields_label as $field_toshow) { |
7637 | 7637 | $translabel = $langs->trans($obj->$field_toshow); |
7638 | 7638 | if ($translabel != $obj->$field_toshow) { |
7639 | - $labeltoshow = dol_trunc($translabel) . ' '; |
|
7639 | + $labeltoshow = dol_trunc($translabel).' '; |
|
7640 | 7640 | } else { |
7641 | - $labeltoshow = dol_trunc($obj->$field_toshow) . ' '; |
|
7641 | + $labeltoshow = dol_trunc($obj->$field_toshow).' '; |
|
7642 | 7642 | } |
7643 | 7643 | } |
7644 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7644 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7645 | 7645 | } else { |
7646 | 7646 | if (!$notrans) { |
7647 | 7647 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
@@ -7655,34 +7655,34 @@ discard block |
||
7655 | 7655 | $labeltoshow = '(not defined)'; |
7656 | 7656 | } |
7657 | 7657 | if ($value == $obj->rowid) { |
7658 | - $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>'; |
|
7658 | + $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>'; |
|
7659 | 7659 | } |
7660 | 7660 | |
7661 | 7661 | if (!empty($InfoFieldList[3]) && $parentField) { |
7662 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7662 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7663 | 7663 | $isDependList = 1; |
7664 | 7664 | } |
7665 | 7665 | |
7666 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
7666 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
7667 | 7667 | $out .= ($value == $obj->rowid ? ' selected' : ''); |
7668 | - $out .= (!empty($parent) ? ' parent="' . $parent . '"' : ''); |
|
7669 | - $out .= '>' . $labeltoshow . '</option>'; |
|
7668 | + $out .= (!empty($parent) ? ' parent="'.$parent.'"' : ''); |
|
7669 | + $out .= '>'.$labeltoshow.'</option>'; |
|
7670 | 7670 | } |
7671 | 7671 | |
7672 | 7672 | $i++; |
7673 | 7673 | } |
7674 | 7674 | $this->db->free($resql); |
7675 | 7675 | } else { |
7676 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7676 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7677 | 7677 | } |
7678 | 7678 | } else { |
7679 | 7679 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7680 | 7680 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7681 | 7681 | $out .= '<option value="0"> </option>'; |
7682 | 7682 | foreach ($data as $data_key => $data_value) { |
7683 | - $out .= '<option value="' . $data_key . '"'; |
|
7683 | + $out .= '<option value="'.$data_key.'"'; |
|
7684 | 7684 | $out .= ($value == $data_key ? ' selected' : ''); |
7685 | - $out .= '>' . $data_value . '</option>'; |
|
7685 | + $out .= '>'.$data_value.'</option>'; |
|
7686 | 7686 | } |
7687 | 7687 | } |
7688 | 7688 | } |
@@ -7691,7 +7691,7 @@ discard block |
||
7691 | 7691 | $value_arr = explode(',', $value); |
7692 | 7692 | $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ? null : $param['options']), $value_arr, 0, 0, $morecss, 0, '100%'); |
7693 | 7693 | } elseif ($type == 'radio') { |
7694 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7694 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7695 | 7695 | foreach ($param['options'] as $keyopt => $valopt) { |
7696 | 7696 | $out .= '<input class="flat '.$morecss.'" type="radio" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : ''); |
7697 | 7697 | $out .= ' value="'.$keyopt.'"'; |
@@ -7749,8 +7749,8 @@ discard block |
||
7749 | 7749 | } |
7750 | 7750 | |
7751 | 7751 | $sqlwhere = ''; |
7752 | - $sql = "SELECT " . $keyList; |
|
7753 | - $sql .= ' FROM ' . $this->db->prefix() . $InfoFieldList[0]; |
|
7752 | + $sql = "SELECT ".$keyList; |
|
7753 | + $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; |
|
7754 | 7754 | if (!empty($InfoFieldList[4])) { |
7755 | 7755 | // can use SELECT request |
7756 | 7756 | if (strpos($InfoFieldList[4], '$SEL$') !== false) { |
@@ -7766,23 +7766,23 @@ discard block |
||
7766 | 7766 | |
7767 | 7767 | // We have to join on extrafield table |
7768 | 7768 | if (strpos($InfoFieldList[4], 'extra') !== false) { |
7769 | - $sql .= ' as main, ' . $this->db->prefix() . $InfoFieldList[0] . '_extrafields as extra'; |
|
7770 | - $sqlwhere .= " WHERE extra.fk_object=main." . $InfoFieldList[2] . " AND " . $InfoFieldList[4]; |
|
7769 | + $sql .= ' as main, '.$this->db->prefix().$InfoFieldList[0].'_extrafields as extra'; |
|
7770 | + $sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4]; |
|
7771 | 7771 | } else { |
7772 | - $sqlwhere .= " WHERE " . $InfoFieldList[4]; |
|
7772 | + $sqlwhere .= " WHERE ".$InfoFieldList[4]; |
|
7773 | 7773 | } |
7774 | 7774 | } else { |
7775 | 7775 | $sqlwhere .= ' WHERE 1=1'; |
7776 | 7776 | } |
7777 | 7777 | // Some tables may have field, some other not. For the moment we disable it. |
7778 | 7778 | if (in_array($InfoFieldList[0], array('tablewithentity'))) { |
7779 | - $sqlwhere .= " AND entity = " . ((int) $conf->entity); |
|
7779 | + $sqlwhere .= " AND entity = ".((int) $conf->entity); |
|
7780 | 7780 | } |
7781 | 7781 | // $sql.=preg_replace('/^ AND /','',$sqlwhere); |
7782 | 7782 | // print $sql; |
7783 | 7783 | |
7784 | 7784 | $sql .= $sqlwhere; |
7785 | - dol_syslog(get_class($this) . '::showInputField type=chkbxlst', LOG_DEBUG); |
|
7785 | + dol_syslog(get_class($this).'::showInputField type=chkbxlst', LOG_DEBUG); |
|
7786 | 7786 | $resql = $this->db->query($sql); |
7787 | 7787 | if ($resql) { |
7788 | 7788 | $num = $this->db->num_rows($resql); |
@@ -7800,7 +7800,7 @@ discard block |
||
7800 | 7800 | if (count($fields_label) > 1) { |
7801 | 7801 | $notrans = true; |
7802 | 7802 | foreach ($fields_label as $field_toshow) { |
7803 | - $labeltoshow .= $obj->$field_toshow . ' '; |
|
7803 | + $labeltoshow .= $obj->$field_toshow.' '; |
|
7804 | 7804 | } |
7805 | 7805 | } else { |
7806 | 7806 | $labeltoshow = $obj->{$InfoFieldList[1]}; |
@@ -7811,9 +7811,9 @@ discard block |
||
7811 | 7811 | foreach ($fields_label as $field_toshow) { |
7812 | 7812 | $translabel = $langs->trans($obj->$field_toshow); |
7813 | 7813 | if ($translabel != $obj->$field_toshow) { |
7814 | - $labeltoshow = dol_trunc($translabel, 18) . ' '; |
|
7814 | + $labeltoshow = dol_trunc($translabel, 18).' '; |
|
7815 | 7815 | } else { |
7816 | - $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' '; |
|
7816 | + $labeltoshow = dol_trunc($obj->$field_toshow, 18).' '; |
|
7817 | 7817 | } |
7818 | 7818 | } |
7819 | 7819 | |
@@ -7836,7 +7836,7 @@ discard block |
||
7836 | 7836 | } |
7837 | 7837 | |
7838 | 7838 | if (!empty($InfoFieldList[3]) && $parentField) { |
7839 | - $parent = $parentName . ':' . $obj->{$parentField}; |
|
7839 | + $parent = $parentName.':'.$obj->{$parentField}; |
|
7840 | 7840 | $isDependList = 1; |
7841 | 7841 | } |
7842 | 7842 | |
@@ -7847,14 +7847,14 @@ discard block |
||
7847 | 7847 | } |
7848 | 7848 | $this->db->free($resql); |
7849 | 7849 | |
7850 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7850 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7851 | 7851 | } else { |
7852 | - print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.<br>'; |
|
7852 | + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.<br>'; |
|
7853 | 7853 | } |
7854 | 7854 | } else { |
7855 | 7855 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
7856 | 7856 | $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]], '', 'parent', 64, $InfoFieldList[6], 1, 1); |
7857 | - $out = $form->multiselectarray($keyprefix . $key . $keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7857 | + $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, 0, 0, $morecss, 0, '100%'); |
|
7858 | 7858 | } |
7859 | 7859 | } |
7860 | 7860 | } elseif ($type == 'link') { |
@@ -7912,7 +7912,7 @@ discard block |
||
7912 | 7912 | $newval = $val; |
7913 | 7913 | $newval['type'] = 'varchar(256)'; |
7914 | 7914 | |
7915 | - $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7915 | + $out = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
7916 | 7916 | if (!empty($value)) { |
7917 | 7917 | foreach ($value as $option) { |
7918 | 7918 | $out .= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> '; |
@@ -8081,7 +8081,7 @@ discard block |
||
8081 | 8081 | $value = $this->getLibStatut(3); |
8082 | 8082 | } elseif ($type == 'date') { |
8083 | 8083 | if (!empty($value)) { |
8084 | - $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8084 | + $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) |
|
8085 | 8085 | } else { |
8086 | 8086 | $value = ''; |
8087 | 8087 | } |
@@ -8126,7 +8126,7 @@ discard block |
||
8126 | 8126 | $value = isset($param['options'][(string) $value]) ? $param['options'][(string) $value] : ''; |
8127 | 8127 | if (strpos($value, "|") !== false) { |
8128 | 8128 | $value = $langs->trans(explode('|', $value)[0]); |
8129 | - } elseif (! is_numeric($value)) { |
|
8129 | + } elseif (!is_numeric($value)) { |
|
8130 | 8130 | $value = $langs->trans($value); |
8131 | 8131 | } |
8132 | 8132 | } elseif ($type == 'sellist') { |
@@ -8188,9 +8188,9 @@ discard block |
||
8188 | 8188 | $translabel = $langs->trans($obj->$field_toshow); |
8189 | 8189 | } |
8190 | 8190 | if ($translabel != $field_toshow) { |
8191 | - $value .= dol_trunc($translabel, 18) . ' '; |
|
8191 | + $value .= dol_trunc($translabel, 18).' '; |
|
8192 | 8192 | } else { |
8193 | - $value .= $obj->$field_toshow . ' '; |
|
8193 | + $value .= $obj->$field_toshow.' '; |
|
8194 | 8194 | } |
8195 | 8195 | } |
8196 | 8196 | } else { |
@@ -8206,7 +8206,7 @@ discard block |
||
8206 | 8206 | } |
8207 | 8207 | } |
8208 | 8208 | } else { |
8209 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8209 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8210 | 8210 | |
8211 | 8211 | $toprint = array(); |
8212 | 8212 | $obj = $this->db->fetch_object($resql); |
@@ -8214,7 +8214,7 @@ discard block |
||
8214 | 8214 | $c->fetch($obj->rowid); |
8215 | 8215 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8216 | 8216 | foreach ($ways as $way) { |
8217 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8217 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8218 | 8218 | } |
8219 | 8219 | $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
8220 | 8220 | } |
@@ -8230,11 +8230,11 @@ discard block |
||
8230 | 8230 | $toprint = array(); |
8231 | 8231 | foreach ($value_arr as $keyval => $valueval) { |
8232 | 8232 | if (!empty($valueval)) { |
8233 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $param['options'][$valueval] . '</li>'; |
|
8233 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>'; |
|
8234 | 8234 | } |
8235 | 8235 | } |
8236 | 8236 | if (!empty($toprint)) { |
8237 | - $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
8237 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
8238 | 8238 | } |
8239 | 8239 | } |
8240 | 8240 | } elseif ($type == 'chkbxlst') { |
@@ -8289,9 +8289,9 @@ discard block |
||
8289 | 8289 | $translabel = $langs->trans($obj->$field_toshow); |
8290 | 8290 | } |
8291 | 8291 | if ($translabel != $field_toshow) { |
8292 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8292 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8293 | 8293 | } else { |
8294 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->$field_toshow . '</li>'; |
|
8294 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>'; |
|
8295 | 8295 | } |
8296 | 8296 | } |
8297 | 8297 | } else { |
@@ -8300,15 +8300,15 @@ discard block |
||
8300 | 8300 | $translabel = $langs->trans($obj->{$InfoFieldList[1]}); |
8301 | 8301 | } |
8302 | 8302 | if ($translabel != $obj->{$InfoFieldList[1]}) { |
8303 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . dol_trunc($translabel, 18) . '</li>'; |
|
8303 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>'; |
|
8304 | 8304 | } else { |
8305 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $obj->{$InfoFieldList[1]} . '</li>'; |
|
8305 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>'; |
|
8306 | 8306 | } |
8307 | 8307 | } |
8308 | 8308 | } |
8309 | 8309 | } |
8310 | 8310 | } else { |
8311 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
8311 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
8312 | 8312 | |
8313 | 8313 | $toprint = array(); |
8314 | 8314 | while ($obj = $this->db->fetch_object($resql)) { |
@@ -8317,7 +8317,7 @@ discard block |
||
8317 | 8317 | $c->fetch($obj->rowid); |
8318 | 8318 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
8319 | 8319 | foreach ($ways as $way) { |
8320 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
8320 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
8321 | 8321 | } |
8322 | 8322 | } |
8323 | 8323 | } |
@@ -8470,7 +8470,7 @@ discard block |
||
8470 | 8470 | global $langs; |
8471 | 8471 | |
8472 | 8472 | if (!class_exists('Validate')) { |
8473 | - require_once DOL_DOCUMENT_ROOT . '/core/class/validate.class.php'; |
|
8473 | + require_once DOL_DOCUMENT_ROOT.'/core/class/validate.class.php'; |
|
8474 | 8474 | } |
8475 | 8475 | |
8476 | 8476 | $this->clearFieldError($fieldKey); |
@@ -8702,7 +8702,7 @@ discard block |
||
8702 | 8702 | $out .= "\n"; |
8703 | 8703 | |
8704 | 8704 | $nbofextrafieldsshown = 0; |
8705 | - $e = 0; // var to manage the modulo (odd/even) |
|
8705 | + $e = 0; // var to manage the modulo (odd/even) |
|
8706 | 8706 | |
8707 | 8707 | $lastseparatorkeyfound = ''; |
8708 | 8708 | $extrafields_collapse_num = ''; |
@@ -9228,13 +9228,13 @@ discard block |
||
9228 | 9228 | if (!empty($this->photo)) { |
9229 | 9229 | if (dolIsAllowedForPreview($this->photo)) { |
9230 | 9230 | if ((string) $imagesize == 'mini') { |
9231 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini')); |
|
9231 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_mini')); |
|
9232 | 9232 | } elseif ((string) $imagesize == 'small') { |
9233 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small')); |
|
9233 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName(getImageFileNameForSize($this->photo, '_small')); |
|
9234 | 9234 | } else { |
9235 | - $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo); |
|
9235 | + $file = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo); |
|
9236 | 9236 | } |
9237 | - $originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart) . 'photos/' . dol_sanitizeFileName($this->photo); |
|
9237 | + $originalfile = get_exdir(0, 0, 0, 0, $this, $newmodulepart).'photos/'.dol_sanitizeFileName($this->photo); |
|
9238 | 9238 | } |
9239 | 9239 | } |
9240 | 9240 | |
@@ -9810,7 +9810,7 @@ discard block |
||
9810 | 9810 | continue; |
9811 | 9811 | } |
9812 | 9812 | } |
9813 | - $keys_with_alias[] = $alias . '.' . $fieldname; |
|
9813 | + $keys_with_alias[] = $alias.'.'.$fieldname; |
|
9814 | 9814 | } |
9815 | 9815 | return implode(',', $keys_with_alias); |
9816 | 9816 | } else { |
@@ -9945,7 +9945,7 @@ discard block |
||
9945 | 9945 | if (!$error) { |
9946 | 9946 | $sql = "INSERT INTO ".$this->db->prefix().$this->table_element; |
9947 | 9947 | $sql .= " (".implode(", ", $keys).')'; |
9948 | - $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
9948 | + $sql .= " VALUES (".implode(", ", $values).")"; // $values can contains 'abc' or 123 |
|
9949 | 9949 | |
9950 | 9950 | $res = $this->db->query($sql); |
9951 | 9951 | if (!$res) { |
@@ -10242,7 +10242,7 @@ discard block |
||
10242 | 10242 | |
10243 | 10243 | // Update extrafield |
10244 | 10244 | if (!$error) { |
10245 | - $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10245 | + $result = $this->insertExtraFields(); // This delete and reinsert extrafields |
|
10246 | 10246 | if ($result < 0) { |
10247 | 10247 | $error++; |
10248 | 10248 | } |
@@ -10444,12 +10444,12 @@ discard block |
||
10444 | 10444 | $error++; |
10445 | 10445 | } else { |
10446 | 10446 | while ($obj = $this->db->fetch_object($resql)) { |
10447 | - $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10447 | + $result = $this->fetch($obj->rowid); // @phpstan-ignore-line |
|
10448 | 10448 | if ($result < 0) { |
10449 | 10449 | $error++; |
10450 | 10450 | $this->errors[] = $this->error; |
10451 | 10451 | } else { |
10452 | - $result = $this->delete($user); // @phpstan-ignore-line |
|
10452 | + $result = $this->delete($user); // @phpstan-ignore-line |
|
10453 | 10453 | if ($result < 0) { |
10454 | 10454 | $error++; |
10455 | 10455 | $this->errors[] = $this->error; |
@@ -10665,7 +10665,7 @@ discard block |
||
10665 | 10665 | ); |
10666 | 10666 | foreach ($fields as $key => $value) { |
10667 | 10667 | if (array_key_exists($key, $this->fields)) { |
10668 | - $this->{$key} = $value; // @phpstan-ignore-line |
|
10668 | + $this->{$key} = $value; // @phpstan-ignore-line |
|
10669 | 10669 | } |
10670 | 10670 | } |
10671 | 10671 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $action = GETPOST('action', 'aZ09'); |
46 | 46 | $massaction = GETPOST('massaction', 'alpha'); |
47 | 47 | $cancel = GETPOST('cancel', 'alpha'); |
48 | -$toselect = GETPOST('toselect', 'array'); |
|
48 | +$toselect = GETPOST('toselect', 'array'); |
|
49 | 49 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
50 | 50 | $backtopage = GETPOST('backtopage', 'alpha'); |
51 | 51 | $mode = GETPOST('mode', 'alpha'); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $object->note_public = trim($comment); |
146 | 146 | $object->note_private = ''; |
147 | 147 | $object->mail_valid = trim($mail_valid); |
148 | - $object->vote = $vote; // $vote is already int |
|
148 | + $object->vote = $vote; // $vote is already int |
|
149 | 149 | |
150 | 150 | // Fill array 'array_options' with data from add form |
151 | 151 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; |
180 | 180 | $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect field created after a New on another form object creation |
181 | 181 | |
182 | - header("Location: " . $urltogo); |
|
182 | + header("Location: ".$urltogo); |
|
183 | 183 | exit; |
184 | 184 | } else { |
185 | 185 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $object->note_public = trim($comment); |
207 | 207 | $object->note_private = ''; |
208 | 208 | $object->mail_valid = trim($mail_valid); |
209 | - $object->vote = $vote; // $vote is already int. |
|
209 | + $object->vote = $vote; // $vote is already int. |
|
210 | 210 | |
211 | 211 | // Fill array 'array_options' with data from add form |
212 | 212 | $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); |