Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-09-25 14:56:58 +02:00
commit d4e9f03c8c
204 changed files with 1078 additions and 1140 deletions

View File

@ -1351,7 +1351,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td></tr>\n"; print "</td></tr>\n";
// Default language // Default language
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3">'."\n"; print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3">'."\n";
print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1); print img_picto('', 'language').$formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1);
print '</td>'; print '</td>';
@ -1799,7 +1799,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
// Default language // Default language
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td>'.$langs->trans("DefaultLang").'</td><td>'; print '<tr><td>'.$langs->trans("DefaultLang").'</td><td>';
//$s=picto_from_langcode($object->default_lang); //$s=picto_from_langcode($object->default_lang);

View File

@ -1867,10 +1867,10 @@ class Adherent extends CommonObject
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
$lang_id = GETPOST('lang_id'); $lang_id = GETPOST('lang_id');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($lang_id)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($lang_id)) {
$newlang = $lang_id; $newlang = $lang_id;
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $customer->default_lang; $newlang = $customer->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -397,7 +397,7 @@ class AdherentType extends CommonObject
$this->description = $this->db->escape($this->note_public); $this->description = $this->db->escape($this->note_public);
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
if ($this->setMultiLangs($user) < 0) { if ($this->setMultiLangs($user) < 0) {
$this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql;
return -2; return -2;
@ -509,7 +509,7 @@ class AdherentType extends CommonObject
$this->vote = $obj->vote; $this->vote = $obj->vote;
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->getMultiLangs(); $this->getMultiLangs();
} }

View File

@ -32,10 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->load("admin"); $langs->load("admin");
// Security Check Access
if (!$user->admin) { if (!$user->admin) {
accessforbidden(); accessforbidden();
} }
// Get Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php

View File

@ -68,7 +68,7 @@ $conditions = array(
'USERSIGN' => 1, 'USERSIGN' => 1,
'MAILING' => isModEnabled('mailing'), 'MAILING' => isModEnabled('mailing'),
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
'TICKET' => !empty($conf->ticket->enabled), 'TICKET' => isModEnabled('ticket'),
); );
// Picto // Picto
$picto = array( $picto = array(

View File

@ -207,7 +207,7 @@ if (isModEnabled("expedition")) {
if (isModEnabled("reception")) { if (isModEnabled("reception")) {
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception'));
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
} }
if (isModEnabled('supplier_proposal')) { if (isModEnabled('supplier_proposal')) {
@ -222,7 +222,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->
if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
} }
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { if (isModEnabled('ticket') && !empty($user->rights->ticket->read)) {
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket'));
} }
if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) { if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
@ -583,7 +583,7 @@ if (!$user->admin) {
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me $sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me $sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
} }
if (empty($conf->global->MAIN_MULTILANGS)) { if (!getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')"; $sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
} }
if ($search_label) { if ($search_label) {
@ -706,7 +706,7 @@ if ($action == 'add') {
$valuetoshow = $langs->trans("Owner"); $valuetoshow = $langs->trans("Owner");
} }
if ($fieldlist[$field] == 'lang') { if ($fieldlist[$field] == 'lang') {
$valuetoshow = (empty($conf->global->MAIN_MULTILANGS) ? '&nbsp;' : $langs->trans("Language")); $valuetoshow = (!getDolGlobalInt('MAIN_MULTILANGS') ? '&nbsp;' : $langs->trans("Language"));
} }
if ($fieldlist[$field] == 'type') { if ($fieldlist[$field] == 'type') {
$valuetoshow = $langs->trans("Type"); $valuetoshow = $langs->trans("Type");
@ -1332,7 +1332,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print '</td>'; print '</td>';
} elseif ($value == 'lang') { } elseif ($value == 'lang') {
print '<td>'; print '<td>';
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang; $selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang;
if ($context == 'edit') { if ($context == 'edit') {
$selectedlang = $obj->{$value}; $selectedlang = $obj->{$value};

View File

@ -472,7 +472,7 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width=
// Use 2 languages into PDF // Use 2 languages into PDF
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
//if (!empty($conf->global->MAIN_MULTILANGS)) //if (getDolGlobalInt('MAIN_MULTILANGS'))
//{ //{
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);

View File

@ -75,7 +75,7 @@ $workflowcodes = array(
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
'family'=>'create', 'family'=>'create',
'position'=>25, 'position'=>25,
'enabled'=>(!empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)), 'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')),
'picto'=>'ticket' 'picto'=>'ticket'
), ),
@ -133,7 +133,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
'family'=>'classify_supplier_order', 'family'=>'classify_supplier_order',
'position'=>63, 'position'=>63,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
'picto'=>'supplier_order', 'picto'=>'supplier_order',
'warning'=>'' 'warning'=>''
), ),
@ -141,7 +141,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
'family'=>'classify_supplier_order', 'family'=>'classify_supplier_order',
'position'=>64, 'position'=>64,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))),
'picto'=>'supplier_order', 'picto'=>'supplier_order',
'warning'=>'' 'warning'=>''
), ),
@ -174,13 +174,13 @@ $workflowcodes = array(
'WORKFLOW_TICKET_LINK_CONTRACT' => array( 'WORKFLOW_TICKET_LINK_CONTRACT' => array(
'family' => 'link_ticket', 'family' => 'link_ticket',
'position' => 75, 'position' => 75,
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
'picto' => 'ticket' 'picto' => 'ticket'
), ),
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array( 'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
'family' => 'link_ticket', 'family' => 'link_ticket',
'position' => 76, 'position' => 76,
'enabled' => !empty($conf->ticket->enabled) && !empty($conf->contract->enabled), 'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
'picto' => 'ticket' 'picto' => 'ticket'
), ),
); );

View File

@ -128,7 +128,7 @@ if ($object->id > 0) {
$help_url = 'EN:Module_Agenda_En'; $help_url = 'EN:Module_Agenda_En';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = assetPrepareHead($object); $head = assetPrepareHead($object);

View File

@ -1171,10 +1171,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref; global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->thirdparty->default_lang; $newlang = $this->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1234,10 +1234,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref; global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->thirdparty->default_lang; $newlang = $this->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -130,7 +130,7 @@ if ($object->id > 0) {
$help_url = 'EN:Module_Agenda_En'; $help_url = 'EN:Module_Agenda_En';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = assetModelPrepareHead($object); $head = assetModelPrepareHead($object);

View File

@ -165,7 +165,7 @@ class BlockedLog
*/ */
// Donation // Donation
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
$this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE';
$this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; $this->trackedevents['DON_DELETE'] = 'logDON_DELETE';
//$this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL'; //$this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL';

View File

@ -32,15 +32,16 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("mrp", "other")); $langs->loadLangs(array('mrp', 'other'));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$socid = GETPOST('socid', 'int');
if (GETPOST('actioncode', 'array')) { if (GETPOST('actioncode', 'array')) {
$actioncode = GETPOST('actioncode', 'array', 3); $actioncode = GETPOST('actioncode', 'array', 3);
@ -50,8 +51,10 @@ if (GETPOST('actioncode', 'array')) {
} else { } else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
} }
$search_agenda_label = GETPOST('search_agenda_label'); $search_agenda_label = GETPOST('search_agenda_label');
// Load variables for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
@ -74,6 +77,7 @@ $object = new BOM($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('bomagenda', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('bomagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -130,7 +134,7 @@ if ($object->id > 0) {
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = bomPrepareHead($object); $head = bomPrepareHead($object);

View File

@ -353,7 +353,7 @@ if (empty($reshook)) {
} }
$text = $langs->trans('ConfirmValidateBom', $numref); $text = $langs->trans('ConfirmValidateBom', $numref);
/*if (! empty($conf->notification->enabled)) /*if (isModEnabled('notification'))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -362,7 +362,7 @@ if (empty($reshook)) {
}*/ }*/
$formquestion = array(); $formquestion = array();
if (!empty($conf->bom->enabled)) { if (isModEnabled('bom')) {
$langs->load("mrp"); $langs->load("mrp");
$forcecombo = 0; $forcecombo = 0;
if ($conf->browser->name == 'ie') { if ($conf->browser->name == 'ie') {
@ -381,7 +381,7 @@ if (empty($reshook)) {
// Confirmation of closing // Confirmation of closing
if ($action == 'close') { if ($action == 'close') {
$text = $langs->trans('ConfirmCloseBom', $object->ref); $text = $langs->trans('ConfirmCloseBom', $object->ref);
/*if (! empty($conf->notification->enabled)) /*if (isModEnabled('notification'))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -390,7 +390,7 @@ if (empty($reshook)) {
}*/ }*/
$formquestion = array(); $formquestion = array();
if (!empty($conf->bom->enabled)) { if (isModEnabled('bom')) {
$langs->load("mrp"); $langs->load("mrp");
$forcecombo = 0; $forcecombo = 0;
if ($conf->browser->name == 'ie') { if ($conf->browser->name == 'ie') {
@ -409,7 +409,7 @@ if (empty($reshook)) {
// Confirmation of reopen // Confirmation of reopen
if ($action == 'reopen') { if ($action == 'reopen') {
$text = $langs->trans('ConfirmReopenBom', $object->ref); $text = $langs->trans('ConfirmReopenBom', $object->ref);
/*if (! empty($conf->notification->enabled)) /*if (isModEnabled('notification'))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -418,7 +418,7 @@ if (empty($reshook)) {
}*/ }*/
$formquestion = array(); $formquestion = array();
if (!empty($conf->bom->enabled)) { if (isModEnabled('bom')) {
$langs->load("mrp"); $langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$forcecombo = 0; $forcecombo = 0;

View File

@ -17,35 +17,35 @@
*/ */
/** /**
* \file bom_document.php * \file htdocs/bom/bom_document.php
* \ingroup bom * \ingroup bom
* \brief Tab for documents linked to BillOfMaterials * \brief Tab for documents linked to BillOfMaterials
*/ */
// Load Dolibarr environment // Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.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/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("mrp", "companies", "other", "mails")); $langs->loadLangs(array("mrp", "companies", "other", "mails"));
// Get parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
// Security check - Protection if external user // Security check - Protection if external user
//if ($user->socid > 0) accessforbidden(); // if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; // if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'bom', $id); // $result = restrictedArea($user, 'bom', $id);
// Get parameters // Load variables for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');

View File

@ -16,9 +16,9 @@
*/ */
/** /**
* \file htdocs/bom/bom_list.php * \file htdocs/bom/bom_list.php
* \ingroup bom * \ingroup bom
* \brief List page for bom * \brief List page for BillOfMaterials
*/ */
// Load Dolibarr environment // Load Dolibarr environment
@ -29,8 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("mrp", "other")); $langs->loadLangs(array('mrp', 'other'));
// Get Parameters
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
@ -38,16 +40,14 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$id = GETPOST('id', 'int');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
$page = 0; $page = 0;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action

View File

@ -35,20 +35,24 @@ $langs->loadLangs(array("mrp", "other", "stocks"));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$lineid = GETPOST('lineid', 'int'); $lineid = GETPOST('lineid', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomnet_needs'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomnet_needs'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
// Initialize technical objects // Initialize technical objects
$object = new BOM($db); $object = new BOM($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
// Initialize technical objects for hooks
$hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array
// Massaction
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
@ -73,13 +77,13 @@ if ($object->id > 0) {
} }
// Security check - Protection if external user // Security check - Protection if external user
//if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; //if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); $result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
// Permissions
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php $permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@ -123,13 +127,11 @@ if (empty($reshook)) {
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$title = $langs->trans('BOM'); $title = $langs->trans('BOM');
$help_url ='EN:Module_BOM'; $help_url ='EN:Module_BOM';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
// Part to show record // Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$head = bomPrepareHead($object); $head = bomPrepareHead($object);

View File

@ -384,7 +384,7 @@ class Categorie extends CommonObject
$this->db->free($resql); $this->db->free($resql);
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->getMultiLangs(); $this->getMultiLangs();
} }
@ -1000,7 +1000,7 @@ class Categorie extends CommonObject
$categories[$i]['array_options'] = $category_static->array_options; $categories[$i]['array_options'] = $category_static->array_options;
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && isset($category_static->multilangs)) { if (getDolGlobalInt('MAIN_MULTILANGS') && isset($category_static->multilangs)) {
$categories[$i]['multilangs'] = $category_static->multilangs; $categories[$i]['multilangs'] = $category_static->multilangs;
} }
} }
@ -1128,11 +1128,11 @@ class Categorie extends CommonObject
// Init $this->cats array // Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates $sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= ", t.label as label_trans, t.description as description_trans"; $sql .= ", t.label as label_trans, t.description as description_trans";
} }
$sql .= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'";
} }
$sql .= " WHERE c.entity IN (".getEntity('category').")"; $sql .= " WHERE c.entity IN (".getEntity('category').")";

View File

@ -60,7 +60,7 @@ if (isModEnabled('contrat')) {
if (isModEnabled('adherent')) { if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
@ -82,10 +82,10 @@ if (isModEnabled('facture')) {
if (isModEnabled('project')) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$langs->load("interventions"); $langs->load("interventions");
} }
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
@ -545,7 +545,7 @@ if ($object->id > 0) {
} }
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { if (isModEnabled('stock') && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) {
$langs->load('stocks'); $langs->load('stocks');
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -1231,7 +1231,7 @@ if ($object->id > 0) {
/* /*
* Latest interventions * Latest interventions
*/ */
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity"; $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
$sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " WHERE f.fk_soc = s.rowid";
@ -1564,7 +1564,7 @@ if ($object->id > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
} }
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status == 1) { if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer && $object->status == 1) {
$langs->load("fichinter"); $langs->load("fichinter");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
} }

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
@ -104,7 +104,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
$supplierorderstatic = new CommandeFournisseur($db); $supplierorderstatic = new CommandeFournisseur($db);
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$fichinterstatic = new Fichinter($db); $fichinterstatic = new Fichinter($db);
} }
@ -519,7 +519,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
/* /*
* Draft interventionals * Draft interventionals
*/ */
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut"; $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -55,7 +55,7 @@ if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
if (!empty($conf->variants->enabled)) { if (isModEnabled('variants')) {
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
} }
@ -256,7 +256,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -281,10 +281,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -326,8 +326,8 @@ if (empty($reshook)) {
} elseif (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { } elseif (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -347,8 +347,8 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -647,10 +647,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -746,7 +746,7 @@ if (empty($reshook)) {
$ret = $deposit->fetch($deposit->id); // Reload to get new records $ret = $deposit->fetch($deposit->id); // Reload to get new records
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($deposit->thirdparty->default_lang); $outputlangs->setDefaultLang($deposit->thirdparty->default_lang);
$outputlangs->load('products'); $outputlangs->load('products');
@ -877,7 +877,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -976,7 +976,7 @@ if (empty($reshook)) {
$error++; $error++;
} }
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
if ($combinations = GETPOST('combinations', 'array')) { if ($combinations = GETPOST('combinations', 'array')) {
//Check if there is a product with the given combination //Check if there is a product with the given combination
$prodcomb = new ProductCombination($db); $prodcomb = new ProductCombination($db);
@ -1133,7 +1133,7 @@ if (empty($reshook)) {
$desc = ''; $desc = '';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -1167,7 +1167,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) { if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@ -1268,7 +1268,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1442,7 +1442,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -1696,7 +1696,7 @@ if ($action == 'create') {
if ($soc->fk_warehouse > 0) { if ($soc->fk_warehouse > 0) {
$warehouse_id = $soc->fk_warehouse; $warehouse_id = $soc->fk_warehouse;
} }
if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
$warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; $warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
} }
@ -1836,7 +1836,7 @@ if ($action == 'create') {
} }
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">'; print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
@ -2209,7 +2209,7 @@ if ($action == 'create') {
} }
} }
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$formquestion = array_merge($formquestion, array( $formquestion = array_merge($formquestion, array(
@ -2248,7 +2248,7 @@ if ($action == 'create') {
} }
$text = $langs->trans('ConfirmValidateProp', $numref); $text = $langs->trans('ConfirmValidateProp', $numref);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
@ -2520,7 +2520,7 @@ if ($action == 'create') {
} }
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
$langs->load('stocks'); $langs->load('stocks');
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -2880,7 +2880,7 @@ if ($action == 'create') {
} }
// Create an intervention // Create an intervention
if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateintervention) { if ($usercancreateintervention) {
$langs->load("interventions"); $langs->load("interventions");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>';

View File

@ -1901,7 +1901,7 @@ class Propal extends CommonObject
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product); $tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs(); $tmpproduct->getMultiLangs();
@ -2660,7 +2660,7 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -2753,7 +2753,7 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);

View File

@ -1095,7 +1095,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx')); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'));
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';

View File

@ -58,7 +58,7 @@ if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }
if (!empty($conf->variants->enabled)) { if (isModEnabled('variants')) {
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
} }
@ -66,10 +66,10 @@ if (!empty($conf->variants->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('orders', 'sendings', 'companies', 'bills', 'propal', 'deliveries', 'products', 'other')); $langs->loadLangs(array('orders', 'sendings', 'companies', 'bills', 'propal', 'deliveries', 'products', 'other'));
if (!empty($conf->incoterm->enabled)) { if (isModEnabled('incoterm')) {
$langs->load('incoterm'); $langs->load('incoterm');
} }
if (!empty($conf->margin->enabled)) { if (isModEnabled('margin')) {
$langs->load('margins'); $langs->load('margins');
} }
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
@ -228,10 +228,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -591,7 +591,7 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -603,7 +603,7 @@ if (empty($reshook)) {
$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
} elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) { } elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) {
// Set incoterm // Set incoterm
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
if ($result < 0) { if ($result < 0) {
@ -724,7 +724,7 @@ if (empty($reshook)) {
$error++; $error++;
} }
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') {
if ($combinations = GETPOST('combinations', 'array')) { if ($combinations = GETPOST('combinations', 'array')) {
//Check if there is a product with the given combination //Check if there is a product with the given combination
$prodcomb = new ProductCombination($db); $prodcomb = new ProductCombination($db);
@ -875,7 +875,7 @@ if (empty($reshook)) {
$desc = ''; $desc = '';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -909,7 +909,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) { if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@ -1008,7 +1008,7 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1183,10 +1183,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1242,7 +1242,7 @@ if (empty($reshook)) {
} }
// Check parameters // Check parameters
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
if (!$idwarehouse || $idwarehouse == -1) { if (!$idwarehouse || $idwarehouse == -1) {
$error++; $error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
@ -1262,7 +1262,7 @@ if (empty($reshook)) {
if ( if (
GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
&& !empty($conf->facture->enabled) && !empty($user->rights->facture->creer) && isModEnabled('facture') && !empty($user->rights->facture->creer)
) { ) {
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
@ -1336,7 +1336,7 @@ if (empty($reshook)) {
} }
// Check parameters // Check parameters
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
if (!$idwarehouse || $idwarehouse == -1) { if (!$idwarehouse || $idwarehouse == -1) {
$error++; $error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
@ -1351,10 +1351,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1384,7 +1384,7 @@ if (empty($reshook)) {
} }
// Check parameters // Check parameters
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
if (!$idwarehouse || $idwarehouse == -1) { if (!$idwarehouse || $idwarehouse == -1) {
$error++; $error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
@ -1705,7 +1705,7 @@ if ($action == 'create' && $usercancreate) {
if ($soc->fk_warehouse > 0) { if ($soc->fk_warehouse > 0) {
$warehouse_id = $soc->fk_warehouse; $warehouse_id = $soc->fk_warehouse;
} }
if (!empty($conf->stock->enabled) && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && empty($warehouse_id) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
$warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE; $warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
} }
@ -1838,7 +1838,7 @@ if ($action == 'create' && $usercancreate) {
} }
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
print '<tr><td>'.$langs->trans('Warehouse').'</td><td>'; print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
@ -2062,7 +2062,7 @@ if ($action == 'create' && $usercancreate) {
} }
$text = $langs->trans('ConfirmValidateOrder', $numref); $text = $langs->trans('ConfirmValidateOrder', $numref);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
@ -2077,7 +2077,7 @@ if ($action == 'create' && $usercancreate) {
} }
$formquestion = array(); $formquestion = array();
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
$langs->load("stocks"); $langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -2231,7 +2231,7 @@ if ($action == 'create' && $usercancreate) {
$text = $langs->trans('ConfirmUnvalidateOrder', $object->ref); $text = $langs->trans('ConfirmUnvalidateOrder', $object->ref);
$formquestion = array(); $formquestion = array();
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
$langs->load("stocks"); $langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -2270,7 +2270,7 @@ if ($action == 'create' && $usercancreate) {
$text = $langs->trans('ConfirmCancelOrder', $object->ref); $text = $langs->trans('ConfirmCancelOrder', $object->ref);
$formquestion = array(); $formquestion = array();
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change) {
$langs->load("stocks"); $langs->load("stocks");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -2483,7 +2483,7 @@ if ($action == 'create' && $usercancreate) {
} }
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
$langs->load('stocks'); $langs->load('stocks');
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -2827,7 +2827,7 @@ if ($action == 'create' && $usercancreate) {
} }
// Create intervention // Create intervention
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$langs->load("interventions"); $langs->load("interventions");
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {

View File

@ -514,7 +514,7 @@ class Commande extends CommonOrder
if (!$error) { if (!$error) {
// If stock is incremented on validate order, we must increment it // If stock is incremented on validate order, we must increment it
if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -642,7 +642,7 @@ class Commande extends CommonOrder
} }
// If stock is decremented on validate order, we must reincrement it // If stock is decremented on validate order, we must reincrement it
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
$result = 0; $result = 0;
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
@ -827,7 +827,7 @@ class Commande extends CommonOrder
dol_syslog(get_class($this)."::cancel", LOG_DEBUG); dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
if ($this->db->query($sql)) { if ($this->db->query($sql)) {
// If stock is decremented on validate order, we must reincrement it // If stock is decremented on validate order, we must reincrement it
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -2143,7 +2143,7 @@ class Commande extends CommonOrder
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product); $tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs(); $tmpproduct->getMultiLangs();

View File

@ -1305,7 +1305,7 @@ if ($resql) {
print $langs->trans('ValidateInvoices'); print $langs->trans('ValidateInvoices');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { if (isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
print $form->selectyesno('validate_invoices', 0, 1, 1); print $form->selectyesno('validate_invoices', 0, 1, 1);
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')'; print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
} else { } else {
@ -1371,7 +1371,7 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If Stock is enabled // If Stock is enabled
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
@ -2385,7 +2385,7 @@ if ($resql) {
// Show shippable Icon (this creates subloops, so may be slow) // Show shippable Icon (this creates subloops, so may be slow)
if (!empty($arrayfields['shippable']['checked'])) { if (!empty($arrayfields['shippable']['checked'])) {
print '<td class="center">'; print '<td class="center">';
if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) { if (!empty($show_shippable_command) && isModEnabled('stock')) {
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) { if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
$generic_commande->getLinesArray(); // Load array ->lines $generic_commande->getLinesArray(); // Load array ->lines
$generic_commande->loadExpeditions(); // Load array ->expeditions $generic_commande->loadExpeditions(); // Load array ->expeditions

View File

@ -601,7 +601,7 @@ if (isModEnabled('multicompany') && is_object($mc)) {
print '<br>'; print '<br>';
// Project filter // Project filter
if (!empty($conf->projet->enabled)) { if (isModEnabled('projet')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
$langs->load('projects'); $langs->load('projects');
print '<span class="marginrightonly">'.$langs->trans('Project').":</span>"; print '<span class="marginrightonly">'.$langs->trans('Project').":</span>";

View File

@ -542,7 +542,7 @@ if (empty($reshook)) {
$desc = ''; $desc = '';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -567,7 +567,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) { if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@ -651,8 +651,8 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -858,9 +858,9 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id','aZ09'))
$newlang = GETPOST('lang_id','aZ09'); $newlang = GETPOST('lang_id','aZ09');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang))
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);

View File

@ -279,10 +279,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id')) {
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -527,10 +527,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -611,10 +611,10 @@ if (empty($reshook)) {
if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -666,10 +666,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -756,10 +756,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1963,10 +1963,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -2181,7 +2181,7 @@ if (empty($reshook)) {
$desc = ''; $desc = '';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -2216,7 +2216,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'alpha')) { if (empty($newlang) && GETPOST('lang_id', 'alpha')) {
@ -2339,10 +2339,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -2598,10 +2598,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -4119,7 +4119,7 @@ if ($action == 'create') {
} }
$text = $langs->trans('ConfirmValidateBill', $numref); $text = $langs->trans('ConfirmValidateBill', $numref);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';

View File

@ -602,10 +602,10 @@ class Facture extends CommonInvoice
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->thirdparty->default_lang)) {
$newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ... $newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ...
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->default_lang)) {
$newlang = $this->default_lang; // for thirdparty $newlang = $this->default_lang; // for thirdparty
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1012,7 +1012,7 @@ class Facture extends CommonInvoice
// else we get the best supplier price // else we get the best supplier price
if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) {
$buyprice = $producttmp->cost_price; $buyprice = $producttmp->cost_price;
} elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { } elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
$buyprice = $producttmp->pmp; $buyprice = $producttmp->pmp;
} else { } else {
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) {
@ -2193,7 +2193,7 @@ class Facture extends CommonInvoice
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product); $tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs(); $tmpproduct->getMultiLangs();
@ -2655,7 +2655,7 @@ class Facture extends CommonInvoice
} }
// If we decrease stock on invoice validation, we increase back if a warehouse id was provided // If we decrease stock on invoice validation, we increase back if a warehouse id was provided
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) { if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse != -1) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -3162,7 +3162,7 @@ class Facture extends CommonInvoice
$result = $this->thirdparty->set_as_client(); $result = $this->thirdparty->set_as_client();
// If active we decrement the main product and its components at invoice validation // If active we decrement the main product and its components at invoice validation
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) { if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -3475,7 +3475,7 @@ class Facture extends CommonInvoice
} }
// If we decrease stock on invoice validation, we increase back // If we decrease stock on invoice validation, we increase back
if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");

View File

@ -139,10 +139,10 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -190,10 +190,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque-
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -232,10 +232,10 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang; //if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);

View File

@ -455,7 +455,7 @@ class Paiement extends CommonObject
$newlang = ''; $newlang = '';
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$invoice->fetch_thirdparty(); $invoice->fetch_thirdparty();
$newlang = $invoice->thirdparty->default_lang; $newlang = $invoice->thirdparty->default_lang;
} }

View File

@ -884,7 +884,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
//Default language //Default language
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n"; print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print '</td>'; print '</td>';
@ -1171,7 +1171,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
//Default language //Default language
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n"; print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language(GETPOST('default_lang', 'alpha') ? GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
print '</td>'; print '</td>';
@ -1398,7 +1398,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
// Default language // Default language
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td>'.$langs->trans("DefaultLang").'</td><td>'; print '<tr><td>'.$langs->trans("DefaultLang").'</td><td>';
//$s=picto_from_langcode($object->default_lang); //$s=picto_from_langcode($object->default_lang);

View File

@ -170,7 +170,7 @@ if ($object->thirdparty->client) {
} }
} }
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
} }
@ -497,7 +497,7 @@ if ($sql_select) {
// Product // Product
if ($objp->fk_product > 0) { if ($objp->fk_product > 0) {
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($objp->fk_product); $prod->fetch($objp->fk_product);

View File

@ -87,7 +87,7 @@ if ($id > 0) {
/* /*
* Affichage onglets * Affichage onglets
*/ */
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }

View File

@ -68,7 +68,7 @@ if ($id) {
} }
llxHeader('', $title); llxHeader('', $title);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = contact_prepare_head($object); $head = contact_prepare_head($object);

View File

@ -138,7 +138,7 @@ if ($id > 0) {
} }
llxHeader('', $title); llxHeader('', $title);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
$langs->load("mails"); $langs->load("mails");
} }
$head = contract_prepare_head($object); $head = contract_prepare_head($object);

View File

@ -292,7 +292,7 @@ if (empty($reshook)) {
$product_static = new Product($db); $product_static = new Product($db);
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod = new Product($db); $prod = new Product($db);
$prod->id = $lines[$i]->fk_product; $prod->id = $lines[$i]->fk_product;
$prod->getMultiLangs(); $prod->getMultiLangs();
@ -618,10 +618,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -795,10 +795,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -874,7 +874,7 @@ class Contrat extends CommonObject
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs // multilangs
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($objp->fk_product) && !empty($loadalsotranslation)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($objp->fk_product) && !empty($loadalsotranslation)) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$tmpproduct->fetch($objp->fk_product); $tmpproduct->fetch($objp->fk_product);
$tmpproduct->getMultiLangs(); $tmpproduct->getMultiLangs();

View File

@ -366,10 +366,10 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($object->thirdparty)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -405,10 +405,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -442,10 +442,10 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -486,10 +486,10 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -66,13 +66,13 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc)))
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->thirdparty->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->thirdparty->default_lang)) {
$newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ... $newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ...
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->default_lang)) {
$newlang = $object->default_lang; // for thirdparty $newlang = $object->default_lang; // for thirdparty
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -34,10 +34,10 @@ if ($action == 'up' && $permissiontoedit) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -59,10 +59,10 @@ if ($action == 'down' && $permissiontoedit) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -615,6 +615,9 @@ if (!$error && $massaction == 'confirm_presend') {
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') { if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') {
$triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; $triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
} }
if ($triggername == 'PROJET_SENTBYMAIL') {
$triggername = 'PROJECT_SENTBYMAIL';
}
if (!empty($triggername)) { if (!empty($triggername)) {
// Call trigger // Call trigger
@ -763,10 +766,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
// Define output language (Here it is not used because we do only merging existing PDF) // Define output language (Here it is not used because we do only merging existing PDF)
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//elseif (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty //elseif (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty
// $newlang = $objecttmp->thirdparty->default_lang; // $newlang = $objecttmp->thirdparty->default_lang;
//} //}
if (!empty($newlang)) { if (!empty($newlang)) {
@ -912,12 +915,12 @@ if ($action == 'remove_file') {
if (!$error && $massaction == 'validate' && $permissiontoadd) { if (!$error && $massaction == 'validate' && $permissiontoadd) {
$objecttmp = new $objectclass($db); $objecttmp = new $objectclass($db);
if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) { if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
$error++; $error++;
} }
if ($objecttmp->element == 'invoice_supplier' && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { if ($objecttmp->element == 'invoice_supplier' && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
$error++; $error++;
@ -965,10 +968,10 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $objecttmp->thirdparty->default_lang; $newlang = $objecttmp->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1116,13 +1119,13 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->thirdparty->default_lang)) {
$newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ...
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($objecttmp->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) {
$newlang = $objecttmp->default_lang; // for thirdparty $newlang = $objecttmp->default_lang; // for thirdparty
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -45,10 +45,10 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -119,7 +119,7 @@ class box_produits extends ModeleBoxes
$datem = $this->db->jdate($objp->tms); $datem = $this->db->jdate($objp->tms);
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sqld = "SELECT label"; $sqld = "SELECT label";
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sqld .= " WHERE fk_product = ".((int) $objp->rowid); $sqld .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$this->db = $db; $this->db = $db;
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock'); $tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1); $this->hidden = ($showmode != 1);
} }
@ -126,7 +126,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$price_base_type = ''; $price_base_type = '';
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sqld = "SELECT label"; $sqld = "SELECT label";
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sqld .= " WHERE fk_product = ".((int) $objp->rowid); $sqld .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -4989,7 +4989,7 @@ abstract class CommonObject
$text = $product_static->getNomUrl(1); $text = $product_static->getNomUrl(1);
// Define output language and label // Define output language and label
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { if (property_exists($this, 'socid') && !is_object($this->thirdparty)) {
dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before');
return; return;

View File

@ -2313,7 +2313,7 @@ class Form
} }
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
if (!empty($conf->variants->enabled) && is_array($selected_combinations)) { if (isModEnabled('variants') && is_array($selected_combinations)) {
// Code to automatically insert with javascript the select of attributes under the select of product // Code to automatically insert with javascript the select of attributes under the select of product
// when a parent of variant has been selected. // when a parent of variant has been selected.
$out .= ' $out .= '
@ -2562,7 +2562,7 @@ class Form
} }
// Multilang : we add translation // Multilang : we add translation
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= ", pl.label as label_translated"; $sql .= ", pl.label as label_translated";
$sql .= ", pl.description as description_translated"; $sql .= ", pl.description as description_translated";
$selectFields .= ", label_translated"; $selectFields .= ", label_translated";
@ -2605,7 +2605,7 @@ class Form
$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
} }
// Multilang : we add translation // Multilang : we add translation
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid ";
if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@ -2671,7 +2671,7 @@ class Form
$sql .= " AND "; $sql .= " AND ";
} }
$sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'";
} }
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
@ -2679,7 +2679,7 @@ class Form
} }
if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) {
$sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'";
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'";
} }
} }
@ -2885,7 +2885,7 @@ class Form
$outrefcust = empty($objp->custref) ? '' : $objp->custref; $outrefcust = empty($objp->custref) ? '' : $objp->custref;
$outlabel = $objp->label; $outlabel = $objp->label;
$outdesc = $objp->description; $outdesc = $objp->description;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$outlabel_translated = $objp->label_translated; $outlabel_translated = $objp->label_translated;
$outdesc_translated = $objp->description_translated; $outdesc_translated = $objp->description_translated;
} }
@ -2944,7 +2944,7 @@ class Form
if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) {
$opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"';
} }
if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (!empty($user->rights->stock->lire)) { if (!empty($user->rights->stock->lire)) {
if ($objp->stock > 0) { if ($objp->stock > 0) {
$opt .= ' class="product_line_stock_ok"'; $opt .= ' class="product_line_stock_ok"';
@ -3101,7 +3101,7 @@ class Form
$outdefault_vat_code = $objp->default_vat_code; $outdefault_vat_code = $objp->default_vat_code;
} }
if (!empty($conf->stock->enabled) && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (!empty($user->rights->stock->lire)) { if (!empty($user->rights->stock->lire)) {
$opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'));
@ -3486,7 +3486,7 @@ class Form
} }
} }
if (!empty($conf->stock->enabled) && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
$novirtualstock = ($showstockinlist == 2); $novirtualstock = ($showstockinlist == 2);
if (!empty($user->rights->stock->lire)) { if (!empty($user->rights->stock->lire)) {
@ -8614,7 +8614,7 @@ class Form
} }
} elseif ($objecttype == 'ficheinter') { } elseif ($objecttype == 'ficheinter') {
$tplpath = 'fichinter'; $tplpath = 'fichinter';
if (empty($conf->ficheinter->enabled)) { if (!isModEnabled('ficheinter')) {
continue; // Do not show if module disabled continue; // Do not show if module disabled
} }
} elseif ($objecttype == 'invoice_supplier') { } elseif ($objecttype == 'invoice_supplier') {

View File

@ -1026,7 +1026,7 @@ class FormCompany extends Form
public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '') public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '', $allowempty = '')
{ {
global $conf, $langs; global $conf, $langs;
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->fournisseur->enabled)) { if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && !isModEnabled('fournisseur')) {
return '' ; return '' ;
} }

View File

@ -728,7 +728,7 @@ class FormFile
} }
// Language code (if multilang) // Language code (if multilang)
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) { if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && getDolGlobalInt('MAIN_MULTILANGS') && !$forcenomultilang && (!empty($modellist) || $showempty)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db); $formadmin = new FormAdmin($this->db);
$defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang(); $defaultlang = ($codelang && $codelang != 'auto') ? $codelang : $langs->getDefaultLang();

View File

@ -401,7 +401,7 @@ class FormMail extends Form
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($this->param['langsmodels'])) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($this->param['langsmodels'])) {
$newlang = $this->param['langsmodels']; $newlang = $this->param['langsmodels'];
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1634,7 +1634,7 @@ class FormMail extends Form
if (isModEnabled('adherent')) { if (isModEnabled('adherent')) {
$tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
$tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation';
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -1651,7 +1651,7 @@ class FormMail extends Form
if (isModEnabled('adherent')) { if (isModEnabled('adherent')) {
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
$tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation';
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {

View File

@ -1264,7 +1264,7 @@ class FormTicket
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->param['langsmodels']; $newlang = $this->param['langsmodels'];
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1311,7 +1311,7 @@ class FormTicket
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $this->param['langsmodels']; $newlang = $this->param['langsmodels'];
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -49,7 +49,7 @@ function categories_prepare_head(Categorie $object, $type)
$head[$h][2] = 'photos'; $head[$h][2] = 'photos';
$h++; $h++;
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&amp;type='.$type; $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&amp;type='.$type;
$head[$h][1] = $langs->trans("Translation"); $head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation'; $head[$h][2] = 'translation';

View File

@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
} }
// Related items // Related items
if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Referers"); $head[$tab][1] = $langs->trans("Referers");
$head[$tab][2] = 'consumption'; $head[$tab][2] = 'consumption';

View File

@ -57,7 +57,7 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu
if ($idprod) { if ($idprod) {
$prodser->fetch($idprod); $prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated // If a predefined product and multilang and on other lang, we renamed label with label translated
if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) { if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) {
$label = $prodser->multilangs[$outputlangs->defaultlang]["label"]; $label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
} }

View File

@ -2948,7 +2948,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) { if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1; $accessallowed = 1;
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file; $original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file;
} }
} elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) { } elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) {

View File

@ -157,7 +157,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object)
$h++; $h++;
} }
if (!empty($conf->stock->enabled) && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) { if (isModEnabled('stock') && (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE))) {
$langs->load("stocks"); $langs->load("stocks");
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
$head[$h][1] = $langs->trans("OrderDispatch"); $head[$h][1] = $langs->trans("OrderDispatch");

View File

@ -7404,7 +7404,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/ $substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
} }
// add variables subtitutions ticket // add variables subtitutions ticket
if (!empty($conf->ticket->enabled) && (!is_object($object) || $object->element == 'ticket')) { if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket')) {
$substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__'; $substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__';
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__'; $substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__'; $substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';

View File

@ -149,7 +149,7 @@ function member_type_prepare_head(AdherentType $object)
$h++; $h++;
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT."/adherents/type_translation.php?rowid=".$object->id; $head[$h][0] = DOL_URL_ROOT."/adherents/type_translation.php?rowid=".$object->id;
$head[$h][1] = $langs->trans("Translation"); $head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation'; $head[$h][2] = 'translation';

View File

@ -1420,7 +1420,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if ($idprod) { if ($idprod) {
$prodser->fetch($idprod); $prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated // If a predefined product and multilang and on other lang, we renamed label with label translated
if (!empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it) $translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation // TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation

View File

@ -74,7 +74,7 @@ function product_prepare_head($object)
} }
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id;
$head[$h][1] = $langs->trans("Translation"); $head[$h][1] = $langs->trans("Translation");
$head[$h][2] = 'translation'; $head[$h][2] = 'translation';
@ -94,7 +94,7 @@ function product_prepare_head($object)
$h++; $h++;
} }
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) {
global $db; global $db;
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
@ -115,7 +115,7 @@ function product_prepare_head($object)
} }
if ($object->isProduct() || ($object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { // If physical product we can stock (or service with option) if ($object->isProduct() || ($object->isService() && !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { // If physical product we can stock (or service with option)
if (!empty($conf->stock->enabled) && $user->rights->stock->lire) { if (isModEnabled('stock') && $user->rights->stock->lire) {
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id;
$head[$h][1] = $langs->trans("Stock"); $head[$h][1] = $langs->trans("Stock");
$head[$h][2] = 'stock'; $head[$h][2] = 'stock';
@ -547,7 +547,7 @@ function show_stats_for_company($product, $socid)
} }
// BOM // BOM
if (!empty($conf->bom->enabled) && $user->rights->bom->read) { if (isModEnabled('bom') && $user->rights->bom->read) {
$nblines++; $nblines++;
$ret = $product->load_stats_bom($socid); $ret = $product->load_stats_bom($socid);
if ($ret < 0) { if ($ret < 0) {

View File

@ -127,7 +127,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
|| isModEnabled("propal") || isModEnabled('commande') || isModEnabled("propal") || isModEnabled('commande')
|| isModEnabled('facture') || isModEnabled('contrat') || isModEnabled('facture') || isModEnabled('contrat')
|| !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { || isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) {
$nbElements = 0; $nbElements = 0;
// Enable caching of thirdrparty count Contacts // Enable caching of thirdrparty count Contacts
$cachekey = 'count_elements_project_'.$project->id; $cachekey = 'count_elements_project_'.$project->id;
@ -135,7 +135,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!is_null($dataretrieved)) { if (!is_null($dataretrieved)) {
$nbElements = $dataretrieved; $nbElements = $dataretrieved;
} else { } else {
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project'); $nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project');
} }
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
@ -162,7 +162,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('contrat')) { if (isModEnabled('contrat')) {
$nbElements += $project->getElementCount('contract', 'contrat'); $nbElements += $project->getElementCount('contract', 'contrat');
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$nbElements += $project->getElementCount('intervention', 'fichinter'); $nbElements += $project->getElementCount('intervention', 'fichinter');
} }
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
@ -177,7 +177,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('expensereport')) { if (isModEnabled('expensereport')) {
$nbElements += $project->getElementCount('expensereport', 'expensereport'); $nbElements += $project->getElementCount('expensereport', 'expensereport');
} }
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
$nbElements += $project->getElementCount('donation', 'don'); $nbElements += $project->getElementCount('donation', 'don');
} }
if (!empty($conf->loan->enabled)) { if (!empty($conf->loan->enabled)) {
@ -189,7 +189,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('project')) { if (isModEnabled('project')) {
$nbElements += $project->getElementCount('project_task', 'projet_task'); $nbElements += $project->getElementCount('project_task', 'projet_task');
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$nbElements += $project->getElementCount('stock_mouvement', 'stock'); $nbElements += $project->getElementCount('stock_mouvement', 'stock');
} }
if (!empty($conf->salaries->enabled)) { if (!empty($conf->salaries->enabled)) {

View File

@ -276,7 +276,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
print '<td class="center">'.$langs->trans("DateCreation").'</td>'; print '<td class="center">'.$langs->trans("DateCreation").'</td>';
print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<td class="center">'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>'; print '<td class="center">'.$langs->trans("QtyPreparedOrShipped").'</td>';
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td>'.$langs->trans("Warehouse").'</td>'; print '<td>'.$langs->trans("Warehouse").'</td>';
} }
/*TODO Add link to expeditiondet_batch /*TODO Add link to expeditiondet_batch
@ -305,7 +305,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
// Description // Description
if ($objp->fk_product > 0) { if ($objp->fk_product > 0) {
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$object = new $origin($db); $object = new $origin($db);
$object->fetch($origin_id); $object->fetch($origin_id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -385,7 +385,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
print '<td class="center">'.$objp->qty_shipped.'</td>'; print '<td class="center">'.$objp->qty_shipped.'</td>';
// Warehouse // Warehouse
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td>'; print '<td>';
if ($objp->warehouse_id > 0) { if ($objp->warehouse_id > 0) {
$warehousestatic->fetch($objp->warehouse_id); $warehousestatic->fetch($objp->warehouse_id);

View File

@ -107,7 +107,7 @@ function user_prepare_head(User $object)
} }
// Notifications // Notifications
if ($user->socid == 0 && !empty($conf->notification->enabled)) { if ($user->socid == 0 && isModEnabled('notification')) {
$nbNote = 0; $nbNote = 0;
$sql = "SELECT COUNT(n.rowid) as nb"; $sql = "SELECT COUNT(n.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n";

View File

@ -316,7 +316,7 @@ class mailing_thirdparties extends MailingTargets
$s .= '</select>'; $s .= '</select>';
$s .= ajax_combobox("filter_status_thirdparties"); $s .= ajax_combobox("filter_status_thirdparties");
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Choose language // Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db); $formadmin = new FormAdmin($this->db);

View File

@ -162,7 +162,7 @@ class modBanque extends DolibarrModules
"s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company" "s.nom"=>"company", "s.code_compta"=>"company", "s.code_compta_fournisseur"=>"company"
); );
$this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG'); $this->export_special_array[$r] = array('-b.amount'=>'NULLIFNEG', 'b.amount'=>'NULLIFNEG');
if ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled) || empty($conf->supplier_invoice->enabled)) { if ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order') || !isModEnabled('supplier_invoice')) {
unset($this->export_fields_array[$r]['s.code_compta_fournisseur']); unset($this->export_fields_array[$r]['s.code_compta_fournisseur']);
unset($this->export_entities_array[$r]['s.code_compta_fournisseur']); unset($this->export_entities_array[$r]['s.code_compta_fournisseur']);
} }

View File

@ -154,7 +154,7 @@ class modCategorie extends DolibarrModules
if (!empty($conf->bank->enabled)) { if (!empty($conf->bank->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."8=Bank line"; $typeexample .= ($typeexample ? " / " : "")."8=Bank line";
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$typeexample .= ($typeexample ? " / " : "")."9=Warehouse"; $typeexample .= ($typeexample ? " / " : "")."9=Warehouse";
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {
@ -180,7 +180,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0]; $this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0];
$this->export_label[$r] = 'CatProdList'; $this->export_label[$r] = 'CatProdList';
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->enabled)'; $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label');
$this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text');

View File

@ -214,7 +214,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('e.ref'=>'DefaultWarehouse', 'p.tobatch'=>'ManageLotSerial', 'p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -230,7 +230,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote'));
} }
if (!empty($conf->global->PRODUCT_USE_UNITS)) { if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -252,7 +252,7 @@ class modProduct extends DolibarrModules
'p.tva_tx'=>'Numeric', 'p.tva_tx'=>'Numeric',
'p.datec'=>'Date', 'p.tms'=>'Date' 'p.datec'=>'Date', 'p.tms'=>'Date'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('e.ref'=>'Text', 'p.tobatch'=>'Numeric', 'p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -261,7 +261,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@ -271,7 +271,7 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category'));
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -280,13 +280,13 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_dependencies_array[$r] = array('category'=>'p.rowid'); $this->export_dependencies_array[$r] = array('category'=>'p.rowid');
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -295,7 +295,7 @@ class modProduct extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@ -309,14 +309,14 @@ class modProduct extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid';
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
} }
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON e.rowid = p.fk_default_warehouse'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON e.rowid = p.fk_default_warehouse';
} }
$this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')'; $this->export_sql_end[$r] .= ' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
@ -409,7 +409,7 @@ class modProduct extends DolibarrModules
'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell", 'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell",
'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification' 'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -425,7 +425,7 @@ class modProduct extends DolibarrModules
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean",
'p.datec'=>'Date', 'p.tms'=>'Date' 'p.datec'=>'Date', 'p.tms'=>'Date'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -441,7 +441,7 @@ class modProduct extends DolibarrModules
'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct", 'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct",
'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct" 'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct"
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -601,7 +601,7 @@ class modProduct extends DolibarrModules
'p.recuperableonly' => '^[0|1]$', 'p.recuperableonly' => '^[0|1]$',
); );
if (!empty($conf->stock->enabled)) {//if Stock module enabled if (isModEnabled('stock')) {//if Stock module enabled
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.fk_default_warehouse'=>'DefaultWarehouse', 'p.fk_default_warehouse'=>'DefaultWarehouse',
'p.tobatch'=>'ManageLotSerial', 'p.tobatch'=>'ManageLotSerial',
@ -710,7 +710,7 @@ class modProduct extends DolibarrModules
'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"' 'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"'
); );
//clauses copied from import_fields_array //clauses copied from import_fields_array
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$import_sample = array_merge($import_sample, array( $import_sample = array_merge($import_sample, array(
'p.tobatch'=>"0 (don't use) / 1 (use batch) / 2 (use serial number)", 'p.tobatch'=>"0 (don't use) / 1 (use batch) / 2 (use serial number)",
'p.seuil_stock_alerte' => '', 'p.seuil_stock_alerte' => '',
@ -905,7 +905,7 @@ class modProduct extends DolibarrModules
'pr.date_price'=>'2020-12-31'); 'pr.date_price'=>'2020-12-31');
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Import translations of product names and descriptions // Import translations of product names and descriptions
$r++; $r++;
$this->import_code[$r] = $this->rights_class.'_languages'; $this->import_code[$r] = $this->rights_class.'_languages';

View File

@ -179,7 +179,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") || !empty($conf->margin->enabled)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -195,7 +195,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('group_concat(cat.label)'=>'Categories'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel', 'l.description'=>'TranslatedDescription', 'l.note'=>'TranslatedNote'));
} }
if (!empty($conf->global->PRODUCT_USE_UNITS)) { if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -215,7 +215,7 @@ class modService extends DolibarrModules
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric',
'p.datec'=>'Date', 'p.tms'=>'Date' 'p.datec'=>'Date', 'p.tms'=>'Date'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -224,7 +224,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('s.nom'=>'Text', 'pf.ref_fourn'=>'Text', 'pf.unitprice'=>'Numeric', 'pf.quantity'=>'Numeric', 'pf.remise_percent'=>'Numeric', 'pf.delivery_time_days'=>'Numeric'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('l.lang'=>'Text', 'l.label'=>'Text', 'l.description'=>'Text', 'l.note'=>'Text'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@ -234,7 +234,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array("group_concat(cat.label)"=>'category'));
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -243,13 +243,13 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_dependencies_array[$r] = array('category'=>'p.rowid'); $this->export_dependencies_array[$r] = array('category'=>'p.rowid');
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'product', 'p.pmp'=>'product'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -258,7 +258,7 @@ class modService extends DolibarrModules
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('s.nom'=>'product_supplier_ref', 'pf.ref_fourn'=>'product_supplier_ref', 'pf.unitprice'=>'product_supplier_ref', 'pf.quantity'=>'product_supplier_ref', 'pf.remise_percent'=>'product_supplier_ref', 'pf.delivery_time_days'=>'product_supplier_ref'));
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('l.lang'=>'translation', 'l.label'=>'translation', 'l.description'=>'translation', 'l.note'=>'translation'));
} }
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
@ -272,7 +272,7 @@ class modService extends DolibarrModules
if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) { if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cp.fk_categorie = cat.rowid';
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lang as l ON l.fk_product = p.rowid';
} }
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
@ -368,7 +368,7 @@ class modService extends DolibarrModules
'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell", 'p.price_base_type'=>"PriceBase", 'p.price'=>"UnitPriceHT", 'p.price_ttc'=>"UnitPriceTTC", 'p.tva_tx'=>'VATRate', 'p.tosell'=>"OnSell",
'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification' 'p.tobuy'=>"OnBuy", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue')); $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.stock'=>'Stock', 'p.seuil_stock_alerte'=>'StockLimit', 'p.desiredstock'=>'DesiredStock', 'p.pmp'=>'PMPValue'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -384,7 +384,7 @@ class modService extends DolibarrModules
'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.price_base_type'=>"Text", 'p.price'=>"Numeric", 'p.price_ttc'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean",
'p.datec'=>'Date', 'p.tms'=>'Date' 'p.datec'=>'Date', 'p.tms'=>'Date'
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric')); $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', 'p.desiredstock'=>'Numeric', 'p.pmp'=>'Numeric', 'p.cost_price'=>'Numeric'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -400,7 +400,7 @@ class modService extends DolibarrModules
'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct", 'p.price_base_type'=>"virtualproduct", 'p.price'=>"virtualproduct", 'p.price_ttc'=>"virtualproduct", 'p.tva_tx'=>"virtualproduct",
'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct" 'p.tosell'=>"virtualproduct", 'p.tobuy'=>"virtualproduct", 'p.datec'=>"virtualproduct", 'p.tms'=>"virtualproduct"
); );
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct')); $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.stock'=>'virtualproduct', 'p.seuil_stock_alerte'=>'virtualproduct', 'p.desiredstock'=>'virtualproduct', 'p.pmp'=>'virtualproduct'));
} }
if (isModEnabled('barcode')) { if (isModEnabled('barcode')) {
@ -548,7 +548,7 @@ class modService extends DolibarrModules
'p.recuperableonly' => '^[0|1]$', 'p.recuperableonly' => '^[0|1]$',
); );
if (!empty($conf->stock->enabled)) {//if Stock module enabled if (isModEnabled('stock')) {//if Stock module enabled
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.fk_default_warehouse'=>'DefaultWarehouse', 'p.fk_default_warehouse'=>'DefaultWarehouse',
'p.tobatch'=>'ManageLotSerial', 'p.tobatch'=>'ManageLotSerial',
@ -656,7 +656,7 @@ class modService extends DolibarrModules
'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"' 'p.finished' => '0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.'c_product_nature"'
); );
//clauses copied from import_fields_array //clauses copied from import_fields_array
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$import_sample = array_merge($import_sample, array( $import_sample = array_merge($import_sample, array(
'p.seuil_stock_alerte' => '', 'p.seuil_stock_alerte' => '',
'p.pmp' => '0', 'p.pmp' => '0',
@ -834,7 +834,7 @@ class modService extends DolibarrModules
'pr.date_price'=>'2013-04-10'); 'pr.date_price'=>'2013-04-10');
} }
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
// Import translations of product names and descriptions // Import translations of product names and descriptions
$r++; $r++;
$this->import_code[$r] = $this->rights_class.'_languages'; $this->import_code[$r] = $this->rights_class.'_languages';

View File

@ -413,7 +413,7 @@ class modSociete extends DolibarrModules
't.libelle'=>"company", 't.libelle'=>"company",
's.entity'=>'company', 's.entity'=>'company',
); // We define here only fields that use another picto ); // We define here only fields that use another picto
if (empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if (!isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
unset($this->export_fields_array[$r]['s.code_fournisseur']); unset($this->export_fields_array[$r]['s.code_fournisseur']);
unset($this->export_entities_array[$r]['s.code_fournisseur']); unset($this->export_entities_array[$r]['s.code_fournisseur']);
} }

View File

@ -491,7 +491,7 @@ class pdf_standard extends ModelePDFMovement
$objp = $this->db->fetch_object($resql); $objp = $this->db->fetch_object($resql);
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sql = "SELECT label"; $sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid); $sql .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (isModEnabled('contrat')) { if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (isModEnabled('deplacement')) { if (isModEnabled('deplacement')) {

View File

@ -59,7 +59,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (isModEnabled('contrat')) { if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (isModEnabled('deplacement')) { if (isModEnabled('deplacement')) {

View File

@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales
// Find the desire PDF // Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db); $filetomerge = new Propalmergepdfproduct($this->db);
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else { } else {
$filetomerge->fetch_by_product($line->fk_product); $filetomerge->fetch_by_product($line->fk_product);

View File

@ -918,7 +918,7 @@ class pdf_cyan extends ModelePDFPropales
// Find the desire PDF // Find the desire PDF
$filetomerge = new Propalmergepdfproduct($this->db); $filetomerge = new Propalmergepdfproduct($this->db);
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
$filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang); $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
} else { } else {
$filetomerge->fetch_by_product($line->fk_product); $filetomerge->fetch_by_product($line->fk_product);

View File

@ -306,7 +306,7 @@ class pdf_standard extends ModelePDFStock
$objp = $this->db->fetch_object($resql); $objp = $this->db->fetch_object($resql);
// Multilangs // Multilangs
if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active if (getDolGlobalInt('MAIN_MULTILANGS')) { // si l'option est active
$sql = "SELECT label"; $sql = "SELECT label";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product = ".((int) $objp->rowid); $sql .= " WHERE fk_product = ".((int) $objp->rowid);

View File

@ -243,7 +243,7 @@ print '</td><td>'."\n";
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Customer Default Langauge // Customer Default Langauge
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$langs->trans("DefaultLang"); print '<tr><td>'.$langs->trans("DefaultLang");
if (!empty($array_query['cust_language'])) { if (!empty($array_query['cust_language'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');

View File

@ -63,7 +63,7 @@ if ($action == 'presend') {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
if (GETPOST('lang_id', 'aZ09')) { if (GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');

View File

@ -41,7 +41,7 @@ if (empty($object) || !is_object($object)) {
exit; exit;
} }
$usemargins = 0; $usemargins = 0;
if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) { if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) {
$usemargins = 1; $usemargins = 1;
} }
if (!isset($dateSelector)) { if (!isset($dateSelector)) {
@ -184,7 +184,7 @@ if ($nolinesbefore) {
$freelines = true; $freelines = true;
$forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service) $forceall = 1; // We always force all type for free lines (module product or service means we use predefined product or service)
if ($object->element == 'contrat') { if ($object->element == 'contrat') {
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { if (!isModEnabled('product') && !isModEnabled('service') && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
$forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set $forceall = -1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
} elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { } elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
$forceall = 3; $forceall = 3;
@ -196,7 +196,7 @@ if ($nolinesbefore) {
if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) { if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) {
echo '<label for="prod_entry_mode_free">'; echo '<label for="prod_entry_mode_free">';
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') ); //echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (!isModEnabled('product') || !isModEnabled('service')))?' checked':'') );
echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : ''); echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : '');
echo '> '; echo '> ';
// Show type selector // Show type selector
@ -207,7 +207,7 @@ if ($nolinesbefore) {
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
// Show type selector // Show type selector
if ($forceall >= 0) { if ($forceall >= 0) {
if (empty($conf->product->enabled) || empty($conf->service->enabled)) { if (!isModEnabled('product') || !isModEnabled('service')) {
echo $langs->trans("Type"); echo $langs->trans("Type");
} else { } else {
echo $langs->trans("FreeLineOfType"); echo $langs->trans("FreeLineOfType");
@ -230,17 +230,17 @@ if ($nolinesbefore) {
$labelforradio = ''; $labelforradio = '';
if (empty($conf->dol_optimize_smallscreen)) { if (empty($conf->dol_optimize_smallscreen)) {
if (empty($senderissupplier)) { if (empty($senderissupplier)) {
if (isModEnabled("product") && empty($conf->service->enabled)) { if (isModEnabled("product") && !isModEnabled('service')) {
$labelforradio = $langs->trans('PredefinedProductsToSell'); $labelforradio = $langs->trans('PredefinedProductsToSell');
} elseif ((empty($conf->product->enabled) && isModEnabled("service")) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) { } elseif ((!isModEnabled('product') && isModEnabled('service')) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) {
$labelforradio = $langs->trans('PredefinedServicesToSell'); $labelforradio = $langs->trans('PredefinedServicesToSell');
} else { } else {
$labelforradio = $langs->trans('PredefinedProductsAndServicesToSell'); $labelforradio = $langs->trans('PredefinedProductsAndServicesToSell');
} }
} else { } else {
if (isModEnabled("product") && empty($conf->service->enabled)) { if (isModEnabled("product") && !isModEnabled('service')) {
$labelforradio = $langs->trans('PredefinedProductsToPurchase'); $labelforradio = $langs->trans('PredefinedProductsToPurchase');
} elseif (empty($conf->product->enabled) && isModEnabled("service")) { } elseif (!isModEnabled('product') && isModEnabled('service')) {
$labelforradio = $langs->trans('PredefinedServicesToPurchase'); $labelforradio = $langs->trans('PredefinedServicesToPurchase');
} else { } else {
$labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase'); $labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase');
@ -338,7 +338,7 @@ if ($nolinesbefore) {
} }
if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("product") || isModEnabled("service")) {
echo '<br>'; echo '<br>';
if (!empty($conf->variants->enabled)) { if (isModEnabled('variants')) {
echo '<div id="attributes_box"></div>'; echo '<div id="attributes_box"></div>';
} }
} }
@ -763,7 +763,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
} }
<?php <?php
if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) { if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?> if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
var proddesc = data.desc_trans; var proddesc = data.desc_trans;
<?php <?php
} else { ?> } else { ?>

View File

@ -118,7 +118,7 @@ if (isModEnabled('adherent')) {
} }
print '<br>'; print '<br>';
} }
if (!empty($conf->don->enabled)) { if (isModEnabled('don')) {
print '<div id="donation"></div>'; print '<div id="donation"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'donation')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'donation')."</strong><br>\n";

View File

@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'TICKET_CREATE') { if ($action == 'TICKET_CREATE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// Auto link contract // Auto link contract
if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) { if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) {
$societe = new Societe($this->db); $societe = new Societe($this->db);
$company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); $company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]);
@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
} }
} }
// Automatically create intervention // Automatically create intervention
if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) { if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
$fichinter = new Fichinter($this->db); $fichinter = new Fichinter($this->db);
$fichinter->socid = (int) $object->fk_soc; $fichinter->socid = (int) $object->fk_soc;
$fichinter->fk_project = $projectid; $fichinter->fk_project = $projectid;

View File

@ -848,6 +848,19 @@ class InterfaceActionsAuto extends DolibarrTriggers
} }
$object->sendtoid = 0; $object->sendtoid = 0;
} elseif ($action == 'PROJECT_SENTBYMAIL') {
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
if (empty($object->actionmsg2)) {
$object->actionmsg2 = $langs->transnoentities("ProjectSentByEMail", $object->ref);
}
if (empty($object->actionmsg)) {
$object->actionmsg = $langs->transnoentities("ProjectSentByEMail", $object->ref);
}
// Parameters $object->sendtoid defined by caller
//$object->sendtoid=0;
} elseif ($action == 'TASK_CREATE') { } elseif ($action == 'TASK_CREATE') {
// Project tasks // Project tasks
// Load translation files required by the page // Load translation files required by the page

View File

@ -66,7 +66,7 @@ class InterfaceNotification extends DolibarrTriggers
*/ */
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{ {
if (empty($conf->notification) || empty($conf->notification->enabled)) { if (empty($conf->notification) || !isModEnabled('notification')) {
return 0; // Module not active, we do nothing return 0; // Module not active, we do nothing
} }
@ -135,9 +135,9 @@ class InterfaceNotification extends DolibarrTriggers
$element = $obj->elementtype; $element = $obj->elementtype;
// Exclude events if related module is disabled // Exclude events if related module is disabled
if ($element == 'order_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))) { if ($element == 'order_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_order'))) {
$qualified = 0; $qualified = 0;
} elseif ($element == 'invoice_supplier' && ((empty($conf->fournisseur->enabled) && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_invoice->enabled))) { } elseif ($element == 'invoice_supplier' && ((!isModEnabled('fournisseur') && !empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !isModEnabled('supplier_invoice'))) {
$qualified = 0; $qualified = 0;
} elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) {
$qualified = 0; $qualified = 0;

View File

@ -61,7 +61,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
{ {
$ok = 0; $ok = 0;
if (empty($conf->ticket) || empty($conf->ticket->enabled)) { if (empty($conf->ticket) || !isModEnabled('ticket')) {
return 0; // Module not active, we do nothing return 0; // Module not active, we do nothing
} }

View File

@ -118,7 +118,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?l='.$l.'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvalue">'; print '<input type="hidden" name="action" value="setvalue">';
print '<table>'; print '<table>';
if (!empty($conf->global->MAIN_MULTILANGS)) { if (getDolGlobalInt('MAIN_MULTILANGS')) {
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n"; print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
print img_picto('', 'language', 'class="pictofixedwidth"'); print img_picto('', 'language', 'class="pictofixedwidth"');
print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');

View File

@ -41,7 +41,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
if (!empty($conf->expedition_bon->enabled)) { if (!empty($conf->expedition_bon->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -104,7 +104,7 @@ if ($action == 'add') {
$object->commande_id = GETPOST("commande_id", 'int'); $object->commande_id = GETPOST("commande_id", 'int');
$object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->fk_incoterms = GETPOST('incoterm_id', 'int');
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) { if (!$conf->expedition_bon->enabled && isModEnabled('stock')) {
$expedition->entrepot_id = GETPOST('entrepot_id', 'int'); $expedition->entrepot_id = GETPOST('entrepot_id', 'int');
} }
@ -143,10 +143,10 @@ if ($action == 'add') {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -491,7 +491,7 @@ if ($action == 'create') {
print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n"; print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n";
print '</tr>';*/ print '</tr>';*/
if (!$conf->expedition_bon->enabled && !empty($conf->stock->enabled)) { if (!$conf->expedition_bon->enabled && isModEnabled('stock')) {
// Entrepot // Entrepot
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$entrepot->fetch($object->entrepot_id); $entrepot->fetch($object->entrepot_id);
@ -547,7 +547,7 @@ if ($action == 'create') {
$product->fetch($object->lines[$i]->fk_product); $product->fetch($object->lines[$i]->fk_product);
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {

View File

@ -120,10 +120,10 @@ if (empty($reshook)) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -350,8 +350,8 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) $newlang=$object->thirdparty->default_lang;
if (!empty($newlang)) if (!empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);

View File

@ -91,7 +91,7 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation');
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this
if (!empty($conf->don->enabled) && $user->rights->don->lire) { if (isModEnabled('don') && $user->rights->don->lire) {
$listofsearchfields['search_donation'] = array('text'=>'Donation'); $listofsearchfields['search_donation'] = array('text'=>'Donation');
} }

View File

@ -352,7 +352,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
$rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$langs->load("interventions"); $langs->load("interventions");
$rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
} }

View File

@ -147,7 +147,7 @@ if (isModEnabled('tax')) {
if (isModEnabled('project')) { if (isModEnabled('project')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
} }
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
} }
if (isModEnabled('expensereport')) { if (isModEnabled('expensereport')) {

View File

@ -391,7 +391,7 @@ if (empty($reshook)) {
} }
} elseif (!$error) { } elseif (!$error) {
$labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip"); $labelfieldmissing = $langs->transnoentitiesnoconv("QtyToShip");
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse"); $labelfieldmissing .= '/'.$langs->transnoentitiesnoconv("Warehouse");
} }
setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $labelfieldmissing), null, 'errors');
@ -437,10 +437,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -739,7 +739,7 @@ if (empty($reshook)) {
unset($_POST[$qty]); unset($_POST[$qty]);
} }
} }
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. } elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
$qty = "qtyl".$line_id; $qty = "qtyl".$line_id;
$line->id = $line_id; $line->id = $line_id;
$line->qty = GETPOST($qty, 'int'); $line->qty = GETPOST($qty, 'int');
@ -773,10 +773,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -865,7 +865,7 @@ if ($action == 'create') {
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
} }
@ -1077,7 +1077,7 @@ if ($action == 'create') {
} }
print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>'; print '<span id="autoreset" class="opacitymedium link cursor cursorpointer">'.img_picto($langs->trans("Reset"), 'eraser').'</span>';
print '</td>'; print '</td>';
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
if (empty($conf->productbatch->enabled)) { if (empty($conf->productbatch->enabled)) {
print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>'; print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
} else { } else {
@ -1212,7 +1212,7 @@ if ($action == 'create') {
} }
$warehouseObject = null; $warehouseObject = null;
if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection if (count($warehousePicking) == 1 || !($line->fk_product > 0) || !isModEnabled('stock')) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
print '<!-- Case warehouse already known or product not a predefined product -->'; print '<!-- Case warehouse already known or product not a predefined product -->';
//ship from preselected location //ship from preselected location
$stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number $stock = + (isset($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0); // Convert to number
@ -1240,7 +1240,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
// Stock // Stock
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td class="left">'; print '<td class="left">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ? if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Type of product need stock change ?
// Show warehouse combo list // Show warehouse combo list
@ -1423,7 +1423,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
// Stock // Stock
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td class="left">'; print '<td class="left">';
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print $tmpwarehouseObject->getNomUrl(0).' '; print $tmpwarehouseObject->getNomUrl(0).' ';
@ -1693,7 +1693,7 @@ if ($action == 'create') {
$text = $langs->trans("ConfirmValidateSending", $numref); $text = $langs->trans("ConfirmValidateSending", $numref);
if (!empty($conf->notification->enabled)) { if (isModEnabled('notification')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
@ -2045,7 +2045,7 @@ if ($action == 'create') {
} }
if ($action == 'editline') { if ($action == 'editline') {
$editColspan = 3; $editColspan = 3;
if (empty($conf->stock->enabled)) { if (!isModEnabled('stock')) {
$editColspan--; $editColspan--;
} }
if (empty($conf->productbatch->enabled)) { if (empty($conf->productbatch->enabled)) {
@ -2057,7 +2057,7 @@ if ($action == 'create') {
} else { } else {
print $langs->trans("QtyShipped").' - '; print $langs->trans("QtyShipped").' - ';
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print $langs->trans("WarehouseSource").' - '; print $langs->trans("WarehouseSource").' - ';
} }
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
@ -2070,7 +2070,7 @@ if ($action == 'create') {
} else { } else {
print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>'; print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>';
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>';
} }
@ -2090,7 +2090,7 @@ if ($action == 'create') {
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$newlang = ''; $newlang = '';
if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (empty($newlang) && GETPOST('lang_id', 'aZ09')) {
@ -2169,7 +2169,7 @@ if ($action == 'create') {
// Predefined product or service // Predefined product or service
if ($lines[$i]->fk_product > 0) { if ($lines[$i]->fk_product > 0) {
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($lines[$i]->fk_product); $prod->fetch($lines[$i]->fk_product);
$label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label;
@ -2255,7 +2255,7 @@ if ($action == 'create') {
print $shipment_static->getNomUrl(1); print $shipment_static->getNomUrl(1);
print ' - '.$shipmentline_var['qty_shipped']; print ' - '.$shipmentline_var['qty_shipped'];
$htmltext = $langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour')); $htmltext = $langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($shipmentline_var['date_valid'], 'dayhour'));
if (!empty($conf->stock->enabled) && $shipmentline_var['warehouse'] > 0) { if (isModEnabled('stock') && $shipmentline_var['warehouse'] > 0) {
$warehousestatic->fetch($shipmentline_var['warehouse']); $warehousestatic->fetch($shipmentline_var['warehouse']);
$htmltext .= '<br>'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); $htmltext .= '<br>'.$langs->trans("FromLocation").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
} }
@ -2292,7 +2292,7 @@ if ($action == 'create') {
// Batch number managment // Batch number managment
print '<td>'.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'</td>'; print '<td>'.$formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product).'</td>';
print '</tr>'; print '</tr>';
} elseif (!empty($conf->stock->enabled)) { } elseif (isModEnabled('stock')) {
if ($lines[$i]->fk_product > 0) { if ($lines[$i]->fk_product > 0) {
if ($lines[$i]->entrepot_id > 0) { if ($lines[$i]->entrepot_id > 0) {
print '<!-- case edit 2 -->'; print '<!-- case edit 2 -->';
@ -2331,7 +2331,7 @@ if ($action == 'create') {
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';
} }
} elseif (empty($conf->stock->enabled) && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. } elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated.
print '<!-- case edit 6 -->'; print '<!-- case edit 6 -->';
print '<tr>'; print '<tr>';
// Qty to ship or shipped // Qty to ship or shipped
@ -2349,7 +2349,7 @@ if ($action == 'create') {
print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>'; print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>';
// Warehouse source // Warehouse source
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<td class="linecolwarehousesource left">'; print '<td class="linecolwarehousesource left">';
if ($lines[$i]->entrepot_id > 0) { if ($lines[$i]->entrepot_id > 0) {
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
@ -2452,7 +2452,7 @@ if ($action == 'create') {
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
$colspan++; $colspan++;
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
$colspan++; $colspan++;
} }

View File

@ -707,7 +707,7 @@ class Expedition extends CommonObject
} }
// If stock increment is done on sending (recommanded choice) // If stock increment is done on sending (recommanded choice)
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -913,7 +913,7 @@ class Expedition extends CommonObject
$line->rang = $orderline->rang; $line->rang = $orderline->rang;
$line->product_type = $orderline->product_type; $line->product_type = $orderline->product_type;
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) { if (isModEnabled('stock') && !empty($orderline->fk_product)) {
$fk_product = $orderline->fk_product; $fk_product = $orderline->fk_product;
if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) { if (!($entrepot_id > 0) && empty($conf->global->STOCK_WAREHOUSE_NOT_REQUIRED_FOR_SHIPMENTS)) {
@ -2150,7 +2150,7 @@ class Expedition extends CommonObject
$this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback $this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
// If stock increment is done on closing // If stock increment is done on closing
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -2327,7 +2327,7 @@ class Expedition extends CommonObject
$this->billed = 0; $this->billed = 0;
// If stock increment is done on closing // If stock increment is done on closing
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");

View File

@ -38,7 +38,7 @@ if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
} }
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
@ -431,7 +431,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'; print '</tr>';
// Warehouse // Warehouse
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
print '<tr><td>'; print '<tr><td>';
@ -642,7 +642,7 @@ if ($id > 0 || !empty($ref)) {
print '<th class="center">'.$langs->trans("QtyOrdered").'</th>'; print '<th class="center">'.$langs->trans("QtyOrdered").'</th>';
print '<th class="center">'.$langs->trans("QtyShipped").'</th>'; print '<th class="center">'.$langs->trans("QtyShipped").'</th>';
print '<th class="center">'.$langs->trans("KeepToShip").'</th>'; print '<th class="center">'.$langs->trans("KeepToShip").'</th>';
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
print '<th class="center">'.$langs->trans("RealStock").'</th>'; print '<th class="center">'.$langs->trans("RealStock").'</th>';
} else { } else {
print '<th>&nbsp;</th>'; print '<th>&nbsp;</th>';
@ -679,7 +679,7 @@ if ($id > 0 || !empty($ref)) {
// Product label // Product label
if ($objp->fk_product > 0) { if ($objp->fk_product > 0) {
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$prod = new Product($db); $prod = new Product($db);
@ -794,7 +794,7 @@ if ($id > 0 || !empty($ref)) {
$product->load_stock('warehouseopen'); $product->load_stock('warehouseopen');
} }
if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && !empty($conf->stock->enabled)) { if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && isModEnabled('stock')) {
print '<td class="center">'; print '<td class="center">';
print $product->stock_reel; print $product->stock_reel;
if ($product->stock_reel < $toBeShipped[$objp->fk_product]) { if ($product->stock_reel < $toBeShipped[$objp->fk_product]) {
@ -858,7 +858,7 @@ if ($id > 0 || !empty($ref)) {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// Bouton expedier sans gestion des stocks // Bouton expedier sans gestion des stocks
if (empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { if (!isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
if ($user->rights->expedition->creer) { if ($user->rights->expedition->creer) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/card.php?action=create&amp;origin=commande&amp;object_id='.$id.'">'.$langs->trans("CreateShipment").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/card.php?action=create&amp;origin=commande&amp;object_id='.$id.'">'.$langs->trans("CreateShipment").'</a>';
if ($toBeShippedTotal <= 0) { if ($toBeShippedTotal <= 0) {
@ -874,11 +874,11 @@ if ($id > 0 || !empty($ref)) {
// Bouton expedier avec gestion des stocks // Bouton expedier avec gestion des stocks
if (!empty($conf->stock->enabled) && $object->statut == Commande::STATUS_DRAFT) { if (isModEnabled('stock') && $object->statut == Commande::STATUS_DRAFT) {
print $langs->trans("ValidateOrderFirstBeforeShipment"); print $langs->trans("ValidateOrderFirstBeforeShipment");
} }
if (!empty($conf->stock->enabled) && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) { if (isModEnabled('stock') && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED)) {
if ($user->rights->expedition->creer) { if ($user->rights->expedition->creer) {
//print load_fiche_titre($langs->trans("CreateShipment")); //print load_fiche_titre($langs->trans("CreateShipment"));
print '<div class="tabsAction">'; print '<div class="tabsAction">';
@ -896,7 +896,7 @@ if ($id > 0 || !empty($ref)) {
//print '<tr>'; //print '<tr>';
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
//print '<td>'; //print '<td>';
print $langs->trans("WarehouseSource"); print $langs->trans("WarehouseSource");
//print '</td>'; //print '</td>';

View File

@ -384,10 +384,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -494,10 +494,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -604,10 +604,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -718,10 +718,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -832,10 +832,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -944,10 +944,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -983,10 +983,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1012,10 +1012,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1186,7 +1186,7 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1230,10 +1230,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1322,10 +1322,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -174,10 +174,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -199,10 +199,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -311,7 +311,7 @@ if (empty($reshook)) {
$prod->id = $lines[$i]->fk_product; $prod->id = $lines[$i]->fk_product;
// Define output language // Define output language
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { if (getDolGlobalInt('MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$prod->getMultiLangs(); $prod->getMultiLangs();
// We show if duration is present on service (so we get it) // We show if duration is present on service (so we get it)
$prod->fetch($lines[$i]->fk_product); $prod->fetch($lines[$i]->fk_product);
@ -517,10 +517,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -613,10 +613,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -646,10 +646,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -666,10 +666,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -688,10 +688,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -170,7 +170,7 @@ if ($resql) {
/* /*
* Draft orders * Draft orders
*/ */
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."societe as s";
@ -293,7 +293,7 @@ if ($resql) {
* interventions to process * interventions to process
*/ */
if (!empty($conf->ficheinter->enabled)) { if (isModEnabled('ficheinter')) {
$sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid"; $sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."societe as s";

View File

@ -93,7 +93,7 @@ if ($idprod > 0) {
} }
// After best supplier prices and before costprice // After best supplier prices and before costprice
if (!empty($conf->stock->enabled)) { if (isModEnabled('stock')) {
// Add price for pmp // Add price for pmp
$price = $producttmp->pmp; $price = $producttmp->pmp;
if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) {

View File

@ -1097,7 +1097,7 @@ class CommandeFournisseur extends CommonOrder
} }
// If stock is incremented on validate order, we must increment it // If stock is incremented on validate order, we must increment it
if (!$error && $movetoapprovestatus && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { if (!$error && $movetoapprovestatus && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -2085,7 +2085,7 @@ class CommandeFournisseur extends CommonOrder
} }
// If module stock is enabled and the stock increase is done on purchase order dispatching // If module stock is enabled and the stock increase is done on purchase order dispatching
if (!$error && $entrepot > 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { if (!$error && $entrepot > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
$mouv = new MouvementStock($this->db); $mouv = new MouvementStock($this->db);
if ($product > 0) { if ($product > 0) {
// $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on)

View File

@ -504,10 +504,10 @@ class FactureFournisseur extends CommonInvoice
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->thirdparty->default_lang)) {
$newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ... $newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ...
} }
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($this->default_lang)) {
$newlang = $this->default_lang; // for thirdparty $newlang = $this->default_lang; // for thirdparty
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -762,7 +762,7 @@ class FactureFournisseur extends CommonInvoice
// else we get the best supplier price // else we get the best supplier price
if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) {
$buyprice = $producttmp->cost_price; $buyprice = $producttmp->cost_price;
} elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { } elseif (isModEnabled('stock') && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) {
$buyprice = $producttmp->pmp; $buyprice = $producttmp->pmp;
} else { } else {
if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) {
@ -1812,7 +1812,7 @@ class FactureFournisseur extends CommonInvoice
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
// Si on incrémente le produit principal et ses composants à la validation de facture fournisseur // Si on incrémente le produit principal et ses composants à la validation de facture fournisseur
if (!$error && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -1943,7 +1943,7 @@ class FactureFournisseur extends CommonInvoice
} }
// Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente // Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente
if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { if ($result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");

View File

@ -349,7 +349,7 @@ class PaiementFourn extends Paiement
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$newlang = ''; $newlang = '';
$outputlangs = $langs; $outputlangs = $langs;
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $invoice->thirdparty->default_lang; $newlang = $invoice->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

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