fix php8 warnings

This commit is contained in:
Frédéric France 2022-08-31 21:55:55 +02:00
parent ece2f5553a
commit fc01cc66cd
90 changed files with 243 additions and 243 deletions

View File

@ -487,24 +487,24 @@ $tabcond[1] = (isModEnabled("societe"));
$tabcond[2] = true; $tabcond[2] = true;
$tabcond[3] = true; $tabcond[3] = true;
$tabcond[4] = true; $tabcond[4] = true;
$tabcond[5] = (isModEnabled("societe") || !empty($conf->adherent->enabled)); $tabcond[5] = (isModEnabled("societe") || isModEnabled('adherent'));
$tabcond[6] = isModEnabled('agenda'); $tabcond[6] = isModEnabled('agenda');
$tabcond[7] = !empty($conf->tax->enabled); $tabcond[7] = isModEnabled('tax');
$tabcond[8] = isModEnabled("societe"); $tabcond[8] = isModEnabled("societe");
$tabcond[9] = true; $tabcond[9] = true;
$tabcond[10] = true; $tabcond[10] = true;
$tabcond[11] = (isModEnabled("societe")); $tabcond[11] = (isModEnabled("societe"));
$tabcond[12] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order"));
$tabcond[13] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order"));
$tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
$tabcond[15] = true; $tabcond[15] = true;
$tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
$tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled)); $tabcond[17] = (isModEnabled('deplacement') || isModEnabled('expensereport'));
$tabcond[18] = isModEnabled("expedition") || isModEnabled("reception"); $tabcond[18] = isModEnabled("expedition") || isModEnabled("reception");
$tabcond[19] = isModEnabled("societe"); $tabcond[19] = isModEnabled("societe");
$tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order"); $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order");
$tabcond[21] = isModEnabled("propal"); $tabcond[21] = isModEnabled("propal");
$tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); $tabcond[22] = (isModEnabled('commande') || isModEnabled("propal"));
$tabcond[23] = true; $tabcond[23] = true;
$tabcond[24] = isModEnabled('resource'); $tabcond[24] = isModEnabled('resource');
$tabcond[25] = isModEnabled('website'); $tabcond[25] = isModEnabled('website');
@ -517,15 +517,15 @@ $tabcond[30] = isModEnabled('label');
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm'); $tabcond[33] = isModEnabled('hrm');
$tabcond[34] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm');
$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[35] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[36] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[37] = isModEnabled("product"); $tabcond[37] = isModEnabled("product");
$tabcond[38] = isModEnabled('socialnetworks'); $tabcond[38] = isModEnabled('socialnetworks');
$tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[41] = isModEnabled('intracommreport'); $tabcond[41] = isModEnabled('intracommreport');
$tabcond[42] = isModEnabled("product"); $tabcond[42] = isModEnabled("product");
$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2;
$tabcond[44] = isModEnabled('asset'); $tabcond[44] = isModEnabled('asset');
// List of help for fields (no more used, help is defined into tabcomplete) // List of help for fields (no more used, help is defined into tabcomplete)

View File

@ -63,10 +63,10 @@ $conditions = array(
'NOTE_PRIVATE' => 1, 'NOTE_PRIVATE' => 1,
'SOCIETE' => 1, 'SOCIETE' => 1,
'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")),
'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
'USERSIGN' => 1, 'USERSIGN' => 1,
'MAILING' => !empty($conf->mailing->enabled), 'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled)), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
'TICKET' => !empty($conf->ticket->enabled), 'TICKET' => !empty($conf->ticket->enabled),
); );
// Picto // Picto

View File

@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// Load translation files required by the page // Load translation files required by the page
$langsArray=array("errors", "admin", "mails", "languages"); $langsArray=array("errors", "admin", "mails", "languages");
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langsArray[]='members'; $langsArray[]='members';
} }
if (!empty($conf->eventorganization->enabled)) { if (!empty($conf->eventorganization->enabled)) {
@ -179,7 +179,7 @@ $elementList = array();
$elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --';
$elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --';
$elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser'));
if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) { if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) {
$elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember'));
} }
if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) {
@ -194,7 +194,7 @@ if (!empty($conf->project->enabled)) {
if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { if (isModEnabled("propal") && !empty($user->rights->propal->lire)) {
$elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); $elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal'));
} }
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { if (isModEnabled('commande') && !empty($user->rights->commande->lire)) {
$elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder'));
} }
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
@ -224,7 +224,7 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) {
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { if (!empty($conf->ticket->enabled) && !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 (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
$elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport')); $elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport'));
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -180,7 +180,7 @@ $formproduct = new FormProduct($db);
$disabled = ''; $disabled = '';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
$disabled = ' disabled'; $disabled = ' disabled';
print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced"));
@ -226,7 +226,7 @@ $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>'; print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -763,7 +763,7 @@ print "</td>\n";
print "</tr>\n"; print "</tr>\n";
/* Disabled. Would be better to be managed with a user cookie /* Disabled. Would be better to be managed with a user cookie
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>'; print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
print '<td class="right">'; print '<td class="right">';

View File

@ -62,13 +62,13 @@ $workflowcodes = array(
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
'family'=>'create', 'family'=>'create',
'position'=>10, 'position'=>10,
'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
'family'=>'create', 'family'=>'create',
'position'=>20, 'position'=>20,
'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')),
'picto'=>'bill' 'picto'=>'bill'
), ),
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
@ -84,7 +84,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
'family'=>'classify_proposal', 'family'=>'classify_proposal',
'position'=>30, 'position'=>30,
'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')),
'picto'=>'propal', 'picto'=>'propal',
'warning'=>'' 'warning'=>''
), ),
@ -100,19 +100,19 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>40, 'position'=>40,
'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>41, 'position'=>41,
'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>42, 'position'=>42,
'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')),
'picto'=>'order', 'picto'=>'order',
'warning'=>'' 'warning'=>''
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.

View File

@ -179,7 +179,7 @@ class BlockedLog
} }
*/ */
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE';
$this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY';
$this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE';

View File

@ -201,7 +201,7 @@ class CActionComm
if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) { if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) {

View File

@ -47,7 +47,7 @@ if (isModEnabled('facture')) {
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
@ -56,7 +56,7 @@ if (isModEnabled("expedition")) {
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->adherent->enabled)) { 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 (!empty($conf->ficheinter->enabled)) {
@ -69,7 +69,7 @@ $langs->loadLangs(array('companies', 'banks'));
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
$langs->load("contracts"); $langs->load("contracts");
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$langs->load("orders"); $langs->load("orders");
} }
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
@ -510,7 +510,7 @@ if ($object->id > 0) {
} }
if ($object->client) { if ($object->client) {
if (!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { if (isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) {
print '<!-- Minimim amount for orders -->'."\n"; print '<!-- Minimim amount for orders -->'."\n";
print '<tr class="nowrap">'; print '<tr class="nowrap">';
print '<td>'; print '<td>';
@ -621,7 +621,7 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
$langs->load("users"); $langs->load("users");
@ -718,7 +718,7 @@ if ($object->id > 0) {
} }
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
// Box commandes // Box commandes
$tmp = $object->getOutstandingOrders(); $tmp = $object->getOutstandingOrders();
$outstandingOpened = $tmp['opened']; $outstandingOpened = $tmp['opened'];
@ -913,7 +913,7 @@ if ($object->id > 0) {
/* /*
* Latest orders * Latest orders
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$param =""; $param ="";
$sql = "SELECT s.nom, s.rowid"; $sql = "SELECT s.nom, s.rowid";
@ -1553,7 +1553,7 @@ if ($object->id > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status == 1) { if (isModEnabled('commande') && $user->rights->commande->creer && $object->status == 1) {
$langs->load("orders"); $langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
} }
@ -1570,7 +1570,7 @@ if ($object->id > 0) {
// Add invoice // Add invoice
if ($user->socid == 0) { if ($user->socid == 0) {
if (!empty($conf->deplacement->enabled) && $object->status == 1) { if (isModEnabled('deplacement') && $object->status == 1) {
$langs->load("trips"); $langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
} }
@ -1581,7 +1581,7 @@ if ($object->id > 0) {
} else { } else {
$langs->loadLangs(array("orders", "bills")); $langs->loadLangs(array("orders", "bills"));
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if ($object->client != 0 && $object->client != 2) { if ($object->client != 0 && $object->client != 2) {
if (!empty($orders2invoice) && $orders2invoice > 0) { if (!empty($orders2invoice) && $orders2invoice > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';

View File

@ -96,7 +96,7 @@ if (isModEnabled("propal")) {
if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->supplier_proposal->enabled)) {
$supplierproposalstatic = new SupplierProposal($db); $supplierproposalstatic = new SupplierProposal($db);
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$orderstatic = new Commande($db); $orderstatic = new Commande($db);
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
@ -323,7 +323,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
* Draft customer orders * Draft customer orders
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
$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";
@ -1007,7 +1007,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
/* /*
* Opened (validated) order * Opened (validated) order
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
$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

@ -1792,7 +1792,7 @@ if ($action == 'create') {
// Delivery delay // Delivery delay
print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod'); print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print ' ('.$langs->trans('AfterOrder').')'; print ' ('.$langs->trans('AfterOrder').')';
} }
print '</td><td class="valuefieldcreate">'; print '</td><td class="valuefieldcreate">';
@ -2441,7 +2441,7 @@ if ($action == 'create') {
// Delivery delay // Delivery delay
print '<tr class="fielddeliverydelay"><td>'; print '<tr class="fielddeliverydelay"><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
} else { } else {
print $langs->trans('AvailabilityPeriod'); print $langs->trans('AvailabilityPeriod');
@ -2826,7 +2826,7 @@ if ($action == 'create') {
} }
// Create a sale order // Create a sale order
if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateorder) { if ($usercancreateorder) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a>';
} }

View File

@ -71,7 +71,7 @@ if (!empty($conf->incoterm->enabled)) {
if (!empty($conf->margin->enabled)) { if (!empty($conf->margin->enabled)) {
$langs->load('margins'); $langs->load('margins');
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }

View File

@ -92,7 +92,7 @@ if ($tmp) {
/* /*
* Draft orders * Draft orders
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
@ -244,7 +244,7 @@ $max = 10;
/* /*
* Orders to process * Orders to process
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled)) {
/* /*
* Orders that are in process * Orders that are in process
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";

View File

@ -2389,7 +2389,7 @@ if ($resql) {
$stock_order = 0; $stock_order = 0;
$stock_order_supplier = 0; $stock_order_supplier = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ?
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0, '1,2'); $generic_product->load_stats_commande(0, '1,2');
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];

View File

@ -2321,7 +2321,7 @@ if (empty($reshook)) {
if (!$error) { if (!$error) {
// Add batchinfo if the detail_batch array is defined // Add batchinfo if the detail_batch array is defined
if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) {
$langs->load('productbatch'); $langs->load('productbatch');
foreach ($lines[$i]->detail_batch as $batchline) { foreach ($lines[$i]->detail_batch as $batchline) {
$desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' ';

View File

@ -191,7 +191,7 @@ abstract class ActionsContactCardCommon
$this->object->load_ref_elements(); $this->object->load_ref_elements();
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder");
$i++; $i++;

View File

@ -1225,7 +1225,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->load_ref_elements(); $object->load_ref_elements();
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
print $object->ref_commande ? $object->ref_commande : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyOrder").'</span>'); print $object->ref_commande ? $object->ref_commande : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyOrder").'</span>');
print '</td></tr>'; print '</td></tr>';
@ -1498,7 +1498,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->commande->enabled) || isModEnabled("expedition")) { if (isModEnabled('commande') || isModEnabled("expedition")) {
print '<tr><td>'; print '<tr><td>';
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
print $langs->trans("ContactForOrdersOrShipments"); print $langs->trans("ContactForOrdersOrShipments");

View File

@ -159,7 +159,7 @@ if ($object->thirdparty->client) {
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
} }
if (isModEnabled('facture') && $user->rights->facture->lire) { if (isModEnabled('facture') && $user->rights->facture->lire) {

View File

@ -2116,7 +2116,7 @@ if ($action == 'create') {
} }
} }
if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { if (isModEnabled('commande') && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) {
$langs->load("orders"); $langs->load("orders");
if ($user->rights->commande->creer) { if ($user->rights->commande->creer) {
print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);

View File

@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes
} }
// list the summary of the orders // list the summary of the orders
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic = new Commande($this->db); $commandestatic = new Commande($this->db);

View File

@ -214,7 +214,7 @@ class box_graph_product_distribution extends ModeleBoxes
} }
} }
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { if (isModEnabled('commande') && !empty($user->rights->commande->lire)) {
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showordernb) { if ($showordernb) {
$langs->load("orders"); $langs->load("orders");
@ -369,7 +369,7 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals"); $stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals");
$stringtoshow .= '&nbsp;'; $stringtoshow .= '&nbsp;';
} }
if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { if (isModEnabled('commande') || !empty($user->rights->commande->lire)) {
$stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders"); $stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders");
} }
if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { if (isModEnabled('facture') || !empty($user->rights->facture->lire)) {

View File

@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -1630,7 +1630,7 @@ class FormMail extends Form
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
$tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN; $tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN;
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -1639,7 +1639,7 @@ class FormMail extends Form
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder';
} }
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
@ -1647,7 +1647,7 @@ class FormMail extends Form
} }
//Online payement link //Online payement link
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -1656,7 +1656,7 @@ class FormMail extends Form
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder';
} }
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {

View File

@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
} }
// Related items // Related items
if (!empty($conf->commande->enabled) || 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') || !empty($conf->ficheinter->enabled) || (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

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

View File

@ -2976,7 +2976,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
$newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); $newemail .= img_warning($langs->trans("ErrorBadEMail", $email));
} }
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
$type = 'AC_EMAIL'; $type = 'AC_EMAIL';
$link = ''; $link = '';
if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) { if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) {
@ -3082,7 +3082,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
$htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">'; $htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">';
$htmllink .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">'; $htmllink .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
$htmllink .= '</a>'; $htmllink .= '</a>';
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
$addlink = 'AC_SKYPE'; $addlink = 'AC_SKYPE';
$link = ''; $link = '';
if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) { if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) {
@ -7371,7 +7371,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__';
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';
} }
if (!empty($conf->adherent->enabled) && (!is_object($object) || $object->element == 'adherent')) { if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent')) {
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';

View File

@ -64,14 +64,14 @@ function ldap_prepare_head()
$h++; $h++;
} }
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_ACTIVE)) {
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php";
$head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][1] = $langs->trans("LDAPMembersSynchro");
$head[$h][2] = 'members'; $head[$h][2] = 'members';
$h++; $h++;
} }
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) {
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php";
$head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro");
$head[$h][2] = 'memberstypes'; $head[$h][2] = 'memberstypes';

View File

@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object)
$h = 0; $h = 0;
$head = array(); $head = array();
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][1] = $langs->trans("CustomerOrder");
$head[$h][2] = 'order'; $head[$h][2] = 'order';

View File

@ -417,7 +417,7 @@ function show_stats_for_company($product, $socid)
print '</tr>'; print '</tr>';
} }
// Customer orders // Customer orders
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$nblines++; $nblines++;
$ret = $product->load_stats_commande($socid); $ret = $product->load_stats_commande($socid);
if ($ret < 0) { if ($ret < 0) {

View File

@ -125,9 +125,9 @@ 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") || !empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('commande')
|| isModEnabled('facture') || !empty($conf->contrat->enabled) || isModEnabled('facture') || !empty($conf->contrat->enabled)
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) {
$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;
@ -141,7 +141,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
$nbElements += $project->getElementCount('propal', 'propal'); $nbElements += $project->getElementCount('propal', 'propal');
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$nbElements += $project->getElementCount('order', 'commande'); $nbElements += $project->getElementCount('order', 'commande');
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -171,10 +171,10 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->mrp->enabled)) { if (!empty($conf->mrp->enabled)) {
$nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project'); $nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project');
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
$nbElements += $project->getElementCount('trip', 'deplacement'); $nbElements += $project->getElementCount('trip', 'deplacement');
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$nbElements += $project->getElementCount('expensereport', 'expensereport'); $nbElements += $project->getElementCount('expensereport', 'expensereport');
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -183,7 +183,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->loan->enabled)) { if (!empty($conf->loan->enabled)) {
$nbElements += $project->getElementCount('loan', 'loan'); $nbElements += $project->getElementCount('loan', 'loan');
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$nbElements += $project->getElementCount('chargesociales', 'chargesociales'); $nbElements += $project->getElementCount('chargesociales', 'chargesociales');
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {

View File

@ -143,7 +143,7 @@ function user_prepare_head(User $object)
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read)) || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) || (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
) { ) {
// Bank // Bank

View File

@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules
if (isModEnabled("societe")) { if (isModEnabled("societe")) {
$typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect";
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$typeexample .= ($typeexample ? " / " : "")."3=Member"; $typeexample .= ($typeexample ? " / " : "")."3=Member";
} }
if (isModEnabled("societe")) { if (isModEnabled("societe")) {
@ -297,7 +297,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3];
$this->export_label[$r] = 'CatMemberList'; $this->export_label[$r] = 'CatMemberList';
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = '!empty($conf->adherent->enabled)'; $this->export_enabled[$r] = 'isModEnabled('adherent')';
$this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname');
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
@ -527,7 +527,7 @@ class modCategorie extends DolibarrModules
} }
// 3 Members // 3 Members
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$r++; $r++;
$this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3];
$this->import_label[$r] = "CatMembersLinks"; // Translation key $this->import_label[$r] = "CatMembersLinks"; // Translation key

View File

@ -266,7 +266,7 @@ class modStock extends DolibarrModules
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')'; $this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
// Export stock including batch number // Export stock including batch number
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
// This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch
@ -340,7 +340,7 @@ class modStock extends DolibarrModules
'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product' 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product'
); // We define here only fields that use another icon that the one defined into export_icon ); // We define here only fields that use another icon that the one defined into export_icon
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$this->export_fields_array[$r]['sm.batch'] = 'Batch'; $this->export_fields_array[$r]['sm.batch'] = 'Batch';
$this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; $this->export_TypeFields_array[$r]['sm.batch'] = 'Text';
$this->export_entities_array[$r]['sm.batch'] = 'movement'; $this->export_entities_array[$r]['sm.batch'] = 'movement';

View File

@ -46,7 +46,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
@ -61,7 +61,7 @@ if (!empty($conf->contrat->enabled)) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -47,7 +47,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
@ -62,7 +62,7 @@ if (!empty($conf->contrat->enabled)) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -531,7 +531,7 @@ class pdf_eagle extends ModelePdfStockTransfer
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// Lot / série // Lot / série
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$pdf->SetXY($this->posxlot, $curY); $pdf->SetXY($this->posxlot, $curY);
$pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C'); $pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C');
} }
@ -813,7 +813,7 @@ class pdf_eagle extends ModelePdfStockTransfer
$pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); $pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L');
} }
if (!empty($conf->productbatch->enabled) && $this->atLeastOneBatch) { if (isModEnabled('productbatch') && $this->atLeastOneBatch) {
$pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height); $pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxlot, $tab_top + 1); $pdf->SetXY($this->posxlot, $tab_top + 1);

View File

@ -30,7 +30,7 @@ print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br><b
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'free')."</strong><br><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'free')."</strong><br><br>\n";
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print '<div id="order"></div>'; print '<div id="order"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'order')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'order')."</strong><br>\n";
@ -96,7 +96,7 @@ if (!empty($conf->contrat->enabled)) {
} }
print '<br>'; print '<br>';
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
print '<div id="membersubscription"></div>'; print '<div id="membersubscription"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'membersubscription')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'membersubscription')."</strong><br>\n";

View File

@ -71,7 +71,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Proposals to order // Proposals to order
if ($action == 'PROPAL_CLOSE_SIGNED') { if ($action == 'PROPAL_CLOSE_SIGNED') {
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);
if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) {
$object->fetchObjectLinked(); $object->fetchObjectLinked();
if (!empty($object->linkedObjectsIds['commande'])) { if (!empty($object->linkedObjectsIds['commande'])) {
setEventMessages($langs->trans("OrderExists"), null, 'warnings'); setEventMessages($langs->trans("OrderExists"), null, 'warnings');
@ -142,7 +142,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
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);
// First classify billed the order to allow the proposal classify process // First classify billed the order to allow the proposal classify process
if (!empty($conf->commande->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { if (isModEnabled('commande') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) {
$object->fetchObjectLinked('', 'commande', $object->id, $object->element); $object->fetchObjectLinked('', 'commande', $object->id, $object->element);
if (!empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0; $totalonlinkedelements = 0;
@ -272,7 +272,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'BILL_PAYED') { if ($action == 'BILL_PAYED') {
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);
if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) {
$object->fetchObjectLinked('', 'commande', $object->id, $object->element); $object->fetchObjectLinked('', 'commande', $object->id, $object->element);
if (!empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0; $totalonlinkedelements = 0;
@ -296,7 +296,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) {
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);
if (!empty($conf->commande->enabled) && isModEnabled("expedition") && !empty($conf->workflow->enabled) && if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) &&
( (
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) ||
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED'))

View File

@ -50,7 +50,7 @@ if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) {
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
); );
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$arrayofparameters['Member'] = array( $arrayofparameters['Member'] = array(
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')),
); );

View File

@ -308,7 +308,7 @@ if ($action == 'create') { // Create. Seems to no be used
* Delivery * Delivery
*/ */
if ($typeobject == 'commande' && $expedition->origin_id > 0 && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($expedition->origin_id); $objectsrc->fetch($expedition->origin_id);
} }
@ -400,7 +400,7 @@ if ($action == 'create') { // Create. Seems to no be used
*/ */
// Document origine // Document origine
if ($typeobject == 'commande' && $expedition->origin_id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) {
print '<tr><td class="titlefield">'.$langs->trans("RefOrder").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("RefOrder").'</td>';
$order = new Commande($db); $order = new Commande($db);
$order->fetch($expedition->origin_id); $order->fetch($expedition->origin_id);

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }

View File

@ -322,7 +322,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
$rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -338,7 +338,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) { if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) {
$rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); $rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$langs->load("compta"); $langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
$rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT"))); $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
@ -355,7 +355,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$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")));
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$langs->load("trips"); $langs->load("trips");
$rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
} }

View File

@ -125,7 +125,7 @@ if (isModEnabled("propal")) {
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -140,7 +140,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -149,7 +149,7 @@ if (!empty($conf->project->enabled)) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
$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 (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
} }
if (isModEnabled('holiday')) { if (isModEnabled('holiday')) {

View File

@ -53,7 +53,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -67,7 +67,7 @@ $langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders'
if (!empty($conf->incoterm->enabled)) { if (!empty($conf->incoterm->enabled)) {
$langs->load('incoterm'); $langs->load('incoterm');
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }
@ -258,7 +258,7 @@ if (empty($reshook)) {
$stockLocation = "ent1".$i."_0"; $stockLocation = "ent1".$i."_0";
$qty = "qtyl".$i; $qty = "qtyl".$i;
if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number
if (GETPOSTISSET($batch)) { if (GETPOSTISSET($batch)) {
//shipment line with batch-enable product //shipment line with batch-enable product
$qty .= '_'.$j; $qty .= '_'.$j;
@ -875,7 +875,7 @@ if ($action == 'create') {
// Ref // Ref
print '<tr><td class="titlefieldcreate fieldrequired">'; print '<tr><td class="titlefieldcreate fieldrequired">';
if ($origin == 'commande' && !empty($conf->commande->enabled)) { if ($origin == 'commande' && isModEnabled('commande')) {
print $langs->trans("RefOrder"); print $langs->trans("RefOrder");
} }
if ($origin == 'propal' && isModEnabled("propal")) { if ($origin == 'propal' && isModEnabled("propal")) {
@ -1033,7 +1033,7 @@ if ($action == 'create') {
$i = 0; $i = 0;
while ($i < $numAsked) { while ($i < $numAsked) {
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
} }
$i++; $i++;
@ -1552,7 +1552,7 @@ if ($action == 'create') {
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)) {
$disabled = ''; $disabled = '';
if (!empty($conf->productbatch->enabled) && $product->hasbatch()) { if (isModEnabled('productbatch') && $product->hasbatch()) {
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
} }
if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty.
@ -1714,7 +1714,7 @@ if ($action == 'create') {
$totalVolume = $tmparray['volume']; $totalVolume = $tmparray['volume'];
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
@ -1779,7 +1779,7 @@ if ($action == 'create') {
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
print '<tr><td>'; print '<tr><td>';
print $langs->trans("RefOrder").'</td>'; print $langs->trans("RefOrder").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
@ -2048,7 +2048,7 @@ if ($action == 'create') {
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {
print $langs->trans("WarehouseSource").' - '; print $langs->trans("WarehouseSource").' - ';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print $langs->trans("Batch"); print $langs->trans("Batch");
} }
print '</td>'; print '</td>';
@ -2062,7 +2062,7 @@ if ($action == 'create') {
print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>'; print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>';
} }
} }
@ -2358,7 +2358,7 @@ if ($action == 'create') {
} }
// Batch number managment // Batch number managment
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if (isset($lines[$i]->detail_batch)) { if (isset($lines[$i]->detail_batch)) {
print '<!-- Detail of lot -->'; print '<!-- Detail of lot -->';
print '<td class="linecolbatch">'; print '<td class="linecolbatch">';
@ -2437,7 +2437,7 @@ if ($action == 'create') {
if ($origin && $origin_id > 0) { if ($origin && $origin_id > 0) {
$colspan++; $colspan++;
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$colspan++; $colspan++;
} }
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {

View File

@ -965,7 +965,7 @@ class Expedition extends CommonObject
} }
// If product need a batch number, we should not have called this function but addline_batch instead. // If product need a batch number, we should not have called this function but addline_batch instead.
if (!empty($conf->productbatch->enabled) && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) {
$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH'; $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH';
return -4; return -4;
} }
@ -1716,7 +1716,7 @@ class Expedition extends CommonObject
} }
// Detail of batch // Detail of batch
if (!empty($conf->productbatch->enabled) && $obj->line_id > 0 && $obj->product_tobatch > 0) { if (isModEnabled('productbatch') && $obj->line_id > 0 && $obj->product_tobatch > 0) {
$newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product); $newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product);
if (is_array($newdetailbatch)) { if (is_array($newdetailbatch)) {

View File

@ -53,7 +53,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) {
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);

View File

@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.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/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->adherent->enabled)) { 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->categorie->enabled)) { if (!empty($conf->categorie->enabled)) {
@ -353,7 +353,7 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
$langs->load("users"); $langs->load("users");
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';

View File

@ -36,7 +36,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
} }
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';

View File

@ -1173,7 +1173,7 @@ class ProductFournisseur extends Product
$label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier; $label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); $label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
} }

View File

@ -46,7 +46,7 @@ if (!empty($conf->project->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks", "receptions")); $langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks", "receptions"));
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }
@ -721,7 +721,7 @@ if ($id > 0 || !empty($ref)) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>'; print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>'; print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
@ -820,7 +820,7 @@ if ($id > 0 || !empty($ref)) {
$linktoprod = $tmpproduct->getNomUrl(1); $linktoprod = $tmpproduct->getNomUrl(1);
$linktoprod .= ' - '.$objp->label."\n"; $linktoprod .= ' - '.$objp->label."\n";
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if ($objp->tobatch) { if ($objp->tobatch) {
// Product // Product
print '<td>'; print '<td>';
@ -869,7 +869,7 @@ if ($id > 0 || !empty($ref)) {
// Already dispatched // Already dispatched
print '<td class="right">'.$products_dispatched[$objp->rowid].'</td>'; print '<td class="right">'.$products_dispatched[$objp->rowid].'</td>';
if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { if (isModEnabled('productbatch') && $objp->tobatch > 0) {
$type = 'batch'; $type = 'batch';
print '<td class="right">'; print '<td class="right">';
print '</td>'; // Qty to dispatch print '</td>'; // Qty to dispatch
@ -981,7 +981,7 @@ if ($id > 0 || !empty($ref)) {
print '</td>'; print '</td>';
print '<td>'; print '<td>';
if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { if (isModEnabled('productbatch') && $objp->tobatch > 0) {
$type = 'batch'; $type = 'batch';
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"');
} else { } else {
@ -1162,7 +1162,7 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.$langs->trans("Product").'</td>'; print '<td>'.$langs->trans("Product").'</td>';
print '<td>'.$langs->trans("DateCreation").'</td>'; print '<td>'.$langs->trans("DateCreation").'</td>';
print '<td>'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<td>'.$langs->trans("DateDeliveryPlanned").'</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>'; print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>'; print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
@ -1227,7 +1227,7 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.dol_print_date($db->jdate($objp->datec), 'day').'</td>'; print '<td>'.dol_print_date($db->jdate($objp->datec), 'day').'</td>';
print '<td>'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>'; print '<td>'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if ($objp->batch) { if ($objp->batch) {
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
$lot = new Productlot($db); $lot = new Productlot($db);

View File

@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
} }
if (!empty($conf->recruitment->enabled)) { if (!empty($conf->recruitment->enabled)) {
@ -116,11 +116,11 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
$langs->load("holiday"); $langs->load("holiday");
$listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP'); $listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP');
} }
if (!empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { if (isModEnabled('deplacement') && $user->rights->deplacement->lire) {
$langs->load("trips"); $langs->load("trips");
$listofsearchfields['search_deplacement'] = array('text'=>'ExpenseReport'); $listofsearchfields['search_deplacement'] = array('text'=>'ExpenseReport');
} }
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { if (isModEnabled('expensereport') && $user->rights->expensereport->lire) {
$langs->load("trips"); $langs->load("trips");
$listofsearchfields['search_expensereport'] = array('text'=>'ExpenseReport'); $listofsearchfields['search_expensereport'] = array('text'=>'ExpenseReport');
} }
@ -270,7 +270,7 @@ if (isModEnabled('holiday') && $user->rights->holiday->read) {
// Latest expense report // Latest expense report
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { if (isModEnabled('expensereport') && $user->rights->expensereport->lire) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,"; $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,";
$sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";

View File

@ -2024,7 +2024,7 @@ function migrate_modeles($db, $langs, $conf)
} }
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
$modellist = ModelePDFCommandes::liste_modeles($db); $modellist = ModelePDFCommandes::liste_modeles($db);
if (count($modellist) == 0) { if (count($modellist) == 0) {

View File

@ -2432,7 +2432,7 @@ function printDropdownQuickadd()
"title" => "MenuNewMember@members", "title" => "MenuNewMember@members",
"name" => "Adherent@members", "name" => "Adherent@members",
"picto" => "object_member", "picto" => "object_member",
"activation" => !empty($conf->adherent->enabled) && $user->hasRight("adherent", "write"), // vs hooking "activation" => isModEnabled('adherent') && $user->hasRight("adherent", "write"), // vs hooking
"position" => 5, "position" => 5,
), ),
array( array(
@ -2465,7 +2465,7 @@ function printDropdownQuickadd()
"title" => "NewOrder@orders", "title" => "NewOrder@orders",
"name" => "Order@orders", "name" => "Order@orders",
"picto" => "object_order", "picto" => "object_order",
"activation" => !empty($conf->commande->enabled) && $user->hasRight("commande", "write"), // vs hooking "activation" => isModEnabled('commande') && $user->hasRight("commande", "write"), // vs hooking
"position" => 40, "position" => 40,
), ),
array( array(

View File

@ -119,9 +119,9 @@ $arrayfields = array(
'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2),
'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3),
'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5),
'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))),
'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))),
'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),

View File

@ -278,7 +278,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors');
$error++; $error++;
} }
if (!empty($conf->productbatch->enabled) && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { if (isModEnabled('productbatch') && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors');
$error++; $error++;

View File

@ -62,7 +62,7 @@ if (isModEnabled("propal")) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if (!empty($conf->accounting->enabled)) { if (!empty($conf->accounting->enabled)) {
@ -82,7 +82,7 @@ if (!empty($conf->stock->enabled)) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$langs->load("bills"); $langs->load("bills");
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -1353,7 +1353,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
// Batch number management // Batch number management
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>'; print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch'));
@ -2368,7 +2368,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
// Batch number management (to batch) // Batch number management (to batch)
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>'; print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
print $object->getLibStatut(0, 2); print $object->getLibStatut(0, 2);
@ -2823,7 +2823,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
} }
// Commande // Commande
if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { if (isModEnabled('commande') && $user->rights->commande->creer) {
$commande = new Commande($db); $commande = new Commande($db);
$langs->load("orders"); $langs->load("orders");

View File

@ -4943,7 +4943,7 @@ class Product extends CommonObject
$label .= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; $label .= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
} }
if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
$label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2); $label .= "<br><b>".$langs->trans("ManageLotSerial").'</b>: '.$this->getLibStatut(0, 2);
} }
@ -5141,7 +5141,7 @@ class Product extends CommonObject
$labelStatus = $labelStatusShort = ''; $labelStatus = $labelStatusShort = '';
$langs->load('products'); $langs->load('products');
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -5456,7 +5456,7 @@ class Product extends CommonObject
//dol_syslog("load_virtual_stock"); //dol_syslog("load_virtual_stock");
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$result = $this->load_stats_commande(0, '1,2', 1); $result = $this->load_stats_commande(0, '1,2', 1);
if ($result < 0) { if ($result < 0) {
dol_print_error($this->db, $this->error); dol_print_error($this->db, $this->error);

View File

@ -348,7 +348,7 @@ if (empty($reshook)) {
$error++; $error++;
setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors');
} }
if (!$error && !empty($conf->productbatch->enabled)) { if (!$error && isModEnabled('productbatch')) {
$tmpproduct = new Product($db); $tmpproduct = new Product($db);
$result = $tmpproduct->fetch($fk_product); $result = $tmpproduct->fetch($fk_product);
@ -608,7 +608,7 @@ if ($object->id > 0) {
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
if ($permissiontoadd) { if ($permissiontoadd) {
// Link to launch scan tool // Link to launch scan tool
if (isModEnabled('barcode') || !empty($conf->productbatch->enabled)) { if (isModEnabled('barcode') || isModEnabled('productbatch')) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=updatebyscaning" class="marginrightonly paddingright marginleftonly paddingleft">'.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=updatebyscaning" class="marginrightonly paddingright marginleftonly paddingleft">'.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").'</a>';
} }
@ -906,7 +906,7 @@ if ($object->id > 0) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Warehouse").'</td>'; print '<td>'.$langs->trans("Warehouse").'</td>';
print '<td>'.$langs->trans("Product").'</td>'; print '<td>'.$langs->trans("Product").'</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td>'; print '<td>';
print $langs->trans("Batch"); print $langs->trans("Batch");
print '</td>'; print '</td>';
@ -944,7 +944,7 @@ if ($object->id > 0) {
print '<td>'; print '<td>';
print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOST('fk_product', 'int') : $object->fk_product), 'fk_product', '', 0, 0, -1, 2, '', 0, null, 0, '1', 0, 'maxwidth300'); print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOST('fk_product', 'int') : $object->fk_product), 'fk_product', '', 0, 0, -1, 2, '', 0, null, 0, '1', 0, 'maxwidth300');
print '</td>'; print '</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td>'; print '<td>';
print '<input type="text" name="batch" class="maxwidth100" value="'.(GETPOSTISSET('batch') ? GETPOST('batch') : '').'">'; print '<input type="text" name="batch" class="maxwidth100" value="'.(GETPOSTISSET('batch') ? GETPOST('batch') : '').'">';
print '</td>'; print '</td>';
@ -1022,7 +1022,7 @@ if ($object->id > 0) {
print $product_static->getNomUrl(1).' - '.$product_static->label; print $product_static->getNomUrl(1).' - '.$product_static->label;
print '</td>'; print '</td>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td id="id_'.$obj->rowid.'_batch" data-batch="'.dol_escape_htmltag($obj->batch).'">'; print '<td id="id_'.$obj->rowid.'_batch" data-batch="'.dol_escape_htmltag($obj->batch).'">';
$batch_static = new Productlot($db); $batch_static = new Productlot($db);
$res = $batch_static->fetch(0, $product_static->id, $obj->batch); $res = $batch_static->fetch(0, $product_static->id, $obj->batch);
@ -1039,7 +1039,7 @@ if ($object->id > 0) {
$valuetoshow = $obj->qty_stock; $valuetoshow = $obj->qty_stock;
// For inventory not yet close, we overwrite with the real value in stock now // For inventory not yet close, we overwrite with the real value in stock now
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
if (!empty($conf->productbatch->enabled) && $product_static->hasbatch()) { if (isModEnabled('productbatch') && $product_static->hasbatch()) {
$valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty;
} else { } else {
$valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real; $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real;

View File

@ -49,7 +49,7 @@ if (!empty($conf->categorie->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins')); $langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins'));
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -238,7 +238,7 @@ $arrayfields = array(
'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51), 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51),
'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52), 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52),
'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53), 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53),
'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60), 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60),
'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100), 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101), 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
$alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400), $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400),

View File

@ -272,7 +272,7 @@ class MouvementStock extends CommonObject
} }
// Test if product require batch data. If yes, and there is not or values are not correct, we throw an error. // Test if product require batch data. If yes, and there is not or values are not correct, we throw an error.
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) {
if (empty($batch)) { if (empty($batch)) {
$langs->load("errors"); $langs->load("errors");
$this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref); $this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
@ -384,7 +384,7 @@ class MouvementStock extends CommonObject
// Check if stock is enough when qty is < 0 // Check if stock is enough when qty is < 0
// Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2.
if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) {
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) {
$foundforbatch = 0; $foundforbatch = 0;
$qtyisnotenough = 0; $qtyisnotenough = 0;
@ -544,7 +544,7 @@ class MouvementStock extends CommonObject
} }
// Update detail of stock for the lot. // Update detail of stock for the lot.
if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) {
if ($id_product_batch > 0) { if ($id_product_batch > 0) {
$result = $this->createBatch($id_product_batch, $qty); $result = $this->createBatch($id_product_batch, $qty);
} else { } else {
@ -596,7 +596,7 @@ class MouvementStock extends CommonObject
// End call triggers // End call triggers
// Check unicity for serial numbered equipments once all movement were done. // Check unicity for serial numbered equipments once all movement were done.
if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) {
if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty
if ($this->getBatchCount($fk_product, $batch) > 1) { if ($this->getBatchCount($fk_product, $batch) > 1) {
$error++; $error++;

View File

@ -164,7 +164,7 @@ if ($resql) {
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<th>'.$langs->trans("LastMovements", min($num, $max)).'</th>'; print '<th>'.$langs->trans("LastMovements", min($num, $max)).'</th>';
print '<th>'.$langs->trans("Product").'</th>'; print '<th>'.$langs->trans("Product").'</th>';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<th>'.$langs->trans("Batch").'</th>'; print '<th>'.$langs->trans("Batch").'</th>';
/*if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { /*if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<th>'.$langs->trans("SellByDate").'</th>'; print '<th>'.$langs->trans("SellByDate").'</th>';
@ -204,7 +204,7 @@ if ($resql) {
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
print $producttmp->getNomUrl(1); print $producttmp->getNomUrl(1);
print "</td>\n"; print "</td>\n";
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td>'; print '<td>';
print $tmplotstatic->getNomUrl(0, 'nolink'); print $tmplotstatic->getNomUrl(0, 'nolink');
print '</td>'; print '</td>';

View File

@ -44,7 +44,7 @@ if (!empty($conf->project->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'orders')); $langs->loadLangs(array('products', 'stocks', 'orders'));
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -106,9 +106,9 @@ $arrayfields = array(
'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1), 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'),
'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1),
'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))), 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(isModEnabled('productbatch'))),
'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
@ -273,7 +273,7 @@ if ($action == "transfert_stock" && !$cancel) {
$action = 'transfert'; $action = 'transfert';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$product = new Product($db); $product = new Product($db);
$result = $product->fetch($product_id); $result = $product->fetch($product_id);

View File

@ -45,7 +45,7 @@ if (!empty($conf->project->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'orders')); $langs->loadLangs(array('products', 'stocks', 'orders'));
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -125,9 +125,9 @@ $arrayfields = array(
'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2),
'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3),
'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5),
'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))),
'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))),
'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120),
'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130),
@ -448,7 +448,7 @@ if ($action == "transfert_stock" && !$cancel) {
$action = 'transfert'; $action = 'transfert';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$product = new Product($db); $product = new Product($db);
$result = $product->fetch($product_id); $result = $product->fetch($product_id);

View File

@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class.php';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -56,7 +56,7 @@ if (!empty($conf->variants->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins')); $langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins'));
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
} }
@ -248,7 +248,7 @@ if ($action == "correct_stock" && !$cancel) {
$action = 'correction'; $action = 'correction';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$object = new Product($db); $object = new Product($db);
$result = $object->fetch($id); $result = $object->fetch($id);
@ -345,7 +345,7 @@ if ($action == "transfert_stock" && !$cancel) {
$error++; $error++;
$action = 'transfert'; $action = 'transfert';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$object = new Product($db); $object = new Product($db);
$result = $object->fetch($id); $result = $object->fetch($id);
@ -761,7 +761,7 @@ if ($id > 0 || $ref) {
$found = 0; $found = 0;
$helpondiff = '<strong>'.$langs->trans("StockDiffPhysicTeoric").':</strong><br>'; $helpondiff = '<strong>'.$langs->trans("StockDiffPhysicTeoric").':</strong><br>';
// Number of customer orders running // Number of customer orders running
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if ($found) { if ($found) {
$helpondiff .= '<br>'; $helpondiff .= '<br>';
} else { } else {
@ -959,7 +959,7 @@ if (!$variants) {
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { if ((isModEnabled('productbatch')) && $object->hasbatch()) {
$colspan = 3; $colspan = 3;
print '<tr class="liste_titre"><td class="minwidth200">'; print '<tr class="liste_titre"><td class="minwidth200">';
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
@ -1029,7 +1029,7 @@ if (!$variants) {
// Warehouse // Warehouse
print '<td colspan="4">'; print '<td colspan="4">';
print $entrepotstatic->getNomUrl(1); print $entrepotstatic->getNomUrl(1);
if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) { if (!empty($conf->use_javascript_ajax) && isModEnabled('productbatch') && $object->hasbatch()) {
print '<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id . '" href="#">'; print '<a class="collapse_batch marginleftonly" id="ent' . $entrepotstatic->id . '" href="#">';
print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)');
print '</a>'; print '</a>';
@ -1096,7 +1096,7 @@ if (!$variants) {
$totalvalue = $totalvalue + ($object->pmp * $obj->reel); $totalvalue = $totalvalue + ($object->pmp * $obj->reel);
$totalvaluesell = $totalvaluesell + ($object->price * $obj->reel); $totalvaluesell = $totalvaluesell + ($object->price * $obj->reel);
// Batch Detail // Batch Detail
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { if ((isModEnabled('productbatch')) && $object->hasbatch()) {
$details = Productbatch::findAll($db, $obj->product_stock_id, 0, $object->id); $details = Productbatch::findAll($db, $obj->product_stock_id, 0, $object->id);
if ($details < 0) { if ($details < 0) {
dol_print_error($db); dol_print_error($db);

View File

@ -85,7 +85,7 @@ if ($id || $ref) {
$object->fetch($id, $productid, $batch); $object->fetch($id, $productid, $batch);
$object->ref = $object->batch; // Old system for document management ( it uses $object->ref) $object->ref = $object->batch; // Old system for document management ( it uses $object->ref)
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart); $upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
$filearray = dol_dir_list($upload_dir, "files"); $filearray = dol_dir_list($upload_dir, "files");
if (empty($filearray)) { if (empty($filearray)) {

View File

@ -413,7 +413,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre
$sql .= ', s.fk_product'; $sql .= ', s.fk_product';
if ($usevirtualstock) { if ($usevirtualstock) {
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
$sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1";
$sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")"; $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")";

View File

@ -93,7 +93,7 @@ print '<tr><td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td c
print '</tr>'; print '</tr>';
// Serial / Eat-by date // Serial / Eat-by date
if (!empty($conf->productbatch->enabled) && if (isModEnabled('productbatch') &&
(($object->element == 'product' && $object->hasbatch()) (($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock')) || ($object->element == 'stock'))
) { ) {

View File

@ -1348,7 +1348,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$langs->load("propal"); $langs->load("propal");
print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true)); print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { if (isModEnabled('commande') && $user->rights->commande->creer) {
$langs->load("orders"); $langs->load("orders");
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true)); print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
} }
@ -1376,7 +1376,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$langs->load("contracts"); $langs->load("contracts");
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true)); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
} }
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) { if (isModEnabled('expensereport') && $user->rights->expensereport->creer) {
$langs->load("trips"); $langs->load("trips");
print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true)); print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
} }

View File

@ -46,7 +46,7 @@ if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->supplier_proposal->enabled)) {
@ -67,10 +67,10 @@ if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {
@ -86,7 +86,7 @@ if (!empty($conf->loan->enabled)) {
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
} }
if (isModEnabled("banque")) { if (isModEnabled("banque")) {
@ -107,7 +107,7 @@ $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta'));
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$langs->load("bills"); $langs->load("bills");
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$langs->load("orders"); $langs->load("orders");
} }
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
@ -116,10 +116,10 @@ if (isModEnabled("propal")) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions"); $langs->load("interventions");
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
$langs->load("trips"); $langs->load("trips");
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$langs->load("trips"); $langs->load("trips");
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {

View File

@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) {
} }
$object->info($object->id); $object->info($object->id);
} }
$agenda = (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; $agenda = (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : '';
$title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name; $title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name;
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info");

View File

@ -54,7 +54,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -67,7 +67,7 @@ $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'order
if (!empty($conf->incoterm->enabled)) { if (!empty($conf->incoterm->enabled)) {
$langs->load('incoterm'); $langs->load('incoterm');
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }
@ -626,7 +626,7 @@ if (empty($reshook)) {
$line->qty = GETPOST($qty, 'int'); $line->qty = GETPOST($qty, 'int');
$line->comment = GETPOST($comment, 'alpha'); $line->comment = GETPOST($comment, 'alpha');
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$batch = "batch".$line_id; $batch = "batch".$line_id;
$dlc = "dlc".$line_id; $dlc = "dlc".$line_id;
$dluo = "dluo".$line_id; $dluo = "dluo".$line_id;
@ -1041,7 +1041,7 @@ if ($action == 'create') {
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {
print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>'; print '<td class="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="left">'.$langs->trans("batch_number").'</td>'; print '<td class="left">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="left">'.$langs->trans("SellByDate").'</td>'; print '<td class="left">'.$langs->trans("SellByDate").'</td>';
@ -1216,7 +1216,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if (!empty($product->status_batch)) { if (!empty($product->status_batch)) {
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>'; print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
@ -1358,7 +1358,7 @@ if ($action == 'create') {
$totalVolume = $tmparray['volume']; $totalVolume = $tmparray['volume'];
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
@ -1427,7 +1427,7 @@ if ($action == 'create') {
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
print '<tr><td>'; print '<tr><td>';
print $langs->trans("RefOrder").'</td>'; print $langs->trans("RefOrder").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
@ -1700,7 +1700,7 @@ if ($action == 'create') {
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {
print $langs->trans("WarehouseSource").' - '; print $langs->trans("WarehouseSource").' - ';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print $langs->trans("Batch"); print $langs->trans("Batch");
} }
print '</td>'; print '</td>';
@ -1721,7 +1721,7 @@ if ($action == 'create') {
print '<td class="left">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="left">'.$langs->trans("WarehouseSource").'</td>';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="left">'.$langs->trans("Batch").'</td>'; print '<td class="left">'.$langs->trans("Batch").'</td>';
} }
} }
@ -1957,7 +1957,7 @@ if ($action == 'create') {
} }
// Batch number managment // Batch number managment
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if (isset($lines[$i]->batch)) { if (isset($lines[$i]->batch)) {
print '<!-- Detail of lot -->'; print '<!-- Detail of lot -->';
print '<td class="linecolbatch">'; print '<td class="linecolbatch">';

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
@ -849,7 +849,7 @@ class Reception extends CommonObject
// Check batch is set // Check batch is set
$product = new Product($this->db); $product = new Product($this->db);
$product->fetch($fk_product); $product->fetch($fk_product);
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("errors"); $langs->load("errors");
if (!empty($product->status_batch) && empty($batch)) { if (!empty($product->status_batch) && empty($batch)) {
$this->error = $langs->trans('ErrorProductNeedBatchNumber', $product->ref); $this->error = $langs->trans('ErrorProductNeedBatchNumber', $product->ref);

View File

@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }

View File

@ -342,7 +342,7 @@ abstract class ActionsCardCommon
} }
// Linked member // Linked member
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
$adh = new Adherent($this->db); $adh = new Adherent($this->db);
$result = $adh->fetch('', '', $this->object->id); $result = $adh->fetch('', '', $this->object->id);

View File

@ -247,7 +247,7 @@ for ($i = 1; $i <= 4; $i++) {
<td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td> <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
</tr> </tr>
<?php if (!empty($conf->adherent->enabled)) { ?> <?php if (isModEnabled('adherent')) { ?>
<tr> <tr>
<td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td> <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td> <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>

View File

@ -174,7 +174,7 @@ if ($this->control->tpl['action_delete']) {
<td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td> <td colspan="3"><?php echo $this->control->tpl['sales_representatives']; ?></td>
</tr> </tr>
<?php if (!empty($conf->adherent->enabled)) { ?> <?php if (isModEnabled('adherent')) { ?>
<tr> <tr>
<td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td> <td width="25%" valign="top"><?php echo $langs->trans("LinkedToDolibarrMember"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td> <td colspan="3"><?php echo $this->control->tpl['linked_member']; ?></td>

View File

@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (!empty($conf->adherent->enabled)) { 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->accounting->enabled)) { if (!empty($conf->accounting->enabled)) {
@ -68,7 +68,7 @@ if (! empty($conf->eventorganization->enabled)) {
$langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users"));
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
} }
if (!empty($conf->categorie->enabled)) { if (!empty($conf->categorie->enabled)) {
@ -3035,7 +3035,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td>'; print '<td>';
@ -3108,7 +3108,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$adh = new Adherent($db); $adh = new Adherent($db);
$result = $adh->fetch('', '', $object->id); $result = $adh->fetch('', '', $object->id);
if ($result == 0 && ($object->client == 1 || $object->client == 3) && !empty($conf->global->MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS)) { if ($result == 0 && ($object->client == 1 || $object->client == 3) && !empty($conf->global->MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS)) {

View File

@ -214,8 +214,8 @@ class Societe extends CommonObject
'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305), 'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305),
'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308), 'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308),
'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1), 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1),
'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1),
'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1),
'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330), 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330),
'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335), 'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335),
'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340), 'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340),
@ -1561,7 +1561,7 @@ class Societe extends CommonObject
if (!$error && $nbrowsaffected) { if (!$error && $nbrowsaffected) {
// Update information on linked member if it is an update // Update information on linked member if it is an update
if (!$nosyncmember && !empty($conf->adherent->enabled)) { if (!$nosyncmember && isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
dol_syslog(get_class($this)."::update update linked member"); dol_syslog(get_class($this)."::update update linked member");

View File

@ -170,7 +170,7 @@ if ($object->client) {
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
} }
if (isModEnabled('facture') && $user->rights->facture->lire) { if (isModEnabled('facture') && $user->rights->facture->lire) {

View File

@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
} }

View File

@ -791,7 +791,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
} }
if (isModEnabled('facture') && $user->rights->facture->lire) { if (isModEnabled('facture') && $user->rights->facture->lire) {

View File

@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) {
} }
// additionnal list with adherents of company // additionnal list with adherents of company
if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { if (isModEnabled('adherent') && $user->rights->adherent->lire) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
if (isModEnabled('holiday')) { if (isModEnabled('holiday')) {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
} }
if (!empty($conf->salaries->enabled)) { if (!empty($conf->salaries->enabled)) {
@ -361,7 +361,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
print "</tr>\n"; print "</tr>\n";
// Expense report validator // Expense report validator
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
print '<tr><td>'; print '<tr><td>';
$text = $langs->trans("ForceUserExpenseValidator"); $text = $langs->trans("ForceUserExpenseValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -691,7 +691,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
} }
// Latest expense report // Latest expense report
if (!empty($conf->expensereport->enabled) && if (isModEnabled('expensereport') &&
($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id))
) { ) {
$exp = new ExpenseReport($db); $exp = new ExpenseReport($db);

View File

@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
if (!empty($conf->ldap->enabled)) { if (!empty($conf->ldap->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
} }
if (!empty($conf->adherent->enabled)) { 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->categorie->enabled)) { if (!empty($conf->categorie->enabled)) {
@ -950,7 +950,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</tr>\n"; print "</tr>\n";
// Expense report validator // Expense report validator
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';
$text = $langs->trans("ForceUserExpenseValidator"); $text = $langs->trans("ForceUserExpenseValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -1498,7 +1498,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</tr>\n"; print "</tr>\n";
// Expense report validator // Expense report validator
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
print '<tr><td>'; print '<tr><td>';
$text = $langs->trans("ForceUserExpenseValidator"); $text = $langs->trans("ForceUserExpenseValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -1707,7 +1707,7 @@ if ($action == 'create' || $action == 'adduserldap') {
} }
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td>'; print '<td>';
@ -2239,7 +2239,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</tr>\n"; print "</tr>\n";
// Expense report validator // Expense report validator
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
$text = $langs->trans("ForceUserExpenseValidator"); $text = $langs->trans("ForceUserExpenseValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -2629,7 +2629,7 @@ if ($action == 'create' || $action == 'adduserldap') {
} }
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td>'; print '<td>';

View File

@ -192,19 +192,19 @@ if (isModEnabled("societe")) {
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
$tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
} }
if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) { if (isModEnabled('holiday') || isModEnabled('expensereport')) {
$tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
} }
if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("product") || isModEnabled("service")) {
$tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
} }
if (isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
$tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
} }
if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) { if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
$tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea'; $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea'; $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -227,7 +227,7 @@ if ($object->id > 0) {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (!empty($conf->agenda->enabled)) { if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
} else { } else {
@ -237,7 +237,7 @@ if ($object->id > 0) {
print '</div>'; print '</div>';
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid; $param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage); $param .= '&contextpage='.urlencode($contextpage);

View File

@ -103,10 +103,10 @@ $webservices = array(
'thirdparty' => 'isModEnabled("societe")', 'thirdparty' => 'isModEnabled("societe")',
'contact' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")',
'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))',
'order' => '!empty($conf->commande->enabled)', 'order' => 'isModEnabled('commande')',
'invoice' => 'isModEnabled("facture")', 'invoice' => 'isModEnabled("facture")',
'supplier_invoice' => 'isModEnabled("fournisseur")', 'supplier_invoice' => 'isModEnabled("fournisseur")',
'actioncomm' => '!empty($conf->agenda->enabled)', 'actioncomm' => 'isModEnabled('agenda')',
'category' => '!empty($conf->categorie->enabled)', 'category' => '!empty($conf->categorie->enabled)',
'project' => '!empty($conf->project->enabled)', 'project' => '!empty($conf->project->enabled)',
'other' => '' 'other' => ''