Fix php8.2 warnings

This commit is contained in:
Laurent Destailleur 2023-11-27 11:56:32 +01:00
parent a136f304a6
commit e8dc651877
168 changed files with 1190 additions and 1190 deletions

View File

@ -192,7 +192,7 @@ class KnowledgeRecord extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@ -805,7 +805,7 @@ class KnowledgeRecord extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowKnowledgeRecord");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -995,11 +995,11 @@ class KnowledgeRecord extends CommonObject
global $langs, $conf;
$langs->load("knowledgemanagement");
if (empty($conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON)) {
if (!getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON')) {
$conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON = 'mod_knowledgerecord_standard';
}
if (!empty($conf->global->KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON)) {
if (getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON')) {
$mybool = false;
$file = getDolGlobalString('KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON') . ".php";
@ -1065,7 +1065,7 @@ class KnowledgeRecord extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->KNOWLEDGERECORD_ADDON_PDF)) {
} elseif (getDolGlobalString('KNOWLEDGERECORD_ADDON_PDF')) {
$modele = $conf->global->KNOWLEDGERECORD_ADDON_PDF;
}
}

View File

@ -148,7 +148,7 @@ END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright">';
$NBMAX = (empty($conf->global->MAIN_SIZE_SHORTLIST_LIMIT) ? 25 : $conf->global->MAIN_SIZE_SHORTLIST_LIMIT);
$NBMAX = (!getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT') ? 25 : $conf->global->MAIN_SIZE_SHORTLIST_LIMIT);
$max = $NBMAX;
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT

View File

@ -60,7 +60,7 @@ $searchCategoryKnowledgemanagementList = GETPOST('search_category_knowledgemanag
$searchCategoryKnowledgemanagementOperator = 0;
if (GETPOSTISSET('formfilteraction')) {
$searchCategoryKnowledgemanagementOperator = GETPOST('search_category_knowledgemanagement_operator', 'int');
} elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
} elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) {
$searchCategoryKnowledgemanagementOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
}
// Load variable for pagination
@ -383,7 +383,7 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$id);

View File

@ -52,7 +52,7 @@ function knowledgerecordPrepareHead($object)
$head[$h][0] = DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
}
$head[$h][2] = 'note';
$h++;

View File

@ -307,8 +307,8 @@ class MailmanSpip
}
if (isModEnabled('adherent')) { // Synchro for members
if (!empty($conf->global->ADHERENT_MAILMAN_URL)) {
if ($listes == '' && !empty($conf->global->ADHERENT_MAILMAN_LISTS)) {
if (getDolGlobalString('ADHERENT_MAILMAN_URL')) {
if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) {
$lists = explode(',', $conf->global->ADHERENT_MAILMAN_LISTS);
} else {
$lists = explode(',', $listes);
@ -377,8 +377,8 @@ class MailmanSpip
}
if (isModEnabled('adherent')) { // Synchro for members
if (!empty($conf->global->ADHERENT_MAILMAN_UNSUB_URL)) {
if ($listes == '' && !empty($conf->global->ADHERENT_MAILMAN_LISTS)) {
if (getDolGlobalString('ADHERENT_MAILMAN_UNSUB_URL')) {
if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) {
$lists = explode(',', $conf->global->ADHERENT_MAILMAN_LISTS);
} else {
$lists = explode(',', $listes);

View File

@ -154,7 +154,7 @@ print '<td colspan="2">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARGIN_RATES');
} else {
if (empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (!getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_DISPLAY_MARGIN_RATES&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_DISPLAY_MARGIN_RATES&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
@ -171,7 +171,7 @@ print '<td colspan="2">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('DISPLAY_MARK_RATES');
} else {
if (empty($conf->global->DISPLAY_MARK_RATES)) {
if (!getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_DISPLAY_MARK_RATES&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_DISPLAY_MARK_RATES&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
@ -188,7 +188,7 @@ print '<td colspan="2">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('ForceBuyingPriceIfNull');
} else {
if (empty($conf->global->ForceBuyingPriceIfNull)) {
if (!getDolGlobalString('ForceBuyingPriceIfNull')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ForceBuyingPriceIfNull&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ForceBuyingPriceIfNull&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';

View File

@ -157,7 +157,7 @@ $sql .= " sum(".$db->ifsql('(d.total_ht < 0 OR (d.total_ht = 0 AND f.type = 2))'
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."facture as f";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE) ?-1 : $conf->global->AGENT_CONTACT_TYPE);
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(!getDolGlobalString('AGENT_CONTACT_TYPE') ?-1 : $conf->global->AGENT_CONTACT_TYPE);
$sql .= ", ".MAIN_DB_PREFIX."facturedet as d";
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= ", ".MAIN_DB_PREFIX."user as u";
@ -165,7 +165,7 @@ $sql .= " WHERE f.fk_soc = s.rowid";
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
$sql .= " AND sc.fk_soc = f.fk_soc";
$sql .= " AND (d.product_type = 0 OR d.product_type = 1)";
if (!empty($conf->global->AGENT_CONTACT_TYPE)) {
if (getDolGlobalString('AGENT_CONTACT_TYPE')) {
$sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
} else {
$sql .= " AND sc.fk_user = u.rowid";
@ -174,7 +174,7 @@ $sql .= " AND f.fk_statut NOT IN (".$db->sanitize(implode(', ', $invoice_status_
$sql .= ' AND s.entity IN ('.getEntity('societe').')';
$sql .= " AND d.fk_facture = f.rowid";
if ($agentid > 0) {
if (!empty($conf->global->AGENT_CONTACT_TYPE)) {
if (getDolGlobalString('AGENT_CONTACT_TYPE')) {
$sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".((int) $agentid).") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".((int) $agentid)."))";
} else {
$sql .= " AND sc.fk_user = ".((int) $agentid);
@ -257,10 +257,10 @@ if ($result) {
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
print "</tr>\n";
@ -334,10 +334,10 @@ if ($result) {
print '<td class="nowrap right"><span class="amount">'.price(price2num($pv, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($pa, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($marge, 'MT')).'</span></td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print "</tr>\n";
@ -366,10 +366,10 @@ if ($result) {
print '<td class="nowrap right">'.price(price2num($cumul_vente, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($cumul_achat, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($totalMargin, 'MT')).'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print '</tr>';

View File

@ -192,14 +192,14 @@ print '<span id="totalMargin" class="amount"></span> <span class="amount">'.$lan
print '</td></tr>';
// Margin Rate
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<tr><td>'.$langs->trans("MarginRate").'</td><td colspan="4">';
print '<span id="marginRate"></span>'; // set by jquery (see below)
print '</td></tr>';
}
// Mark Rate
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<tr><td>'.$langs->trans("MarkRate").'</td><td colspan="4">';
print '<span id="markRate"></span>'; // set by jquery (see below)
print '</td></tr>';
@ -327,10 +327,10 @@ if ($result) {
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, 'align="right"', $sortfield, $sortorder);
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, 'align="right"', $sortfield, $sortorder);
}
print "</tr>\n";
@ -377,10 +377,10 @@ if ($result) {
print '<td class="nowrap right"><span class="amount">'.price(price2num($pv, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($pa, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($marge, 'MT')).'</span></td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print "</tr>\n";
@ -415,10 +415,10 @@ if ($result) {
print '<td class="nowrap right">'.price(price2num($cumul_vente, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($cumul_achat, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($totalMargin, 'MT')).'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print '</tr>';

View File

@ -156,14 +156,14 @@ print '<span id="totalMargin" class="amount"></span> <span class="amount">'.$lan
print '</td></tr>';
// Margin Rate
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<tr><td>'.$langs->trans("MarginRate").'</td><td colspan="4">';
print '<span id="marginRate"></span>'; // set by jquery (see below)
print '</td></tr>';
}
// Mark Rate
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<tr><td>'.$langs->trans("MarkRate").'</td><td colspan="4">';
print '<span id="markRate"></span>'; // set by jquery (see below)
print '</td></tr>';
@ -279,10 +279,10 @@ if ($result) {
print_liste_field_titre("SellingPrice", $_SERVER["PHP_SELF"], "selling_price", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($labelcostprice, $_SERVER["PHP_SELF"], "buying_price", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
print "</tr>\n";
@ -336,10 +336,10 @@ if ($result) {
print '<td class="nowrap right"><span class="amount">'.price(price2num($pv, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($pa, 'MT')).'</span></td>';
print '<td class="nowrap right"><span class="amount">'.price(price2num($marge, 'MT')).'</span></td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print "</tr>\n";
@ -369,10 +369,10 @@ if ($result) {
print '<td class="nowrap right">'.price(price2num($cumul_vente, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($cumul_achat, 'MT')).'</td>';
print '<td class="nowrap right">'.price(price2num($totalMargin, 'MT')).'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="nowrap right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="nowrap right">'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'</td>';
}
print "</tr>\n";

View File

@ -117,14 +117,14 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Margin Rate
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<tr><td>'.$langs->trans("MarginRate").'</td><td>';
print '<span id="marginRate"></span>'; // set by jquery (see below)
print '</td></tr>';
}
// Mark Rate
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<tr><td>'.$langs->trans("MarkRate").'</td><td>';
print '<span id="markRate"></span>'; // set by jquery (see below)
print '</td></tr>';
@ -200,10 +200,10 @@ if ($id > 0 || !empty($ref)) {
print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "buying_price", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
}
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", "&amp;id=".$object->id, '', $sortfield, $sortorder, 'right ');
@ -234,10 +234,10 @@ if ($id > 0 || !empty($ref)) {
print '<td class="right amount">'.price(price2num($objp->buying_price, 'MT'))."</td>\n";
print '<td class="right">'.price(price2num($objp->qty, 'MT'))."</td>\n";
print '<td class="right amount">'.price(price2num($objp->marge, 'MT'))."</td>\n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print "<td class=\"right\">".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."</td>\n";
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print "<td class=\"right\">".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."</td>\n";
}
print '<td class="right">'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).'</td>';
@ -265,10 +265,10 @@ if ($id > 0 || !empty($ref)) {
print '<td class="right amount">'.price(price2num($cumul_achat, 'MT'))."</td>\n";
print '<td class="right">'.price(price2num($cumul_qty, 'MT'))."</td>\n";
print '<td class="right amount">'.price(price2num($totalMargin, 'MT'))."</td>\n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="right">'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."</td>\n";
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print "<td class=\"right\">".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."</td>\n";
}
print '<td class="right">&nbsp;</td>';

View File

@ -87,7 +87,7 @@ $invoicestatic = new Facture($db);
$form = new Form($db);
$title = $langs->trans("ThirdParty").' - '.$langs->trans("Margins");
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->name.' - '.$langs->trans("Files");
}
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
@ -130,7 +130,7 @@ if ($socid > 0) {
print '</td></tr>';
}
if (((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) && $object->fournisseur) {
if (((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) && $object->fournisseur) {
print '<tr><td class="titlefield">';
print $langs->trans('SupplierCode').'</td><td colspan="3">';
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
@ -147,14 +147,14 @@ if ($socid > 0) {
print '</td></tr>';
// Margin Rate
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<tr><td>'.$langs->trans("MarginRate").'</td><td colspan="3">';
print '<span id="marginRate"></span>'; // set by jquery (see below)
print '</td></tr>';
}
// Mark Rate
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<tr><td>'.$langs->trans("MarkRate").'</td><td colspan="3">';
print '<span id="markRate"></span>'; // set by jquery (see below)
print '</td></tr>';
@ -211,10 +211,10 @@ if ($socid > 0) {
print_liste_field_titre("SoldAmount", $_SERVER["PHP_SELF"], "selling_price", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("PurchasedAmount", $_SERVER["PHP_SELF"], "buying_price", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Margin", $_SERVER["PHP_SELF"], "marge", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print_liste_field_titre("MarginRate", $_SERVER["PHP_SELF"], "", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
}
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", "&amp;socid=".$_REQUEST["socid"], '', $sortfield, $sortorder, 'right ');
@ -246,10 +246,10 @@ if ($socid > 0) {
print "<td class=\"right amount\">".price(price2num($objp->selling_price, 'MT'))."</td>\n";
print "<td class=\"right amount\">".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))."</td>\n";
print "<td class=\"right amount\">".$sign.price(price2num($objp->marge, 'MT'))."</td>\n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print "<td class=\"right\">".(($marginRate === '') ? 'n/a' : $sign.price(price2num($marginRate, 'MT'))."%")."</td>\n";
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print "<td class=\"right\">".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."</td>\n";
}
print '<td class="right">'.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).'</td>';
@ -277,10 +277,10 @@ if ($socid > 0) {
print "<td class=\"right\">".price(price2num($cumul_vente, 'MT'))."</td>\n";
print "<td class=\"right\">".price(price2num($cumul_achat, 'MT'))."</td>\n";
print "<td class=\"right\">".price(price2num($totalMargin, 'MT'))."</td>\n";
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print "<td class=\"right\">".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."</td>\n";
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print "<td class=\"right\">".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."</td>\n";
}
print '<td class="right">&nbsp;</td>';

View File

@ -125,7 +125,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
} else {
if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) {
if (!getDolGlobalString('MODULEBUILDER_USE_ABOUT')) {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=set_MODULEBUILDER_USE_ABOUT&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=del_MODULEBUILDER_USE_ABOUT&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';

View File

@ -110,7 +110,7 @@ $FILEFLAG = 'modulebuilder.txt';
$now = dol_now();
$newmask = 0;
if (empty($newmask) && !empty($conf->global->MAIN_UMASK)) {
if (empty($newmask) && getDolGlobalString('MAIN_UMASK')) {
$newmask = $conf->global->MAIN_UMASK;
}
if (empty($newmask)) { // This should no happen
@ -127,7 +127,7 @@ $form = new Form($db);
$dirsrootforscan = array($dirread);
// Add also the core modules into the list of modules to show/edit
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT))) {
if ($dirread != DOL_DOCUMENT_ROOT && ($conf->global->MAIN_FEATURES_LEVEL >= 2 || getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT'))) {
$dirsrootforscan[] = DOL_DOCUMENT_ROOT;
}
@ -275,7 +275,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
}
}
if (!empty($conf->global->MODULEBUILDER_USE_ABOUT)) {
if (getDolGlobalString('MODULEBUILDER_USE_ABOUT')) {
dol_delete_file($destdir.'/admin/about.php');
}
@ -352,7 +352,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
'500000'=>$idmodule
);
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
}
@ -363,7 +363,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
}
}
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_README)) {
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_README')) {
setEventMessages($langs->trans("ContentOfREADMECustomized"), null, 'warnings');
dol_delete_file($destdir.'/README.md');
file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README);
@ -1511,7 +1511,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
'---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
);
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
}

View File

@ -1027,7 +1027,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) {
if (!getDolGlobalString('MAIN_PDF_HIDE_CUSTOMER_CODE') && !empty($object->thirdparty->code_client)) {
$posy += 3;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
@ -1074,7 +1074,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
// Show sender frame
if (empty($conf->global->MAIN_PDF_NO_SENDER_FRAME)) {
if (!getDolGlobalString('MAIN_PDF_NO_SENDER_FRAME')) {
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy - 5);
@ -1086,7 +1086,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
// Show sender name
if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) {
if (!getDolGlobalString('MAIN_PDF_HIDE_SENDER_NAME')) {
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
@ -1133,7 +1133,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
// Show recipient frame
if (empty($conf->global->MAIN_PDF_NO_RECIPENT_FRAME)) {
if (!getDolGlobalString('MAIN_PDF_NO_RECIPENT_FRAME')) {
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx + 2, $posy - 5);

View File

@ -265,7 +265,7 @@ class Mo extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@ -961,7 +961,7 @@ class Mo extends CommonObject
global $langs, $conf;
$langs->load("mrp");
if (!empty($conf->global->MRP_MO_ADDON)) {
if (getDolGlobalString('MRP_MO_ADDON')) {
$mybool = false;
$file = getDolGlobalString('MRP_MO_ADDON') . ".php";
@ -1426,7 +1426,7 @@ class Mo extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMo");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1610,7 +1610,7 @@ class Mo extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->MO_ADDON_PDF)) {
} elseif (getDolGlobalString('MO_ADDON_PDF')) {
$modele = $conf->global->MO_ADDON_PDF;
}
}
@ -1671,18 +1671,18 @@ class Mo extends CommonObject
$langs->load('stocks');
$text_stock_options = $langs->trans("RealStockDesc").'<br>';
$text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE') ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_BILL') ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_BILL') ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE') ? '- '.$langs->trans("StockOnReception").'<br>' : '');
print '<tr class="liste_titre">';
// Product or sub-bom
print '<td class="linecoldescription">'.$langs->trans('Ref');
if (!empty($conf->global->BOM_SUB_BOM)) {
if (getDolGlobalString('BOM_SUB_BOM')) {
print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}
@ -2035,7 +2035,7 @@ class MoLine extends CommonObjectLine
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {

View File

@ -154,7 +154,7 @@ if ($object->id > 0) {
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}

View File

@ -289,7 +289,7 @@ if (empty($reshook)) {
$result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED');
if ($result >= 0) {
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
$outputlangs = $langs;
$newlang = '';
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'label' => $langs->trans('MoCancelConsumedAndProducedLines'),
'name' => 'alsoCancelConsumedAndProducedLines',
'type' => 'checkbox',
'value' => empty($conf->global->MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT) ? 0 : 1
'value' => !getDolGlobalString('MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1
)
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMo'), $langs->trans('ConfirmDeleteMo'), 'confirm_delete', $formquestion, 0, 1);
@ -599,7 +599,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}

View File

@ -131,7 +131,7 @@ if ($object->id) {
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}

View File

@ -355,7 +355,7 @@ if (!$resql) {
$num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/mrp/mo_card.php', 1).'?id='.$id);

View File

@ -137,10 +137,10 @@ $arrayfields = array(
//'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500)
);
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
unset($arrayfields['pl.sellby']);
}
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
unset($arrayfields['pl.eatby']);
}
$objectlist->fields = dol_sort_array($objectlist->fields, 'position');
@ -331,7 +331,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}
@ -452,7 +452,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
$sql .= " AND m.fk_entrepot = e.rowid";
$sql .= " AND e.entity IN (".getEntity('stock').")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = 0";
}
$sql .= dolSqlDateFilter('m.datem', 0, $month, $year);

View File

@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}

View File

@ -447,7 +447,7 @@ if (empty($reshook)) {
$result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED');
if ($result >= 0) {
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
$outputlangs = $langs;
$newlang = '';
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -516,7 +516,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$res = $object->fetch_thirdparty();
$res = $object->fetch_optionals();
if (!empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) && $object->fk_warehouse > 0) {
if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $object->fk_warehouse > 0) {
$tmpwarehouse->fetch($object->fk_warehouse);
$fk_default_warehouse = $object->fk_warehouse;
}
@ -596,7 +596,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'label' => $langs->trans('MoCancelConsumedAndProducedLines'),
'name' => 'alsoCancelConsumedAndProducedLines',
'type' => 'checkbox',
'value' => empty($conf->global->MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT) ? 0 : 1
'value' => !getDolGlobalString('MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT') ? 0 : 1
),
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1);
@ -630,7 +630,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
if (is_object($object->thirdparty)) {
$morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
}
@ -840,7 +840,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="right">' . $langs->trans("Unit") . '</td>';
}
// Cost price
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) {
print '<td class="right">'.$langs->trans("UnitCost").'</td>';
}
// Qty already consumed
@ -909,7 +909,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td></td>';
}
// Cost price
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) {
print '<td></td>';
}
// Qty already consumed + Warehouse
@ -1090,7 +1090,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $form->textwithpicto('', $help, -1, 'lock') . ' ';
}
if ($line->disable_stock_change) {
$help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("DisableStockChange") . '</strong>: ' . yn(1) . ' (' . (($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")) . ')';
$help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("DisableStockChange") . '</strong>: ' . yn(1) . ' (' . (($tmpproduct->type == Product::TYPE_SERVICE && !getDolGlobalString('STOCK_SUPPORTS_SERVICES')) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")) . ')';
print $form->textwithpicto('', $help, -1, 'help') . ' ';
}
print price2num($line->qty, 'MS');
@ -1102,7 +1102,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
}
// Cost price
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) {
print '<td class="right nowraponall">';
print price($linecost);
print '</td>';
@ -1138,18 +1138,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
// Warehouse
print '<td>';
if (!empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) && $tmpwarehouse->id > 0) {
if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) {
print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label;
}
print '</td>';
// Stock
if (isModEnabled('stock')) {
print '<td class="nowraponall right">';
if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $tmpproduct->type != Product::TYPE_SERVICE) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') && $tmpproduct->type != Product::TYPE_SERVICE) {
if (!$line->disable_stock_change && $tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
print img_warning($langs->trans('StockTooLow')) . ' ';
}
if (empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) || empty($tmpwarehouse->id)) {
if (!getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') || empty($tmpwarehouse->id)) {
print price2num($tmpproduct->stock_reel, 'MS'); // Available
} else {
// Print only the stock in the selected warehouse
@ -1225,7 +1225,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="right">'.$line2['qty'].'</td>';
// Cost price
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) {
print '<td></td>';
}
@ -1296,7 +1296,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
$disable = '';
if (!empty($conf->global->MRP_NEVER_CONSUME_MORE_THAN_EXPECTED) && ($line->qty - $alreadyconsumed) <= 0) {
if (getDolGlobalString('MRP_NEVER_CONSUME_MORE_THAN_EXPECTED') && ($line->qty - $alreadyconsumed) <= 0) {
$disable = 'disabled';
}
@ -1310,7 +1310,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>';
// Cost
if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) {
if ($permissiontoupdatecost && getDolGlobalString('MRP_SHOW_COST_FOR_CONSUMPTION')) {
print '<td></td>';
}
@ -1319,7 +1319,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Warehouse
print '<td>';
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($tmpproduct->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
if (empty($line->disable_stock_change)) {
$preselected = (GETPOSTISSET('idwarehouse-'.$line->id.'-'.$i) ? GETPOST('idwarehouse-'.$line->id.'-'.$i) : ($tmpproduct->fk_default_warehouse > 0 ? $tmpproduct->fk_default_warehouse : 'ifone'));
print $formproduct->selectWarehouses($preselected, 'idwarehouse-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth200 csswarehouse_'.$line->id.'_'.$i);
@ -1390,7 +1390,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
</script>';
if (in_array($action, array('consumeorproduce', 'consumeandproduceall')) &&
!empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE)) {
getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE')) {
print '<script>$(document).ready(function () {
$("#fk_default_warehouse").change();
});</script>';
@ -1717,7 +1717,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($tmpproduct->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : ($manufacturingcost ? price($manufacturingcost) : ''));
print '<td class="right"><input type="text" class="width75 right" name="pricetoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
} else {
@ -1728,7 +1728,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td></td>';
// Warehouse
print '<td>';
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($tmpproduct->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$preselected = (GETPOSTISSET('idwarehousetoproduce-'.$line->id.'-'.$i) ? GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) : ($object->fk_warehouse > 0 ? $object->fk_warehouse : 'ifone'));
print $formproduct->selectWarehouses($preselected, 'idwarehousetoproduce-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth200 csswarehouse_'.$line->id.'_'.$i);
} else {

View File

@ -52,7 +52,7 @@ if ($res) {
print ' ' . $langs->trans("or") . ' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-' . $line->id . '" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
print (!getDolGlobalString('BOM_SHOW_ALL_BOM_BY_DEFAULT') ? img_picto('', 'folder') : img_picto('', 'folder-open'));
}
print '</a>';
} else {
@ -115,7 +115,7 @@ if ($resql) {
$sub_bom_line->fetch($obj->rowid);
//If hidden conf is set, we show directly all the sub-BOM lines
if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) {
if (!getDolGlobalString('BOM_SHOW_ALL_BOM_BY_DEFAULT')) {
print '<tr style="display:none" class="sub_bom_lines" parentid="'.$line->id.'">';
} else {
print '<tr class="sub_bom_lines" parentid="'.$line->id.'">';

View File

@ -533,7 +533,7 @@ class MultiCurrency extends CommonObject
$sql1 .= " WHERE m.code = '".$dbs->escape($code)."'";
$sql1 .= " AND m.entity IN (".getEntity('multicurrency').")";
$sql2 = '';
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) { // Use last known rate compared to document date
if (getDolGlobalString('MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE') && !empty($date_document)) { // Use last known rate compared to document date
$tmparray = dol_getdate($date_document);
$sql2 .= " AND mc.date_sync <= '".$dbs->idate(dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], true))."'";
}
@ -545,7 +545,7 @@ class MultiCurrency extends CommonObject
if ($resql && $obj = $dbs->fetch_object($resql)) {
return array($obj->rowid, $obj->rate);
} else {
if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE)) {
if (getDolGlobalString('MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE')) {
$resql = $dbs->query($sql1.$sql3);
if ($resql && $obj = $dbs->fetch_object($resql)) {
return array($obj->rowid, $obj->rate);
@ -663,7 +663,7 @@ class MultiCurrency extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
$urlendpoint = 'http://api.currencylayer.com/live?access_key='.$key;
$urlendpoint .= '&source=' . (empty($conf->global->MULTICURRENCY_APP_SOURCE) ? 'USD' : $conf->global->MULTICURRENCY_APP_SOURCE);
$urlendpoint .= '&source=' . (!getDolGlobalString('MULTICURRENCY_APP_SOURCE') ? 'USD' : $conf->global->MULTICURRENCY_APP_SOURCE);
dol_syslog("Call url endpoint ".$urlendpoint);

View File

@ -100,7 +100,7 @@ $fieldstosearchall = array(
$arrayfields = array(
'cr.date_sync'=>array('label'=>'Date', 'checked'=>1),
'cr.rate'=>array('label'=>'Rate', 'checked'=>1),
'cr.rate_indirect'=>array('label'=>'RateIndirect', 'checked'=>0, 'enabled'=>(empty($conf->global->MULTICURRENCY_USE_RATE_INDIRECT) ? 0 : 1)),
'cr.rate_indirect'=>array('label'=>'RateIndirect', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT') ? 0 : 1)),
'm.code'=>array('label'=>'Code', 'checked'=>1),
);
@ -286,7 +286,7 @@ if (!in_array($action, array("updateRate", "deleteRate"))) {
print ' <td>'.$langs->trans('Rate').' / '.$langs->getCurrencySymbol($conf->currency).'</td>';
print ' <td><input type="text" min="0" step="any" class="maxwidth75" id="rateinput" name="rateinput" value="'.dol_escape_htmltag($rateinput).'"></td>';
if (!empty($conf->global->MULTICURRENCY_USE_RATE_INDIRECT)) {
if (getDolGlobalString('MULTICURRENCY_USE_RATE_INDIRECT')) {
print ' <td>'.$langs->trans('RateIndirect').' / '.$langs->getCurrencySymbol($conf->currency).'</td>';
print ' <td><input type="text" min="0" step="any" class="maxwidth75" id="rateindirectinput" name="rateindirectinput" value="'.dol_escape_htmltag($rateindirectinput).'"></td>';
// LRR Calculate Rate Direct

View File

@ -519,7 +519,7 @@ class Opensurveysondage extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -114,13 +114,13 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
print '>';
print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
}
print '</div>';
}
if (!empty($conf->global->OPENSURVEY_IMAGE_PUBLIC_INTERFACE)) {
if (getDolGlobalString('OPENSURVEY_IMAGE_PUBLIC_INTERFACE')) {
print '<div class="backimagepublicopensurvey">';
print '<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('OPENSURVEY_IMAGE_PUBLIC_INTERFACE').'">';
print '</div>';

View File

@ -223,7 +223,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
}
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/opensurvey/card.php', 1).'?id='.$id);
@ -245,7 +245,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
$fieldtosortuser = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? 'firstname' : 'lastname';
$fieldtosortuser = !getDolGlobalString('MAIN_FIRSTNAME_NAME_POSITION') ? 'firstname' : 'lastname';
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);

View File

@ -136,7 +136,7 @@ print '</tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").'</td>';
print '<td>';
$dnbdays = '30';
$backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays;
$backlinks = (getDolGlobalString('PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL')) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays;
print '<input class="maxwidth50" type="text" name="PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL" value="'.$backlinks.'">';
print '</td>';
print '<td><span class="opacitymedium">'.$dnbdays.'</span></td>';
@ -165,7 +165,7 @@ print '</tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").'</td>';
print '<td>';
$backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK);
$backlinks = (!getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK);
print '<input class="minwidth400" type="text" name="PARTNERSHIP_BACKLINKS_TO_CHECK" value="'.$backlinks.'">';
print '</td>';
print '<td><span class="opacitymedium">dolibarr.org|dolibarr.fr|dolibarr.es</span></td>';

View File

@ -138,7 +138,7 @@ print '<span class="opacitymedium">'.$langs->trans("PublicFormRegistrationPartne
$param = '';
$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' ';
if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
if (!getDolGlobalString('PARTNERSHIP_ENABLE_PUBLIC')) {
// Button off, click to enable
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setPARTNERSHIP_ENABLE_PUBLIC&token='.newToken().'&value=1'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
@ -150,7 +150,7 @@ if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
$enabledisablehtml .= '</a>';
}
print $enabledisablehtml;
print '<input type="hidden" id="PARTNERSHIP_ENABLE_PUBLIC" name="PARTNERSHIP_ENABLE_PUBLIC" value="'.(empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC) ? 0 : 1).'">';
print '<input type="hidden" id="PARTNERSHIP_ENABLE_PUBLIC" name="PARTNERSHIP_ENABLE_PUBLIC" value="'.(!getDolGlobalString('PARTNERSHIP_ENABLE_PUBLIC') ? 0 : 1).'">';
print '<br>';
@ -210,7 +210,7 @@ print dol_get_fiche_end();
print '</form>';
if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
if (getDolGlobalString('PARTNERSHIP_ENABLE_PUBLIC')) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';

View File

@ -170,7 +170,7 @@ class Partnership extends CommonObject
$this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150');
}
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
$this->fields['rowid']['visible'] = 0;
}
@ -983,7 +983,7 @@ class Partnership extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowPartnership");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1181,11 +1181,11 @@ class Partnership extends CommonObject
global $langs, $conf;
$langs->load("partnership");
if (empty($conf->global->PARTNERSHIP_ADDON)) {
if (!getDolGlobalString('PARTNERSHIP_ADDON')) {
$conf->global->PARTNERSHIP_ADDON = 'mod_partnership_standard';
}
if (!empty($conf->global->PARTNERSHIP_ADDON)) {
if (getDolGlobalString('PARTNERSHIP_ADDON')) {
$mybool = false;
$file = getDolGlobalString('PARTNERSHIP_ADDON') . ".php";
@ -1251,7 +1251,7 @@ class Partnership extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->PARTNERSHIP_ADDON_PDF)) {
} elseif (getDolGlobalString('PARTNERSHIP_ADDON_PDF')) {
$modele = $conf->global->PARTNERSHIP_ADDON_PDF;
}
}

View File

@ -89,7 +89,7 @@ class PartnershipType extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@ -295,7 +295,7 @@ class PartnershipType extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -72,7 +72,7 @@ class PartnershipUtils
}
$partnership = new Partnership($this->db);
$MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL) ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call
$MAXPERCALL = (!getDolGlobalString('PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL') ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call
$langs->loadLangs(array("partnership", "member"));
@ -201,7 +201,7 @@ class PartnershipUtils
$object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$object->actionmsg = $arraydefaultmessage->topic."\n".$arraydefaultmessage->content; // Long text
$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);; // Short text ($langs->transnoentities('MailSentBy')...);
if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) {
if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
$object->actionmsg2 = $subject; // Short text
}
@ -415,7 +415,7 @@ class PartnershipUtils
$object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$object->actionmsg = $arraydefaultmessage->topic."\n".$arraydefaultmessage->content; // Long text
$object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);; // Short text ($langs->transnoentities('MailSentBy')...);
if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) {
if (getDolGlobalString('MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT')) {
$object->actionmsg2 = $subject; // Short text
}
@ -523,7 +523,7 @@ class PartnershipUtils
}
}
if ($webcontent && !empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) && preg_match('/' . getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
if ($webcontent && getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') && preg_match('/' . getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK').'/', $webcontent)) {
$found = 1;
}

View File

@ -104,7 +104,7 @@ function partnershipPrepareHead($object)
$head[$h][0] = dol_buildpath('/partnership/partnership_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
}
$head[$h][2] = 'note';
$h++;

View File

@ -135,7 +135,7 @@ if (empty($reshook)) {
$result = $object->validate($user);
if ($result >= 0) {
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';
@ -167,7 +167,7 @@ if (empty($reshook)) {
$result = $object->approve($user);
if ($result >= 0) {
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';

View File

@ -458,7 +458,7 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$id);
@ -499,7 +499,7 @@ if ($managedfor == "member") {
print '<table class="border centpercent tableforfield">';
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) {
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
}

View File

@ -121,15 +121,15 @@ if ($action == 'setvalue' && $user->admin) {
*/
$IBS_SITE = "1999888"; // Site test
if (empty($conf->global->PAYBOX_IBS_SITE)) {
if (!getDolGlobalString('PAYBOX_IBS_SITE')) {
$conf->global->PAYBOX_IBS_SITE = $IBS_SITE;
}
$IBS_RANG = "99"; // Rang test
if (empty($conf->global->PAYBOX_IBS_RANG)) {
if (!getDolGlobalString('PAYBOX_IBS_RANG')) {
$conf->global->PAYBOX_IBS_RANG = $IBS_RANG;
}
$IBS_DEVISE = "978"; // Euro
if (empty($conf->global->PAYBOX_IBS_DEVISE)) {
if (!getDolGlobalString('PAYBOX_IBS_DEVISE')) {
$conf->global->PAYBOX_IBS_DEVISE = $IBS_DEVISE;
}
@ -279,7 +279,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("SecurityTokenIsUnique").'</td><td>';
print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (empty($conf->global->PAYMENT_SECURITY_TOKEN) ? 0 : $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
print $form->selectyesno("PAYMENT_SECURITY_TOKEN_UNIQUE", (!getDolGlobalString('PAYMENT_SECURITY_TOKEN') ? 0 : $conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
print '</td></tr>';
print '</table>';

View File

@ -44,15 +44,15 @@ function print_paybox_redirect($PRICE, $CURRENCY, $EMAIL, $urlok, $urlko, $TAG)
// Clean parameters
$PBX_IDENTIFIANT = "2"; // Identifiant pour v2 test
if (!empty($conf->global->PAYBOX_PBX_IDENTIFIANT)) {
if (getDolGlobalString('PAYBOX_PBX_IDENTIFIANT')) {
$PBX_IDENTIFIANT = $conf->global->PAYBOX_PBX_IDENTIFIANT;
}
$IBS_SITE = "1999888"; // Site test
if (!empty($conf->global->PAYBOX_IBS_SITE)) {
if (getDolGlobalString('PAYBOX_IBS_SITE')) {
$IBS_SITE = $conf->global->PAYBOX_IBS_SITE;
}
$IBS_RANG = "99"; // Rang test
if (!empty($conf->global->PAYBOX_IBS_RANG)) {
if (getDolGlobalString('PAYBOX_IBS_RANG')) {
$IBS_RANG = $conf->global->PAYBOX_IBS_RANG;
}
$IBS_DEVISE = "840"; // Currency (Dollar US by default)

View File

@ -82,7 +82,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
//'
//'-------------------------------------------------
if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) {
if (!getDolGlobalString('PAYPAL_API_INTEGRAL_OR_PAYPALONLY')) {
$conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY = 'integral';
}
@ -213,17 +213,17 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
//$nvpstr = $nvpstr . "&VERSION=".$API_version; // Already added by hash_call
$nvpstr = $nvpstr."&RETURNURL=".urlencode($returnURL);
$nvpstr = $nvpstr."&CANCELURL=".urlencode($cancelURL);
if (!empty($conf->global->PAYPAL_ALLOW_NOTES)) {
if (getDolGlobalString('PAYPAL_ALLOW_NOTES')) {
$nvpstr = $nvpstr."&ALLOWNOTE=0";
}
if (empty($conf->global->PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS)) {
if (!getDolGlobalString('PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS')) {
$nvpstr = $nvpstr."&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted
} else {
$nvpstr = $nvpstr."&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory)
}
$nvpstr = $nvpstr."&SOLUTIONTYPE=".urlencode($solutionType);
$nvpstr = $nvpstr."&LANDINGPAGE=".urlencode($landingPage);
if (!empty($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER)) {
if (getDolGlobalString('PAYPAL_CUSTOMER_SERVICE_NUMBER')) {
$nvpstr = $nvpstr."&CUSTOMERSERVICENUMBER=".urlencode($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER); // Hotline phone number
}
@ -261,7 +261,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
$nvpstr = $nvpstr."&".$paypalprefix."DESC=".urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC
}
if (!empty($conf->global->PAYPAL_LOGOIMG) && $mysoc->logo) {
if (getDolGlobalString('PAYPAL_LOGOIMG') && $mysoc->logo) {
global $dolibarr_main_url_root;
// Define $urlwithroot
@ -272,10 +272,10 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
$urllogo = $urlwithroot."/viewimage.php?modulepart=mycompany&file=".urlencode('logos/'.$mysoc->logo);
$nvpstr = $nvpstr."&LOGOIMG=".urlencode($urllogo);
}
if (!empty($conf->global->PAYPAL_BRANDNAME)) {
if (getDolGlobalString('PAYPAL_BRANDNAME')) {
$nvpstr = $nvpstr."&BRANDNAME=".urlencode($conf->global->PAYPAL_BRANDNAME); // BRANDNAME
}
if (!empty($conf->global->PAYPAL_NOTETOBUYER)) {
if (getDolGlobalString('PAYPAL_NOTETOBUYER')) {
$nvpstr = $nvpstr."&NOTETOBUYER=".urlencode($conf->global->PAYPAL_NOTETOBUYER); // PAYPAL_NOTETOBUYER
}
@ -457,7 +457,7 @@ function hash_call($methodName, $nvpStr)
// TODO problem with triggers
$API_version = "98.0";
if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} else {
@ -467,19 +467,19 @@ function hash_call($methodName, $nvpStr)
// Clean parameters
$PAYPAL_API_USER = "";
if (!empty($conf->global->PAYPAL_API_USER)) {
if (getDolGlobalString('PAYPAL_API_USER')) {
$PAYPAL_API_USER = $conf->global->PAYPAL_API_USER;
}
$PAYPAL_API_PASSWORD = "";
if (!empty($conf->global->PAYPAL_API_PASSWORD)) {
if (getDolGlobalString('PAYPAL_API_PASSWORD')) {
$PAYPAL_API_PASSWORD = $conf->global->PAYPAL_API_PASSWORD;
}
$PAYPAL_API_SIGNATURE = "";
if (!empty($conf->global->PAYPAL_API_SIGNATURE)) {
if (getDolGlobalString('PAYPAL_API_SIGNATURE')) {
$PAYPAL_API_SIGNATURE = $conf->global->PAYPAL_API_SIGNATURE;
}
$PAYPAL_API_SANDBOX = "";
if (!empty($conf->global->PAYPAL_API_SANDBOX)) {
if (getDolGlobalString('PAYPAL_API_SANDBOX')) {
$PAYPAL_API_SANDBOX = $conf->global->PAYPAL_API_SANDBOX;
}
// TODO END problem with triggers
@ -496,7 +496,7 @@ function hash_call($methodName, $nvpStr)
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// TLSv1 by default or change to TLSv1.2 in module configuration
curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION) ? 1 : $conf->global->PAYPAL_SSLVERSION));
curl_setopt($ch, CURLOPT_SSLVERSION, (!getDolGlobalString('PAYPAL_SSLVERSION') ? 1 : $conf->global->PAYPAL_SSLVERSION));
$ssl_verifypeer = -1;
@ -505,7 +505,7 @@ function hash_call($methodName, $nvpStr)
global $dolibarr_main_prod;
$ssl_verifypeer = ($dolibarr_main_prod ? true : false);
}
if (!empty($conf->global->MAIN_CURL_DISABLE_VERIFYPEER)) {
if (getDolGlobalString('MAIN_CURL_DISABLE_VERIFYPEER')) {
$ssl_verifypeer = 0;
}
@ -513,8 +513,8 @@ function hash_call($methodName, $nvpStr)
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, ($ssl_verifypeer ? true : false));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, ($ssl_verifypeer ? true : false));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT);
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, !getDolGlobalString('MAIN_USE_CONNECT_TIMEOUT') ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT);
curl_setopt($ch, CURLOPT_TIMEOUT, !getDolGlobalString('MAIN_USE_RESPONSE_TIMEOUT') ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);

View File

@ -47,7 +47,7 @@ $API_version = "56";
' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
if (getDolGlobalString('PAYPAL_API_SANDBOX') || GETPOST('forcesandbox', 'alpha')) { // We can force sand box with param 'forcesandbox'
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} else {
@ -57,19 +57,19 @@ if (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha'
// Clean parameters
$PAYPAL_API_USER = "";
if (!empty($conf->global->PAYPAL_API_USER)) {
if (getDolGlobalString('PAYPAL_API_USER')) {
$PAYPAL_API_USER = $conf->global->PAYPAL_API_USER;
}
$PAYPAL_API_PASSWORD = "";
if (!empty($conf->global->PAYPAL_API_PASSWORD)) {
if (getDolGlobalString('PAYPAL_API_PASSWORD')) {
$PAYPAL_API_PASSWORD = $conf->global->PAYPAL_API_PASSWORD;
}
$PAYPAL_API_SIGNATURE = "";
if (!empty($conf->global->PAYPAL_API_SIGNATURE)) {
if (getDolGlobalString('PAYPAL_API_SIGNATURE')) {
$PAYPAL_API_SIGNATURE = $conf->global->PAYPAL_API_SIGNATURE;
}
$PAYPAL_API_SANDBOX = "";
if (!empty($conf->global->PAYPAL_API_SANDBOX)) {
if (getDolGlobalString('PAYPAL_API_SANDBOX')) {
$PAYPAL_API_SANDBOX = $conf->global->PAYPAL_API_SANDBOX;
}
@ -78,4 +78,4 @@ $PROXY_HOST = $conf->global->MAIN_PROXY_HOST;
$PROXY_PORT = $conf->global->MAIN_PROXY_PORT;
$PROXY_USER = $conf->global->MAIN_PROXY_USER;
$PROXY_PASS = $conf->global->MAIN_PROXY_PASS;
$USE_PROXY = empty($conf->global->MAIN_PROXY_USE) ?false:true;
$USE_PROXY = !getDolGlobalString('MAIN_PROXY_USE') ?false:true;

View File

@ -69,7 +69,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->$keyforpara
}
// Clean param
if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')) {
dolibarr_set_const($db, 'PRODUIT_MULTIPRICES_LIMIT', 5, 'chaine', 0, '', $conf->entity);
}
@ -336,7 +336,7 @@ foreach ($dirproduct as $dirroot) {
print '<td>'.$modCodeProduct->info($langs).'</td>'."\n";
print '<td class="nowrap"><span class="opacitymedium">'.$modCodeProduct->getExample($langs).'</span></td>'."\n";
if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) {
if (getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON') && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) {
print '<td class="center">'."\n";
print img_picto($langs->trans("Activated"), 'switch_on');
print "</td>\n";
@ -567,16 +567,16 @@ if (!isModEnabled('multicompany')) {
}
print '<td class="right">';
$current_rule = 'PRODUCT_PRICE_UNIQ';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
$current_rule = 'PRODUIT_MULTIPRICES';
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY')) {
$current_rule = 'PRODUIT_CUSTOMER_PRICES_BY_QTY';
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
$current_rule = 'PRODUIT_CUSTOMER_PRICES';
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
$current_rule = 'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
}
print $form->selectarray("princingrule", $select_pricing_rules, $current_rule, 0, 0, 0, '', 1, 0, 0, '', 'maxwidth400', 1);
@ -585,7 +585,7 @@ print '</tr>';
// multiprix nombre de prix a proposer
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
print '<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="' . getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT').'"></td>';
@ -658,7 +658,7 @@ if (empty($conf->use_javascript_ajax)) {
}
print '</tr>';
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
if (!getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NumberOfProductShowInSelect").'</td>';
print '<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="' . getDolGlobalString('PRODUIT_LIMIT_SIZE').'"></td>';
@ -673,7 +673,7 @@ print '<!-- PRODUIT_AUTOFILL_DESC -->';
print $form->selectarray(
"activate_FillProductDescAuto",
array(0=>'DoNotAutofillButAutoConcat', 1=>'AutoFillFormFieldBeforeSubmit', 2=>'DoNotUseDescriptionOfProdut'),
empty($conf->global->PRODUIT_AUTOFILL_DESC) ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
!getDolGlobalString('PRODUIT_AUTOFILL_DESC') ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
0,
0,
0,
@ -724,13 +724,13 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
print '<td class="right">';
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
print '</td>';
print '</tr>';
}
if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
if (getDolGlobalString('PRODUCT_CANVAS_ABILITY')) {
// Add canvas feature
$dir = DOL_DOCUMENT_ROOT."/product/canvas/";

View File

@ -141,7 +141,7 @@ if ($id > 0 || $ref) {
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung';
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/productnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->name." - ".$title;
}
llxHeader('', $title, $help_url);

View File

@ -134,7 +134,7 @@ if ($action == 'fetch' && !empty($id)) {
}
// Price by qty
if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price related to qty
if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { // If we need a particular price related to qty
$sql = "SELECT price, unitprice, quantity, remise_percent";
$sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty";
$sql .= " WHERE rowid = ".((int) $price_by_qty_rowid);
@ -159,7 +159,7 @@ if ($action == 'fetch' && !empty($id)) {
}
// Multiprice (1 price per level)
if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price level (from 1 to 6)
if (!$found && isset($price_level) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { // If we need a particular price level (from 1 to 6)
$sql = "SELECT price, price_ttc, price_base_type,";
$sql .= " tva_tx, default_vat_code"; // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on.
$sql .= " FROM ".MAIN_DB_PREFIX."product_price ";
@ -177,7 +177,7 @@ if ($action == 'fetch' && !empty($id)) {
$outprice_ht = price($objp->price); // formated for langage user because is inserted into input field
$outprice_ttc = price($objp->price_ttc); // formated for langage user because is inserted into input field
$outpricebasetype = $objp->price_base_type;
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
$outtva_tx_formated = price($objp->tva_tx); // formated for langage user because is inserted into input field
$outtva_tx = price2num($objp->tva_tx); // international numeric
$outdefault_vat_code = $objp->default_vat_code;

View File

@ -96,7 +96,7 @@ $refalreadyexists = 0;
// Get parameters
$id = GETPOST('id', 'int');
if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) {
if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'nohtml') : null);
} else {
$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'alpha') : null);
@ -120,10 +120,10 @@ $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha');
$checkmandatory = GETPOST('accountancy_code_buy_export', 'alpha');
// by default 'alphanohtml' (better security); hidden conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML allows basic html
if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) {
if (getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) {
$label_security_check = 'nohtml';
} else {
$label_security_check = empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML) ? 'alphanohtml' : 'restricthtml';
$label_security_check = !getDolGlobalString('MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML') ? 'alphanohtml' : 'restricthtml';
}
if (!empty($user->socid)) {
@ -131,7 +131,7 @@ if (!empty($user->socid)) {
}
// Load object modCodeProduct
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
$module = (getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON') ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -212,7 +212,7 @@ if ($cancel) {
}
$createbarcode = isModEnabled('barcode');
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'creer_advance')) {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'creer_advance')) {
$createbarcode = 0;
}
@ -492,7 +492,7 @@ if (empty($reshook)) {
$error++;
}
if (empty($ref)) {
if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) {
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('ProductRef')), null, 'errors');
$action = "create";
$error++;
@ -664,7 +664,7 @@ if (empty($reshook)) {
}
// MultiPrix
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($i = 2; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
if (GETPOSTISSET("price_".$i)) {
$object->multiprices["$i"] = price2num(GETPOST("price_".$i), 'MU');
@ -681,7 +681,7 @@ if (empty($reshook)) {
$error++;
}
if (!$ref && !empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) {
if (!$ref && getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
// Generate ref...
$ref = $modCodeProduct->getNextValue($object, $type);
}
@ -741,7 +741,7 @@ if (empty($reshook)) {
//Need dol_clone methode 1 (same object class) because update product use hasbatch() method on oldcopy
$object->oldcopy = dol_clone($object, 1);
if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) {
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
$object->ref = $ref;
}
$object->label = GETPOST('label', $label_security_check);
@ -750,7 +750,7 @@ if (empty($reshook)) {
$object->description = $desc;
$object->url = GETPOST('url');
if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private', 'restricthtml'));
$object->note = $object->note_private;
}
@ -1069,7 +1069,7 @@ if (empty($reshook)) {
$pu_ht = $object->multiprices[$soc->price_level];
$pu_ttc = $object->multiprices_ttc[$soc->price_level];
$price_base_type = $object->multiprices_base_type[$soc->price_level];
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
$prodcustprice = new ProductCustomerPrice($db);
@ -1273,7 +1273,7 @@ llxHeader('', $title, $help_url);
// Load object modBarCodeProduct
$res = 0;
if (isModEnabled('barcode') && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcode as $dirroot) {
@ -1318,7 +1318,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Load object modCodeProduct
$module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
$module = (getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON') ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard');
if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') {
$module = substr($module, 0, dol_strlen($module) - 4);
}
@ -1368,7 +1368,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (empty($reshook)) {
print '<table class="border centpercent">';
if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) {
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
print '<tr>';
$tmpcode = '';
if (!empty($modCodeProduct->code_auto)) {
@ -1453,7 +1453,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
$showbarcode = isModEnabled('barcode');
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) {
$showbarcode = 0;
}
@ -1462,7 +1462,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (GETPOSTISSET('fk_barcode_type')) {
$fk_barcode_type = GETPOST('fk_barcode_type')?GETPOST('fk_barcode_type'):0;
} else {
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
if (empty($fk_barcode_type) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE')) {
$fk_barcode_type = getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE");
} else {
$fk_barcode_type=0;
@ -1489,7 +1489,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$doleditor->Create();
print "</td></tr>";
if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
if (!getDolGlobalString('PRODUCT_DISABLE_PUBLIC_URL')) {
// Public URL
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td>';
print img_picto('', 'globe', 'class="pictofixedwidth"');
@ -1508,7 +1508,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td>';
print '</tr>';
if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) {
if (!getDolGlobalString('PRODUCT_DISABLE_STOCK_LEVELS')) {
// Stock min level
print '<tr><td>'.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).'</td><td>';
print '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
@ -1521,7 +1521,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
}
} else {
if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) {
if (!getDolGlobalString('PRODUCT_DISABLE_STOCK_LEVELS')) {
print '<input name="seuil_stock_alerte" type="hidden" value="0">';
print '<input name="desiredstock" type="hidden" value="0">';
}
@ -1554,7 +1554,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
if ($type != 1) { // Nature, Weight and volume only applies to products and not to services
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) {
// Nature
print '<tr><td>'.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).'</td><td>';
print $formproduct->selectProductNature('finished', $object->finished);
@ -1563,17 +1563,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
if ($type != 1) {
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
if (!getDolGlobalString('PRODUCT_DISABLE_WEIGHT')) {
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"');
print '<input name="weight" size="4" value="'.GETPOST('weight').'">';
print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
print '</td></tr>';
}
// Brut Length
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SIZE')) {
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td>';
print img_picto('', 'fa-ruler', 'class="pictofixedwidth"');
print '<input name="size" class="width50" value="'.GETPOST('size').'"> x ';
@ -1582,14 +1582,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTISSET('size_units') ?GETPOST('size_units', 'alpha') : '0', 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SURFACE')) {
// Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td>';
print '<input name="surface" size="4" value="'.GETPOST('surface').'">';
print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ?GETPOST('surface_units', 'alpha') : '0', 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) {
if (!getDolGlobalString('PRODUCT_DISABLE_VOLUME')) {
// Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
print '<input name="volume" size="4" value="'.GETPOST('volume').'">';
@ -1597,17 +1597,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
}
if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) {
if (getDolGlobalString('PRODUCT_ADD_NET_MEASURE')) {
// Net Measure
print '<tr><td>'.$langs->trans("NetMeasure").'</td><td>';
print '<input name="net_measure" size="4" value="'.GETPOST('net_measure').'">';
print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ?GETPOST('net_measure_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 0);
print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ?GETPOST('net_measure_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 0);
print '</td></tr>';
}
}
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td>';
print '<td>';
print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, 'units');
@ -1615,7 +1615,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Custom code
if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO) && empty($type)) {
if (!getDolGlobalString('PRODUCT_DISABLE_CUSTOM_INFO') && empty($type)) {
print '<tr><td class="wordbreak">'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.GETPOST('customcode').'"></td></tr>';
// Origin country
@ -1629,9 +1629,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
// State
if (empty($conf->global->PRODUCT_DISABLE_STATE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_STATE')) {
print '<tr>';
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
if (getDolGlobalString('MAIN_SHOW_REGION_IN_STATE_SELECT') && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
print '<td>'.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).'</td><td>';
} else {
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td>';
@ -1644,7 +1644,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Quality control
if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) {
if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
print '<tr><td>'.$langs->trans("LifeTime").'</td><td><input name="lifetime" class="maxwidth50" value="'.GETPOST('lifetime').'"></td></tr>';
print '<tr><td>'.$langs->trans("QCFrequency").'</td><td><input name="qc_frequency" class="maxwidth50" value="'.GETPOST('qc_frequency').'"></td></tr>';
}
@ -1681,8 +1681,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<hr>';
if (empty($conf->global->PRODUCT_DISABLE_PRICES)) {
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUCT_DISABLE_PRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
// We do no show price array on create when multiprices enabled.
// We must set them on prices tab.
print '<table class="border centpercent">';
@ -1725,7 +1725,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<!-- accountancy codes -->'."\n";
print '<table class="border centpercent">';
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
if (!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING')) {
if (isModEnabled('accounting')) {
// Accountancy_code_sell
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
@ -1914,7 +1914,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<table class="border allwidth">';
// Ref
if (empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) {
if (!getDolGlobalString('MAIN_PRODUCT_REF_NOT_EDITABLE')) {
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST('ref') : $object->ref).'"></td></tr>';
} else {
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="ref" class="maxwidth200" maxlength="128" value="'.dol_escape_htmltag($object->ref).'" readonly="true"></td></tr>';
@ -1951,7 +1951,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Batch number managment
if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($object->isProduct() || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
@ -2062,7 +2062,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Barcode
$showbarcode = isModEnabled('barcode');
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) {
$showbarcode = 0;
}
@ -2072,7 +2072,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
$fk_barcode_type = GETPOST('fk_barcode_type');
} else {
$fk_barcode_type = $object->barcode_type;
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
if (empty($fk_barcode_type) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE')) {
$fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
}
}
@ -2100,7 +2100,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print "\n";
// Public Url
if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
if (!getDolGlobalString('PRODUCT_DISABLE_PUBLIC_URL')) {
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td>';
print img_picto('', 'globe', 'class="pictofixedwidth"');
print '<input type="text" name="url" class="quatrevingtpercent" value="'.(GETPOSTISSET('url') ? GETPOST('url') : $object->url).'">';
@ -2158,7 +2158,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
} else {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) {
// Nature
print '<tr><td>'.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).'</td><td>';
print $formproduct->selectProductNature('finished', (GETPOSTISSET('finished') ? GETPOST('finished') : $object->finished));
@ -2174,7 +2174,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
if (!$object->isService()) {
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
if (!getDolGlobalString('PRODUCT_DISABLE_WEIGHT')) {
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
print '<input name="weight" size="5" value="'.(GETPOSTISSET('weight') ? GETPOST('weight') : $object->weight).'"> ';
@ -2182,7 +2182,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SIZE')) {
// Brut Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td>';
print '<input name="size" size="5" value="'.(GETPOSTISSET('size') ? GETPOST('size') : $object->length).'">x';
@ -2191,14 +2191,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTISSET('size_units') ? GETPOST('size_units') : $object->length_units, 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SURFACE')) {
// Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td>';
print '<input name="surface" size="5" value="'.(GETPOSTISSET('surface') ? GETPOST('surface') : $object->surface).'"> ';
print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ? GETPOST('surface_units') : $object->surface_units, 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) {
if (!getDolGlobalString('PRODUCT_DISABLE_VOLUME')) {
// Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
print '<input name="volume" size="5" value="'.(GETPOSTISSET('volume') ? GETPOST('volume') : $object->volume).'"> ';
@ -2206,7 +2206,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
}
if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) {
if (getDolGlobalString('PRODUCT_ADD_NET_MEASURE')) {
// Net Measure
print '<tr><td>'.$langs->trans("NetMeasure").'</td><td>';
print '<input name="net_measure" size="5" value="'.(GETPOSTISSET('net_measure') ? GETPOST('net_measure') : $object->net_measure).'"> ';
@ -2215,7 +2215,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td>';
print '<td>';
print $form->selectUnits($object->fk_unit, 'units');
@ -2223,7 +2223,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Custom code
if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) {
if (!$object->isService() && !getDolGlobalString('PRODUCT_DISABLE_CUSTOM_INFO')) {
print '<tr><td class="wordbreak">'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.(GETPOSTISSET('customcode') ? GETPOST('customcode') : $object->customcode).'"></td></tr>';
// Origin country
print '<tr><td>'.$langs->trans("CountryOrigin").'</td>';
@ -2236,9 +2236,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
// State
if (empty($conf->global->PRODUCT_DISABLE_STATE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_STATE')) {
print '<tr>';
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
if (getDolGlobalString('MAIN_SHOW_REGION_IN_STATE_SELECT') && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
print '<td>'.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).'</td><td>';
} else {
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td>';
@ -2252,7 +2252,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Quality control
if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) {
if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
print '<tr><td>'.$langs->trans("LifeTime").'</td><td><input name="lifetime" class="maxwidth100onsmartphone" value="'.$object->lifetime.'"></td></tr>';
print '<tr><td>'.$langs->trans("QCFrequency").'</td><td><input name="qc_frequency" class="maxwidth100onsmartphone" value="'.$object->qc_frequency.'"></td></tr>';
}
@ -2287,7 +2287,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Note private
if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td>';
$doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_4, '90%');
@ -2302,7 +2302,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<table class="border centpercent">';
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
if (!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING')) {
if (isModEnabled('accounting')) {
// Accountancy_code_sell
print '<tr><td class="titlefieldcreate">'.$langs->trans("ProductAccountancySellCode").'</td>';
@ -2392,7 +2392,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Fiche en mode visu
$showbarcode = isModEnabled('barcode');
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('barcode', 'lire_advance')) {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('barcode', 'lire_advance')) {
$showbarcode = 0;
}
@ -2427,7 +2427,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="titlefield">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat);
print '</td></tr>';
@ -2491,12 +2491,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Batch number management (to batch)
if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($object->isProduct() || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
print $object->getLibStatut(0, 2);
print '</td></tr>';
if ((($object->status_batch == '1' && !empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced')
|| ($object->status_batch == '2' && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced' && !empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)))) {
if ((($object->status_batch == '1' && getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced')
|| ($object->status_batch == '2' && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced' && getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS')))) {
print '<tr><td>'.$langs->trans("ManageLotMask").'</td><td>';
print $object->batch_mask;
print '</td></tr>';
@ -2504,7 +2504,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
}
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
if (!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING')) {
// Accountancy sell code
print '<tr><td class="nowrap">';
print $langs->trans("ProductAccountancySellCode");
@ -2610,7 +2610,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).'</td></tr>';
// Public URL
if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
if (!getDolGlobalString('PRODUCT_DISABLE_PUBLIC_URL')) {
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td>';
print dol_print_url($object->url, '_blank', 128);
print '</td></tr>';
@ -2678,7 +2678,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print '</td></tr>';
} else {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) {
// Nature
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).'</td><td>';
print $object->getLibFinished();
@ -2698,7 +2698,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if (!$object->isService()) {
// Brut Weight
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
if (!getDolGlobalString('PRODUCT_DISABLE_WEIGHT')) {
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td>';
if ($object->weight != '') {
print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units);
@ -2708,7 +2708,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print "</td></tr>\n";
}
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SIZE')) {
// Brut Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td>';
if ($object->length != '' || $object->width != '' || $object->height != '') {
@ -2725,7 +2725,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
print "</td></tr>\n";
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SURFACE')) {
// Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td>';
if ($object->surface != '') {
@ -2735,7 +2735,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
print "</td></tr>\n";
}
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) {
if (!getDolGlobalString('PRODUCT_DISABLE_VOLUME')) {
// Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
if ($object->volume != '') {
@ -2746,7 +2746,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print "</td></tr>\n";
}
if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) {
if (getDolGlobalString('PRODUCT_ADD_NET_MEASURE')) {
// Net Measure
print '<tr><td class="titlefield">'.$langs->trans("NetMeasure").'</td><td>';
if ($object->net_measure != '') {
@ -2759,7 +2759,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Unit
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$unit = $object->getLabelOfUnit();
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td><td>';
@ -2770,7 +2770,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Custom code
if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) {
if (!$object->isService() && !getDolGlobalString('PRODUCT_DISABLE_CUSTOM_INFO')) {
print '<tr><td>'.$langs->trans("CustomCode").'</td><td>'.$object->customcode.'</td></tr>';
// Origin country code
@ -2782,7 +2782,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Quality Control
if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) {
if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
print '<tr><td>'.$langs->trans("LifeTime").'</td><td>'.$object->lifetime.'</td></tr>';
print '<tr><td>'.$langs->trans("QCFrequency").'</td><td>'.$object->qc_frequency.'</td></tr>';
}
@ -2799,7 +2799,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Note private
if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
print '<!-- show Note --> '."\n";
print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td><td>'.(dol_textishtml($object->note_private) ? $object->note_private : dol_nl2br($object->note_private, 1, true)).'</td></tr>'."\n";
print '<!-- End show Note --> '."\n";
@ -2853,10 +2853,10 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1),
array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1),
);
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
$formquestionclone[] = array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("CustomerPrices").')', 'value' => 0);
}
if (!empty($conf->global->PRODUIT_SOUSPRODUITS)) {
if (getDolGlobalString('PRODUIT_SOUSPRODUITS')) {
$formquestionclone[] = array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1);
}
@ -2928,7 +2928,7 @@ if ($action != 'create' && $action != 'edit') {
* All the "Add to" areas if PRODUCT_ADD_FORM_ADD_TO is set
*/
if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == '' || $action == 'view') && $object->status) {
if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action == '' || $action == 'view') && $object->status) {
//Variable used to check if any text is going to be printed
$html = '';
//print '<div class="fichecenter"><div class="fichehalfleft">';

View File

@ -373,7 +373,7 @@ class Products extends DolibarrApi
$result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update', $updatetype);
// If price mode is 1 price per product
if ($result > 0 && !empty($conf->global->PRODUCT_PRICE_UNIQ)) {
if ($result > 0 && getDolGlobalString('PRODUCT_PRICE_UNIQ')) {
// We update price only if it was changed
$pricemodified = false;
if ($this->product->price_base_type != $oldproduct->price_base_type) {
@ -617,7 +617,7 @@ class Products extends DolibarrApi
throw new RestException(401);
}
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup');
}
@ -659,7 +659,7 @@ class Products extends DolibarrApi
throw new RestException(401);
}
if (empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup');
}
@ -708,7 +708,7 @@ class Products extends DolibarrApi
throw new RestException(401);
}
if (empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY')) {
throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup');
}

View File

@ -290,7 +290,7 @@ class FormProduct
dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
$out = '';
if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
if (!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
$filterstatus = '';
}
if (!empty($fk_product) && $fk_product > 0) {
@ -308,11 +308,11 @@ class FormProduct
if (strpos($htmlname, 'search_') !== 0) {
if (empty($user->fk_warehouse) || $user->fk_warehouse == -1) {
if (is_scalar($selected) && ($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
if (is_scalar($selected) && ($selected == '-2' || $selected == 'ifone') && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE')) {
$selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
}
} else {
if (is_scalar($selected) && ($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
if (is_scalar($selected) && ($selected == '-2' || $selected == 'ifone') && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE_USER')) {
$selected = $user->fk_warehouse;
}
}
@ -430,11 +430,11 @@ class FormProduct
if (strpos($htmlname, 'search_') !== 0) {
if (empty($user->fk_workstation) || $user->fk_workstation == -1) {
if (($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WORKSTATION)) {
if (($selected == '-2' || $selected == 'ifone') && getDolGlobalString('MAIN_DEFAULT_WORKSTATION')) {
$selected = $conf->global->MAIN_DEFAULT_WORKSTATION;
}
} else {
if (($selected == '-2' || $selected == 'ifone') && !empty($conf->global->MAIN_DEFAULT_WORKSTATION)) {
if (($selected == '-2' || $selected == 'ifone') && getDolGlobalString('MAIN_DEFAULT_WORKSTATION')) {
$selected = $user->fk_workstation;
}
}

View File

@ -803,7 +803,7 @@ class Product extends CommonObject
$sql .= ", price_base_type";
$sql .= ", tobuy";
$sql .= ", tosell";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= ", accountancy_code_buy";
$sql .= ", accountancy_code_buy_intra";
$sql .= ", accountancy_code_buy_export";
@ -832,7 +832,7 @@ class Product extends CommonObject
$sql .= ", '".$this->db->escape($this->price_base_type)."'";
$sql .= ", ".((int) $this->status);
$sql .= ", ".((int) $this->status_buy);
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
@ -871,7 +871,7 @@ class Product extends CommonObject
}
// update accountancy for this entity
if (!$error && !empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
@ -1005,7 +1005,7 @@ class Product extends CommonObject
{
// phpcs:enable
global $conf;
if (isModEnabled('barcode') && !empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
@ -1156,7 +1156,7 @@ class Product extends CommonObject
if ($this->hasbatch() && !$this->oldcopy->hasbatch()) {
//$valueforundefinedlot = 'Undefined'; // In previous version, 39 and lower
$valueforundefinedlot = '000000';
if (!empty($conf->global->STOCK_DEFAULT_BATCH)) {
if (getDolGlobalString('STOCK_DEFAULT_BATCH')) {
$valueforundefinedlot = $conf->global->STOCK_DEFAULT_BATCH;
}
@ -1267,7 +1267,7 @@ class Product extends CommonObject
$sql .= ", note = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : 'null');
$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
@ -1302,7 +1302,7 @@ class Product extends CommonObject
$action = 'update';
// update accountancy for this entity
if (!$error && !empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
@ -1633,19 +1633,19 @@ class Product extends CommonObject
$sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", note='".$this->db->escape($this->other)."'";
}
$sql2 .= " WHERE fk_product = ".((int) $this->id)." AND lang = '".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".$this->db->prefix()."product_lang (fk_product, lang, label, description";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", note";
}
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
$sql2 .= " '".$this->db->escape($this->description)."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", '".$this->db->escape($this->other)."'";
}
$sql2 .= ")";
@ -1673,19 +1673,19 @@ class Product extends CommonObject
$sql2 .= " SET ";
$sql2 .= " label = '".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description = '".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", note = '".$this->db->escape($this->multilangs["$key"]["other"])."'";
}
$sql2 .= " WHERE fk_product = ".((int) $this->id)." AND lang = '".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".$this->db->prefix()."product_lang (fk_product, lang, label, description";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", note";
}
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
$sql2 .= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
}
$sql2 .= ")";
@ -1982,12 +1982,12 @@ class Product extends CommonObject
$price_base_type = $this->price_base_type;
// If price per segment
if (!empty($conf->global->PRODUIT_MULTIPRICES) && !empty($thirdparty_buyer->price_level)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($thirdparty_buyer->price_level)) {
$pu_ht = $this->multiprices[$thirdparty_buyer->price_level];
$pu_ttc = $this->multiprices_ttc[$thirdparty_buyer->price_level];
$price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
$price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
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
if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) {
$tva_tx = $this->multiprices_tva_tx[$thirdparty_buyer->price_level];
}
@ -1998,7 +1998,7 @@ class Product extends CommonObject
$tva_npr = 0;
}
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
// If price per customer
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
@ -2023,7 +2023,7 @@ class Product extends CommonObject
}
}
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY')) {
// If price per quantity
if ($this->prices_by_qty[0]) {
// yes, this product has some prices per quantity
@ -2041,7 +2041,7 @@ class Product extends CommonObject
break;
}
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
// If price per quantity and customer
if ($this->prices_by_qty[$thirdparty_buyer->price_level]) {
// yes, this product has some prices per quantity
@ -2132,7 +2132,7 @@ class Product extends CommonObject
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) {
$this->packaging = $obj->packaging;
}
$result = $obj->fk_product;
@ -2197,7 +2197,7 @@ class Product extends CommonObject
$this->fourn_multicurrency_tx = $obj->multicurrency_tx;
$this->fourn_multicurrency_id = $obj->fk_multicurrency;
$this->fourn_multicurrency_code = $obj->multicurrency_code;
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) {
$this->packaging = $obj->packaging;
}
$result = $obj->fk_product;
@ -2265,7 +2265,7 @@ class Product extends CommonObject
// If multiprices are enabled, then we check if the current product is subject to price autogeneration
// Price will be modified ONLY when the first one is the one that is being modified
if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !$ignore_autogen && $this->price_autogen && ($level == 1)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !$ignore_autogen && $this->price_autogen && ($level == 1)) {
return $this->generateMultiprices($user, $newprice, $newpricebase, $newvat, $newnpr, $newpbq);
}
@ -2396,7 +2396,7 @@ class Product extends CommonObject
// check if price have really change before log
$newPriceData = $this->getArrayForPriceCompare($level);
if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || !getDolGlobalString('PRODUIT_MULTIPRICES')) {
$this->_log_price($user, $level); // Save price for level into table product_price
}
@ -2471,7 +2471,7 @@ class Product extends CommonObject
$sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.fk_default_workstation, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,";
$sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,";
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period,";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
} else {
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
@ -2482,8 +2482,8 @@ class Product extends CommonObject
$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
$visibleWarehousesEntities = $conf->entity;
if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) {
if (!empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) {
if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
if ($this->db->num_rows($checkPMPPerEntity)>0) {
$separatedEntityPMP = true;
@ -2508,7 +2508,7 @@ class Product extends CommonObject
$sql .= " p.stock";
}
$sql .= " FROM ".$this->db->prefix()."product as p";
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) || $separatedEntityPMP) {
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
if ($separatedStock) {
@ -2533,7 +2533,7 @@ class Product extends CommonObject
$sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.fk_default_workstation, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,";
$sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,";
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period,";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
} else {
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
@ -2658,7 +2658,7 @@ class Product extends CommonObject
}
// Load multiprices array
if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($ignore_price_load)) { // prices per segment
if (getDolGlobalString('PRODUIT_MULTIPRICES') && empty($ignore_price_load)) { // prices per segment
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly";
@ -2721,9 +2721,9 @@ class Product extends CommonObject
return -1;
}
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && empty($ignore_price_load)) { // prices per customers
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && empty($ignore_price_load)) { // prices per customers
// Nothing loaded by default. List may be very long.
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) && empty($ignore_price_load)) { // prices per quantity
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') && empty($ignore_price_load)) { // prices per quantity
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid";
$sql .= " FROM ".$this->db->prefix()."product_price";
@ -2768,7 +2768,7 @@ class Product extends CommonObject
$this->error = $this->db->lasterror;
return -1;
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES) && empty($ignore_price_load)) { // prices per customer and quantity
} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') && empty($ignore_price_load)) { // prices per customer and quantity
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly";
@ -3024,7 +3024,7 @@ class Product extends CommonObject
$this->stats_propale['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in proposal by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -3136,7 +3136,7 @@ class Product extends CommonObject
}
$sql .= " WHERE c.rowid = cd.fk_commande";
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'commande').")";
$sql .= " AND cd.fk_product = ".((int) $this->id);
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
@ -3157,7 +3157,7 @@ class Product extends CommonObject
$this->stats_commande['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in order by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -3179,8 +3179,8 @@ class Product extends CommonObject
// If stock decrease is on invoice validation, the theorical stock continue to
// count the orders to ship in theorical stock when some are already removed by invoice validation.
if ($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
if (!empty($conf->global->DECREASE_ONLY_UNINVOICEDPRODUCTS)) {
if ($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_ON_BILL')) {
if (getDolGlobalString('DECREASE_ONLY_UNINVOICEDPRODUCTS')) {
// If option DECREASE_ONLY_UNINVOICEDPRODUCTS is on, we make a compensation but only if order not yet invoice.
$adeduire = 0;
$sql = "SELECT SUM(".$this->db->ifsql('f.type=2', -1, 1)." * fd.qty) as count FROM ".$this->db->prefix()."facturedet as fd ";
@ -3264,7 +3264,7 @@ class Product extends CommonObject
}
$sql .= " WHERE c.rowid = cd.fk_commande";
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sql .= " AND c.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")";
$sql .= " AND cd.fk_product = ".((int) $this->id);
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
$sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
@ -3328,7 +3328,7 @@ class Product extends CommonObject
$sql .= " WHERE e.rowid = ed.fk_expedition";
$sql .= " AND c.rowid = cd.fk_commande";
$sql .= " AND e.fk_soc = s.rowid";
$sql .= " AND e.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")";
$sql .= " AND e.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'expedition').")";
$sql .= " AND ed.fk_origin_line = cd.rowid";
$sql .= " AND cd.fk_product = ".((int) $this->id);
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
@ -3353,7 +3353,7 @@ class Product extends CommonObject
$this->stats_expedition['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in sending by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -3411,7 +3411,7 @@ class Product extends CommonObject
}
$sql .= " WHERE cf.rowid = fd.fk_commande";
$sql .= " AND cf.fk_soc = s.rowid";
$sql .= " AND cf.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sql .= " AND cf.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")";
$sql .= " AND fd.fk_product = ".((int) $this->id);
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
$sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
@ -3471,7 +3471,7 @@ class Product extends CommonObject
$sql .= ", ".$this->db->prefix()."societe_commerciaux as sc";
}
$sql .= " WHERE m.rowid = mp.fk_mo";
$sql .= " AND m.entity IN (".getEntity($forVirtualStock && !empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mrp').")";
$sql .= " AND m.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'mrp').")";
$sql .= " AND mp.fk_product = ".((int) $this->id);
if (!$user->hasRight('societe', 'client', 'voir') && !$socid && !$forVirtualStock) {
$sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
@ -3587,7 +3587,7 @@ class Product extends CommonObject
$this->stats_contrat['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in contract by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -3661,7 +3661,7 @@ class Product extends CommonObject
$this->stats_facture['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in invoice by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -3736,7 +3736,7 @@ class Product extends CommonObject
$this->stats_facturerec['qty'] = $obj->qty ? $obj->qty : 0;
// if it's a virtual product, maybe it is in invoice by extension
if (!empty($conf->global->PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC)) {
if (getDolGlobalString('PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC')) {
$TFather = $this->getFather();
if (is_array($TFather) && !empty($TFather)) {
foreach ($TFather as &$fatherData) {
@ -4879,7 +4879,7 @@ class Product extends CommonObject
}
$tmpproduct->fetch($id); // Load product to get ->ref
if (empty($ignore_stock_load) && ($tmpproduct->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (empty($ignore_stock_load) && ($tmpproduct->isProduct() || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) {
$tmpproduct->load_stock('nobatch,novirtual'); // Load stock to get true ->stock_reel
}
@ -5166,7 +5166,7 @@ class Product extends CommonObject
$datas = array();
$nofetch = !empty($params['nofetch']);
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return ['optimize' => $langs->trans("ShowProduct")];
}
@ -5195,7 +5195,7 @@ class Product extends CommonObject
if (!empty($this->description)) {
$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineofText($this->description, 5);
}
if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if ($this->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
if (isModEnabled('productbatch')) {
$langs->load("productbatch");
$datas['batchstatus']= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
@ -5311,7 +5311,7 @@ class Product extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowProduct");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1, 1).'"';
}
@ -5686,7 +5686,7 @@ class Product extends CommonObject
$warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL;
}
if (preg_match('/warehouseinternal/', $option)) {
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
$warehouseStatus[Entrepot::STATUS_OPEN_INTERNAL] = Entrepot::STATUS_OPEN_INTERNAL;
} else {
$warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL;
@ -5703,7 +5703,7 @@ class Product extends CommonObject
$sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")";
}
$sql .= " ORDER BY ps.reel ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation;
$sql .= " ORDER BY ps.reel ".(getDolGlobalString('DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE')?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation;
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
$result = $this->db->query($sql);
@ -5770,9 +5770,9 @@ class Product extends CommonObject
if (isModEnabled("expedition")) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
$filterShipmentStatus = '';
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
$filterShipmentStatus = Expedition::STATUS_VALIDATED.','.Expedition::STATUS_CLOSED;
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
$filterShipmentStatus = Expedition::STATUS_CLOSED;
}
$result = $this->load_stats_sending(0, '1,2', 1, $filterShipmentStatus);
@ -5782,7 +5782,7 @@ class Product extends CommonObject
$stock_sending_client = $this->stats_expedition['qty'];
}
if (isModEnabled("supplier_order")) {
$filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK;
$filterStatus = !getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK') ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK;
if (isset($includedraftpoforvirtual)) {
$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
}
@ -5827,21 +5827,21 @@ class Product extends CommonObject
$this->stock_theorique = $this->stock_reel + $stock_inproduction;
// Stock decrease mode
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
$this->stock_theorique -= ($stock_commande_client - $stock_sending_client);
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) {
$this->stock_theorique += 0;
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL')) {
$this->stock_theorique -= $stock_commande_client;
}
// Stock Increase mode
if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
if (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')) {
$this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur);
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
$this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur);
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) {
$this->stock_theorique -= $stock_reception_fournisseur;
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_BILL')) {
$this->stock_theorique += ($stock_commande_fournisseur - $stock_reception_fournisseur);
}
@ -6177,7 +6177,7 @@ class Product extends CommonObject
global $conf;
$result = '';
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirsociete as $dirroot) {
$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
@ -6302,7 +6302,7 @@ class Product extends CommonObject
$maxpricesupplier = 0;
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product_fourn = new ProductFournisseur($this->db);
$product_fourn_list = $product_fourn->list_product_fournisseur_price($this->id, '', '');

View File

@ -459,7 +459,7 @@ class Productbatch extends CommonObject
$sql .= " t.eatby as oldeatby,"; // deprecated but may not be migrated into new table
$sql .= " t.batch,";
$sql .= " t.qty,";
if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) $sql .= " MAX(sm.datem) as date_entree,";
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) $sql .= " MAX(sm.datem) as date_entree,";
$sql .= " t.import_key";
if ($fk_product > 0) {
$sql .= ", pl.rowid as lotid, pl.eatby as eatby, pl.sellby as sellby";
@ -470,7 +470,7 @@ class Productbatch extends CommonObject
$sql .= " LEFT JOIN ".$dbs->prefix()."product_lot as pl ON pl.fk_product = ".((int) $fk_product)." AND pl.batch = t.batch";
// TODO May add extrafields to ?
}
if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) {
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock AS ps ON (ps.rowid = fk_product_stock)';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'stock_mouvement AS sm ON (sm.batch = t.batch AND ps.fk_entrepot=sm.fk_entrepot)';
}
@ -478,7 +478,7 @@ class Productbatch extends CommonObject
if ($with_qty) {
$sql .= " AND t.qty <> 0";
}
if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) {
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
$sql .= ' AND sm.type_mouvement IN (0,3)';
$sql .= ' GROUP BY t.rowid, t.tms, t.fk_product_stock,t.sellby,t.eatby , t.batch,t.qty,t.import_key';
if ($fk_product > 0) {
@ -487,12 +487,12 @@ class Productbatch extends CommonObject
}
$sql .= " ORDER BY ";
// TODO : use product lifo and fifo when product will implement it
if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) {
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
$sql .= 'date_entree ASC,t.batch ASC,';
}
if ($fk_product > 0) { $sql .= "pl.eatby ASC, pl.sellby ASC, "; }
$sql .= "t.eatby ASC, t.sellby ASC ";
$sql .= ", t.qty ".(empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'ASC':'DESC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation
$sql .= ", t.qty ".(!getDolGlobalString('DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE')?'ASC':'DESC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation
$sql .= ", t.batch ASC";
dol_syslog("productbatch::findAll", LOG_DEBUG);
@ -512,7 +512,7 @@ class Productbatch extends CommonObject
$tmp->qty = $obj->qty;
$tmp->import_key = $obj->import_key;
if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) {
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
$tmp->context['stock_date_entry'] = $obj->date_entree;
}

View File

@ -819,7 +819,7 @@ class ProductCustomerPrice extends CommonObject
{
global $conf;
if (!empty($conf->global->PRODUCT_DISABLE_PROPAGATE_CUSTOMER_PRICES_ON_CHILD_COMPANIES)) {
if (getDolGlobalString('PRODUCT_DISABLE_PROPAGATE_CUSTOMER_PRICES_ON_CHILD_COMPANIES')) {
return 0;
}

View File

@ -177,7 +177,7 @@ class ProductFournisseurPrice extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
// Unset fields that are disabled
@ -607,7 +607,7 @@ class ProductFournisseurPrice extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowProductFournisseurPrice");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -756,11 +756,11 @@ class ProductFournisseurPrice extends CommonObject
global $langs, $conf;
$langs->load("buypricehistory@buypricehistory");
if (empty($conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON)) {
if (!getDolGlobalString('BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON')) {
$conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON = 'mod_productfournisseurprice_standard';
}
if (!empty($conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON)) {
if (getDolGlobalString('BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON')) {
$mybool = false;
$file = getDolGlobalString('BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON') . ".php";
@ -826,7 +826,7 @@ class ProductFournisseurPrice extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->PRODUCTFOURNISSEURPRICE_ADDON_PDF)) {
} elseif (getDolGlobalString('PRODUCTFOURNISSEURPRICE_ADDON_PDF')) {
$modele = $conf->global->PRODUCTFOURNISSEURPRICE_ADDON_PDF;
}
}

View File

@ -241,7 +241,7 @@ if ($id > 0 || !empty($ref)) {
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', '');
if ($object->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES) || empty($conf->global->PRODUIT_MULTIPRICES)) {
if ($object->type != Product::TYPE_SERVICE || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || !getDolGlobalString('PRODUIT_MULTIPRICES')) {
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
@ -252,7 +252,7 @@ if ($id > 0 || !empty($ref)) {
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="titlefield">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat);
print '</td></tr>';
@ -267,7 +267,7 @@ if ($id > 0 || !empty($ref)) {
// Nature
if ($object->type != Product::TYPE_SERVICE) {
if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
if (!getDolGlobalString('PRODUCT_DISABLE_NATURE')) {
print '<tr><td>'.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).'</td><td>';
print $object->getLibFinished();
//print $formproduct->selectProductNature('finished', $object->finished);
@ -275,7 +275,7 @@ if ($id > 0 || !empty($ref)) {
}
}
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
// Price
print '<tr><td class="titlefield">'.$langs->trans("SellingPrice").'</td><td>';
if ($object->price_base_type == 'TTC') {
@ -445,7 +445,7 @@ if ($id > 0 || !empty($ref)) {
// Best selling price
$pricesell = $productstatic->price;
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
$pricesell = 'Variable';
} else {
$totallinesell = price2num($value['nb'] * ($pricesell), 'MT');
@ -480,7 +480,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'."\n";
} else {
$hide = '';
if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) {
if (!getDolGlobalString('PRODUCT_SHOW_SUB_SUB_PRODUCTS')) {
$hide = ' hideobject'; // By default, we do not show this. It makes screen very difficult to understand
}

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) {
if (getDolGlobalString('PRODUIT_PDF_MERGE_PROPAL')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php';
}
@ -128,7 +128,7 @@ if ($reshook < 0) {
if (empty($reshook)) {
// Delete line if product propal merge is linked to a file
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) {
if (getDolGlobalString('PRODUIT_PDF_MERGE_PROPAL')) {
if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontoadd) {
//extract file name
$urlfile = GETPOST('urlfile', 'alpha');
@ -268,7 +268,7 @@ if ($object->id) {
// Merge propal PDF document PDF files
if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) {
if (getDolGlobalString('PRODUIT_PDF_MERGE_PROPAL')) {
$filetomerge = new Propalmergepdfproduct($db);
if (getDolGlobalInt('MAIN_MULTILANGS')) {

View File

@ -410,7 +410,7 @@ if ($id > 0 || $ref) {
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
print '</td></tr>';
@ -428,7 +428,7 @@ if ($id > 0 || $ref) {
// PMP
$usercaneditpmp = 0;
if (!empty($conf->global->PRODUCT_CAN_EDIT_WAP)) {
if (getDolGlobalString('PRODUCT_CAN_EDIT_WAP')) {
$usercaneditpmp = $usercancreate;
}
print '<tr><td class="titlefieldcreate">';
@ -588,7 +588,7 @@ if ($id > 0 || $ref) {
print '<input class="flat" name="qty" size="5" value="'.$quantity.'">';
}
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$unit = $object->getLabelOfUnit();
if ($unit !== '') {
print '&nbsp;&nbsp;'.$langs->trans($unit);
@ -596,7 +596,7 @@ if ($id > 0 || $ref) {
}
print '</td></tr>';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) {
// Packaging/Conditionnement
print '<tr>';
@ -606,7 +606,7 @@ if ($id > 0 || $ref) {
print '<input class="flat" name="packaging" size="5" value="'.$packaging.'">';
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$unit = $object->getLabelOfUnit();
if ($unit !== '') {
print '&nbsp;&nbsp;'.$langs->trans($unit);
@ -816,7 +816,7 @@ END;
}
// Product description of the supplier
if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
//WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -952,7 +952,7 @@ END;
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10),
'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => !empty($conf->global->PRODUCT_CHARGES), 'checked'=>0, 'position'=>11),
'pfp.charges'=>array('label'=>$langs->trans("Charges"), 'enabled' => getDolGlobalString('PRODUCT_CHARGES'), 'checked'=>0, 'position'=>11),
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13),
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14),
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
@ -1143,7 +1143,7 @@ END;
print '<td class="right">';
print $productfourn->fourn_qty;
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$unit = $object->getLabelOfUnit();
if ($unit !== '') {
print '&nbsp;&nbsp;'.$langs->trans($unit);

View File

@ -91,7 +91,7 @@ print load_fiche_titre($transAreaType, $linkback, 'product');
print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo
if (getDolGlobalString('MAIN_SEARCH_FORM_ON_HOME_AREAS')) { // This may be useless due to the global search combo
// Search contract
if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) {
$listofsearchfields['search_product'] = array('text'=>'ProductOrService');
@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr
}
if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) {
if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
print '<br>';
print '<div class="div-table-responsive-no-min">';
@ -321,7 +321,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr
print '<table class="noborder centpercent">';
$colnb = 2;
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
$colnb++;
}
@ -372,7 +372,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr
print dol_print_date($db->jdate($objp->datem), 'day', 'tzuserrel');
print "</td>";
// Sell price
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (isModEnabled('dynamicprices') && !empty($objp->fk_price_expression)) {
$product = new Product($db);
$product->fetch($objp->rowid);

View File

@ -42,7 +42,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
$backtopage = GETPOST('backtopage', 'alpha');
$include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0;
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$result = restrictedArea($user, 'stock', $id);
} else {
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
@ -83,7 +83,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $id);
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$permissiontoread = $user->rights->stock->lire;
$permissiontoadd = $user->rights->stock->creer;
$permissiontodelete = $user->rights->stock->supprimer;

View File

@ -230,7 +230,7 @@ class Inventory extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID')) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany')) {
@ -286,7 +286,7 @@ class Inventory extends CommonObject
$sql .= " ".$this->db->prefix()."product as p, ".$this->db->prefix()."entrepot as e";
$sql .= " WHERE p.entity IN (".getEntity('product').")";
$sql .= " AND ps.fk_product = p.rowid AND ps.fk_entrepot = e.rowid";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = 0";
}
if ($this->fk_product > 0) {
@ -593,7 +593,7 @@ class Inventory extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowInventory");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -58,7 +58,7 @@ $lineid = GETPOST('lineid', 'int');
$batch = GETPOST('batch', 'alphanohtml');
$totalExpectedValuation = 0;
$totalRealValuation = 0;
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$result = restrictedArea($user, 'stock', $id);
} else {
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
@ -103,7 +103,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
}
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$permissiontoadd = $user->rights->stock->creer;
$permissiontodelete = $user->rights->stock->supprimer;
} else {
@ -197,7 +197,7 @@ if (empty($reshook)) {
//$inventorycode = 'INV'.$object->id;
$inventorycode = 'INV-'.$object->ref;
$price = 0;
if (!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) $price = $line->pmp_real;
if (!empty($line->pmp_real) && getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) $price = $line->pmp_real;
$idstockmove = $stockmovment->_create($user, $line->fk_product, $line->fk_warehouse, $stock_movement_qty, $movement_type, $price, $langs->trans('LabelOfInventoryMovemement', $object->ref), $inventorycode, $datemovement, '', '', $line->batch);
if ($idstockmove < 0) {
@ -221,7 +221,7 @@ if (empty($reshook)) {
}
}
if (!empty($line->pmp_real) && !empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (!empty($line->pmp_real) && getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
$sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product SET pmp = '.((float) $line->pmp_real).' WHERE rowid = '.((int) $line->fk_product);
$resqlpmp = $db->query($sqlpmp);
if (! $resqlpmp) {
@ -229,7 +229,7 @@ if (empty($reshook)) {
setEventMessages($db->lasterror(), null, 'errors');
break;
}
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product_perentity SET pmp = '.((float) $line->pmp_real).' WHERE fk_product = '.((int) $line->fk_product).' AND entity='.$conf->entity;
$resqlpmp = $db->query($sqlpmp);
if (! $resqlpmp) {
@ -925,7 +925,7 @@ if (isModEnabled('productbatch')) {
print '</td>';
}
print '<td class="right">'.$langs->trans("ExpectedQty").'</td>';
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
print '<td class="right">'.$langs->trans('PMPExpected').'</td>';
print '<td class="right">'.$langs->trans('ExpectedValuation').'</td>';
print '<td class="right">'.$form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp")).'</td>';
@ -963,7 +963,7 @@ if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STAT
print '</td>';
}
print '<td class="right"></td>';
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
print '<td class="right">';
print '</td>';
print '<td class="right">';
@ -1081,7 +1081,7 @@ if ($resql) {
$hasinput = true;
}
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
//PMP Expected
if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected;
else $pmp_expected = $product_static->pmp;
@ -1132,7 +1132,7 @@ if ($resql) {
print '<input type="hidden" class="maxwidth50 right realqty" name="id_'.$obj->rowid.'_input_tmp" id="id_'.$obj->rowid.'_input_tmp" value="'.$qty_tmp.'">';
print '</td>';
} else {
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
//PMP Expected
if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected;
else $pmp_expected = $product_static->pmp;
@ -1182,7 +1182,7 @@ if ($resql) {
} else {
dol_print_error($db);
}
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
print '<tr class="liste_total">';
print '<td colspan="4">'.$langs->trans("Total").'</td>';
print '<td class="right" colspan="2">'.price($totalExpectedValuation).'</td>';
@ -1258,7 +1258,7 @@ print '<script type="text/javascript">
</script>';
if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) {
if (getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
?>
<script type="text/javascript">
$('.realqty').on('change', function () {

View File

@ -95,7 +95,7 @@ foreach ($object->fields as $key => $val) {
$searchCategoryProductOperator = 0;
if (GETPOSTISSET('formfilteraction')) {
$searchCategoryProductOperator = GETPOST('search_category_product_operator', 'int');
} elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
} elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) {
$searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
}
$searchCategoryProductList = GETPOST('search_category_product_list', 'array');
@ -139,7 +139,7 @@ if ($user->socid > 0) { // Protection if external user
//$socid = $user->socid;
accessforbidden();
}
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$result = restrictedArea($user, 'stock');
} else {
$result = restrictedArea($user, 'stock', 0, '', 'inventory_advance');
@ -363,7 +363,7 @@ if (!$resql) {
$num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/inventory/card.php?id='.$id);
@ -476,7 +476,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_
$moreforfilter.= '</div>';*/
// Filter on categories
if (!empty($conf->global->MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS) && isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
if (getDolGlobalString('MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS') && isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->transnoentities('ProductsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');

View File

@ -82,7 +82,7 @@ $search_vatrate = GETPOST("search_vatrate", 'alpha');
$searchCategoryProductOperator = 0;
if (GETPOSTISSET('formfilteraction')) {
$searchCategoryProductOperator = GETPOSTINT('search_category_product_operator');
} elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
} elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) {
$searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
}
$searchCategoryProductList = GETPOST('search_category_product_list', 'array');
@ -175,11 +175,11 @@ if (!empty($canvas)) {
// Define virtualdiffersfromphysical
$virtualdiffersfromphysical = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|| !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')
|| getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')
|| getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')
|| isModEnabled('mrp')) {
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
}
@ -203,20 +203,20 @@ if (isModEnabled('barcode')) {
$fieldstosearchall['pfp.barcode'] = 'GencodBuyPrice';
}
// Personalized search criterias. Example: $conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS = 'p.ref=ProductRef;p.label=ProductLabel;p.description=Description;p.note=Note;'
if (!empty($conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS)) {
if (getDolGlobalString('PRODUCT_QUICKSEARCH_ON_FIELDS')) {
$fieldstosearchall = dolExplodeIntoArray($conf->global->PRODUCT_QUICKSEARCH_ON_FIELDS);
}
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
$titlesellprice = $langs->trans("SellingPrice");
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
$titlesellprice = $form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer"));
}
}
$isInEEC = isInEEC($mysoc);
$alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe";
$alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
// Definition of array of fields for columns
$arrayfields = array(
@ -233,37 +233,37 @@ $arrayfields = array(
'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>19),
'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>20),
'p.weight_units'=>array('label'=>'WeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>21),
'p.length'=>array('label'=>'Length', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>22),
'p.length_units'=>array('label'=>'LengthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>23),
'p.width'=>array('label'=>'Width', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>24),
'p.width_units'=>array('label'=>'WidthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>25),
'p.height'=>array('label'=>'Height', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>26),
'p.height_units'=>array('label'=>'HeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SIZE) && $type != '1'), 'position'=>27),
'p.surface'=>array('label'=>'Surface', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SURFACE) && $type != '1'), 'position'=>28),
'p.surface_units'=>array('label'=>'SurfaceUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_SURFACE) && $type != '1'), 'position'=>29),
'p.volume'=>array('label'=>'Volume', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_VOLUME) && $type != '1'), 'position'=>30),
'p.volume_units'=>array('label'=>'VolumeUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && empty($conf->global->PRODUCT_DISABLE_VOLUME) && $type != '1'), 'position'=>31),
'cu.label'=>array('label'=>"DefaultUnitToShow", 'checked'=>0, 'enabled'=>(isModEnabled("product") && !empty($conf->global->PRODUCT_USE_UNITS)), 'position'=>32),
'p.length'=>array('label'=>'Length', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>22),
'p.length_units'=>array('label'=>'LengthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>23),
'p.width'=>array('label'=>'Width', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>24),
'p.width_units'=>array('label'=>'WidthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>25),
'p.height'=>array('label'=>'Height', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>26),
'p.height_units'=>array('label'=>'HeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>27),
'p.surface'=>array('label'=>'Surface', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position'=>28),
'p.surface_units'=>array('label'=>'SurfaceUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position'=>29),
'p.volume'=>array('label'=>'Volume', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position'=>30),
'p.volume_units'=>array('label'=>'VolumeUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position'=>31),
'cu.label'=>array('label'=>"DefaultUnitToShow", 'checked'=>0, 'enabled'=>(isModEnabled("product") && getDolGlobalString('PRODUCT_USE_UNITS')), 'position'=>32),
'p.fk_default_workstation'=>array('label'=>'DefaultWorkstation', 'checked'=>0, 'enabled'=>isModEnabled('workstation') && $type == 1, 'position'=>33),
'p.sellprice'=>array('label'=>"SellingPrice", 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES), 'position'=>40),
'p.tva_tx'=>array('label'=>"VATRate", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES), 'position'=>41),
'p.sellprice'=>array('label'=>"SellingPrice", 'checked'=>1, 'enabled'=>!getDolGlobalString('PRODUIT_MULTIPRICES'), 'position'=>40),
'p.tva_tx'=>array('label'=>"VATRate", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUIT_MULTIPRICES'), 'position'=>41),
'p.minbuyprice'=>array('label'=>"BuyingPriceMinShort", 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>42),
'p.numbuyprice'=>array('label'=>"BuyingPriceNumShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>43),
'p.pmp'=>array('label'=>"PMPValueShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>44),
'p.cost_price'=>array('label'=>"CostPrice", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>45),
'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50),
'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51),
'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52),
'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53),
'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>50),
'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>51),
'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>52),
'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) && $virtualdiffersfromphysical), 'position'=>53),
'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60),
'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
$alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400),
$alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>401),
$alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>402),
$alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>403),
$alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>404),
$alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>405),
$alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>400),
$alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>401),
$alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>402),
$alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>403),
$alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>404),
$alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>405),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000),
@ -284,7 +284,7 @@ $arrayfields = array(
// MultiPrices
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
if (!empty($conf->global->$keyforlabel)) {
@ -439,7 +439,7 @@ $sql .= ' p.tobatch, ';
if (isModEnabled('workstation')) {
$sql .= ' p.fk_default_workstation, ws.status as status_workstation, ws.ref as ref_workstation, ';
}
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
} else {
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export, ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export,";
@ -472,7 +472,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
if (isModEnabled('workstation')) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "workstation_workstation as ws ON (p.fk_default_workstation = ws.rowid)";
}
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
@ -610,7 +610,7 @@ if ($search_accountancy_code_buy_intra) {
if ($search_accountancy_code_buy_export) {
$sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', clean_account($search_accountancy_code_buy_export));
}
if (!empty($conf->global->PRODUCT_USE_UNITS) && $search_units) {
if (getDolGlobalString('PRODUCT_USE_UNITS') && $search_units) {
$sql .= natural_search('cu.rowid', $search_units);
}
// Add where from extra fields
@ -622,7 +622,7 @@ $sql .= $hookmanager->resPrint;
$sql .= " GROUP BY p.rowid, p.ref, p.description, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,";
$sql .= " p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
$sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.pmp, p.cost_price, p.stock,';
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
} else {
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export, ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export,";
@ -688,7 +688,7 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sall) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/product/card.php?id='.$id);
@ -1104,7 +1104,7 @@ if (!empty($arrayfields['p.sellprice']['checked'])) {
}
// Multiprice
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
foreach ($arraypricelevel as $key => $value) {
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) {
print '<td class="liste_titre right">';
@ -1359,7 +1359,7 @@ if (!empty($arrayfields['p.sellprice']['checked'])) {
}
// Multiprices
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
foreach ($arraypricelevel as $key => $value) {
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) {
print_liste_field_titre($arrayfields['p.sellprice'.$key]['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
@ -1537,13 +1537,13 @@ while ($i < $imaxinloop) {
$product_static->volume_units = $obj->volume_units;
$product_static->surface = $obj->surface;
$product_static->surface_units = $obj->surface_units;
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$product_static->fk_unit = $obj->fk_unit;
}
// STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock.
if ((isModEnabled('stock') && $user->hasRight('stock', 'lire') && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock
if ($product_static->type != 1 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Not a service
if ((isModEnabled('stock') && $user->hasRight('stock', 'lire') && $search_type != 1) || getDolGlobalString('STOCK_DISABLE_OPTIM_LOAD')) { // To optimize call of load_stock
if ($product_static->type != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Not a service
$option = 'nobatch';
if (empty($arrayfields['stock_virtual']['checked'])) {
$option .= ',novirtual';
@ -1907,7 +1907,7 @@ while ($i < $imaxinloop) {
}
// Multiprices
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (! isset($productpricescache)) {
$productpricescache=array();
}
@ -1968,7 +1968,7 @@ while ($i < $imaxinloop) {
if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) {
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
if ($product_fourn->product_fourn_price_id > 0) {
if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
} else {
@ -2174,7 +2174,7 @@ while ($i < $imaxinloop) {
// Status (to sell)
if (!empty($arrayfields['p.tosell']['checked'])) {
print '<td class="center nowrap">';
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && getDolGlobalString('MAIN_DIRECT_STATUS_UPDATE')) {
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else {
print $product_static->LibStatut($product_static->status, 5, 0);
@ -2187,7 +2187,7 @@ while ($i < $imaxinloop) {
// Status (to buy)
if (!empty($arrayfields['p.tobuy']['checked'])) {
print '<td class="center nowrap">';
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && getDolGlobalString('MAIN_DIRECT_STATUS_UPDATE')) {
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
} else {
print $product_static->LibStatut($product_static->status_buy, 5, 1);

View File

@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_expression.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
$prodcustprice = new ProductCustomerPrice($db);
@ -75,7 +75,7 @@ if ($id > 0 || !empty($ref)) {
}
// Clean param
if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')) {
$conf->global->PRODUIT_MULTIPRICES_LIMIT = 5;
}
@ -196,7 +196,7 @@ if (empty($reshook)) {
}
if (!$error) {
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
// Force the update of the price of the product using the new VAT
if ($object->multiprices_base_type[$i] == 'HT') {
@ -276,7 +276,7 @@ if (empty($reshook)) {
}
// Multiprices
if (!$error && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) {
if (!$error && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
$newprice = GETPOST('price', 'array');
$newprice_min = GETPOST('price_min', 'array');
$newpricebase = GETPOST('multiprices_base_type', 'array');
@ -463,7 +463,7 @@ if (empty($reshook)) {
$newprice_min = price2num($val['price_min'], 'MU');
$newvattx = price2num($val['vat_tx']);
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE') && $newprice_min < $maxpricesupplier) {
setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), null, 'errors');
$error++;
break;
@ -706,7 +706,7 @@ if (empty($reshook)) {
$error++;
$action = 'add_customer_price';
}
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $prodcustprice->price_min < $maxpricesupplier) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE') && $prodcustprice->price_min < $maxpricesupplier) {
$langs->load("errors");
setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')), null, 'errors');
$error++;
@ -820,7 +820,7 @@ if (empty($reshook)) {
$prodcustprice->localtax1_type = $localtax1_type;
$prodcustprice->localtax2_type = $localtax2_type;
if ($prodcustprice->price_min < $maxpricesupplier && !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if ($prodcustprice->price_min < $maxpricesupplier && getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')), null, 'errors');
$error++;
$action = 'update_customer_price';
@ -889,7 +889,7 @@ print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield centpercent">';
// Price per customer segment/level
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
// Price and min price are variable (depends on level of company).
if (!empty($socid)) {
$soc = new Societe($db);
@ -900,7 +900,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
print '</td></tr>';
@ -932,7 +932,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
}
print '</td></tr>';
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
// TVA
print '<tr><td>'.$langs->trans("DefaultTaxRate").'</td><td colspan="2">';
@ -979,12 +979,12 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print '</td></tr>';
}
} else {
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
// Type
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
print '</td></tr>';
@ -999,7 +999,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
print '</td></tr>';
@ -1096,7 +1096,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print '</td></tr>';
// Price by quantity
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { // TODO Fix the form included into a tr instead of a td
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { // TODO Fix the form included into a tr instead of a td
print '<tr><td>'.$langs->trans("PriceByQuantity").' '.$i;
if (!empty($conf->global->$keyforlabel)) {
print ' - '.$langs->trans($conf->global->$keyforlabel);
@ -1204,7 +1204,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print price($object->price_ttc).' '.$langs->trans($object->price_base_type);
} else {
print price($object->price).' '.$langs->trans($object->price_base_type);
if (!empty($conf->global->PRODUCT_DISPLAY_VAT_INCL_PRICES) && !empty($object->price_ttc)) {
if (getDolGlobalString('PRODUCT_DISPLAY_VAT_INCL_PRICES') && !empty($object->price_ttc)) {
print '<i class="opacitymedium"> - ' . price($object->price_ttc).' '.$langs->trans('TTC') . '</i>';
}
}
@ -1217,7 +1217,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print price($object->price_min_ttc).' '.$langs->trans($object->price_base_type);
} else {
print price($object->price_min).' '.$langs->trans($object->price_base_type);
if (!empty($conf->global->PRODUCT_DISPLAY_VAT_INCL_PRICES) && !empty($object->price_min_ttc)) {
if (getDolGlobalString('PRODUCT_DISPLAY_VAT_INCL_PRICES') && !empty($object->price_min_ttc)) {
print '<i class="opacitymedium"> - ' . price($object->price_min_ttc).' '.$langs->trans('TTC') . '</i>';
}
}
@ -1225,7 +1225,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print '</td></tr>';
// Price by quantity
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { // TODO Fix the form inside tr instead of td
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { // TODO Fix the form inside tr instead of td
print '<tr><td>'.$langs->trans("PriceByQuantity");
if ($object->prices_by_qty[0] == 0) {
print '&nbsp; <a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=activate_price_by_qty&level=1&token='.newToken().'">('.$langs->trans("Activate").')';
@ -1343,7 +1343,7 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("NoEditVariants")) . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
}
} else {
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
} else {
@ -1351,7 +1351,7 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a
}
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
} else {
@ -1359,7 +1359,7 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a
}
}
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_vat&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("UpdateVAT") . '</a></div>';
} else {
@ -1414,7 +1414,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '<br>';
print load_fiche_titre($langs->trans("NewPrice"), '');
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<!-- Edit price -->'."\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -1502,7 +1502,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
} else {
print '<input name="price_min" size="10" value="'.price($object->price_min).'">';
}
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
print ' &nbsp; '.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')).' '.img_warning().'</td>';
}
print '</td>';
@ -1552,7 +1552,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
//print dol_get_fiche_head('', '', '', -1);
if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && getDolGlobalString('PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL')) {
print $langs->trans('UseMultipriceRules').' <input type="checkbox" id="usePriceRules" name="usePriceRules" '.($object->price_autogen ? 'checked' : '').'><br><br>';
}
@ -1562,7 +1562,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '<td>'.$langs->trans("PriceLevel").'</td>';
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
print '<td style="text-align: center">'.$langs->trans("DefaultTaxRate").'</td>';
} else {
print '<td></td>';
@ -1572,7 +1572,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '<td class="center">'.$langs->trans("MinPrice").'</td>';
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
print '<td></td>';
}
print '</tr></thead>';
@ -1588,7 +1588,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
print '</td>';
// VAT
if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) {
print '<td>';
print '<input type="hidden" name="tva_tx['.$i.']" value="'.($object->default_vat_code ? $object->tva_tx.' ('.$object->default_vat_code.')' : $object->tva_tx).'">';
print '<input type="hidden" name="tva_npr['.$i.']" value="'.$object->tva_npr.'">';
@ -1621,7 +1621,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
} else {
print '<input name="price_min['.$i.']" size="10" value="'.price($object->multiprices_min [$i]).'">';
}
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
print '<td class="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')).' '.img_warning().'</td>';
}
print '</td>';
@ -1645,7 +1645,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) {
// List of price changes - log historic (ordered by descending date)
if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_default_price') && !in_array($action, array('edit_price', 'edit_vat'))) {
if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_default_price') && !in_array($action, array('edit_price', 'edit_vat'))) {
$sql = "SELECT p.rowid, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.recuperableonly, p.localtax1_tx, p.localtax1_type, p.localtax2_tx, p.localtax2_type,";
$sql .= " p.price_level, p.price_min, p.price_min_ttc,p.price_by_qty,";
$sql .= " p.date_price as dp, p.fk_price_expression, u.rowid as user_id, u.login";
@ -1654,7 +1654,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
$sql .= " WHERE fk_product = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('productprice').")";
$sql .= " AND p.fk_user_author = u.rowid";
if (!empty($socid) && !empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!empty($socid) && getDolGlobalString('PRODUIT_MULTIPRICES')) {
$sql .= " AND p.price_level = ".((int) $soc->price_level);
}
$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
@ -1673,7 +1673,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
// We emulate the change of the price from interface with the same value than the one into table llx_product
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
$ret = $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
} else {
$ret = $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
@ -1692,7 +1692,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
// Log of previous customer prices
$backbutton = '<a class="justalink" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'.$langs->trans("Back").'</a>';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
print_barre_liste($langs->trans("DefaultPriceLog"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png');
} else {
print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png');
@ -1705,15 +1705,15 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("AppliedPricesFrom").'</td>';
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="center">'.$langs->trans("PriceLevel").'</td>';
}
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')) {
print '<td class="center">'.$langs->trans("Type").'</td>';
}
print '<td class="center">'.$langs->trans("PriceBase").'</td>';
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="right">'.$langs->trans("DefaultTaxRate").'</td>';
}
print '<td class="right">'.$langs->trans("HT").'</td>';
@ -1743,11 +1743,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
print "<td>".dol_print_date($db->jdate($objp->dp), "dayhour", 'tzuserrel')."</td>";
// Price level
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="center">'.$objp->price_level."</td>";
}
// 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')) {
$type = ($objp->price_by_qty == 1) ? 'PriceByQuantity' : 'Standard';
print '<td class="center">'.$langs->trans($type)."</td>";
}
@ -1758,7 +1758,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
}
print "</td>";
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="right">';
if (empty($objp->price_by_qty)) {
@ -1867,7 +1867,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
// Action
if ($user->hasRight('produit', 'supprimer')) {
$candelete = 0;
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
if (empty($notfirstlineforlevel[$objp->price_level])) {
$notfirstlineforlevel[$objp->price_level] = 1;
} else {
@ -1906,7 +1906,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
// Add area to show/add/edit a price for a dedicated customer
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
$prodcustprice = new ProductCustomerPrice($db);
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -1995,7 +1995,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
} else {
print '<td><input name="price_min" size="10" value="'.price($object->price_min).'">';
}
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
print '<td class="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')).' '.img_warning().'</td>';
}
print '</td></tr>';
@ -2082,7 +2082,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print '<input name="price_min" size="10" value="'.price($prodcustprice->price_min).'">';
}
print '</td>';
if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) {
if (getDolGlobalString('PRODUCT_MINIMUM_RECOMMENDED_PRICE')) {
print '<td class="left">'.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier, 0, '', 1, -1, -1, 'auto')).' '.img_warning().'</td>';
}
print '</tr>';

View File

@ -87,11 +87,11 @@ if (!empty($canvas)) {
// Define virtualdiffersfromphysical
$virtualdiffersfromphysical = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|| !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')
|| getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')
|| getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')
|| isModEnabled('mrp')) {
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
}
@ -140,7 +140,7 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price
$sql .= ' p.fk_product_type, p.tms as datem,';
$sql .= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
$sql .= ' SUM(s.reel) as stock_physique';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$sql .= ', u.short_label as unit_short';
}
// Add fields from hooks
@ -149,7 +149,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
$sql .= $hookmanager->resPrint;
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
}
// Add table from hooks
@ -173,7 +173,7 @@ if (!empty($search_categ) && $search_categ != '-1') {
}
$sql .= ")";
}
if (empty($conf->global->PRODUCT_STOCK_LIST_SHOW_VIRTUAL_WITH_NO_PHYSICAL)) {
if (!getDolGlobalString('PRODUCT_STOCK_LIST_SHOW_VIRTUAL_WITH_NO_PHYSICAL')) {
$sql .= " AND EXISTS (SELECT e.rowid FROM ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = s.fk_entrepot AND e.entity IN (".getEntity('stock')."))";
} else {
$sql .= " AND
@ -412,7 +412,7 @@ if ($resql) {
$warehouses_list = $formProduct->cache_warehouses;
$nb_warehouse = count($warehouses_list);
$colspan_warehouse = 1;
if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) {
if (getDolGlobalString('STOCK_DETAIL_ON_WAREHOUSE')) {
$colspan_warehouse = $nb_warehouse > 1 ? $nb_warehouse + 1 : 1;
}
@ -422,7 +422,7 @@ if ($resql) {
// Fields title search
print '<tr class="liste_titre_filter">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
@ -456,7 +456,7 @@ if ($resql) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
@ -467,7 +467,7 @@ if ($resql) {
// Line for column titles
print '<tr class="liste_titre">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre('');
}
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
@ -479,7 +479,7 @@ if ($resql) {
print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock", '', $param, "", $sortfield, $sortorder, 'right ');
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", '', $param, "", $sortfield, $sortorder, 'right ');
// Details per warehouse
if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
if (getDolGlobalString('STOCK_DETAIL_ON_WAREHOUSE')) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
if ($nb_warehouse > 1) {
foreach ($warehouses_list as &$wh) {
print_liste_field_titre($wh['label'], '', '', '', '', '', '', '', 'right ');
@ -490,7 +490,7 @@ if ($resql) {
print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", '', $param, "", $sortfield, $sortorder, 'right ', 'VirtualStockDesc');
}
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print_liste_field_titre("Unit", $_SERVER["PHP_SELF"], "unit_short", '', $param, 'align="right"', $sortfield, $sortorder);
}
print_liste_field_titre('');
@ -501,7 +501,7 @@ if ($resql) {
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre('');
}
print "</tr>\n";
@ -515,7 +515,7 @@ if ($resql) {
print '<tr>';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}
print '<td class="nowrap">';
@ -555,7 +555,7 @@ if ($resql) {
print '</td>';
// Details per warehouse
if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
if (getDolGlobalString('STOCK_DETAIL_ON_WAREHOUSE')) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context)
if ($nb_warehouse > 1) {
foreach ($warehouses_list as &$wh) {
print '<td class="right">';
@ -577,7 +577,7 @@ if ($resql) {
print '</td>';
}
// Units
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print '<td class="left">'.dol_escape_htmltag($objp->unit_short).'</td>';
}
print '<td class="center nowraponall">';
@ -591,7 +591,7 @@ if ($resql) {
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
}

View File

@ -594,7 +594,7 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
@ -614,7 +614,7 @@ if (isModEnabled("service") && $type == 1) {
print '<td class="liste_titre"><input class="flat" type="text" name="search_warehouse" size="6" value="'.dol_escape_htmltag($search_warehouse).'"></td>';
print '<td class="liste_titre center"><input class="flat" type="text" name="search_batch" size="6" value="'.dol_escape_htmltag($search_batch).'"></td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="liste_titre center">';
$key = 'sellby';
print '<div class="nowrap">';
@ -625,7 +625,7 @@ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '</div>';
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="liste_titre center">';
$key = 'eatby';
print '<div class="nowrap">';
@ -647,7 +647,7 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
@ -662,7 +662,7 @@ $totalarray['nbfield'] = 0;
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre('');
}
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
@ -673,10 +673,10 @@ if (isModEnabled("service") && $type == 1) {
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", '', $param, "", $sortfield, $sortorder);
//print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right );
print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", '', $param, "", $sortfield, $sortorder, 'center ');
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pl.sellby", '', $param, "", $sortfield, $sortorder, 'center ');
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pl.eatby", '', $param, "", $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", '', $param, "", $sortfield, $sortorder, 'right ');
@ -689,7 +689,7 @@ print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre('');
}
print "</tr>\n";
@ -749,7 +749,7 @@ while ($i < $imaxinloop) {
print '<tr>';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
if (!$i) {
$totalarray['nbfield']++;
@ -812,14 +812,14 @@ while ($i < $imaxinloop) {
}
print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="center">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
if (!$i) {
$totalarray['nbfield']++;
@ -872,7 +872,7 @@ while ($i < $imaxinloop) {
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td></td>';
if (!$i) {
$totalarray['nbfield']++;

View File

@ -621,7 +621,7 @@ if ($action == 'create') {
$totalarray['pos'][$totalarray['nbfield']] = 'totalunit';
$totalarray['type'][$totalarray['nbfield']] = 'stock';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print_liste_field_titre("Unit", "", "p.fk_unit", "&amp;id=".$id, "", 'align="left"', $sortfield, $sortorder);
$totalarray['nbfield']++;
$totalarray['pos'][$totalarray['nbfield']] = 'units';
@ -637,11 +637,11 @@ if ($action == 'create') {
$totalarray['type'][$totalarray['nbfield']] = '';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
print_liste_field_titre("SellPriceMin", "", "p.price", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
$totalarray['nbfield']++;
}
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
print_liste_field_titre("EstimatedStockValueSellShort", "", "", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
$totalarray['nbfield']++;
$totalarray['pos'][$totalarray['nbfield']] = 'totalvaluesell';
@ -666,7 +666,7 @@ if ($action == 'create') {
//For MultiCompany PMP per entity
$separatedPMP = false;
if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED) && !empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) {
if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED') && getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
$separatedPMP = true;
}
@ -685,7 +685,7 @@ if ($action == 'create') {
$sql .= " p.pmp as ppmp,";
}
$sql .= " ps.reel as value";
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$sql .= ",fk_unit";
}
// Add fields from hooks
@ -751,7 +751,7 @@ if ($action == 'create') {
$productstatic->type = $objp->type;
$productstatic->entity = $objp->entity;
$productstatic->status_batch = $objp->tobatch;
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$productstatic->fk_unit = $objp->fk_unit;
}
$productstatic->status = $objp->tosell;
@ -779,7 +779,7 @@ if ($action == 'create') {
print '</td>';
$totalunit += $objp->value;
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
// Units
print '<td align="left">';
if (is_null($productstatic->fk_unit)) {
@ -797,7 +797,7 @@ if ($action == 'create') {
$totalvalue += price2num($objp->ppmp * $objp->value, 'MT');
// Price sell min
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
$pricemin = $objp->price;
print '<td class="right">';
print price(price2num($pricemin, 'MU'), 1);
@ -830,7 +830,7 @@ if ($action == 'create') {
$i++;
// Define $unit and $sameunits
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
if ($i == 0) {
$units = $productstatic->fk_unit;
} elseif ($productstatic->fk_unit != $units) {

View File

@ -178,7 +178,7 @@ class Entrepot extends CommonObject
$this->db = $db;
$this->labelStatus[self::STATUS_CLOSED] = 'Closed2';
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
$this->labelStatus[self::STATUS_OPEN_ALL] = 'OpenAnyMovement';
$this->labelStatus[self::STATUS_OPEN_INTERNAL] = 'OpenInternal';
} else {
@ -637,7 +637,7 @@ class Entrepot extends CommonObject
//For MultiCompany PMP per entity
$separatedPMP = false;
if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED) && !empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) {
if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED') && getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
$separatedPMP = true;
}
@ -725,7 +725,7 @@ class Entrepot extends CommonObject
$option = $params['option'] ?? '';
$nofetch = !empty($params['nofetch']);
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return ['optimize' => $langs->trans("Warehouse")];
}
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Warehouse").'</u>';
@ -766,7 +766,7 @@ class Entrepot extends CommonObject
$notooltip = 1; // Force disable tooltips
}
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpicto) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && $withpicto) {
$withpicto = 0;
}
@ -802,7 +802,7 @@ class Entrepot extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("Warehouse");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -819,7 +819,7 @@ class Entrepot extends CommonObject
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
$result .= (($showfullpath || !empty($conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO)) ? $this->get_full_arbo() : $this->label);
$result .= (($showfullpath || getDolGlobalString('STOCK_ALWAYS_SHOW_FULL_ARBO')) ? $this->get_full_arbo() : $this->label);
}
$result .= $linkend;
@ -954,7 +954,7 @@ class Entrepot extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->STOCK_ADDON_PDF)) {
} elseif (getDolGlobalString('STOCK_ADDON_PDF')) {
$modele = $conf->global->STOCK_ADDON_PDF;
}
}

View File

@ -280,7 +280,7 @@ class MouvementStock extends CommonObject
// Define if we must make the stock change (If product type is a service or if stock is used also for services)
// Only record into stock tables wil be disabled by this (the rest like writing into lot table or movement of subproucts are done)
$movestock = 0;
if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1;
if ($product->type != Product::TYPE_SERVICE || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) $movestock = 1;
$this->db->begin();
@ -522,7 +522,7 @@ class MouvementStock extends CommonObject
// After a stock increase
// Note: PMP is calculated on stock input only (type of movement = 0 or 3). If type == 0 or 3, qty should be > 0.
// Note: Price should always be >0 or 0. PMP should be always >0 (calculated on input)
if ($price > 0 || (!empty($conf->global->STOCK_UPDATE_AWP_EVEN_WHEN_ENTRY_PRICE_IS_NULL) && $price == 0 && in_array($this->origin_type, array('order_supplier', 'invoice_supplier')))) {
if ($price > 0 || (getDolGlobalString('STOCK_UPDATE_AWP_EVEN_WHEN_ENTRY_PRICE_IS_NULL') && $price == 0 && in_array($this->origin_type, array('order_supplier', 'invoice_supplier')))) {
$oldqtytouse = ($oldqty >= 0 ? $oldqty : 0);
// We make a test on oldpmp>0 to avoid to use normal rule on old data with no pmp field defined
if ($oldpmp > 0) {
@ -611,7 +611,7 @@ class MouvementStock extends CommonObject
}
// Add movement for sub products (recursive call)
if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) {
if (!$error && getDolGlobalString('PRODUIT_SOUSPRODUITS') && !getDolGlobalString('INDEPENDANT_SUBPRODUCT_STOCK') && empty($disablestockchangeforsubproduct)) {
$error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode, $datem); // we use 0 as price, because AWP must not change for subproduct
}
@ -1216,7 +1216,7 @@ class MouvementStock extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->MOUVEMENT_ADDON_PDF)) {
} elseif (getDolGlobalString('MOUVEMENT_ADDON_PDF')) {
$modele = $conf->global->MOUVEMENT_ADDON_PDF;
}
}

View File

@ -964,10 +964,10 @@ class Productlot extends CommonObject
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Batch").'</u>';
//$datas['divopen'] = '<div width="100%">';
$datas['batch'] = '<br><b>'.$langs->trans('Batch').':</b> '.$this->batch;
if ($this->eatby && empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if ($this->eatby && !getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
$datas['eatby'] = '<br><b>'.$langs->trans('EatByDate').':</b> '.dol_print_date($this->db->jdate($this->eatby), 'day');
}
if ($this->sellby && empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if ($this->sellby && !getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
$datas['sellby'] = '<br><b>'.$langs->trans('SellByDate').':</b> '.dol_print_date($this->db->jdate($this->sellby), 'day');
}
//$datas['divclose'] = '</div>';
@ -1022,7 +1022,7 @@ class Productlot extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1117,7 +1117,7 @@ class Productlot extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->PRODUCT_BATCH_ADDON_PDF)) {
} elseif (getDolGlobalString('PRODUCT_BATCH_ADDON_PDF')) {
$modele = $conf->global->PRODUCT_BATCH_ADDON_PDF;
}
}

View File

@ -61,7 +61,7 @@ print load_fiche_titre($langs->trans("StocksArea"), '', 'stock');
print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo
if (getDolGlobalString('MAIN_SEARCH_FORM_ON_HOME_AREAS')) { // This may be useless due to the global search combo
print '<form method="post" action="'.DOL_URL_ROOT.'/product/stock/list.php">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<div class="div-table-responsive-no-min">';
@ -149,7 +149,7 @@ $sql .= ", ".MAIN_DB_PREFIX."product as p";
$sql .= " WHERE m.fk_product = p.rowid";
$sql .= " AND m.fk_entrepot = e.rowid";
$sql .= " AND e.entity IN (".getEntity('stock').")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = ".Product::TYPE_PRODUCT;
}
$sql .= $db->order("datem", "DESC");

View File

@ -53,7 +53,7 @@ function dolDispatchToDo($order_id)
$sql = 'SELECT fk_product, SUM(qty) as qtyordered FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet';
$sql .= ' WHERE fk_commande = '.((int) $order_id);
$sql .= ' AND fk_product > 0';
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= ' AND product_type = 0';
}
$sql .= ' GROUP BY fk_product';

View File

@ -217,7 +217,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
//For Multicompany PMP per entity
$separatedPMP = false;
if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED) && !empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) {
if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED') && getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
$separatedPMP = true;
$sql .= ", SUM(pa.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty";
} else {
@ -829,7 +829,7 @@ while ($i < $imaxinloop) {
// Selling value
if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
if ($obj->sellvalue) {
print '<span class="amount">'.price(price2num($obj->sellvalue, 'MT'), 1).'</span>';
}

View File

@ -581,10 +581,10 @@ if ($maxmin > 0) {
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
}
print '<input type="file" name="userfile" size="20" maxlength="80"> &nbsp; &nbsp; ';
$out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : '');
$out = (!getDolGlobalString('MAIN_UPLOAD_DOC') ? ' disabled' : '');
print '<input type="submit" class="button small smallpaddingimp" value="'.$langs->trans("ImportFromCSV").'"'.$out.' name="sendit">';
$out = '';
if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
if (getDolGlobalString('MAIN_UPLOAD_DOC')) {
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
$maxphp = @ini_get('upload_max_filesize'); // In unknown
if (preg_match('/k$/i', $maxphp)) {
@ -682,7 +682,7 @@ print '</td>';
// Product
print '<td class="nowraponall">';
$filtertype = 0;
if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$filtertype = '';
}
if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {

View File

@ -461,7 +461,7 @@ if ($msid > 0) {
}
$sql .= " AND m.fk_entrepot = e.rowid";
$sql .= " AND e.entity IN (".getEntity('stock').")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = 0";
}
if ($id > 0) {

View File

@ -147,10 +147,10 @@ $arrayfields = array(
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
unset($arrayfields['pl.sellby']);
}
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
unset($arrayfields['pl.eatby']);
}
@ -687,7 +687,7 @@ if ($msid > 0) {
}
$sql .= " AND m.fk_entrepot = e.rowid";
$sql .= " AND e.entity IN (".getEntity('stock').")";
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = 0";
}
if ($id > 0) {
@ -1063,7 +1063,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$arrayofmassactions['builddoc'] = img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("GeneratePDF");
}
// By default, we should never accept deletion of stock movement
if (!empty($conf->global->STOCK_ALLOW_DELETE_OF_MOVEMENT) && $permissiontodelete) {
if (getDolGlobalString('STOCK_ALLOW_DELETE_OF_MOVEMENT') && $permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (!empty($permissiontoadd)) {

View File

@ -632,7 +632,7 @@ if ($id > 0 || $ref) {
if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '<tr><td class="">';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print (!getDolGlobalString('PRODUCT_DENY_CHANGE_PRODUCT_TYPE')) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
print '</td><td>';
print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat);
print '</td></tr>';
@ -686,7 +686,7 @@ if ($id > 0 || $ref) {
}
print '</td></tr>';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
// Price
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td>';
if ($usercancreadprice) {
@ -746,13 +746,13 @@ if ($id > 0 || $ref) {
// Real stock
$text_stock_options = $langs->trans("RealStockDesc").'<br>';
$text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE') ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_BILL') ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_BILL') ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE') ? '- '.$langs->trans("StockOnReception").'<br>' : '');
$parameters = array();
$reshook = $hookmanager->executeHooks('physicalStockTextStockOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook > 0) {
@ -798,9 +798,9 @@ if ($id > 0 || $ref) {
if (isModEnabled("expedition")) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
$filterShipmentStatus = '';
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
$filterShipmentStatus = Expedition::STATUS_VALIDATED.','.Expedition::STATUS_CLOSED;
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
$filterShipmentStatus = Expedition::STATUS_CLOSED;
}
if ($found) {
@ -935,7 +935,7 @@ if (empty($reshook)) {
print "<div class=\"tabsAction\">\n";
if ($user->hasRight('stock', 'mouvement', 'creer')) {
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("TransferStock").'</a>';
@ -945,7 +945,7 @@ if (empty($reshook)) {
}
if ($user->hasRight('stock', 'mouvement', 'creer')) {
if (!$variants || !empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) {
if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=correction">'.$langs->trans("CorrectStock").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ActionAvailableOnVariantProductOnly").'">'.$langs->trans("CorrectStock").'</a>';
@ -989,11 +989,11 @@ if (!$variants) {
}
print '</td>';
print '<td class="right">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
$colspan--;
print '<td class="center width100">'.$langs->trans("SellByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
$colspan--;
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
}
@ -1050,7 +1050,7 @@ if (!$variants) {
print $entrepotstatic->getNomUrl(1);
if (!empty($conf->use_javascript_ajax) && isModEnabled('productbatch') && $object->hasbatch()) {
print '<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id . '" href="#">';
print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)');
print (!getDolGlobalString('STOCK_SHOW_ALL_BATCH_BY_DEFAULT') ? '(+)' : '(-)');
print '</a>';
}
print '</td>';
@ -1070,7 +1070,7 @@ if (!$variants) {
// Sell price
$minsellprice = null; $maxsellprice = null;
print '<td class="right nowraponall">';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
foreach ($object->multiprices as $priceforlevel) {
if (is_numeric($priceforlevel)) {
if (is_null($maxsellprice) || $priceforlevel > $maxsellprice) {
@ -1098,7 +1098,7 @@ if (!$variants) {
// Value sell
print '<td class="right amount nowraponall">';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
print '<span class="valignmiddle">';
if ($usercancreadprice) {
if ($minsellprice != $maxsellprice) {
@ -1143,12 +1143,12 @@ if (!$variants) {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="pdluoid" value="'.$pdluo->id.'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.'"><table class="noborder centpercent"><tr><td width="10%"></td>';
print '<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
print '</td>';
@ -1163,7 +1163,7 @@ if (!$variants) {
print '<td></td>';
print '</tr>';
} else {
print "\n".'<tr style="display:'.(empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? 'none' : 'visible').';" class="batch_warehouse'.$entrepotstatic->id.'"><td class="left">';
print "\n".'<tr style="display:'.(!getDolGlobalString('STOCK_SHOW_ALL_BATCH_BY_DEFAULT') ? 'none' : 'visible').';" class="batch_warehouse'.$entrepotstatic->id.'"><td class="left">';
print '</td>';
print '<td class="right nowraponall">';
if ($product_lot_static->id > 0) {
@ -1173,11 +1173,11 @@ if (!$variants) {
}
print '</td>';
$colspan = 3;
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
$colspan--;
print '<td class="center">'.dol_print_date($pdluo->sellby, 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
$colspan--;
print '<td class="center">'.dol_print_date($pdluo->eatby, 'day').'</td>';
}
@ -1235,7 +1235,7 @@ if (!$variants) {
if ($num) {
if ($total) {
print '<span class="valignmiddle">';
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
print $form->textwithpicto('', $langs->trans("Variable"));
} elseif ($usercancreadprice) {
print price($totalvaluesell / $total, 1);
@ -1248,7 +1248,7 @@ if (!$variants) {
print '<td class="liste_total right amount">';
if ($num) {
print '<span class="valignmiddle">';
if (empty($conf->global->PRODUIT_MULTIPRICES) && $usercancreadprice) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && $usercancreadprice) {
print price(price2num($totalvaluesell, 'MT'), 1);
} else {
print $form->textwithpicto('', $langs->trans("Variable"));
@ -1263,7 +1263,7 @@ if (!$variants) {
print "</table>";
print '</div>';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
print '<br><br>';
print load_fiche_titre($langs->trans('AddNewProductStockWarehouse'));

View File

@ -456,7 +456,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td></tr>';
// Sell by
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<tr><td>';
print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->hasRight('stock', 'creer'), 'datepicker');
print '</td><td>';
@ -466,7 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Eat by
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<tr><td>';
print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->hasRight('stock', 'creer'), 'datepicker');
print '</td><td>';
@ -475,7 +475,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</tr>';
}
if (!empty($conf->global->PRODUCT_LOT_ENABLE_TRACEABILITY)) {
if (getDolGlobalString('PRODUCT_LOT_ENABLE_TRACEABILITY')) {
print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer')).'</td>';
print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
print '</tr>';
@ -488,7 +488,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Quality control
if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) {
if (getDolGlobalString('PRODUCT_LOT_ENABLE_QUALITY_CONTROL')) {
print '<tr><td>'.$form->editfieldkey($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer')).'</td>';
print '<td>'.$form->editfieldval($langs->trans('EndOfLife'), 'eol_date', $object->eol_date, $object, $user->hasRight('stock', 'creer'), 'datepicker').'</td>';
print '</tr>';

View File

@ -348,7 +348,7 @@ $num = $db->num_rows($resql);
$i = 0;
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/product/stock/productlot_card.php?id='.$id);
@ -479,7 +479,7 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
@ -531,7 +531,7 @@ print $hookmanager->resPrint;
print '<td class="liste_titre"></td>';
}*/
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
@ -545,7 +545,7 @@ $totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
foreach ($object->fields as $key => $val) {
@ -572,7 +572,7 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
$totalarray['nbfield']++;
@ -609,7 +609,7 @@ while ($i < $imaxinloop) {
$j = 0;
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
@ -681,7 +681,7 @@ while ($i < $imaxinloop) {
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;

View File

@ -81,7 +81,7 @@ while ($tmpobj = $db->fetch_object($resWar)) {
}
//MultiCompany : If only 1 Warehouse is visible, filter will automatically be set to it.
if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && !empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) {
if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
$fk_entrepot = $lastWarehouseID;
}
@ -106,17 +106,17 @@ if (!$sortorder) {
// Define virtualdiffersfromphysical
$virtualdiffersfromphysical = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|| !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION)
|| !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')
|| getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')
|| getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION')
|| getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')
|| isModEnabled('mrp')) {
$virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs.
}
if ($virtualdiffersfromphysical) {
$usevirtualstock = empty($conf->global->STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT) ? 1 : 0;
$usevirtualstock = !getDolGlobalString('STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT') ? 1 : 0;
} else {
$usevirtualstock = 0;
}
@ -186,7 +186,7 @@ if ($action == 'order' && GETPOST('valid')) {
}
// if we use supplier description of the products
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
if (!empty($productsupplier->desc_supplier) && getDolGlobalString('PRODUIT_FOURN_TEXTS')) {
$desc = $productsupplier->desc_supplier;
} else {
$desc = $productsupplier->description;
@ -332,7 +332,7 @@ $prod = new Product($db);
$title = $langs->trans('MissingStocks');
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$sqldesiredtock = $db->ifsql("pse.desiredstock IS NULL", "p.desiredstock", "pse.desiredstock");
$sqlalertstock = $db->ifsql("pse.seuil_stock_alerte IS NULL", "p.seuil_stock_alerte", "pse.seuil_stock_alerte");
} else {
@ -344,13 +344,13 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type,';
$sql .= ' p.tms as datem, p.duration, p.tobuy,';
$sql .= ' p.desiredstock, p.seuil_stock_alerte,';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$sql .= ' pse.desiredstock as desiredstockpse, pse.seuil_stock_alerte as seuil_stock_alertepse,';
}
$sql .= " ".$sqldesiredtock." as desiredstockcombined, ".$sqlalertstock." as seuil_stock_alertecombined,";
$sql .= ' s.fk_product,';
$sql .= " SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$sql .= ", SUM(".$db->ifsql("s.reel IS NULL OR s.fk_entrepot <> ".$fk_entrepot, "0", "s.reel").') as stock_real_warehouse';
}
@ -365,7 +365,7 @@ $list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedw
$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse) .')';
//$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')';
}
// Add fields from hooks
@ -392,7 +392,7 @@ if ($search_label) {
$sql .= natural_search('p.label', $search_label);
}
$sql .= ' AND p.tobuy = 1';
if (!empty($conf->variants->eabled) && empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) { // Add test to exclude products that has variants
if (!empty($conf->variants->eabled) && !getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT')) { // Add test to exclude products that has variants
$sql .= ' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM '.MAIN_DB_PREFIX.'product_attribute_combination as pac WHERE pac.entity IN ('.getEntity('product').'))';
}
if ($fk_supplier > 0) {
@ -408,7 +408,7 @@ $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
$sql .= ', p.duration, p.tobuy';
$sql .= ', p.desiredstock';
$sql .= ', p.seuil_stock_alerte';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$sql .= ', pse.desiredstock';
$sql .= ', pse.seuil_stock_alerte';
}
@ -418,7 +418,7 @@ if ($usevirtualstock) {
if (isModEnabled('commande')) {
$sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'commande').")";
$sqlCommandesCli .= " AND cd1.fk_product = p.rowid";
$sqlCommandesCli .= " AND c1.fk_statut IN (1,2))";
} else {
@ -431,7 +431,7 @@ if ($usevirtualstock) {
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commande as c2,";
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2";
$sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'expedition').")";
$sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'expedition').")";
$sqlExpeditionsCli .= " AND cd2.fk_commande = c2.rowid";
$sqlExpeditionsCli .= " AND c2.fk_statut IN (1,2)";
$sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid";
@ -445,14 +445,14 @@ if ($usevirtualstock) {
$sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd3,";
$sqlCommandesFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur as c3";
$sqlCommandesFourn .= " WHERE c3.rowid = cd3.fk_commande";
$sqlCommandesFourn .= " AND c3.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sqlCommandesFourn .= " AND c3.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")";
$sqlCommandesFourn .= " AND cd3.fk_product = p.rowid";
$sqlCommandesFourn .= " AND c3.fk_statut IN (3,4))";
$sqlReceptionFourn = "(SELECT ".$db->ifsql("SUM(fd4.qty) IS NULL", "0", "SUM(fd4.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlReceptionFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf4,";
$sqlReceptionFourn .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as fd4";
$sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'supplier_order').")";
$sqlReceptionFourn .= " WHERE fd4.fk_commande = cf4.rowid AND cf4.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'supplier_order').")";
$sqlReceptionFourn .= " AND fd4.fk_product = p.rowid";
$sqlReceptionFourn .= " AND cf4.fk_statut IN (3,4))";
} else {
@ -464,7 +464,7 @@ if ($usevirtualstock) {
$sqlProductionToConsume = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toconsume'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToConsume .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToConsume .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")";
$sqlProductionToConsume .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'mo').")";
$sqlProductionToConsume .= " AND mp5.fk_product = p.rowid";
$sqlProductionToConsume .= " AND mp5.role IN ('toconsume', 'consumed')";
$sqlProductionToConsume .= " AND mm5.status IN (1,2))";
@ -472,7 +472,7 @@ if ($usevirtualstock) {
$sqlProductionToProduce = "(SELECT GREATEST(0, ".$db->ifsql("SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').") IS NULL", "0", "SUM(".$db->ifsql("mp5.role = 'toproduce'", 'mp5.qty', '- mp5.qty').")").") as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlProductionToProduce .= " FROM ".MAIN_DB_PREFIX."mrp_mo as mm5,";
$sqlProductionToProduce .= " ".MAIN_DB_PREFIX."mrp_production as mp5";
$sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'mo').")";
$sqlProductionToProduce .= " WHERE mm5.rowid = mp5.fk_mo AND mm5.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'mo').")";
$sqlProductionToProduce .= " AND mp5.fk_product = p.rowid";
$sqlProductionToProduce .= " AND mp5.role IN ('toproduce', 'produced')";
$sqlProductionToProduce .= " AND mm5.status IN (1,2))";
@ -579,7 +579,7 @@ print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'<
//$link = '<a title=' .$langs->trans("MenuNewWarehouse"). ' href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("MenuNewWarehouse").'</a>';
if (empty($fk_entrepot) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
if (empty($fk_entrepot) && getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDescPerWarehouse").'</span>'."\n";
}
print '<br><br>';
@ -609,7 +609,7 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
if ($limit > 0 && $limit != $conf->liste_limit) {
print '<input type="hidden" name="limit" value="'.$limit.'">';
}
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
print '</div>';
@ -694,7 +694,7 @@ if ($usevirtualstock == 1) {
if ($usevirtualstock == 0) {
$stocklabel = $langs->trans('PhysicalStock');
}
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$stocklabelbis = $stocklabel.' (Selected warehouse)';
$stocklabel .= ' ('.$langs->trans("AllWarehouses").')';
}
@ -703,7 +703,7 @@ $texte = $langs->trans('Replenishment');
print '<br>';
if (!empty($conf->global->REPLENISH_ALLOW_VARIABLESIZELIST)) {
if (getDolGlobalString('REPLENISH_ALLOW_VARIABLESIZELIST')) {
print_barre_liste(
$texte,
$page,
@ -750,11 +750,11 @@ if (isModEnabled("service") && $type == 1) {
print '<td class="liste_titre right">'.$form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')).'&nbsp;<input type="checkbox" id="includeproductswithoutdesiredqty" name="includeproductswithoutdesiredqty" '.(!empty($includeproductswithoutdesiredqtychecked) ? $includeproductswithoutdesiredqtychecked : '').'></td>';
print '<td class="liste_titre right"></td>';
print '<td class="liste_titre right">'.$langs->trans('AlertOnly').'&nbsp;<input type="checkbox" id="salert" name="salert" '.(!empty($alertchecked) ? $alertchecked : '').'></td>';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
print '<td class="liste_titre">&nbsp;</td>';
}
print '<td class="liste_titre right">';
if (!empty($conf->global->STOCK_REPLENISH_ADD_CHECKBOX_INCLUDE_DRAFT_ORDER)) {
if (getDolGlobalString('STOCK_REPLENISH_ADD_CHECKBOX_INCLUDE_DRAFT_ORDER')) {
print $langs->trans('IncludeAlsoDraftOrders').'&nbsp;<input type="checkbox" id="draftorder" name="draftorder" '.(!empty($draftchecked) ? $draftchecked : '').'>';
}
print '</td>';
@ -781,7 +781,7 @@ if (isModEnabled("service") && $type == 1) {
print_liste_field_titre('DesiredStock', $_SERVER["PHP_SELF"], 'p.desiredstock', $param, '', '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('StockLimitShort', $_SERVER["PHP_SELF"], 'p.seuil_stock_alerte', $param, '', '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($stocklabel, $_SERVER["PHP_SELF"], 'stock_physique', $param, '', '', $sortfield, $sortorder, 'right ', $stocktooltip);
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
print_liste_field_titre($stocklabelbis, $_SERVER["PHP_SELF"], 'stock_real_warehouse', $param, '', '', $sortfield, $sortorder, 'right ');
}
print_liste_field_titre('Ordered', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right ');
@ -798,7 +798,7 @@ print "</tr>\n";
while ($i < ($limit ? min($num, $limit) : $num)) {
$objp = $db->fetch_object($resql);
if (!empty($conf->global->STOCK_SUPPORTS_SERVICES) || $objp->fk_product_type == 0) {
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES') || $objp->fk_product_type == 0) {
$result = $prod->fetch($objp->rowid);
if ($result < 0) {
dol_print_error($db);
@ -920,10 +920,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
// Desired stock
print '<td class="right">'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $desiredstockwarehouse : $desiredstock).'</td>';
print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $desiredstockwarehouse : $desiredstock).'</td>';
// Limit stock for alert
print '<td class="right">'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $alertstockwarehouse : $alertstock).'</td>';
print '<td class="right">'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $alertstockwarehouse : $alertstock).'</td>';
// Current stock (all warehouses)
print '<td class="right">'.$warning.$stock;
@ -931,7 +931,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print '</td>';
// Current stock (warehouse selected only)
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
print '<td class="right">'.$warningwarehouse.$stockwarehouse.'</td>';
}
@ -939,7 +939,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';
// To order
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy).'"></td>';
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy).'"></td>';
// Supplier
print '<td class="right">';
@ -961,7 +961,7 @@ if ($num == 0) {
if (isModEnabled("service") && $type == 1) {
$colspan++;
}
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$colspan++;
}
print '<tr><td colspan="'.$colspan.'">';

View File

@ -131,9 +131,9 @@ if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
}
$sql .= ' WHERE cf.fk_soc = s.rowid ';
$sql .= ' AND cf.entity = '.$conf->entity;
if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) {
$sql .= ' AND cf.fk_statut < 3';
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')) {
$sql .= ' AND cf.fk_statut < 6'; // We want also status 5, we will keep them visible if dispatching is not yet finished (tested with function dolDispatchToDo).
} else {
$sql .= ' AND cf.fk_statut < 5';

View File

@ -131,7 +131,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
}
$warehouseStatus = array();
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
//$warehouseStatus[] = Entrepot::STATUS_CLOSED;
$warehouseStatus[] = Entrepot::STATUS_OPEN_ALL;
$warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL;
@ -148,7 +148,7 @@ if ($date && $dateIsValid) { // Avoid heavy sql if mandatory date is not defined
$sql .= ", ".MAIN_DB_PREFIX."product as p";
$sql .= " WHERE w.entity IN (".getEntity('stock').")";
$sql .= " AND w.rowid = ps.fk_entrepot AND p.rowid = ps.fk_product";
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS') && count($warehouseStatus)) {
$sql .= " AND w.statut IN (".$db->sanitize(implode(',', $warehouseStatus)).")";
}
if ($productid > 0) {
@ -205,7 +205,7 @@ if ($date && $dateIsValid) {
$sql .= ", ".MAIN_DB_PREFIX."product as p";
$sql .= " WHERE w.entity IN (".getEntity('stock').")";
$sql .= " AND w.rowid = sm.fk_entrepot AND p.rowid = sm.fk_product ";
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS') && count($warehouseStatus)) {
$sql .= " AND w.statut IN (".$db->sanitize(implode(',', $warehouseStatus)).")";
}
if ($mode == 'future') {
@ -298,7 +298,7 @@ $sql .= ' WHERE p.entity IN ('.getEntity('product').')';
if ($productid > 0) {
$sql .= " AND p.rowid = ".((int) $productid);
}
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
$sql .= " AND p.fk_product_type = 0";
}
if (!empty($canvas)) {
@ -521,7 +521,7 @@ $i = 0;
while ($i < ($limit ? min($num, $limit) : $num)) {
$objp = $db->fetch_object($resql);
if (!empty($conf->global->STOCK_SUPPORTS_SERVICES) || $objp->fk_product_type == 0) {
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES') || $objp->fk_product_type == 0) {
$prod->fetch($objp->rowid);
// Multilangs
@ -622,7 +622,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Selling value
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
print '<span class="amount">';
if ($stock || (float) ($stock * $objp->price)) {
print price(price2num($stock * $objp->price, 'MT'), 1);
@ -688,7 +688,7 @@ if (empty($date) || !$dateIsValid) {
} else {
print '<td></td>';
print '<td class="right">'.price(price2num($totalbuyingprice, 'MT')).'</td>';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
print '<td class="right">'.price(price2num($totalsellingprice, 'MT')).'</td>';
} else {
print '<td></td>';

View File

@ -192,7 +192,7 @@ class StockTransfer extends CommonObject
$this->db = $db;
$this->origin_type = 'StockTransfer@product/stock/stocktransfer';
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
// Example to show how to set values of fields definition dynamically
@ -760,7 +760,7 @@ class StockTransfer extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowStockTransfer");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -931,11 +931,11 @@ class StockTransfer extends CommonObject
global $langs, $conf;
$langs->load("stocks");
if (empty($conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON)) {
if (!getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADDON')) {
$conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON = 'mod_stocktransfer_standard';
}
if (!empty($conf->global->STOCKTRANSFER_STOCKTRANSFER_ADDON)) {
if (getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADDON')) {
$mybool = false;
$file = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFER_ADDON') . ".php";
@ -1001,7 +1001,7 @@ class StockTransfer extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->STOCKTRANSFER_ADDON_PDF)) {
} elseif (getDolGlobalString('STOCKTRANSFER_ADDON_PDF')) {
$modele = $conf->global->STOCKTRANSFER_ADDON_PDF;
}
}

View File

@ -134,7 +134,7 @@ class StockTransferLine extends CommonObjectLine
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
// Example to show how to set values of fields definition dynamically
@ -745,7 +745,7 @@ class StockTransferLine extends CommonObjectLine
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowStockTransferLine");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -892,11 +892,11 @@ class StockTransferLine extends CommonObjectLine
global $langs, $conf;
$langs->load("stocks");
if (empty($conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON)) {
if (!getDolGlobalString('STOCKTRANSFER_STOCKTRANSFERLINE_ADDON')) {
$conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON = 'mod_stocktransferline_standard';
}
if (!empty($conf->global->STOCKTRANSFER_STOCKTRANSFERLINE_ADDON)) {
if (getDolGlobalString('STOCKTRANSFER_STOCKTRANSFERLINE_ADDON')) {
$mybool = false;
$file = getDolGlobalString('STOCKTRANSFER_STOCKTRANSFERLINE_ADDON') . ".php";
@ -962,7 +962,7 @@ class StockTransferLine extends CommonObjectLine
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->STOCKTRANSFERLINE_ADDON_PDF)) {
} elseif (getDolGlobalString('STOCKTRANSFERLINE_ADDON_PDF')) {
$modele = $conf->global->STOCKTRANSFERLINE_ADDON_PDF;
}
}

View File

@ -42,7 +42,7 @@ function stocktransferPrepareHead($object)
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
$nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external'));
$head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_contact.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
@ -57,7 +57,7 @@ function stocktransferPrepareHead($object)
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
if ($nbNote > 0) $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
$head[$h][2] = 'note';
$h++;
}

View File

@ -840,7 +840,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Product
print '<td class="titlefield">';
$filtertype = 0;
if (!empty($conf->global->STOCK_SUPPORTS_SERVICES)) $filtertype = '';
if (getDolGlobalString('STOCK_SUPPORTS_SERVICES')) $filtertype = '';
if ($conf->global->PRODUIT_LIMIT_SIZE <= 0) {
$limit = '';
} else {

View File

@ -261,7 +261,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
}
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/product/stock/stocktransfer/stocktransfer_card.php', 1).'?id='.$id);

View File

@ -106,7 +106,7 @@ if ($object->element == 'product') {
print '<td class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
print '<td>';
$ident = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ? GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
if (empty($ident) && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE')) {
$ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
}
print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100 maxwidth300 widthcentpercentminusx');
@ -116,7 +116,7 @@ if ($object->element == 'stock') {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>';
print img_picto('', 'product');
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print '</td>';
}
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
@ -133,7 +133,7 @@ print '</td>';
print '</tr>';
// If product is a Kit, we ask if we must disable stock change of subproducts
if (!empty($conf->global->PRODUIT_SOUSPRODUITS) && $object->element == 'product' && $object->hasFatherOrChild(1)) {
if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && $object->element == 'product' && $object->hasFatherOrChild(1)) {
print '<tr>';
print '<td></td>';
print '<td colspan="3">';
@ -161,14 +161,14 @@ if (ismodEnabled('productbatch') &&
print '</tr>';
print '<tr>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td>'.$langs->trans("SellByDate").'</td><td>';
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
// If form was opened for a specific pdluoid, field is disabled
print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
// If form was opened for a specific pdluoid, field is disabled

View File

@ -82,7 +82,7 @@ if ($object->element == 'stock') {
print '<td class="fieldrequired">'.$langs->trans("Product").'</td>';
print '<td>';
print img_picto('', 'product');
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
print '</td>';
}
@ -110,12 +110,12 @@ if (isModEnabled('productbatch') &&
print '</tr>';
print '<tr>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) {
print '<td>'.$langs->trans("SellByDate").'</td><td>';
print $form->selectDate((!empty($d_sellby) ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
print $form->selectDate((!empty($d_eatby) ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';

View File

@ -118,7 +118,7 @@ if ($result) {
print '</td>';
// Selling value
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
print price(price2num($objp->sellvalue, 'MT'), 1);
} else {
print $langs->trans("Variable");

View File

@ -271,7 +271,7 @@ if ($action == 'edit') {
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%');
$doleditor->Create();
print '</td></tr>';
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
print '<tr><td class="tdtop">'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>';
$doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%');
$doleditor->Create();
@ -303,7 +303,7 @@ if ($action == 'edit') {
print '<table class="border centpercent">';
print '<tr><td class="titlefieldcreate">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
print '<tr><td>'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>'.$object->multilangs[$key]["other"].'</td></tr>';
}
print '</table>';
@ -343,7 +343,7 @@ if ($action == 'add' && ($user->hasRight('produit', 'creer') || $user->hasRight(
$doleditor->Create();
print '</td></tr>';
// Other field (not used)
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION')) {
print '<tr><td class="tdtop">'.$langs->trans('Other').' ('.$langs->trans("NotUsed").'</td><td>';
$doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%');
$doleditor->Create();

View File

@ -276,7 +276,7 @@ if ($db->type != 'pgsql')
*/
/* Affichage de la liste des projets du mois */
if (!empty($conf->global->PROJECT_TASK_TIME_MONTH)) {
if (getDolGlobalString('PROJECT_TASK_TIME_MONTH')) {
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -323,7 +323,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_MONTH)) {
}
/* Affichage de la liste des projets de l'annee */
if (!empty($conf->global->PROJECT_TASK_TIME_YEAR)) {
if (getDolGlobalString('PROJECT_TASK_TIME_YEAR')) {
print '<div class="div-table-responsive-no-min">';
print '<br><table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -370,7 +370,7 @@ if (!empty($conf->global->PROJECT_TASK_TIME_YEAR)) {
print '</div>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA')) {
// Get id of types of contacts for projects (This list never contains a lot of elements)
$listofprojectcontacttype = array();
$sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
@ -409,7 +409,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
// This list can be very long, so we don't show it by default on task area. We prefer to use the list page.
// Add constant PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA to show this list
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA) ? 1000 : $conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
$max = (!getDolGlobalString('PROJECT_LIMIT_TASK_PROJECT_AREA') ? 1000 : $conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
$sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, p.public, p.dateo as projdateo, p.datee as projdatee,";
$sql .= " t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.element_duration) as timespent";
@ -449,7 +449,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
print '<tr class="liste_titre">';
//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
print '<th>'.$langs->trans('OpenedProjects').'</th>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<th>'.$langs->trans('OpportunityStatus').'</th>';
}
print '<th>'.$langs->trans('Task').'</th>';
@ -494,7 +494,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
print '<td>';
print $projectstatic->getNomUrl(1, '', 0, '', '<br>');
print '</td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<td>';
$code = dol_getIdFromCode($db, $obj->opp_status, 'c_lead_status', 'rowid', 'code');
if ($code) {
@ -544,7 +544,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH
if ($num > $max) {
$colspan = 6;
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
$colspan++;
}
print '<tr><td colspan="'.$colspan.'">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';

View File

@ -513,7 +513,7 @@ if (!$user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').'<input type="text" name="search_project_ref" class="maxwidth100" value="'.dol_escape_htmltag($search_project_ref).'">';
@ -555,10 +555,10 @@ print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
print '<tr class="liste_titre_filter">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
}
print '<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
@ -588,10 +588,10 @@ print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<th>'.$langs->trans("Project").'</th>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<th>'.$langs->trans("ThirdParty").'</th>';
}
print '<th>'.$langs->trans("Task").'</th>';
@ -628,7 +628,7 @@ $isavailable = array();
$numstartworkingday = 1;
$numendworkingday = 5;
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) {
if (getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS')) {
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
if (count($tmparray) >= 2) {
$numstartworkingday = $tmparray[0];
@ -647,7 +647,7 @@ if ($test) {
$tmparray = dol_getdate($daytoparse, true); // detail of current day
// For monday, must be 0 for monday if MAIN_START_WEEK = 1, must be 1 for monday if MAIN_START_WEEK = 0
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
$idw = ($tmparray['wday'] - (!getDolGlobalString('MAIN_START_WEEK') ? 0 : 1));
// numstartworkingday and numendworkingday are default start and end date of working days (1 means sunday if MAIN_START_WEEK is 0, 1 means monday if MAIN_START_WEEK is 1)
$cssweekend = '';
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) { // This is a day is not inside the setup of working days, so we use a week-end css.
@ -672,7 +672,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $
print "</tr>\n";
$colspan = 2 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2);
$colspan = 2 + (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT') ? 0 : 2);
if ($conf->use_javascript_ajax) {
print '<tr class="liste_total">';

View File

@ -428,7 +428,7 @@ if (!$user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').'<input type="text" name="search_project_ref" class="maxwidth100" value="'.dol_escape_htmltag($search_project_ref).'">';
@ -454,10 +454,10 @@ print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
print '<tr class="liste_titre_filter">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
}
print '<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
@ -476,10 +476,10 @@ print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td>'.$langs->trans("Project").'</td>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td>'.$langs->trans("ThirdParty").'</td>';
}
print '<td>'.$langs->trans("Task").'</td>';
@ -505,7 +505,7 @@ print "</tr>\n";
$colspan = 5;
// By default, we can edit only tasks we are assigned to
$restrictviewformytask = (empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED) ? 1 : 0);
$restrictviewformytask = (!getDolGlobalString('PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED') ? 1 : 0);
// Get if user is available or not for each day
$isavailable = array();

View File

@ -517,7 +517,7 @@ $isavailable = array();
$numstartworkingday = 1;
$numendworkingday = 5;
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)) {
if (getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS')) {
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
if (count($tmparray) >= 2) {
$numstartworkingday = $tmparray[0];
@ -564,7 +564,7 @@ if (!$user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->hasRight('user', 'user', 'lire') ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>';
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block"></div>';
$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').'<input type="text" name="search_project_ref" class="maxwidth100" value="'.dol_escape_htmltag($search_project_ref).'">';
@ -608,10 +608,10 @@ print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
print '<tr class="liste_titre_filter">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
}
print '<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
@ -641,10 +641,10 @@ print '</td>';
print "</tr>\n";
print '<tr class="liste_titre">';
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<th>'.$langs->trans("Project").'</th>';
}
if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
if (getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT')) {
print '<th>'.$langs->trans("ThirdParty").'</th>';
}
print '<th>'.$langs->trans("Task").'</th>';
@ -697,7 +697,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $
print "</tr>\n";
$colspan = 1 + (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : 2);
$colspan = 1 + (!getDolGlobalString('PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT') ? 0 : 2);
if ($conf->use_javascript_ajax) {
print '<tr class="liste_total">';

View File

@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) {
print '</table><br>';
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
// Task numbering module
print load_fiche_titre($langs->trans("TasksNumberingModules"), '', '');
@ -622,7 +622,7 @@ print '</table><br>';
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
/*
* Modeles documents for Task
*/

View File

@ -111,7 +111,7 @@ print '<span class="opacitymedium">'.$langs->trans("LeadPublicFormDesc").'</span
$param = '';
$enabledisablehtml = $langs->trans("EnablePublicLeadForm").' ';
if (empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
if (!getDolGlobalString('PROJECT_ENABLE_PUBLIC')) {
// Button off, click to enable
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setPROJECT_ENABLE_PUBLIC&token='.newToken().'&value=1'.$param.'">';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
@ -123,11 +123,11 @@ if (empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
$enabledisablehtml .= '</a>';
}
print $enabledisablehtml;
print '<input type="hidden" id="PROJECT_ENABLE_PUBLIC" name="PROJECT_ENABLE_PUBLIC" value="'.(empty($conf->global->PROJECT_ENABLE_PUBLIC) ? 0 : 1).'">';
print '<input type="hidden" id="PROJECT_ENABLE_PUBLIC" name="PROJECT_ENABLE_PUBLIC" value="'.(!getDolGlobalString('PROJECT_ENABLE_PUBLIC') ? 0 : 1).'">';
print '<br>';
if (!empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
if (getDolGlobalString('PROJECT_ENABLE_PUBLIC')) {
print '<br>';
print '<div class="div-table-responsive-no-min">';
@ -167,7 +167,7 @@ print dol_get_fiche_end();
print '</form>';
if (!empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
if (getDolGlobalString('PROJECT_ENABLE_PUBLIC')) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';

View File

@ -107,14 +107,14 @@ $object = new Project($db);
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
$object->fetch_thirdparty();
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
$object->info($object->id);
}
$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : '';
$title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");
}
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:M&oacute;dulo_Proyectos";

View File

@ -86,7 +86,7 @@ if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref); // If we create project, ref may be defined into POST but record does not yet exists into database
if ($ret > 0) {
$object->fetch_thirdparty();
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
$id = $object->id;
@ -184,7 +184,7 @@ if (empty($reshook)) {
$error++;
}
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
if (GETPOST('usage_opportunity') != '' && !(GETPOST('opp_status') > 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfUsage"), null, 'errors');
@ -196,7 +196,7 @@ if (empty($reshook)) {
}
// Create with status validated immediatly
if (!empty($conf->global->PROJECT_CREATE_NO_DRAFT) && !$error) {
if (getDolGlobalString('PROJECT_CREATE_NO_DRAFT') && !$error) {
$status = Project::STATUS_VALIDATED;
}
@ -341,7 +341,7 @@ if (empty($reshook)) {
}
}
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
if ($object->opp_amount && ($object->opp_status <= 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
@ -526,7 +526,7 @@ $formproject = new FormProjets($db);
$userstatic = new User($db);
$title = $langs->trans("Project").' - '.$object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : '');
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
$title = $object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : '');
}
@ -570,7 +570,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '<table class="border centpercent tableforfieldcreate">';
$defaultref = '';
$modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
$modele = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
// Search template files
$file = ''; $classname = ''; $filefound = 0;
@ -615,12 +615,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
// Usage (opp, task, bill time, ...)
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">';
print $langs->trans("Usage");
print '</td>';
print '<td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') ? ' checked="checked"' : '') : ' checked="checked"').'"> ';
$htmltext = $langs->trans("ProjectFollowOpportunity");
print '<label for="usage_opportunity">'.$form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext).'</label>';
@ -643,7 +643,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '</script>';
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
print '<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') ? ' checked="checked"' : '') : ' checked="checked"').'"> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
@ -666,7 +666,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '</script>';
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') ? ' checked="checked"' : '') : '').'"> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
@ -718,16 +718,16 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Thirdparty
if (isModEnabled('societe')) {
print '<tr><td>';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '<span class="fieldrequired">');
print (!getDolGlobalString('PROJECT_THIRDPARTY_REQUIRED') ? '' : '<span class="fieldrequired">');
print $langs->trans("ThirdParty");
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '</span>');
print (!getDolGlobalString('PROJECT_THIRDPARTY_REQUIRED') ? '' : '</span>');
print '</td><td class="maxwidthonsmartphone">';
$filter = '';
if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) {
if (getDolGlobalString('PROJECT_FILTER_FOR_THIRDPARTY_LIST')) {
$filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
}
$text = img_picto('', 'company').$form->select_company(GETPOST('socid', 'int'), 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) {
if (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
$texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1);
} else {
@ -758,10 +758,10 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Visibility
print '<tr><td>'.$langs->trans("Visibility").'</td><td class="maxwidthonsmartphone">';
$array = array();
if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) {
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
$array[0] = $langs->trans("PrivateProject");
}
if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) {
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
$array[1] = $langs->trans("SharedProject");
}
@ -780,7 +780,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
print '</td></tr>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
// Opportunity status
print '<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans("OpportunityStatus").'</span></td>';
print '<td class="maxwidthonsmartphone">';
@ -990,12 +990,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
// Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">';
print $langs->trans("Usage");
print '</td>';
print '<td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<input type="checkbox" id="usage_opportunity" name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'> ';
$htmltext = $langs->trans("ProjectFollowOpportunity");
print '<label for="usage_opportunity">'.$form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext).'</label>';
@ -1021,7 +1021,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '</script>';
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>';
@ -1047,7 +1047,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '</script>';
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>';
@ -1105,17 +1105,17 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Thirdparty
if (isModEnabled('societe')) {
print '<tr><td>';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '<span class="fieldrequired">');
print (!getDolGlobalString('PROJECT_THIRDPARTY_REQUIRED') ? '' : '<span class="fieldrequired">');
print $langs->trans("ThirdParty");
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '</span>');
print (!getDolGlobalString('PROJECT_THIRDPARTY_REQUIRED') ? '' : '</span>');
print '</td><td>';
$filter = '';
if (!empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) {
if (getDolGlobalString('PROJECT_FILTER_FOR_THIRDPARTY_LIST')) {
$filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
}
$text = img_picto('', 'company', 'class="pictofixedwidth"');
$text .= $form->select_company($object->thirdparty->id, 'socid', $filter, 'None', 1, 0, array(), 0, 'minwidth300');
if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) {
if (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) {
$texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2);
} else {
@ -1127,10 +1127,10 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Visibility
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
$array = array();
if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) {
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
$array[0] = $langs->trans("PrivateProject");
}
if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) {
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
$array[1] = $langs->trans("SharedProject");
}
@ -1149,7 +1149,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
print '</td></tr>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
$classfortr = ($object->usage_opportunity ? '' : ' hideobject');
// Opportunity status
print '<tr class="classuseopportunity'.$classfortr.'"><td>'.$langs->trans("OpportunityStatus").'</td>';
@ -1290,24 +1290,24 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
print '<table class="border tableforfield centpercent">';
// Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">';
print $langs->trans("Usage");
print '</td>';
print '<td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'> ';
$htmltext = $langs->trans("ProjectFollowOpportunity");
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
@ -1333,7 +1333,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
print '</td></tr>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
// Opportunity status
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
@ -1443,10 +1443,10 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
</script>';
// Change probability from status
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
// Default value to close or not when we set opp to 'WON'.
$defaultcheckedwhenoppclose = 1;
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
$defaultcheckedwhenoppclose = 0;
}
@ -1596,7 +1596,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
}
// Buttons Create
if (empty($conf->global->PROJECT_HIDE_CREATE_OBJECT_BUTTON)) {
if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) {
$arrayforbutaction = array(
10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),

View File

@ -368,18 +368,18 @@ class Project extends CommonObject
global $conf;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID')) {
$this->fields['rowid']['visible'] = 0;
}
if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
$this->fields['fk_opp_status']['enabled'] = 0;
$this->fields['opp_percent']['enabled'] = 0;
$this->fields['opp_amount']['enabled'] = 0;
$this->fields['usage_opportunity']['enabled'] = 0;
}
if (!empty($conf->global->PROJECT_HIDE_TASKS)) {
if (getDolGlobalString('PROJECT_HIDE_TASKS')) {
$this->fields['usage_bill_time']['visible'] = 0;
$this->fields['usage_task']['visible'] = 0;
}
@ -420,7 +420,7 @@ class Project extends CommonObject
dol_syslog(get_class($this)."::create error -1 ref null", LOG_ERR);
return -1;
}
if (!empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) && !($this->socid > 0)) {
if (getDolGlobalString('PROJECT_THIRDPARTY_REQUIRED') && !($this->socid > 0)) {
$this->error = 'ErrorFieldsRequired';
dol_syslog(get_class($this)."::create error -1 thirdparty not defined and option PROJECT_THIRDPARTY_REQUIRED is set", LOG_ERR);
return -1;
@ -1236,7 +1236,7 @@ class Project extends CommonObject
$sql .= " WHERE rowid = ".((int) $this->id);
$sql .= " AND fk_statut = ".self::STATUS_VALIDATED;
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
// TODO What to do if fk_opp_status is not code 'WON' or 'LOST'
}
@ -1379,7 +1379,7 @@ class Project extends CommonObject
}
$result = '';
if (!empty($conf->global->PROJECT_OPEN_ALWAYS_ON_TAB)) {
if (getDolGlobalString('PROJECT_OPEN_ALWAYS_ON_TAB')) {
$option = $conf->global->PROJECT_OPEN_ALWAYS_ON_TAB;
}
$params = [
@ -1427,7 +1427,7 @@ class Project extends CommonObject
$linkclose = '';
if (empty($notooltip) && $user->hasRight('projet', 'lire')) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowProject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1731,7 +1731,7 @@ class Project extends CommonObject
//Generate next ref
$defaultref = '';
$obj = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
$obj = !getDolGlobalString('PROJECT_ADDON') ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
// Search template files
$file = ''; $classname = ''; $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@ -2055,7 +2055,7 @@ class Project extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->PROJECT_ADDON_PDF)) {
} elseif (getDolGlobalString('PROJECT_ADDON_PDF')) {
$modele = $conf->global->PROJECT_ADDON_PDF;
}
}

View File

@ -481,7 +481,7 @@ class Task extends CommonObjectLine
}
}
if (!$error && !empty($conf->global->PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE)) {
if (!$error && getDolGlobalString('PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE')) {
// Close the parent project if it is open (validated) and its tasks are 100% completed
$project = new Project($this->db);
if ($project->fetch($this->fk_project) > 0) {
@ -814,7 +814,7 @@ class Task extends CommonObjectLine
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowTask");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1302,7 +1302,7 @@ class Task extends CommonObjectLine
$this->timespent_datehour = $this->timespent_date;
}
if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) {
if (getDolGlobalString('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm');
@ -1746,7 +1746,7 @@ class Task extends CommonObjectLine
$this->timespent_note = trim($this->timespent_note);
}
if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) {
if (getDolGlobalString('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm');
@ -1792,7 +1792,7 @@ class Task extends CommonObjectLine
$ret = -1;
}
if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM))) {
if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM'))) {
if ($this->timespent_old_duration != $this->timespent_duration) {
// Recalculate amount of time spent for task and update denormalized field
$sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task";
@ -1812,7 +1812,7 @@ class Task extends CommonObjectLine
// Update hourly rate of this time spent entry, but only if it was not set initialy
$res_update = 1;
if (empty($timespent->thm) || !empty($conf->global->TIMESPENT_ALWAYS_UPDATE_THM)) {
if (empty($timespent->thm) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM')) {
$resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user));
if (!empty($resql_thm_user)) {
$obj_thm_user = $this->db->fetch_object($resql_thm_user);
@ -1847,7 +1847,7 @@ class Task extends CommonObjectLine
$error = 0;
if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) {
if (getDolGlobalString('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm');
@ -1948,8 +1948,8 @@ class Task extends CommonObjectLine
$origin_task->fetch($fromid);
$defaultref = '';
$obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
$obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) {
require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php';
$modTask = new $obj;
$defaultref = $modTask->getNextValue(0, $clone_task);
@ -2235,7 +2235,7 @@ class Task extends CommonObjectLine
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->PROJECT_TASK_ADDON_PDF)) {
} elseif (getDolGlobalString('PROJECT_TASK_ADDON_PDF')) {
$modele = $conf->global->PROJECT_TASK_ADDON_PDF;
}
}

View File

@ -67,7 +67,7 @@ if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref); // If we create project, ref may be defined into POST but record does not yet exists into database
if ($ret > 0) {
$object->fetch_thirdparty();
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
$id = $object->id;

View File

@ -53,7 +53,7 @@ $mine = GETPOST('mode') == 'mine' ? 1 : 0;
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
@ -93,7 +93,7 @@ if (empty($reshook)) {
$affect_to = (GETPOST('userid') ? 'userid='.$personToAffect : 'contactid='.$personToAffect);
$url_redirect='?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
if ($personToAffect > 0 && (empty($conf->global->PROJECT_HIDE_TASKS) || $nbTasks > 0)) {
if ($personToAffect > 0 && (!getDolGlobalString('PROJECT_HIDE_TASKS') || $nbTasks > 0)) {
$text = $langs->trans('AddPersonToTask');
$textbody = $text.' (<a href="#" class="selectall">'.$langs->trans("SelectAll").'</a>)';
$formquestion = array('text' => $textbody);
@ -252,7 +252,7 @@ $contactstatic = new Contact($db);
$userstatic = new User($db);
$title = $langs->trans('ProjectContact').' - '.$object->ref.' '.$object->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectContact');
}
@ -266,7 +266,7 @@ if ($id > 0 || !empty($ref)) {
/*
* View
*/
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
// To verify role of users
@ -328,24 +328,24 @@ if ($id > 0 || !empty($ref)) {
print '<table class="border tableforfield centpercent">';
// Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJECT_HIDE_TASKS') || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">';
print $langs->trans("Usage");
print '</td>';
print '<td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_opportunity ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("ProjectFollowOpportunity");
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS')) {
print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("ProjectFollowTasks");
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
print '<br>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) {
print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("ProjectBillTimeDescription");
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
@ -370,7 +370,7 @@ if ($id > 0 || !empty($ref)) {
}
print '</td></tr>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) {
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
// Opportunity status
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');

View File

@ -45,7 +45,7 @@ $mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0);
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) {
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object, 'fetchComments') && empty($object->comments)) {
$object->fetchComments();
}
@ -65,10 +65,10 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) {
if (getDolGlobalString('MAIN_DOC_SORT_FIELD')) {
$sortfield = $conf->global->MAIN_DOC_SORT_FIELD;
}
if (!empty($conf->global->MAIN_DOC_SORT_ORDER)) {
if (getDolGlobalString('MAIN_DOC_SORT_ORDER')) {
$sortorder = $conf->global->MAIN_DOC_SORT_ORDER;
}
@ -99,7 +99,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
*/
$title = $langs->trans('Documents').' - '.$object->ref.' '.$object->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->ref.' '.$object->name.' - '.$langs->trans('Document');
}

Some files were not shown because too many files have changed in this diff Show More