use isModEnabled

This commit is contained in:
Frédéric France 2022-08-23 20:01:34 +02:00
parent 83ace0cb12
commit 4bef0f5745
174 changed files with 450 additions and 450 deletions

View File

@ -111,7 +111,7 @@ if ($action == 'set_default') {
if (isModEnabled('facture')) {
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
}
}
@ -238,13 +238,13 @@ print "</td></tr>\n";
// Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None"));
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect");
}
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
$arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly");
}
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) {
if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
$arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice");
}
print '<td>';
@ -258,7 +258,7 @@ print "</tr>\n";
// Use vat for invoice creation
if (isModEnabled('facture')) {
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td>';
print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print '</td>';
@ -269,7 +269,7 @@ if (isModEnabled('facture')) {
}
print "</tr>\n";
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
print '<td>';
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);

View File

@ -1773,7 +1773,7 @@ class Adherent extends CommonObject
if (!$error) {
// Add line to draft invoice
$idprodsubscription = 0;
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (isModEnabled("product") || !empty($conf->service->enabled))) {
$idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS;
}

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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/subscription.class.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -229,7 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
// Bank line
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
if (isModEnabled("banque") && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
if ($object->fk_bank) {
$bankline = new AccountLine($db);
@ -270,7 +270,7 @@ if ($rowid && $action != 'edit') {
//$formquestion=array();
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text = $langs->trans("ConfirmDeleteSubscription");
if (!empty($conf->banque->enabled) && !empty($conf->global->ADHERENT_BANK_USE)) {
if (isModEnabled("banque") && !empty($conf->global->ADHERENT_BANK_USE)) {
$text .= '<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
}
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1);
@ -325,7 +325,7 @@ if ($rowid && $action != 'edit') {
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
// Bank line
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
if (isModEnabled("banque") && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
if ($object->fk_bank) {
$bankline = new AccountLine($db);

View File

@ -507,7 +507,7 @@ print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>";
if (empty($conf->facture->enabled)) {
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";

View File

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

View File

@ -278,7 +278,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0);
}

View File

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

View File

@ -545,7 +545,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0);
}

View File

@ -158,7 +158,7 @@ if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && empty($conf->global->LDAP_USER
print '</td></tr>';
// Synchro contact active
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR));
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';

View File

@ -185,13 +185,13 @@ if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) {
if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) {
$elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures'));
}
if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) {
if (isModEnabled("societe") && !empty($user->rights->societe->lire)) {
$elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty'));
}
if (!empty($conf->project->enabled)) {
$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
}
if (!empty($conf->propal->enabled) && !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'));
}
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
@ -200,10 +200,10 @@ if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
$elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice'));
}
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
}
if (!empty($conf->reception->enabled)) {
if (isModEnabled("reception")) {
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception'));
}
if (!empty($conf->ficheinter->enabled)) {

View File

@ -177,7 +177,7 @@ print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_set
print '<span class="opacitymedium">';
print $langs->trans("NotificationsDesc").'<br>';
print $langs->trans("NotificationsDescUser").'<br>';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
print $langs->trans("NotificationsDescContact").'<br>';
}
print $langs->trans("NotificationsDescGlobal").'<br>';
@ -361,7 +361,7 @@ print $form->buttonsSaveCancel("Save", '');
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
}
print '</div>';
@ -384,7 +384,7 @@ print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
print '<div class="info">';
print $langs->trans("Note").':<br>';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
}
print '</div>';

View File

@ -525,7 +525,7 @@ print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>";
if (empty($conf->facture->enabled)) {
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0";

View File

@ -245,7 +245,7 @@ $found++;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
print '<td class="right">';
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1);
} else {
@ -262,7 +262,7 @@ $found++;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td class="right">';
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1);
} else {
@ -324,7 +324,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
print "</td>\n</tr>\n";
$found++;
if (!empty($conf->reception->enabled)) {
if (isModEnabled("reception")) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockOnReception").'</td>';
print '<td class="right">';
@ -422,7 +422,7 @@ if (!empty($conf->order->enabled)) {
print "</tr>\n";
}
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td class="right">';

View File

@ -343,7 +343,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0);
}

View File

@ -62,7 +62,7 @@ $workflowcodes = array(
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
'family'=>'create',
'position'=>10,
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)),
'picto'=>'order'
),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
@ -84,14 +84,14 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
'family'=>'classify_proposal',
'position'=>30,
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)),
'picto'=>'propal',
'warning'=>''
),
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
'family'=>'classify_proposal',
'position'=>31,
'enabled'=>(!empty($conf->propal->enabled) && isModEnabled('facture')),
'enabled'=>(isModEnabled("propal") && isModEnabled('facture')),
'picto'=>'propal',
'warning'=>''
),
@ -100,13 +100,13 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated
'family'=>'classify_order',
'position'=>40,
'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)),
'picto'=>'order'
),
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed
'family'=>'classify_order',
'position'=>41,
'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)),
'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)),
'picto'=>'order'
),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
@ -132,7 +132,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
'family'=>'classify_supplier_order',
'position'=>63,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order',
'warning'=>''
),
@ -140,7 +140,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
'family'=>'classify_supplier_order',
'position'=>64,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order',
'warning'=>''
),
@ -157,7 +157,7 @@ $workflowcodes = array(
'WORKFLOW_BILL_ON_RECEPTION'=>array(
'family'=>'classify_reception',
'position'=>80,
'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
'enabled'=>(isModEnabled("reception") && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
'picto'=>'reception'
),
@ -165,7 +165,7 @@ $workflowcodes = array(
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
'family' => 'classify_shipping',
'position' => 90,
'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled),
'enabled' => isModEnabled("expedition") && isModEnabled("facture"),
'picto' => 'shipment'
),

View File

@ -524,7 +524,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0);
}

View File

@ -184,7 +184,7 @@ class BlockedLog
$this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY';
$this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE';
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE';
$this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY';
$this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE';

View File

@ -87,7 +87,7 @@ $coldisplay++;
print '<td class="bordertop nobottom linecoldescription minwidth500imp">';
// Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
if (!empty($conf->global->BOM_SUB_BOM)) {
print $langs->trans("Product");
}

View File

@ -1378,7 +1378,7 @@ if ($action == 'create') {
print '<table class="border centpercent">';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
// Related company
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ActionOnCompany").'</td><td>';
if (GETPOST('socid', 'int') > 0) {
@ -1891,7 +1891,7 @@ if ($id > 0) {
print '<table class="border tableforfield centpercent">';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
// Related company
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
print '<td>';
@ -2300,7 +2300,7 @@ if ($id > 0) {
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield centpercent">';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
// Related company
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : ('<span class="opacitymedium">'.$langs->trans("None").'</span>'));
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') {

View File

@ -129,19 +129,19 @@ class AgendaEvents extends DolibarrApi
}
$sql = "SELECT t.id as rowid";
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
}
}
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as t";
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
}
}
$sql .= ' WHERE t.entity IN ('.getEntity('agenda').')';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= " AND t.fk_soc = sc.fk_soc";
}

View File

@ -204,7 +204,7 @@ class CActionComm
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
$qualified = 1;
}
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) {
$qualified = 1;
}
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
@ -213,7 +213,7 @@ class CActionComm
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
$qualified = 1;
}
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
if ($obj->module == 'shipping' && isModEnabled("expedition") && !empty($user->rights->expedition->lire)) {
$qualified = 1;
}
// For case module = 'myobject@eventorganization'

View File

@ -44,13 +44,13 @@ if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
}
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->commande->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
}
if (!empty($conf->contrat->enabled)) {
@ -72,7 +72,7 @@ if (!empty($conf->contrat->enabled)) {
if (!empty($conf->commande->enabled)) {
$langs->load("orders");
}
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$langs->load("sendings");
}
if (isModEnabled('facture')) {
@ -438,7 +438,7 @@ if ($object->id > 0) {
print "</td>";
print '</tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Compte bancaire par défaut
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
@ -697,7 +697,7 @@ if ($object->id > 0) {
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->rights->propal->lire) {
// Box proposals
$tmp = $object->getOutstandingProposals();
$outstandingOpened = $tmp['opened'];
@ -818,7 +818,7 @@ if ($object->id > 0) {
/*
* Latest proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->rights->propal->lire) {
$langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
@ -1024,7 +1024,7 @@ if ($object->id > 0) {
/*
* Latest shipments
*/
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
if (isModEnabled("expedition") && $user->rights->expedition->lire) {
$sql = 'SELECT e.rowid as id';
$sql .= ', e.ref, e.entity';
$sql .= ', e.date_creation';
@ -1548,7 +1548,7 @@ if ($object->id > 0) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
}
if (!empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status == 1) {
if (isModEnabled("propal") && $user->rights->propal->creer && $object->status == 1) {
$langs->load("propal");
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>';
}

View File

@ -90,7 +90,7 @@ $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global-
$form = new Form($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$propalstatic = new Propal($db);
}
if (!empty($conf->supplier_proposal->enabled)) {
@ -128,7 +128,7 @@ if ($tmp) {
* Draft customer proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->rights->propal->lire) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
@ -592,7 +592,7 @@ print '</div><div class="fichetwothirdright">';
/*
* Last modified customers or prospects
*/
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
if (isModEnabled("societe") && $user->rights->societe->lire) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@ -887,7 +887,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
/*
* Opened (validated) proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->rights->propal->lire) {
$sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -1750,7 +1750,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) {
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && isModEnabled("banque")) {
print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
@ -1773,7 +1773,7 @@ if ($action == 'create') {
print '</td></tr>';
// Shipping Method
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) {
$shipping_method_id = $soc->shipping_method_id;
}
@ -2434,7 +2434,7 @@ if ($action == 'create') {
print '</tr>';
// Shipping Method
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
print '<tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('SendingMethod');
@ -2552,7 +2552,7 @@ if ($action == 'create') {
print '</tr>';
}
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) {
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && isModEnabled("banque")) {
// Bank Account
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';

View File

@ -76,7 +76,7 @@ if ($tmp) {
/*
* Draft proposals
*/
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc";
$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
@ -226,7 +226,7 @@ if ($resql) {
/*
* Open (validated) proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
$sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";

View File

@ -52,7 +52,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$langs->loadLangs(array('sendings'));
}
@ -218,7 +218,7 @@ $arrayfields = array(
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)),
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("expedition")),
'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1),
'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0),
'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),

View File

@ -59,7 +59,7 @@ print load_fiche_titre($langs->trans("ProspectionArea"));
print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$var = false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/card.php">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -118,7 +118,7 @@ if ($resql) {
/*
* Liste des propal brouillons
*/
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
@ -176,7 +176,7 @@ if (isModEnabled('agenda')) {
/*
* Dernieres propales ouvertes
*/
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,";
$sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";

View File

@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->project->enabled)) {
@ -1783,7 +1783,7 @@ if ($action == 'create' && $usercancreate) {
print '</td></tr>';
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) {
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
@ -2581,7 +2581,7 @@ if ($action == 'create' && $usercancreate) {
}
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) {
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && isModEnabled("banque")) {
print '<tr><td>';
$editenable = $usercancreate;
print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable);

View File

@ -3710,7 +3710,7 @@ class Commande extends CommonOrder
$result = '';
if (!empty($conf->expedition->enabled) && ($option == '1' || $option == '2')) {
if (isModEnabled("expedition") && ($option == '1' || $option == '2')) {
$url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
} else {
$url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id;

View File

@ -176,7 +176,7 @@ $arrayfields = array(
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)),
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("expedition")),
'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67),
'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68),
'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69),
@ -199,7 +199,7 @@ $arrayfields = array(
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>990),
'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990),
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995),
'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999),
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)

View File

@ -139,7 +139,7 @@ $listofchoices = array(
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)),
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)),
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)),
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => isModEnabled("banque"), 'perms' => !empty($user->rights->banque->lire)),
'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)),
);

View File

@ -423,11 +423,11 @@ class PaymentVarious extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->fk_account) || $this->fk_account <= 0)) {
if (isModEnabled("banque") && (empty($this->fk_account) || $this->fk_account <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
return -6;
}
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) {
if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -7;
}
@ -481,7 +481,7 @@ class PaymentVarious extends CommonObject
$this->ref = $this->id;
if ($this->id > 0) {
if (!empty($conf->banque->enabled) && !empty($this->amount)) {
if (isModEnabled("banque") && !empty($this->amount)) {
// Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -139,7 +139,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
$error++;
}
if (!empty($conf->banque->enabled) && !$object->accountid > 0) {
if (isModEnabled("banque") && !$object->accountid > 0) {
$langs->load('errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
$error++;
@ -413,7 +413,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td>';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
@ -428,7 +428,7 @@ if ($action == 'create') {
print '</tr>';
// Number
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</label></td>';
@ -642,7 +642,7 @@ if ($id) {
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
print '</td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($object->fk_account > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);

View File

@ -152,8 +152,8 @@ $arrayfields = array(
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)),
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)),
'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500),

View File

@ -146,7 +146,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -220,7 +220,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
}
print $obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td>';
if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank);
@ -254,7 +254,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td></td>';
}
print '<td class="liste_total right">'.price($totalpaid)."</td>";
@ -304,7 +304,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -341,7 +341,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print $obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td>';
if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank);

View File

@ -3688,7 +3688,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
@ -4588,7 +4588,7 @@ if ($action == 'create') {
}
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td class="nowrap">';
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
@ -4844,7 +4844,7 @@ if ($action == 'create') {
if (!empty($conf->project->enabled)) {
$nbrows++;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$nbrows++;
$nbcols++;
}
@ -4873,7 +4873,7 @@ if ($action == 'create') {
print '<td>'.$langs->trans('ListOfSituationInvoices').'</td>';
print '<td></td>';
print '<td class="center">'.$langs->trans('Situation').'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="right"></td>';
}
print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@ -4897,7 +4897,7 @@ if ($action == 'create') {
print '<td>'.$prev_invoice->getNomUrl(1).'</td>';
print '<td></td>';
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($prev_invoice->total_ht).'</span></td>';
@ -4917,7 +4917,7 @@ if ($action == 'create') {
print '<td>'.$object->getNomUrl(1).'</td>';
print '<td></td>';
print '<td class="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($object->total_ht).'</span></td>';
@ -4940,7 +4940,7 @@ if ($action == 'create') {
$i++;
}
print '</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td></td>';
}
print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -4972,7 +4972,7 @@ if ($action == 'create') {
print '<td>'.$next_invoice->getNomUrl(1).'</td>';
print '<td></td>';
print '<td class="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="right"></td>';
}
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
@ -4986,7 +4986,7 @@ if ($action == 'create') {
print '<tr class="oddeven">';
print '<td colspan="3" class="right"></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="right"></td>';
}
print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -5013,7 +5013,7 @@ if ($action == 'create') {
print '<td class="liste_titre">'.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('BankAccount').'</span></td>';
}
print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
@ -5062,7 +5062,7 @@ if ($action == 'create') {
print '</td>';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print '<td>'.$label.' '.$objp->num_payment.'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;

View File

@ -1410,7 +1410,7 @@ class Invoices extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory');
}
@ -1469,7 +1469,7 @@ class Invoices extends DolibarrApi
throw new RestException(400, 'Payment error : '.$paymentobj->error);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
@ -1533,7 +1533,7 @@ class Invoices extends DolibarrApi
}
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory');
}
@ -1617,7 +1617,7 @@ class Invoices extends DolibarrApi
$this->db->rollback();
throw new RestException(400, 'Payment error : '.$paymentobj->error);
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode);

View File

@ -174,7 +174,7 @@ if ($action == 'create') {
// Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Type payment
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx');
@ -243,7 +243,7 @@ if ($id) {
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($object->fk_account > 0) {
$bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank);

View File

@ -467,11 +467,11 @@ class Localtax extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4;
}
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) {
if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) {
if (isModEnabled("banque") && (empty($this->paymenttype) || $this->paymenttype <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -5;
}
@ -503,7 +503,7 @@ class Localtax extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax
if ($this->id > 0) {
$ok = 1;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Insertion dans llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -170,7 +170,7 @@ if (empty($reshook)) {
$error++;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0) {
setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -244,7 +244,7 @@ if (empty($reshook)) {
$multicurrency_code[$key] = $tmpinvoice->multicurrency_code;
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// If the bank module is active, an account is required to input a payment
if (GETPOST('accountid', 'int') <= 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -492,7 +492,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bank account
print '<tr>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($facture->type != 2) {
print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
}

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -285,7 +285,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '',
$disable_delete = 0;
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$bankline = new AccountLine($db);
if ($object->fk_account > 0) {
@ -327,7 +327,7 @@ print '</td></tr>';
*/
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($object->fk_account > 0) {
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';

View File

@ -628,7 +628,7 @@ class Paiement extends CommonObject
$error = 0;
$bank_line_id = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($accountid <= 0) {
$this->error = 'Bad value for parameter accountid='.$accountid;
dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR);

View File

@ -104,8 +104,8 @@ $arrayfields = array(
'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20),
's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("banque"))),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))),
'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80),
'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))),

View File

@ -71,7 +71,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++;
$action = 'create';
}
if (!empty($conf->banque->enabled) && !(GETPOST("accountid") > 0)) {
if (isModEnabled("banque") && !(GETPOST("accountid") > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors');
$error++;
$action = 'create';

View File

@ -69,7 +69,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++;
$action = 'create';
}
if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) {
if (isModEnabled("banque") && !(GETPOST("accountid", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors');
$error++;
$action = 'create';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -141,7 +141,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($object->bank_account) {
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
@ -194,7 +194,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
if ($object->bank_account) {
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);

View File

@ -1127,7 +1127,7 @@ if ($modecompta == 'BOOKKEEPING') {
*/
//$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1;
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$subtotal_ht = 0;
$subtotal_ttc = 0;

View File

@ -796,7 +796,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
* Various Payments
*/
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
// decaiss
$sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p";

View File

@ -426,7 +426,7 @@ if ($action == 'create') {
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('DefaultBankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1);
print '</td></tr>';
@ -638,7 +638,7 @@ if ($id > 0) {
print '</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('DefaultBankAccount');
@ -668,7 +668,7 @@ if ($id > 0) {
print '<div class="fichehalfright">';
$nbcols = 3;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$nbcols++;
}
@ -703,7 +703,7 @@ if ($id > 0) {
print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
}
print '<td class="right">'.$langs->trans("Amount").'</td>';
@ -726,7 +726,7 @@ if ($id > 0) {
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;

View File

@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

View File

@ -107,7 +107,7 @@ $arrayfields = array(
'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110),
);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount");
}

View File

@ -225,7 +225,7 @@ print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
}
@ -245,7 +245,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
}
@ -323,7 +323,7 @@ while ($i < min($num, $limit)) {
print '<td>'.$obj->num_payment.'</td>';
// Account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Bank transaction
print '<td class="nowraponall">';
$accountlinestatic->id = $obj->fk_bank;
@ -379,7 +379,7 @@ print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td></td>';
print '<td></td>';
}

View File

@ -478,7 +478,7 @@ if (count($amount)) {
// Other stats
print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) {
if (isModEnabled("propal") && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (!empty($conf->commande->enabled) && $key > 0) {

View File

@ -652,7 +652,7 @@ if (count($amount)) {
// Other stats
print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) {
if (isModEnabled("propal") && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
}
if (!empty($conf->commande->enabled) && $key > 0) {

View File

@ -494,7 +494,7 @@ if ($action == 'create') {
print "</td>\n";
print "</tr>";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Bank account
print '<tr><td class="fieldrequired" id="label_fk_account">'.$langs->trans("BankAccount").'</td><td>';
print img_picto('', 'bank_account', 'pictofixedwidth');
@ -629,7 +629,7 @@ if ($id > 0) {
print '</td></tr>';
// Bank account
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
@ -660,7 +660,7 @@ if ($id > 0) {
print '<div class="fichehalfright">';
$nbcols = 3;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$nbcols++;
}
@ -695,7 +695,7 @@ if ($id > 0) {
print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
}
print '<td class="right">'.$langs->trans("Amount").'</td>';
@ -712,7 +712,7 @@ if ($id > 0) {
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref;

View File

@ -560,7 +560,7 @@ class PaymentVAT extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

View File

@ -572,11 +572,11 @@ class Tva extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4;
}
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) {
if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) {
if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -5;
}
@ -633,7 +633,7 @@ class Tva extends CommonObject
if ($this->id > 0) {
$ok = 1;
if (!empty($conf->banque->enabled) && !empty($this->amount)) {
if (isModEnabled("banque") && !empty($this->amount)) {
// Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -83,7 +83,7 @@ $arrayfields = array(
't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"),
);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount");
}

View File

@ -129,7 +129,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder);
}
@ -221,7 +221,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
// Chq number
print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
// Bank transaction
print '<td>';
$accountlinestatic->id = $obj->fk_bank;
@ -258,7 +258,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td class="liste_total right"></td>'; // A total here has no sense
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>';
}

View File

@ -196,7 +196,7 @@ abstract class ActionsContactCardCommon
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder");
$i++;
}
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal");
$i++;

View File

@ -1228,7 +1228,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
}
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal ? $object->ref_propal : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyProposal").'</span>');
print '</td></tr>';
@ -1326,7 +1326,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
//array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External')))
);
$text = $langs->trans("ConfirmCreateContact").'<br>';
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
if ($object->socid > 0) {
$text .= $langs->trans("UserWillBeExternalUser");
} else {
@ -1489,22 +1489,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->load_ref_elements();
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
print '<tr><td class="titlefield">'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal");
print '</td></tr>';
}
if (!empty($conf->commande->enabled) || !empty($conf->expedition->enabled)) {
if (!empty($conf->commande->enabled) || isModEnabled("expedition")) {
print '<tr><td>';
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
print $langs->trans("ContactForOrdersOrShipments");
} else {
print $langs->trans("ContactForOrders");
}
print '</td><td colspan="3">';
$none = $langs->trans("NoContactForAnyOrder");
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$none = $langs->trans("NoContactForAnyOrderOrShipments");
}
print $object->ref_commande ? $object->ref_commande : $none;

View File

@ -154,7 +154,7 @@ print '</td></tr>';
if ($object->thirdparty->client) {
$thirdTypeArray['customer'] = $langs->trans("customer");
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
}
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {

View File

@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->project->enabled)) {

View File

@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes
// list the summary of the propals
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
if (isModEnabled("propal") && $user->rights->propale->lire) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic = new Propal($this->db);

View File

@ -152,7 +152,7 @@ class box_graph_product_distribution extends ModeleBoxes
$WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320';
$HEIGHT = '150'; // Height require to have 5+1 entries into legend visible.
if (!empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
if (isModEnabled("propal") && !empty($user->rights->propale->lire)) {
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showpropalnb) {
$langs->load("propal");
@ -365,7 +365,7 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';
if (!empty($conf->propal->enabled) || !empty($user->rights->propale->lire)) {
if (isModEnabled("propal") || !empty($user->rights->propale->lire)) {
$stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals");
$stringtoshow .= '&nbsp;';
}

View File

@ -62,7 +62,7 @@ class box_produits extends ModeleBoxes
$this->db = $db;
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tmpentry = array('enabled'=>(!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'perms'=>(!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)), 'module'=>'product|service');
$tmpentry = array('enabled'=>(isModEnabled("product") || !empty($conf->service->enabled)), 'perms'=>(!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)), 'module'=>'product|service');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
}

View File

@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$this->db = $db;
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tmpentry = array('enabled'=>((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
$tmpentry = array('enabled'=>((isModEnabled("product") || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
}

View File

@ -1104,7 +1104,7 @@ class Form
global $langs, $conf;
// If product & services are enabled or both disabled.
if ($forceall == 1 || (empty($forceall) && !empty($conf->product->enabled) && !empty($conf->service->enabled))
if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && !empty($conf->service->enabled))
|| (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled))) {
if (empty($hidetext)) {
print $langs->trans("Type").': ';
@ -1138,7 +1138,7 @@ class Form
print $langs->trans("Service");
print '<input type="hidden" name="'.$htmlname.'" value="1">';
}
if ((empty($forceall) && !empty($conf->product->enabled) && empty($conf->service->enabled)) || $forceall == 2) {
if ((empty($forceall) && isModEnabled("product") && empty($conf->service->enabled)) || $forceall == 2) {
print $langs->trans("Product");
print '<input type="hidden" name="'.$htmlname.'" value="0">';
}
@ -2278,8 +2278,8 @@ class Form
$ajaxoptions = array();
}
if (strval($filtertype) === '' && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) {
if (strval($filtertype) === '' && (isModEnabled("product") || !empty($conf->service->enabled))) {
if (isModEnabled("product") && empty($conf->service->enabled)) {
$filtertype = '0';
} elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) {
$filtertype = '1';

View File

@ -80,8 +80,8 @@ class FormBarCode
}
// We check if barcode is already selected by default
if (((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) ||
(!empty($conf->societe->enabled) && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) {
if (((isModEnabled("product") || !empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) ||
(isModEnabled("societe") && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) {
$disable = 'disabled';
}

View File

@ -254,7 +254,7 @@ class FormMargin
}
print '</tr>';
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
//if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) {
print '<tr class="oddeven">';
print '<td>' . $langs->trans('MarginOnProducts') . '</td>';
@ -285,7 +285,7 @@ class FormMargin
print '</tr>';
}
if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) {
if (isModEnabled("product") && !empty($conf->service->enabled)) {
print '<tr class="liste_total">';
print '<td>' . $langs->trans('TotalMargin') . '</td>';
print '<td class="right">' . price($marginInfo['pv_total']) . '</td>';

View File

@ -851,7 +851,7 @@ class FormSetupItem
} elseif ($this->type == 'securekey') {
$out.= $this->generateInputFieldSecureKey();
} elseif ($this->type == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$selected = (empty($this->fieldValue) ? '' : $this->fieldValue);
$out.= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1);
}

View File

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

View File

@ -35,7 +35,7 @@
function expedition_prepare_head(Expedition $object)
{
global $langs, $conf, $user;
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$langs->load("sendings");
}
$langs->load("orders");

View File

@ -318,7 +318,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir)
if ($modulepart == 'produit' && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
global $object;
if (!empty($object->id)) {
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$upload_dirold = $conf->product->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
} else {
$upload_dirold = $conf->service->multidir_output[$object->entity].'/'.substr(substr("000".$object->id, -2), 1, 1).'/'.substr(substr("000".$object->id, -2), 0, 1).'/'.$object->id."/photos";
@ -2921,7 +2921,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (($fuser->rights->produit->{$lire} || $fuser->rights->service->{$lire}) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$original_file = $conf->product->multidir_output[$entity].'/'.$original_file;
} elseif (!empty($conf->service->enabled)) {
$original_file = $conf->service->multidir_output[$entity].'/'.$original_file;

View File

@ -7347,7 +7347,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__NOTE_PRIVATE__'] = '__NOTE_PRIVATE__';
$substitutionarray['__EXTRAFIELD_XXX__'] = '__EXTRAFIELD_XXX__';
if (!empty($conf->societe->enabled)) { // Most objects are concerned
if (isModEnabled("societe")) { // Most objects are concerned
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = '__THIRDPARTY_NAME_ALIAS__';
@ -7409,7 +7409,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
}
if (!empty($conf->propal->enabled) && (!is_object($object) || $object->element == 'propal')) {
if (isModEnabled("propal") && (!is_object($object) || $object->element == 'propal')) {
$substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature';
}
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
@ -7426,11 +7426,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = 'Direct download url of a contract';
$substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = 'Direct download url of a supplier proposal';
if (!empty($conf->expedition->enabled) && (!is_object($object) || $object->element == 'shipping')) {
if (isModEnabled("expedition") && (!is_object($object) || $object->element == 'shipping')) {
$substitutionarray['__SHIPPINGTRACKNUM__'] = 'Shipping tracking number';
$substitutionarray['__SHIPPINGTRACKNUMURL__'] = 'Shipping tracking url';
}
if (!empty($conf->reception->enabled) && (!is_object($object) || $object->element == 'reception')) {
if (isModEnabled("reception") && (!is_object($object) || $object->element == 'reception')) {
$substitutionarray['__RECEPTIONTRACKNUM__'] = 'Shippin tracking number of shipment';
$substitutionarray['__RECEPTIONTRACKNUMURL__'] = 'Shipping tracking url';
}

View File

@ -57,7 +57,7 @@ function ldap_prepare_head()
$h++;
}
if (!empty($conf->societe->enabled) && !empty($conf->global->LDAP_CONTACT_ACTIVE)) {
if (isModEnabled("societe") && !empty($conf->global->LDAP_CONTACT_ACTIVE)) {
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_contacts.php";
$head[$h][1] = $langs->trans("LDAPContactsSynchro");
$head[$h][2] = 'contacts';

View File

@ -34,7 +34,7 @@
function commande_prepare_head(Commande $object)
{
global $db, $langs, $conf, $user;
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$langs->load("sendings");
}
$langs->load("orders");

View File

@ -61,7 +61,7 @@ function pdf_admin_prepare_head()
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'pdf_admin');
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$head[$h][0] = DOL_URL_ROOT.'/admin/pdf_other.php';
$head[$h][1] = $langs->trans("Other");
$head[$h][2] = 'other';

View File

@ -171,7 +171,7 @@ function product_prepare_head($object)
// Attachments
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
if (!empty($conf->product->enabled) && ($object->type == Product::TYPE_PRODUCT)) {
if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
}
if (!empty($conf->service->enabled) && ($object->type == Product::TYPE_SERVICE)) {
@ -179,7 +179,7 @@ function product_prepare_head($object)
}
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
if (!empty($conf->product->enabled) && ($object->type == Product::TYPE_PRODUCT)) {
if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos';
}
if (!empty($conf->service->enabled) && ($object->type == Product::TYPE_SERVICE)) {
@ -374,7 +374,7 @@ function show_stats_for_company($product, $socid)
print '</tr>';
// Customer proposals
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
if (isModEnabled("propal") && $user->rights->propale->lire) {
$nblines++;
$ret = $product->load_stats_propale($socid);
if ($ret < 0) {
@ -469,7 +469,7 @@ function show_stats_for_company($product, $socid)
print '</tr>';
}
// Customer template invoices
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
if (isModEnabled("facture") && $user->rights->facture->lire) {
$nblines++;
$ret = $product->load_stats_facturerec($socid);
if ($ret < 0) {

View File

@ -125,7 +125,7 @@ function project_prepare_head(Project $project, $moreparam = '')
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
|| !empty($conf->propal->enabled) || !empty($conf->commande->enabled)
|| isModEnabled("propal") || !empty($conf->commande->enabled)
|| isModEnabled('facture') || !empty($conf->contrat->enabled)
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) {
$nbElements = 0;
@ -138,7 +138,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->stock->enabled)) {
$nbElements += $project->getElementCount('stock', 'entrepot', 'fk_project');
}
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
$nbElements += $project->getElementCount('propal', 'propal');
}
if (!empty($conf->commande->enabled)) {
@ -165,7 +165,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->ficheinter->enabled)) {
$nbElements += $project->getElementCount('intervention', 'fichinter');
}
if (!empty($conf->expedition->enabled)) {
if (isModEnabled("expedition")) {
$nbElements += $project->getElementCount('shipping', 'expedition');
}
if (!empty($conf->mrp->enabled)) {
@ -195,7 +195,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->salaries->enabled)) {
$nbElements += $project->getElementCount('salaries', 'payment_salary');
}
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$nbElements += $project->getElementCount('variouspayment', 'payment_various');
}
dol_setcache($cachekey, $nbElements, 120); // If setting cache fails, this is not a problem, so we do not test result.

View File

@ -42,8 +42,8 @@ function propal_prepare_head($object)
$head[$h][2] = 'comm';
$h++;
if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|| (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) {
if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|| (isModEnabled("expedition") && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) {
$langs->load("sendings");
$text = '';
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;

View File

@ -729,7 +729,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
if ($user->socid != $objectid) {
return false;
}
} elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) {
} elseif (isModEnabled("societe") && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) {
// If internal user: Check permission for internal users that are restricted on their objects
$sql = "SELECT COUNT(sc.fk_soc) as nb";
$sql .= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -755,7 +755,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")";
$sql .= " AND dbt.fk_soc = ".((int) $user->socid);
} elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) {
} elseif (isModEnabled("societe") && ($user->rights->societe->lire && empty($user->rights->societe->client->voir))) {
// If internal user: Check permission for internal users that are restricted on their objects
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@ -827,7 +827,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
$sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")";
$sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid);
} elseif (!empty($conf->societe->enabled) && empty($user->rights->societe->client->voir)) {
} elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)) {
// If internal user: Check permission for internal users that are restricted on their objects
if ($feature != 'ticket') {
if (empty($dbt_keyfield)) {

View File

@ -1368,7 +1368,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
// For the moment, we manage this with hard coded exception
//print "Remove box ".$file.'<br>';
if ($file == 'box_graph_product_distribution.php') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
dol_syslog("We discard deleting module ".$file." because another module still active requires it.");
continue;
}

View File

@ -1043,7 +1043,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0);
$pdf->SetXY($tab3_posx + 35, $tab3_top + 1);
$pdf->MultiCell(30, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$pdf->SetXY($tab3_posx + 65, $tab3_top + 1);
$pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0);
}
@ -1083,7 +1083,7 @@ class pdf_standard extends ModeleExpenseReport
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->p_code);
$pdf->MultiCell(40, 3, $oper, 0, 'L', 0);
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$pdf->SetXY($tab3_posx + 65, $tab3_top + $y + 1);
$pdf->MultiCell(30, 3, $row->baref, 0, 'L', 0);
}

View File

@ -345,7 +345,7 @@ class modAdherent extends DolibarrModules
'a.email'=>"Email", 'a.birth'=>"Birthday", 'a.statut'=>"Status*", 'a.photo'=>"Photo", 'a.note_public'=>"NotePublic", 'a.note_private'=>"NotePrivate",
'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription'
);
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
}
// Add extra fields
@ -380,7 +380,7 @@ class modAdherent extends DolibarrModules
'dict' => 'DictionaryCountry'
)
);
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$this->import_convertvalue_array[$r]['a.fk_soc'] = array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty');
}
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
@ -394,7 +394,7 @@ class modAdherent extends DolibarrModules
'a.email'=>'jsmith@example.com', 'a.birth'=>'1972-10-10', 'a.statut'=>"0 or 1", 'a.note_public'=>"This is a public comment on member",
'a.note_private'=>"This is private comment on member", 'a.datec'=>dol_print_date($now, '%Y-%m__%d'), 'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'), '%Y-%m-%d')
);
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name";
}
$this->import_updatekeys_array[$r] = array('a.ref'=>'MemberRef', 'a.login'=>'Login');

View File

@ -127,19 +127,19 @@ class modCategorie extends DolibarrModules
$this->export_permission[$r] = array(array("categorie", "lire"));
$typeexample = "";
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."0=Product-Service";
}
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
$typeexample .= ($typeexample ? "/" : "")."1=Supplier";
}
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect";
}
if (!empty($conf->adherent->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."3=Member";
}
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$typeexample .= ($typeexample ? " / " : "")."4=Contact";
}
if (!empty($conf->bank->enabled)) {
@ -179,7 +179,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0];
$this->export_label[$r] = 'CatProdList';
$this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = '!empty($conf->product->enabled) || !empty($conf->service->abled)';
$this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->abled)';
$this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label');
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 'p.label'=>'Text');
@ -249,7 +249,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_2_'.Categorie::$MAP_ID_TO_CODE[2];
$this->export_label[$r] = 'CatCusList';
$this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = '!empty($conf->societe->enabled)';
$this->export_enabled[$r] = 'isModEnabled("societe")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "export"));
$this->export_fields_array[$r] = array(
'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory",
@ -321,7 +321,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_4_'.Categorie::$MAP_ID_TO_CODE[4];
$this->export_label[$r] = 'CatContactList';
$this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = '!empty($conf->societe->enabled)';
$this->export_enabled[$r] = 'isModEnabled("societe")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "contact", "export"));
$this->export_fields_array[$r] = array(
'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory",
@ -466,7 +466,7 @@ class modCategorie extends DolibarrModules
$this->import_updatekeys_array[$r] = array('ca.label'=>'Label');
// 0 Products
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$r++;
$this->import_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0];
$this->import_label[$r] = "CatProdLinks"; // Translation key
@ -506,7 +506,7 @@ class modCategorie extends DolibarrModules
}
// 2 Customers
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$r++;
$this->import_code[$r] = $this->rights_class.'_2_'.Categorie::$MAP_ID_TO_CODE[2];
$this->import_label[$r] = "CatCusLinks"; // Translation key
@ -545,7 +545,7 @@ class modCategorie extends DolibarrModules
}
// 4 Contacts/Addresses
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
$r++;
$this->import_code[$r] = $this->rights_class.'_4_'.Categorie::$MAP_ID_TO_CODE[4];
$this->import_label[$r] = "CatContactsLinks"; // Translation key

View File

@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (isModEnabled('facture')) {

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->propal->enabled)) {
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (isModEnabled('facture')) {

View File

@ -815,13 +815,13 @@ class pdf_azur extends ModelePDFPropales
foreach ($filetomerge->lines as $linefile) {
if (!empty($linefile->id) && !empty($linefile->file_name)) {
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos";
} elseif (!empty($conf->service->enabled)) {
$filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos";
}
} else {
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product');
} elseif (!empty($conf->service->enabled)) {
$filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product');

View File

@ -940,13 +940,13 @@ class pdf_cyan extends ModelePDFPropales
foreach ($filetomerge->lines as $linefile) {
if (!empty($linefile->id) && !empty($linefile->file_name)) {
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos";
} elseif (!empty($conf->service->enabled)) {
$filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos";
}
} else {
if (!empty($conf->product->enabled)) {
if (isModEnabled("product")) {
$filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product');
} elseif (!empty($conf->service->enabled)) {
$filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product');

View File

@ -185,14 +185,14 @@ class pdf_paiement
$sql .= ", c.code as paiement_code, p.num_paiement as num_payment";
$sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
$sql .= ", pf.amount as pf_amount";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= ", ba.ref as bankaccount";
}
$sql .= ", p.rowid as prowid";
$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id";
$sql .= ", ".MAIN_DB_PREFIX."facture as f,";
$sql .= " ".MAIN_DB_PREFIX."paiement_facture as pf,";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
}
$sql .= " ".MAIN_DB_PREFIX."societe as s";
@ -200,7 +200,7 @@ class pdf_paiement
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";
@ -223,14 +223,14 @@ class pdf_paiement
$sql .= ", c.code as paiement_code, p.num_paiement as num_payment";
$sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
$sql .= ", pf.amount as pf_amount";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= ", ba.ref as bankaccount";
}
$sql .= ", p.rowid as prowid";
$sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id";
$sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f,";
$sql .= " ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
}
$sql .= " ".MAIN_DB_PREFIX."societe as s";
@ -238,7 +238,7 @@ class pdf_paiement
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid";
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
$sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";

View File

@ -193,7 +193,7 @@ if ($nolinesbefore) {
// Free line
echo '<span class="prod_entry_mode_free">';
// Show radio free line
if ($forceall >= 0 && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) {
if ($forceall >= 0 && (isModEnabled("product") || !empty($conf->service->enabled))) {
echo '<label for="prod_entry_mode_free">';
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') );
@ -219,7 +219,7 @@ if ($nolinesbefore) {
echo '</span>';
}
// Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
if ($forceall >= 0 && $freelines) {
echo '<br><span class="prod_entry_mode_predef paddingtop">';
} else {
@ -230,7 +230,7 @@ if ($nolinesbefore) {
$labelforradio = '';
if (empty($conf->dol_optimize_smallscreen)) {
if (empty($senderissupplier)) {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) {
if (isModEnabled("product") && empty($conf->service->enabled)) {
$labelforradio = $langs->trans('PredefinedProductsToSell');
} elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) {
$labelforradio = $langs->trans('PredefinedServicesToSell');
@ -238,7 +238,7 @@ if ($nolinesbefore) {
$labelforradio = $langs->trans('PredefinedProductsAndServicesToSell');
}
} else {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) {
if (isModEnabled("product") && empty($conf->service->enabled)) {
$labelforradio = $langs->trans('PredefinedProductsToPurchase');
} elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) {
$labelforradio = $langs->trans('PredefinedServicesToPurchase');
@ -336,7 +336,7 @@ if ($nolinesbefore) {
print $hookmanager->resPrint;
}
}
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
echo '<br>';
if (!empty($conf->variants->enabled)) {
echo '<div id="attributes_box"></div>';
@ -446,7 +446,7 @@ if ($nolinesbefore) {
?>
<td class="nobottom margininfos linecolmargin right">
<!-- For predef product -->
<?php if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { ?>
<?php if (isModEnabled("product") || !empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat minwidth75imp maxwidth150" style="display: none;"></select>
<?php } ?>
<!-- For free product -->

View File

@ -290,7 +290,7 @@ $coldisplay++;
?>
<td class="margininfos right">
<!-- For predef product -->
<?php if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { ?>
<?php if (isModEnabled("product") || !empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat minwidth75imp right" style="display: none;"></select>
<?php } ?>
<!-- For free product -->

View File

@ -117,7 +117,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Order classify billed proposal
if ($action == 'ORDER_CLASSIFY_BILLED') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->propal->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL)) {
if (isModEnabled("propal") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL)) {
$object->fetchObjectLinked('', 'propal', $object->id, $object->element);
if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0;
@ -161,7 +161,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
// Second classify billed the proposal.
if (!empty($conf->propal->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL)) {
if (isModEnabled("propal") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL)) {
$object->fetchObjectLinked('', 'propal', $object->id, $object->element);
if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0;
@ -179,7 +179,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
if (!empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) {
if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) {
/** @var Facture $object */
$object->fetchObjectLinked('', 'shipping', $object->id, $object->element);
@ -244,7 +244,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
// Then set reception to "Billed" if WORKFLOW_BILL_ON_RECEPTION is set
if (!empty($conf->reception->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) {
if (isModEnabled("reception") && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) {
$object->fetchObjectLinked('', 'reception', $object->id, $object->element);
if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0;
@ -296,7 +296,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->commande->enabled) && !empty($conf->expedition->enabled) && !empty($conf->workflow->enabled) &&
if (!empty($conf->commande->enabled) && 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_CLOSED) && ($action == 'SHIPPING_CLOSED'))
@ -365,7 +365,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (($action == 'RECEPTION_VALIDATE') || ($action == 'RECEPTION_CLOSED')) {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_order->enabled)) && !empty($conf->reception->enabled) && !empty($conf->workflow->enabled) &&
if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_order->enabled)) && isModEnabled("reception") && !empty($conf->workflow->enabled) &&
(
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION) && ($action == 'RECEPTION_VALIDATE')) ||
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED) && ($action == 'RECEPTION_CLOSED'))

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if (isModEnabled("product") || !empty($conf->service->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
if (!empty($conf->expedition_bon->enabled)) {
@ -312,7 +312,7 @@ if ($action == 'create') { // Create. Seems to no be used
$objectsrc = new Commande($db);
$objectsrc->fetch($expedition->origin_id);
}
if ($typeobject == 'propal' && $expedition->origin_id > 0 && !empty($conf->propal->enabled)) {
if ($typeobject == 'propal' && $expedition->origin_id > 0 && isModEnabled("propal")) {
$objectsrc = new Propal($db);
$objectsrc->fetch($expedition->origin_id);
}
@ -409,7 +409,7 @@ if ($action == 'create') { // Create. Seems to no be used
print "</td>\n";
print '</tr>';
}
if ($typeobject == 'propal' && $expedition->origin_id && !empty($conf->propal->enabled)) {
if ($typeobject == 'propal' && $expedition->origin_id && isModEnabled("propal")) {
$propal = new Propal($db);
$propal->fetch($expedition->origin_id);
print '<tr><td class="titlefield">'.$langs->trans("RefProposal").'</td>';

View File

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

View File

@ -310,7 +310,7 @@ print '<td width="60" class="center">'.$langs->trans("Value")."</td>\n";
print '<td></td>';
print "</tr>\n";
if (!empty($conf->societe->enabled)) {
if (isModEnabled("societe")) {
print '<tr class="oddeven">';
print '<td colspan="2">';
print $langs->trans("DonationUseThirdparties");

View File

@ -211,7 +211,7 @@ if (empty($reshook)) {
$error = 0;
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES) && !(GETPOST("socid", 'int') > 0)) {
if (isModEnabled("societe") && !empty($conf->global->DONATION_USE_THIRDPARTIES) && !(GETPOST("socid", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors');
$action = "create";
$error++;
@ -402,7 +402,7 @@ if ($action == 'create') {
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
// Company
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
if (isModEnabled("societe") && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
// Thirdparty
if ($soc->id > 0) {
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
@ -591,7 +591,7 @@ if (!empty($id) && $action == 'edit') {
print "</td>";
print "</tr>\n";
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
if (isModEnabled("societe") && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
$company = new Societe($db);
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
@ -756,7 +756,7 @@ if (!empty($id) && $action != 'edit') {
print yn($object->public);
print '</td></tr>';
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
if (isModEnabled("societe") && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
$company = new Societe($db);
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';

View File

@ -574,7 +574,7 @@ class PaymentDonation extends CommonObject
$error = 0;
if (!empty($conf->banque->enabled)) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);

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