|
@@ -116,7 +116,7 @@ class Form
|
|
|
$ret = '';
|
|
|
|
|
|
// TODO change for compatibility
|
|
|
- if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;/', $typeofdata)) {
|
|
|
+ if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) {
|
|
|
if (!empty($perm)) {
|
|
|
$tmp = explode(':', $typeofdata);
|
|
|
$ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">';
|
|
@@ -242,7 +242,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
// When option to edit inline is activated
|
|
|
- if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
|
|
|
+ if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
|
|
|
$ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
|
|
|
} else {
|
|
|
if ($editaction == '') {
|
|
@@ -378,7 +378,7 @@ class Form
|
|
|
}
|
|
|
} elseif (preg_match('/^ckeditor/', $typeofdata)) {
|
|
|
$tmpcontent = dol_htmlentitiesbr($value);
|
|
|
- if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
|
|
+ if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
|
|
|
$firstline = preg_replace('/<br>.*/', '', $tmpcontent);
|
|
|
$firstline = preg_replace('/[\n\r].*/', '', $firstline);
|
|
|
$tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : '');
|
|
@@ -422,7 +422,7 @@ class Form
|
|
|
|
|
|
// List of extra languages
|
|
|
$arrayoflangcode = array();
|
|
|
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) {
|
|
|
+ if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
|
|
|
$arrayoflangcode[] = $conf->global->PDF_USE_ALSO_LANGUAGE_CODE;
|
|
|
}
|
|
|
|
|
@@ -1324,7 +1324,7 @@ class Form
|
|
|
|
|
|
$out = '';
|
|
|
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && !$forcecombo) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT') && !$forcecombo) {
|
|
|
if (is_null($ajaxoptions)) {
|
|
|
$ajaxoptions = array();
|
|
|
}
|
|
@@ -1353,7 +1353,7 @@ class Form
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
|
}
|
|
|
- $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
|
|
|
+ $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
|
|
if ($hidelabel == 3) {
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
@@ -1440,12 +1440,12 @@ class Form
|
|
|
|
|
|
// We search companies
|
|
|
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
|
|
- if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
|
|
|
+ if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
|
|
|
$sql .= ", s.address, s.zip, s.town";
|
|
|
$sql .= ", dictp.code as country_code";
|
|
|
}
|
|
|
$sql .= " FROM " . $this->db->prefix() . "societe as s";
|
|
|
- if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
|
|
|
+ if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
|
|
|
$sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays";
|
|
|
}
|
|
|
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
|
|
@@ -1463,7 +1463,7 @@ class Form
|
|
|
if (!$user->hasRight('societe', 'client', 'voir') && !$user->socid) {
|
|
|
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id);
|
|
|
}
|
|
|
- if (!empty($conf->global->COMPANY_HIDE_INACTIVE_IN_COMBOBOX)) {
|
|
|
+ if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) {
|
|
|
$sql .= " AND s.status <> 0";
|
|
|
}
|
|
|
if (!empty($excludeids)) {
|
|
@@ -1476,7 +1476,7 @@ class Form
|
|
|
// Add criteria
|
|
|
if ($filterkey && $filterkey != '') {
|
|
|
$sql .= " AND (";
|
|
|
- $prefix = empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -1516,7 +1516,7 @@ class Form
|
|
|
$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n";
|
|
|
|
|
|
$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : '');
|
|
|
- if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
|
|
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
|
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
|
if ($showempty && !is_numeric($showempty)) {
|
|
@@ -1537,7 +1537,7 @@ class Form
|
|
|
while ($i < $num) {
|
|
|
$obj = $this->db->fetch_object($resql);
|
|
|
$label = '';
|
|
|
- if ($showcode || !empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
|
|
|
+ if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) {
|
|
|
if (($obj->client) && (!empty($obj->code_client))) {
|
|
|
$label = $obj->code_client . ' - ';
|
|
|
}
|
|
@@ -1553,7 +1553,7 @@ class Form
|
|
|
$label .= ' (' . $obj->name_alias . ')';
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) {
|
|
|
+ if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) {
|
|
|
$label .= ' - '.$obj->tva_intra;
|
|
|
}
|
|
|
|
|
@@ -1585,7 +1585,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
|
|
|
+ if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) {
|
|
|
$s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : '');
|
|
|
if (!empty($obj->country_code)) {
|
|
|
$s .= ', ' . $langs->trans('Country' . $obj->country_code);
|
|
@@ -1690,7 +1690,7 @@ class Form
|
|
|
$disabled = ' disabled';
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) {
|
|
|
+ if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) {
|
|
|
$tmpfac = new Facture($this->db);
|
|
|
if ($tmpfac->fetch($obj->fk_facture_source) > 0) {
|
|
|
$desc = $desc . ' - ' . $tmpfac->ref;
|
|
@@ -1789,18 +1789,18 @@ class Form
|
|
|
|
|
|
// We search third parties
|
|
|
$sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste, sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town";
|
|
|
- if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
|
|
|
+ if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
|
|
|
$sql .= ", s.nom as company, s.town AS company_town";
|
|
|
}
|
|
|
$sql .= " FROM " . $this->db->prefix() . "socpeople as sp";
|
|
|
- if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
|
|
|
+ if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
|
|
|
$sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc";
|
|
|
}
|
|
|
$sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")";
|
|
|
if ($socid > 0 || $socid == -1) {
|
|
|
$sql .= " AND sp.fk_soc = " . ((int) $socid);
|
|
|
}
|
|
|
- if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) {
|
|
|
+ if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) {
|
|
|
$sql .= " AND sp.statut <> 0";
|
|
|
}
|
|
|
// Add where from hooks
|
|
@@ -1840,7 +1840,7 @@ class Form
|
|
|
|
|
|
// Set email (or phones) and town extended infos
|
|
|
$extendedInfos = '';
|
|
|
- if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
|
|
|
+ if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) {
|
|
|
$extendedInfos = array();
|
|
|
$email = trim($obj->email);
|
|
|
if (!empty($email)) {
|
|
@@ -2018,7 +2018,7 @@ class Form
|
|
|
global $action;
|
|
|
|
|
|
// If no preselected user defined, we take current user
|
|
|
- if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) {
|
|
|
+ if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && !getDolGlobalString('SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE')) {
|
|
|
$selected = $user->id;
|
|
|
}
|
|
|
|
|
@@ -2079,7 +2079,7 @@ class Form
|
|
|
if ($includeUsers) {
|
|
|
$sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")";
|
|
|
}
|
|
|
- if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $notdisabled) {
|
|
|
+ if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) {
|
|
|
$sql .= " AND u.statut <> 0";
|
|
|
}
|
|
|
if (!empty($morefilter)) {
|
|
@@ -2092,7 +2092,7 @@ class Form
|
|
|
$sql .= $hookmanager->resPrint;
|
|
|
}
|
|
|
|
|
|
- if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname
|
|
|
+ if (!getDolGlobalString('MAIN_FIRSTNAME_NAME_POSITION')) { // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname
|
|
|
$sql .= " ORDER BY u.statut DESC, u.firstname ASC, u.lastname ASC";
|
|
|
} else {
|
|
|
$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC";
|
|
@@ -2144,7 +2144,7 @@ class Form
|
|
|
|
|
|
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
|
|
|
$fullNameMode = 0;
|
|
|
- if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
|
|
|
+ if (!getDolGlobalString('MAIN_FIRSTNAME_NAME_POSITION')) {
|
|
|
$fullNameMode = 1; //Firstname+lastname
|
|
|
}
|
|
|
$labeltoshow .= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
|
|
@@ -2157,7 +2157,7 @@ class Form
|
|
|
// Complete name with a more info string like: ' (info1 - info2 - ...)'
|
|
|
$moreinfo = '';
|
|
|
$moreinfohtml = '';
|
|
|
- if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
|
|
|
+ if (getDolGlobalString('MAIN_SHOW_LOGIN')) {
|
|
|
$moreinfo .= ($moreinfo ? ' - ' : ' (');
|
|
|
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(');
|
|
|
$moreinfo .= $obj->login;
|
|
@@ -2485,7 +2485,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
|
|
|
$placeholder = '';
|
|
|
|
|
|
if ($selected && empty($selected_input_value)) {
|
|
@@ -2591,7 +2591,7 @@ class Form
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
|
}
|
|
|
- $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
|
|
|
+ $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
|
|
if ($hidelabel == 3) {
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
@@ -2747,7 +2747,7 @@ class Form
|
|
|
$sql .= $hookmanager->resPrint;
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) {
|
|
|
+ if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
|
|
|
//Product category
|
|
|
$sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie
|
|
|
FROM " . $this->db->prefix() . "categorie_product
|
|
@@ -2757,7 +2757,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
//Price by customer
|
|
|
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
|
|
|
$sql .= ', pcp.rowid as idprodcustprice, pcp.price as custprice, pcp.price_ttc as custprice_ttc,';
|
|
|
$sql .= ' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx, pcp.default_vat_code as custdefault_vat_code, pcp.ref_customer as custref';
|
|
|
$selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref";
|
|
@@ -2776,15 +2776,15 @@ class Form
|
|
|
$selectFields .= ", description_translated";
|
|
|
}
|
|
|
// Price by quantity
|
|
|
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
|
|
|
$sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid";
|
|
|
- if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
|
|
+ if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
|
|
|
$sql .= " AND price_level = " . ((int) $price_level);
|
|
|
}
|
|
|
$sql .= " ORDER BY date_price";
|
|
|
$sql .= " DESC LIMIT 1) as price_rowid";
|
|
|
$sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable
|
|
|
- if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
|
|
|
+ if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
|
|
|
$sql .= " AND price_level = " . ((int) $price_level);
|
|
|
}
|
|
|
$sql .= " ORDER BY date_price";
|
|
@@ -2805,12 +2805,12 @@ class Form
|
|
|
}
|
|
|
|
|
|
// include search in supplier ref
|
|
|
- if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
|
|
|
+ if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
|
|
|
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
|
|
}
|
|
|
|
|
|
//Price by customer
|
|
|
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
|
|
|
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
|
|
|
}
|
|
|
// Units
|
|
@@ -2820,7 +2820,7 @@ class Form
|
|
|
// Multilang : we add translation
|
|
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
|
|
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid ";
|
|
|
- if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) {
|
|
|
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
|
|
$soc = new Societe($this->db);
|
|
|
$result = $soc->fetch($socid);
|
|
@@ -2834,13 +2834,13 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
|
|
|
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid";
|
|
|
}
|
|
|
|
|
|
$sql .= ' WHERE p.entity IN (' . getEntity('product') . ')';
|
|
|
|
|
|
- if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) {
|
|
|
$sql .= " AND pac.rowid IS NULL";
|
|
|
}
|
|
|
|
|
@@ -2872,7 +2872,7 @@ class Form
|
|
|
// Add criteria on ref/label
|
|
|
if ($filterkey != '') {
|
|
|
$sql .= ' AND (';
|
|
|
- $prefix = empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -2887,16 +2887,16 @@ class Form
|
|
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
|
|
$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
}
|
|
|
- if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
|
|
|
$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
}
|
|
|
- if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
|
|
|
+ if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
|
|
|
$sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
|
|
$sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->MAIN_SEARCH_PRODUCT_BY_FOURN_REF)) {
|
|
|
+ if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) {
|
|
|
$sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
}
|
|
|
$sql .= ")";
|
|
@@ -2915,7 +2915,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
//Sort by category
|
|
|
- if (!empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) {
|
|
|
+ if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) {
|
|
|
$sql .= " ORDER BY categorie_product_id ";
|
|
|
//ASC OR DESC order
|
|
|
(getDolGlobalInt('PRODUCT_SORT_BY_CATEGORY') == 1) ? $sql .= "ASC" : $sql .= "DESC";
|
|
@@ -2947,7 +2947,7 @@ class Form
|
|
|
$textifempty = '';
|
|
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
|
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
|
- if (!empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
|
|
|
if ($showempty && !is_numeric($showempty)) {
|
|
|
$textifempty = $langs->trans($showempty);
|
|
|
} else {
|
|
@@ -2968,7 +2968,7 @@ class Form
|
|
|
$optJson = array();
|
|
|
$objp = $this->db->fetch_object($result);
|
|
|
|
|
|
- if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
|
|
|
+ if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product
|
|
|
$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type";
|
|
|
$sql .= " FROM " . $this->db->prefix() . "product_price_by_qty";
|
|
|
$sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid);
|
|
@@ -3089,7 +3089,7 @@ class Form
|
|
|
$outqty = 1;
|
|
|
$outdiscount = 0;
|
|
|
|
|
|
- $maxlengtharticle = (empty($conf->global->PRODUCT_MAX_LENGTH_COMBO) ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO);
|
|
|
+ $maxlengtharticle = (!getDolGlobalString('PRODUCT_MAX_LENGTH_COMBO') ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO);
|
|
|
|
|
|
$label = $objp->label;
|
|
|
if (!empty($objp->label_translated)) {
|
|
@@ -3116,7 +3116,7 @@ class Form
|
|
|
$outdurationvalue = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, 0, dol_strlen($objp->duration) - 1) : '';
|
|
|
$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : '';
|
|
|
|
|
|
- if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
|
|
|
+ if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
|
|
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
|
|
}
|
|
|
|
|
@@ -3127,7 +3127,7 @@ class Form
|
|
|
$outvalUnits .= ' - ' . $objp->unit_short;
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->PRODUCT_SHOW_DIMENSIONS_IN_COMBO)) {
|
|
|
+ if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) {
|
|
|
if (!empty($objp->weight) && $objp->weight_units !== null) {
|
|
|
$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs);
|
|
|
$outvalUnits .= ' - ' . $unitToShow;
|
|
@@ -3163,7 +3163,7 @@ class Form
|
|
|
if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
|
|
|
$opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"';
|
|
|
}
|
|
|
- if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
|
|
+ if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
|
|
|
if ($user->hasRight('stock', 'lire')) {
|
|
|
if ($objp->stock > 0) {
|
|
|
$opt .= ' class="product_line_stock_ok"';
|
|
@@ -3172,7 +3172,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
|
|
|
$opt .= ' data-labeltrans="' . $outlabel_translated . '"';
|
|
|
$opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"';
|
|
|
}
|
|
@@ -3185,7 +3185,7 @@ class Form
|
|
|
$opt .= ' (' . $outbarcode . ')';
|
|
|
}
|
|
|
$opt .= ' - ' . dol_trunc($label, $maxlengtharticle);
|
|
|
- if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
|
|
|
+ if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
|
|
|
$opt .= ' (' . getCountry($outorigin, 1) . ')';
|
|
|
}
|
|
|
|
|
@@ -3201,7 +3201,7 @@ class Form
|
|
|
$outval .= ' (' . $outbarcode . ')';
|
|
|
}
|
|
|
$outval .= ' - ' . dol_trunc($label, $maxlengtharticle);
|
|
|
- if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) {
|
|
|
+ if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
|
|
|
$outval .= ' (' . getCountry($outorigin, 1) . ')';
|
|
|
}
|
|
|
|
|
@@ -3213,7 +3213,7 @@ class Form
|
|
|
|
|
|
// Multiprice
|
|
|
// If we need a particular price level (from 1 to n)
|
|
|
- if (empty($hidepriceinlabel) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
|
|
|
+ if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
|
|
|
$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
|
|
|
$sql .= " FROM " . $this->db->prefix() . "product_price";
|
|
|
$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
|
|
@@ -3238,7 +3238,7 @@ class Form
|
|
|
$outprice_ht = price($objp2->price);
|
|
|
$outprice_ttc = price($objp2->price_ttc);
|
|
|
$outpricebasetype = $objp2->price_base_type;
|
|
|
- if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility
|
|
|
+ if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility
|
|
|
$outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice
|
|
|
$outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice
|
|
|
} else {
|
|
@@ -3252,7 +3252,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
// Price by quantity
|
|
|
- if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
|
|
|
+ if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
|
|
|
$found = 1;
|
|
|
$outqty = $objp->quantity;
|
|
|
$outdiscount = $objp->remise_percent;
|
|
@@ -3284,7 +3284,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
// Price by customer
|
|
|
- if (empty($hidepriceinlabel) && !empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|
|
+ if (empty($hidepriceinlabel) && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
|
|
|
if (!empty($objp->idprodcustprice)) {
|
|
|
$found = 1;
|
|
|
|
|
@@ -3320,7 +3320,7 @@ class Form
|
|
|
$outdefault_vat_code = $objp->default_vat_code;
|
|
|
}
|
|
|
|
|
|
- if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
|
|
+ if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
|
|
|
if ($user->hasRight('stock', 'lire')) {
|
|
|
$opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
|
|
|
|
|
@@ -3331,7 +3331,7 @@ class Form
|
|
|
}
|
|
|
$outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'));
|
|
|
$outval .= '</span>';
|
|
|
- if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation
|
|
|
+ if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation
|
|
|
$langs->load("stocks");
|
|
|
|
|
|
$tmpproduct = new Product($this->db);
|
|
@@ -3417,7 +3417,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
$selected_input_value = '';
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
|
|
|
if ($selected > 0) {
|
|
|
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
|
|
$producttmpselect = new Product($this->db);
|
|
@@ -3465,7 +3465,7 @@ class Form
|
|
|
$out = '';
|
|
|
$outarray = array();
|
|
|
|
|
|
- $maxlengtharticle = (empty($conf->global->PRODUCT_MAX_LENGTH_COMBO) ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO);
|
|
|
+ $maxlengtharticle = (!getDolGlobalString('PRODUCT_MAX_LENGTH_COMBO') ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO);
|
|
|
|
|
|
$langs->load('stocks');
|
|
|
// Units
|
|
@@ -3478,7 +3478,7 @@ class Form
|
|
|
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.default_vat_code, pfp.fk_soc, s.nom as name,";
|
|
|
$sql .= " pfp.supplier_reputation";
|
|
|
// if we use supplier description of the products
|
|
|
- if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
|
|
|
$sql .= ", pfp.desc_fourn as description";
|
|
|
} else {
|
|
|
$sql .= ", p.description";
|
|
@@ -3517,7 +3517,7 @@ class Form
|
|
|
// Add criteria on ref/label
|
|
|
if ($filterkey != '') {
|
|
|
$sql .= ' AND (';
|
|
|
- $prefix = empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -3529,7 +3529,7 @@ class Form
|
|
|
$sql .= " AND ";
|
|
|
}
|
|
|
$sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
- if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
|
|
+ if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
|
|
|
$sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'";
|
|
|
}
|
|
|
$sql .= ")";
|
|
@@ -3699,20 +3699,20 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
if ($objp->quantity == 1) {
|
|
|
- $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
- $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
+ $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
+ $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
|
|
$outvallabel .= $langs->transnoentities("Unit");
|
|
|
} else {
|
|
|
- $optlabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
|
|
|
- $outvallabel .= ' - ' . price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
|
|
|
+ $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
|
|
|
+ $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity;
|
|
|
$optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
|
|
$outvallabel .= ' ' . $langs->transnoentities("Units");
|
|
|
}
|
|
|
|
|
|
if ($objp->quantity > 1) {
|
|
|
- $optlabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
|
|
- $outvallabel .= " (" . price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
|
|
+ $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
|
|
+ $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding
|
|
|
}
|
|
|
if ($objp->remise_percent >= 1) {
|
|
|
$optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %';
|
|
@@ -3744,7 +3744,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
|
|
+ if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
|
|
|
$novirtualstock = ($showstockinlist == 2);
|
|
|
|
|
|
if ($user->hasRight('stock', 'lire')) {
|
|
@@ -3757,7 +3757,7 @@ class Form
|
|
|
}
|
|
|
$optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS'));
|
|
|
$optlabel .= '</span>';
|
|
|
- if (empty($novirtualstock) && !empty($conf->global->STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO)) { // Warning, this option may slow down combo list generation
|
|
|
+ if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation
|
|
|
$langs->load("stocks");
|
|
|
|
|
|
$tmpproduct = new Product($this->db);
|
|
@@ -3912,7 +3912,7 @@ class Form
|
|
|
$sql .= " AND p.tobuy = 1";
|
|
|
$sql .= " AND s.fournisseur = 1";
|
|
|
$sql .= " AND p.rowid = " . ((int) $productid);
|
|
|
- if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) {
|
|
|
+ if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) {
|
|
|
$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC";
|
|
|
} else {
|
|
|
$sql .= " ORDER BY pfp.unitprice ASC";
|
|
@@ -3938,7 +3938,7 @@ class Form
|
|
|
|
|
|
$opt = '<option value="' . $objp->idprodfournprice . '"';
|
|
|
//if there is only one supplier, preselect it
|
|
|
- if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && !empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED))) {
|
|
|
+ if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) {
|
|
|
$opt .= ' selected';
|
|
|
}
|
|
|
$opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - ';
|
|
@@ -3962,7 +3962,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
if ($objp->quantity == 1) {
|
|
|
- $opt .= price($objp->fprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
+ $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/";
|
|
|
}
|
|
|
|
|
|
$opt .= $objp->quantity . ' ';
|
|
@@ -3974,7 +3974,7 @@ class Form
|
|
|
}
|
|
|
if ($objp->quantity > 1) {
|
|
|
$opt .= " - ";
|
|
|
- $opt .= price($objp->unitprice * (!empty($conf->global->DISPLAY_DISCOUNTED_SUPPLIER_PRICE) ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
|
|
|
+ $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit");
|
|
|
}
|
|
|
if ($objp->duration) {
|
|
|
$opt .= " - " . $objp->duration;
|
|
@@ -4329,7 +4329,7 @@ class Form
|
|
|
$this->load_cache_conditions_paiements();
|
|
|
|
|
|
// Set default value if not already set by caller
|
|
|
- if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) {
|
|
|
+ if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) {
|
|
|
dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE);
|
|
|
$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
|
|
|
}
|
|
@@ -4434,7 +4434,7 @@ class Form
|
|
|
$this->load_cache_types_paiements();
|
|
|
|
|
|
// Set default value if not already set by caller
|
|
|
- if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) {
|
|
|
+ if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) {
|
|
|
dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE);
|
|
|
$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID;
|
|
|
}
|
|
@@ -6049,7 +6049,7 @@ class Form
|
|
|
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
|
|
print '<div class="inline-block">';
|
|
|
if (!empty($discount_type)) {
|
|
|
- if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|
|
+ if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
|
|
if (!$filter || $filter == "fk_invoice_supplier_source IS NULL") {
|
|
|
$translationKey = 'HasAbsoluteDiscountFromSupplier'; // If we want deposit to be substracted to payments only and not to total of final invoice
|
|
|
} else {
|
|
@@ -6063,7 +6063,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|
|
+ if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
|
|
if (!$filter || $filter == "fk_facture_source IS NULL") {
|
|
|
$translationKey = 'CompanyHasAbsoluteDiscount'; // If we want deposit to be substracted to payments only and not to total of final invoice
|
|
|
} else {
|
|
@@ -6149,7 +6149,7 @@ class Form
|
|
|
print $this->selectcontacts($societe->id, $selected, $htmlname);
|
|
|
$num = $this->num;
|
|
|
if ($num == 0) {
|
|
|
- $addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
|
|
+ $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
|
|
print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>';
|
|
|
}
|
|
|
print '</td>';
|
|
@@ -6499,7 +6499,7 @@ class Form
|
|
|
} else {
|
|
|
$code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente
|
|
|
}
|
|
|
- if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { // If option to have vat for end customer for services is on
|
|
|
+ if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on
|
|
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
|
|
if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
|
|
|
// We also add the buyer country code
|
|
@@ -6542,7 +6542,7 @@ class Form
|
|
|
// If we fails to find a default vat rate, we take the last one in list
|
|
|
// Because they are sorted in ascending order, the last one will be the higher one (we suppose the higher one is the current rate)
|
|
|
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) {
|
|
|
- if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) {
|
|
|
+ if (!getDolGlobalString('MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS')) {
|
|
|
// We take the last one found in list
|
|
|
$defaulttx = $this->cache_vatrates[$num - 1]['txtva'];
|
|
|
} else {
|
|
@@ -6564,7 +6564,7 @@ class Form
|
|
|
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") {
|
|
|
// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
|
|
|
// of using supplier invoices (this is a very bad idea !)
|
|
|
- if (empty($conf->global->EXPENSEREPORT_OVERRIDE_VAT)) {
|
|
|
+ if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) {
|
|
|
$title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"';
|
|
|
$disabled = true;
|
|
|
}
|
|
@@ -6606,7 +6606,7 @@ class Form
|
|
|
$return .= '>';
|
|
|
|
|
|
// Show label of VAT
|
|
|
- if ($mysoc->country_code == 'IN' || !empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES)) {
|
|
|
+ if ($mysoc->country_code == 'IN' || getDolGlobalString('MAIN_VAT_LABEL_IS_POSITIVE_RATES')) {
|
|
|
// Label with all localtax and code. For example: x.y / a.b / c.d (CODE)'
|
|
|
$return .= $rate['labelpositiverates'];
|
|
|
} else {
|
|
@@ -6812,8 +6812,8 @@ class Form
|
|
|
|
|
|
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
|
|
|
$usecalendar = 'combo';
|
|
|
- if (!empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
|
|
|
- $usecalendar = ((empty($conf->global->MAIN_POPUP_CALENDAR) || getDolGlobalString('MAIN_POPUP_CALENDAR') == 'eldy') ? 'jquery' : $conf->global->MAIN_POPUP_CALENDAR);
|
|
|
+ if (!empty($conf->use_javascript_ajax) && (!getDolGlobalString('MAIN_POPUP_CALENDAR') || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
|
|
|
+ $usecalendar = ((!getDolGlobalString('MAIN_POPUP_CALENDAR') || getDolGlobalString('MAIN_POPUP_CALENDAR') == 'eldy') ? 'jquery' : $conf->global->MAIN_POPUP_CALENDAR);
|
|
|
}
|
|
|
|
|
|
if ($d) {
|
|
@@ -6872,7 +6872,7 @@ class Form
|
|
|
";
|
|
|
}
|
|
|
// Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php
|
|
|
- if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) {
|
|
|
+ if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) {
|
|
|
$retstring .= "
|
|
|
showOn: 'button', /* both has problem with autocompletion */
|
|
|
buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png',
|
|
@@ -7093,7 +7093,7 @@ class Form
|
|
|
}
|
|
|
}
|
|
|
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick
|
|
|
- if ($reset_scripts && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
|
|
+ if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
|
|
$retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">';
|
|
|
$retstring .= $langs->trans("Now");
|
|
|
$retstring .= '</button> ';
|
|
@@ -7326,7 +7326,7 @@ class Form
|
|
|
// check parameters
|
|
|
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
|
|
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
|
|
$placeholder = '';
|
|
|
|
|
|
if ($selected && empty($selected_input_value)) {
|
|
@@ -7347,7 +7347,7 @@ class Form
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
|
}
|
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
|
|
|
+ $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
|
|
if ($hidelabel == 3) {
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
@@ -7397,7 +7397,7 @@ class Form
|
|
|
// Add criteria on ref/label
|
|
|
if ($filterkey != '') {
|
|
|
$sql .= ' AND (';
|
|
|
- $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('TICKET_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -7435,7 +7435,7 @@ class Form
|
|
|
$textifempty = '';
|
|
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
|
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
|
- if (!empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
|
|
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
|
|
else $textifempty .= $langs->trans("All");
|
|
|
} else {
|
|
@@ -7534,7 +7534,7 @@ class Form
|
|
|
// check parameters
|
|
|
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
|
|
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
|
|
$placeholder = '';
|
|
|
|
|
|
if ($selected && empty($selected_input_value)) {
|
|
@@ -7555,7 +7555,7 @@ class Form
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
|
}
|
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
|
|
|
+ $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
|
|
if ($hidelabel == 3) {
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
@@ -7604,7 +7604,7 @@ class Form
|
|
|
// Add criteria on ref/label
|
|
|
if ($filterkey != '') {
|
|
|
$sql .= ' AND (';
|
|
|
- $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('TICKET_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -7642,7 +7642,7 @@ class Form
|
|
|
$textifempty = '';
|
|
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
|
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
|
- if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
|
|
|
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
|
|
else $textifempty .= $langs->trans("All");
|
|
|
} else {
|
|
@@ -7745,7 +7745,7 @@ class Form
|
|
|
// check parameters
|
|
|
if (is_null($ajaxoptions)) $ajaxoptions = array();
|
|
|
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('TICKET_USE_SEARCH_TO_SELECT')) {
|
|
|
$placeholder = '';
|
|
|
$urloption = '';
|
|
|
|
|
@@ -7768,7 +7768,7 @@ class Form
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
|
}
|
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '') . ' />';
|
|
|
+ $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />';
|
|
|
if ($hidelabel == 3) {
|
|
|
$out .= img_picto($langs->trans("Search"), 'search');
|
|
|
}
|
|
@@ -7819,7 +7819,7 @@ class Form
|
|
|
// Add criteria on ref/label
|
|
|
if ($filterkey != '') {
|
|
|
$sql .= ' AND (';
|
|
|
- $prefix = empty($conf->global->MEMBER_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
+ $prefix = !getDolGlobalString('MEMBER_DONOTSEARCH_ANYWHERE') ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on
|
|
|
// For natural search
|
|
|
$scrit = explode(' ', $filterkey);
|
|
|
$i = 0;
|
|
@@ -7851,7 +7851,7 @@ class Form
|
|
|
|
|
|
if (!$forcecombo) {
|
|
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
|
|
- $out .= ajax_combobox($htmlname, $events, !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT) ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
|
|
|
+ $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : '');
|
|
|
}
|
|
|
|
|
|
$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">';
|
|
@@ -7859,7 +7859,7 @@ class Form
|
|
|
$textifempty = '';
|
|
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'.
|
|
|
//if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty='';
|
|
|
- if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) {
|
|
|
+ if (getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
|
|
|
if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty);
|
|
|
else $textifempty .= $langs->trans("All");
|
|
|
} else {
|
|
@@ -8282,7 +8282,7 @@ class Form
|
|
|
$out = '';
|
|
|
|
|
|
if ($addjscombo < 0) {
|
|
|
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
|
|
+ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
|
|
$addjscombo = 1;
|
|
|
} else {
|
|
|
$addjscombo = 0;
|
|
@@ -8419,7 +8419,7 @@ class Form
|
|
|
global $delayedhtmlcontent; // Will be used later outside of this function
|
|
|
|
|
|
// TODO Use an internal dolibarr component instead of select2
|
|
|
- if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
+ if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
@@ -8524,7 +8524,7 @@ class Form
|
|
|
global $delayedhtmlcontent; // Will be used later outside of this function
|
|
|
|
|
|
// TODO Use an internal dolibarr component instead of select2
|
|
|
- if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
+ if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
@@ -8646,7 +8646,7 @@ class Form
|
|
|
$out = '';
|
|
|
|
|
|
if ($addjscombo < 0) {
|
|
|
- if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
|
|
+ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
|
|
$addjscombo = 1;
|
|
|
} else {
|
|
|
$addjscombo = 0;
|
|
@@ -8654,7 +8654,7 @@ class Form
|
|
|
}
|
|
|
|
|
|
$useenhancedmultiselect = 0;
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
$useenhancedmultiselect = 1;
|
|
|
}
|
|
|
|
|
@@ -8701,11 +8701,11 @@ class Form
|
|
|
$out .= '</select>' . "\n";
|
|
|
|
|
|
// Add code for jquery to use multiselect
|
|
|
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
+ if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
|
|
$out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->';
|
|
|
$out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n";
|
|
|
if ($addjscombo == 1) {
|
|
|
- $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
|
|
+ $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
|
|
$out .= 'function formatResult(record, container) {' . "\n";
|
|
|
// If property html set, we decode html entities and use this.
|
|
|
// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option.
|
|
@@ -8781,7 +8781,7 @@ class Form
|
|
|
{
|
|
|
global $conf, $langs, $user, $extrafields;
|
|
|
|
|
|
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
|
|
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
|
|
return '';
|
|
|
}
|
|
|
if (empty($array)) {
|
|
@@ -9109,10 +9109,10 @@ class Form
|
|
|
$possiblelinks = array();
|
|
|
if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
|
|
|
$listofidcompanytoscan = $object->thirdparty->id;
|
|
|
- if (($object->thirdparty->parent > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) {
|
|
|
+ if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) {
|
|
|
$listofidcompanytoscan .= ',' . $object->thirdparty->parent;
|
|
|
}
|
|
|
- if (($object->fk_project > 0) && !empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO)) {
|
|
|
+ if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) {
|
|
|
include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
|
|
$tmpproject = new Project($this->db);
|
|
|
$tmpproject->fetch($object->fk_project);
|
|
@@ -9220,7 +9220,7 @@ class Form
|
|
|
if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
|
|
|
print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>';
|
|
|
|
|
|
- if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
|
|
|
+ if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
|
|
|
print '<br>'."\n";
|
|
|
print '<!-- form to add a link from anywhere -->'."\n";
|
|
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
|
|
@@ -9299,7 +9299,7 @@ class Form
|
|
|
print '</div>';
|
|
|
|
|
|
//$linktoelem.=($linktoelem?' ':'');
|
|
|
- if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
|
|
|
+ if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) {
|
|
|
$linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>';
|
|
|
// } else $linktoelem.=$langs->trans($possiblelink['label']);
|
|
|
} else {
|
|
@@ -9576,7 +9576,7 @@ class Form
|
|
|
|
|
|
// List of extra languages
|
|
|
$arrayoflangcode = array();
|
|
|
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) {
|
|
|
+ if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
|
|
|
$arrayoflangcode[] = $conf->global->PDF_USE_ALSO_LANGUAGE_CODE;
|
|
|
}
|
|
|
|
|
@@ -9751,7 +9751,7 @@ class Form
|
|
|
$originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo;
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
|
|
|
+ if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
|
|
|
$altfile = $object->id . ".jpg"; // For backward compatibility
|
|
|
}
|
|
|
$email = $object->email;
|
|
@@ -9770,7 +9770,7 @@ class Form
|
|
|
$originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo;
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
|
|
|
+ if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
|
|
|
$altfile = $object->id . ".jpg"; // For backward compatibility
|
|
|
}
|
|
|
$email = $object->email;
|
|
@@ -9790,7 +9790,7 @@ class Form
|
|
|
$originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart) . 'photos/' . $object->photo;
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
|
|
|
+ if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) {
|
|
|
$altfile = $object->id . ".jpg"; // For backward compatibility
|
|
|
}
|
|
|
$email = $object->email;
|
|
@@ -10290,7 +10290,7 @@ class Form
|
|
|
$out = '';
|
|
|
|
|
|
$hideunselectables = false;
|
|
|
- if (!empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) {
|
|
|
+ if (getDolGlobalString('PROJECT_HIDE_UNSELECTABLES')) {
|
|
|
$hideunselectables = true;
|
|
|
}
|
|
|
|