use isModEnabled function

This commit is contained in:
Frédéric France 2022-06-09 22:41:59 +02:00
parent 400afc937f
commit 5dcfc28913
36 changed files with 66 additions and 67 deletions

View File

@ -464,8 +464,7 @@ print "</td></tr>\n";
// Ask for payment bank during supplier order
/* Kept as hidden for the moment
if ($conf->banque->enabled)
{
if (isModEnabled('banque')) {
print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">';
@ -521,7 +520,7 @@ print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
print '<td></td>';
print '<td class="center">';
if ($conf->reception->enabled) {
if (isModEnabled('reception')) {
print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
} else {
if ($conf->use_javascript_ajax) {

View File

@ -638,7 +638,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Create MO
if ($conf->mrp->enabled) {
if (isModEnabled('mrp')) {
if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/mrp/mo_card.php?action=create&fk_bom='.$object->id.'&token='.newToken().'&backtopageforcancel='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("CreateMO").'</a>'."\n";
}

View File

@ -1753,7 +1753,7 @@ if ($action == 'create' && $usercancreate) {
}
// Shipping Method
if (!empty($conf->expedition->enabled)) {
if (isModEnabled('expedition')) {
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
@ -2383,7 +2383,7 @@ if ($action == 'create' && $usercancreate) {
print '</td></tr>';
// Shipping Method
if (!empty($conf->expedition->enabled)) {
if (isModEnabled('expedition')) {
print '<tr><td>';
$editenable = $usercancreate;
print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable);
@ -2758,11 +2758,11 @@ if ($action == 'create' && $usercancreate) {
// Ship
$numshipping = 0;
if (!empty($conf->expedition->enabled)) {
if (isModEnabled('expedition')) {
$numshipping = $object->nb_expedition();
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) {
if ((isModEnabled('expedition_bon') && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) {
if ($user->rights->expedition->creer) {
print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, '');
} else {

View File

@ -541,7 +541,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans($bickey).'</td>';
print '<td><input maxlength="11" type="text" class="flat minwidth150" name="bic" value="'.(GETPOST('bic') ?GETPOST('bic', 'alpha') : $object->bic).'"></td></tr>';
if ($conf->paymentbybanktransfer->enabled) {
if (isModEnabled('paymentbybanktransfer')) {
print '<tr><td>'.$langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation").'</td>';
print '<td><input type="checkbox" class="flat minwidth150" name="pti_in_ctti"'. (empty(GETPOST('pti_in_ctti')) ? '' : ' checked ') . '>&nbsp;';
print img_picto($langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp"), 'info');
@ -778,14 +778,14 @@ if ($action == 'create') {
}
print '</td></tr>';
if ($conf->prelevement->enabled) {
if (isModEnabled('prelevement')) {
print '<tr><td>'.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').'</td>';
print '<td>'.$object->ics.'</td>';
print '</tr>';
}
// TODO ICS is not used with bank transfer !
if ($conf->paymentbybanktransfer->enabled) {
if (isModEnabled('paymentbybanktransfer')) {
print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>';
print '<td>'.$object->ics_transfer.'</td>';
print '</tr>';
@ -1083,12 +1083,12 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans($bickey).'</td>';
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="11" type="text" class="flat" name="bic" value="'.(GETPOSTISSET('bic') ? GETPOST('bic', 'alphanohtml') : $object->bic).'"></td></tr>';
if (!empty($conf->prelevement->enabled)) {
if (isModEnabled('prelevement')) {
print '<tr><td>'.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').'</td>';
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET('ics') ? GETPOST('ics', 'alphanohtml') : $object->ics).'"></td></tr>';
}
if (!empty($conf->paymentbybanktransfer->enabled)) {
if (!empty(isModEnabled('paymentbybanktransfer'))) {
print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>';
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.(GETPOSTISSET('ics_transfer') ? GETPOST('ics_transfer', 'alphanohtml') : $object->ics_transfer).'"></td></tr>';

View File

@ -486,7 +486,7 @@ $morefilter = '';
$moreforfilter = '';
// If the user can view categories of products
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) {
if (isModEnabled('categorie') && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');

View File

@ -132,7 +132,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
$result = $object->create($user);
if ($result > 0) {
// Creation OK
if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
if (isModEnabled('categorie') && method_exists($object, 'setCategories')) {
$categories = GETPOST('categories', 'array:int');
$object->setCategories($categories);
}
@ -239,7 +239,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
}
}
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
$categories = GETPOST('categories', 'array');
if (method_exists($object, 'setCategories')) {
$object->setCategories($categories);

View File

@ -433,7 +433,7 @@ class FormTicket
}
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);

View File

@ -60,7 +60,7 @@ function commande_prepare_head(Commande $object)
$h++;
}
if (($conf->expedition_bon->enabled && $user->rights->expedition->lire)
if ((isModEnabled('expedition_bon') && $user->rights->expedition->lire)
|| ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)) {
$nbShipments = $object->getNbOfShipments();
$nbReceiption = 0;

View File

@ -299,7 +299,7 @@ if (!empty($withproject)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -282,7 +282,7 @@ if (!empty($withproject)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -257,7 +257,7 @@ if (!empty($withproject)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -382,7 +382,7 @@ if ($projectid > 0) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("Categories").'</td><td class="valuefield">';
print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -327,7 +327,7 @@ if (!empty($withproject)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@ -510,7 +510,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -40,7 +40,7 @@ if (!empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
if ($conf->contrat->enabled) {
if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php";
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
}
@ -928,7 +928,7 @@ if ($action == 'create') {
}
// Contract
if ($conf->contrat->enabled) {
if (isModEnabled('contrat')) {
$langs->load("contracts");
print '<tr><td>'.$langs->trans("Contract").'</td><td>';
$numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1, 1);

View File

@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
print "</td></tr>";

View File

@ -224,15 +224,15 @@ class Loan extends CommonObject
$this->error = "ErrorBadParameter";
return -2;
}
if (($conf->accounting->enabled) && empty($this->account_capital)) {
if (isModEnabled('accounting') && empty($this->account_capital)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyCapitalCode"));
return -2;
}
if (($conf->accounting->enabled) && empty($this->account_insurance)) {
if (isModEnabled('accounting') && empty($this->account_insurance)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInsuranceCode"));
return -2;
}
if (($conf->accounting->enabled) && empty($this->account_interest)) {
if (isModEnabled('accounting') && empty($this->account_interest)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("LoanAccountancyInterestCode"));
return -2;
}

View File

@ -2127,7 +2127,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Tags-Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
@ -2632,7 +2632,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1);
print "</td></tr>";

View File

@ -206,7 +206,7 @@ if ($result || !($id > 0)) {
print '</td></tr>';
// Tag
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
$moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"');
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth400');
@ -303,49 +303,49 @@ if ($result || !($id > 0)) {
}
}
if ($conf->propal->enabled) {
if (isModEnabled('propal')) {
$graphfiles['propal'] = array('modulepart'=>'productstats_proposals',
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsProposals") : $langs->transnoentitiesnoconv("NumberOfProposals")));
}
if ($conf->supplier_proposal->enabled) {
if (isModEnabled('supplier_proposal')) {
$graphfiles['proposalssuppliers'] = array('modulepart'=>'productstats_proposalssuppliers',
'file' => $object->id.'/proposalssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierProposals") : $langs->transnoentitiesnoconv("NumberOfSupplierProposals")));
}
if ($conf->order->enabled) {
if (isModEnabled('order')) {
$graphfiles['orders'] = array('modulepart'=>'productstats_orders',
'file' => $object->id.'/orders12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerOrders") : $langs->transnoentitiesnoconv("NumberOfCustomerOrders")));
}
if ($conf->supplier_order->enabled) {
if (isModEnabled('supplier_order')) {
$graphfiles['orderssuppliers'] = array('modulepart'=>'productstats_orderssuppliers',
'file' => $object->id.'/orderssuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierOrders") : $langs->transnoentitiesnoconv("NumberOfSupplierOrders")));
}
if ($conf->facture->enabled) {
if (isModEnabled('facture')) {
$graphfiles['invoices'] = array('modulepart'=>'productstats_invoices',
'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsCustomerInvoices") : $langs->transnoentitiesnoconv("NumberOfCustomerInvoices")));
}
if ($conf->supplier_invoice->enabled) {
if (isModEnabled('supplier_invoice')) {
$graphfiles['invoicessuppliers'] = array('modulepart'=>'productstats_invoicessuppliers',
'file' => $object->id.'/invoicessuppliers12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsSupplierInvoices") : $langs->transnoentitiesnoconv("NumberOfSupplierInvoices")));
}
if ($conf->contrat->enabled) {
if (isModEnabled('contrat')) {
$graphfiles['contracts'] = array('modulepart'=>'productstats_contracts',
'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsContracts") : $langs->transnoentitiesnoconv("NumberOfContracts")));
}
if ($conf->mrp->enabled) {
if (isModEnabled('mrp')) {
$graphfiles['mrp'] = array('modulepart'=>'productstats_mrp',
'file' => $object->id.'/mos12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png',
'label' => ($mode == 'byunit' ? $langs->transnoentitiesnoconv("NumberOfUnitsMos") : $langs->transnoentitiesnoconv("NumberOfMos")));

View File

@ -545,7 +545,7 @@ if ($action == 'create') {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
print "</td></tr>";
@ -919,7 +919,7 @@ if ($action == 'create') {
}
// Tags-Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="tdtop">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1);
$c = new Categorie($db);

View File

@ -903,7 +903,7 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td colspan="3">';
print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1);
print "</td></tr>";

View File

@ -1001,7 +1001,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '</td></tr>';
// Tags-Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
@ -1170,7 +1170,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -167,7 +167,7 @@ print nl2br($object->description);
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@ -421,7 +421,7 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -343,7 +343,7 @@ print nl2br($object->description);
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -216,7 +216,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -648,7 +648,7 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
print "</td></tr>";

View File

@ -258,7 +258,7 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -289,7 +289,7 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -245,7 +245,7 @@ if ($object->id > 0) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -235,7 +235,7 @@ if ($object->id > 0) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -333,7 +333,7 @@ if ($id > 0 || !empty($ref)) {
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -868,7 +868,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
print '</td></tr>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id, 'project', 1);
print "</td></tr>";

View File

@ -199,13 +199,13 @@ if ($object->fournisseur) {
$obj = $db->fetch_object($resql);
$nbCmdsFourn = $obj->nb;
$thirdTypeArray['supplier'] = $langs->trans("supplier");
if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
if ((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) {
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
}
if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
if ((isModEnabled('fournisseur') && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) {
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
}
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire) {
if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$elementTypeArray['supplier_proposal'] = $langs->transnoentitiesnoconv('SupplierProposals');
}
}

View File

@ -838,16 +838,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb;
$thirdTypeArray['customer'] = $langs->trans("customer");
if ($conf->propal->enabled && $user->rights->propal->lire) {
if (isModEnabled('propal') && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
}
if ($conf->commande->enabled && $user->rights->commande->lire) {
if (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
}
if ($conf->facture->enabled && $user->rights->facture->lire) {
if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
if ($conf->contrat->enabled && $user->rights->contrat->lire) {
if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
}

View File

@ -1121,7 +1121,7 @@ if ($action == 'create' || $action == 'presend') {
print '<div class="underbanner clearboth"></div>';
// Categories
if ($conf->categorie->enabled) {
if (isModEnabled('categorie')) {
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="border tableforfield centpercent noborderbottom">';