isModEnabled

This commit is contained in:
Frédéric France 2022-06-21 20:54:28 +02:00
parent 9f32100fef
commit 62c171c26d
11 changed files with 30 additions and 30 deletions

View File

@ -239,7 +239,7 @@ if (!$conf->use_javascript_ajax) {
} else {
print '<td>';
$listmodelcsv = $accountancyexport->getType();
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '</td>';
}

View File

@ -207,7 +207,7 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
$accountancyexport = new AccountancyExport($db);
$listofformat = $accountancyexport->getType();
$formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV;
$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV');
if (empty($listofformat[$formatexportset])) {
$formatexportset = 1;
}

View File

@ -661,7 +661,7 @@ if ($conf->banque->enabled) {
}
// Ask for warehouse during order
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) {

View File

@ -1244,7 +1244,7 @@ class Expedition extends CommonObject
$mouvS->origin = null;
// get lot/serial
$lotArray = null;
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
$lotArray = $shipmentlinebatch->fetchAll($obj->expeditiondet_id);
if (!is_array($lotArray)) {
$error++;
@ -2781,7 +2781,7 @@ class ExpeditionLigne extends CommonObjectLine
$this->db->begin();
// delete batch expedition line
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_batch";
$sql .= " WHERE fk_expeditiondet = ".((int) $this->id);

View File

@ -747,7 +747,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print '</td>';
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
// Available
print '<td align="right">';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
@ -756,7 +756,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
}
// Lot - serial
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@ -787,11 +787,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<input type="submit" class="button buttongen button-add" name="addconsumelinebutton" value="'.$langs->trans("Add").'">';
print '<input type="submit" class="button buttongen button-cancel" name="canceladdconsumelinebutton" value="'.$langs->trans("Cancel").'">';
print '</td>';
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
print '<td></td>';
}
// Lot - serial
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td></td>';
}
// Action
@ -909,7 +909,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td>';
print '</td>';
// Stock
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
print '<td class="nowraponall right">';
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
print img_warning($langs->trans('StockTooLow')).' ';
@ -918,7 +918,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
}
// Lot
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td></td>';
}
// Action delete line
@ -965,12 +965,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
// Stock
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
print '<td></td>';
}
// Lot Batch
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@ -1033,12 +1033,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
// Stock
if ($conf->stock->enabled) {
if (isModEnabled('stock')) {
print '<td></td>';
}
// Lot / Batch
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
@ -1121,7 +1121,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $langs->trans("Warehouse");
}
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
print $langs->trans("Batch");
@ -1149,7 +1149,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<input type="submit" class="button buttongen button-cancel" name="canceladdproducelinebutton" value="'.$langs->trans("Cancel").'">';
print '</td>';
// Lot - serial
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td></td>';
}
// Action
@ -1236,7 +1236,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
print '<td>'; // Warehouse
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td></td>'; // Lot
}
@ -1277,7 +1277,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($line2['batch'] != '') {
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
@ -1324,7 +1324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<span class="opacitymedium">'.$langs->trans("NoStockChangeOnServices").'</span>';
}
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($tmpproduct->status_batch) {
$preselected = (GETPOSTISSET('batchtoproduce-'.$line->id.'-'.$i) ? GETPOST('batchtoproduce-'.$line->id.'-'.$i) : '');

View File

@ -1860,7 +1860,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
// Batch number managment
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));

View File

@ -308,7 +308,7 @@ class Inventory extends CommonObject
$inventoryline->batch = $obj->batch;
$inventoryline->datec = dol_now();
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
} else {
$inventoryline->qty_stock = $obj->reel;

View File

@ -569,7 +569,7 @@ print '<tr class="liste_titre">';
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
@ -601,7 +601,7 @@ print img_picto($langs->trans("Product"), 'product', 'class="paddingright"');
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 1, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1, '', null, 1);
print '</td>';
// Batch number
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
print img_picto($langs->trans("LotSerial"), 'lot', 'class="paddingright"');
print '<input type="text" name="batch" class="flat maxwidth50" value="'.$batch.'">';
@ -643,7 +643,7 @@ foreach ($listofdata as $key => $val) {
print '<td>';
print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
print $val['batch'];
print '</td>';

View File

@ -631,7 +631,7 @@ if ($id > 0 || $ref) {
print '</td></tr>';
}
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<tr><td class="">'.$langs->trans("ManageLotSerial").'</td><td>';
print $object->getLibStatut(0, 2);
print '</td></tr>';

View File

@ -749,7 +749,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<tr class="liste_titre">';
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
}
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
@ -789,7 +789,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($action === 'editline' && $line->id == $lineid) $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
else print $productstatic->getNomUrl(1).' - '.$productstatic->label;
print '</td>';
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
if ($action === 'editline' && $line->id == $lineid) print '<input type="text" value="'.$line->batch.'" name="batch" class="flat maxwidth50"/>';
else {
@ -883,7 +883,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$form->select_produits($fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
print '</td>';
// Batch number
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
print '<td>';
print '<input type="text" name="batch" class="flat maxwidth50" '.(!empty($error) ? 'value="'.$batch.'"' : '').'>';
print '</td>';

View File

@ -1244,7 +1244,7 @@ if ($action == 'create') {
if (!empty($extrafields)) {
//var_dump($line);
$colspan = 5;
if ($conf->productbatch->enabled) {
if (isModEnabled('productbatch')) {
$colspan += 3;
}
$recLine = new CommandeFournisseurDispatch($db);