30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/stock.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
44$langs->loadLangs(array(
"admin",
"stocks"));
51$action =
GETPOST(
'action',
'aZ09');
52$value =
GETPOST(
'value',
'alpha');
53$modulepart =
GETPOST(
'modulepart',
'aZ09');
54$label =
GETPOST(
'label',
'alpha');
55$scandir =
GETPOST(
'scan_dir',
'alpha');
65include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
69if ($action ==
'update' || preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
70 if ($action ==
'update') {
72 'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE',
73 'STOCK_CALCULATE_ON_SUPPLIER_BILL',
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_RECEPTION',
'STOCK_CALCULATE_ON_RECEPTION_CLOSE',
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',
74 'STOCK_DISALLOW_NEGATIVE_TRANSFER',
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE',
'STOCK_MUST_BE_ENOUGH_FOR_ORDER',
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT',
75 'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT'
78 $arrayofcode = array($reg[1]);
82 foreach ($arrayofcode as $code) {
84 if (GETPOSTISSET($code)) {
89 if (in_array($code, array(
'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'))) {
95 if (in_array($code, array(
'STOCK_CALCULATE_ON_SUPPLIER_BILL',
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_RECEPTION',
'STOCK_CALCULATE_ON_RECEPTION_CLOSE',
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'))) {
109 header(
"Location: ".$_SERVER[
"PHP_SELF"].($page_y ?
'?page_y='.$page_y :
''));
116if ($action ==
'update' || preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
117 if ($action ==
'update') {
118 $arrayofcode = array(
119 'STOCK_CALCULATE_ON_BILL',
'STOCK_CALCULATE_ON_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_SHIPMENT',
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE',
120 'STOCK_CALCULATE_ON_SUPPLIER_BILL',
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER',
'STOCK_CALCULATE_ON_RECEPTION',
'STOCK_CALCULATE_ON_RECEPTION_CLOSE',
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',
123 $arrayofcode = array($reg[1]);
127 foreach ($arrayofcode as $code) {
131 header(
"Location: ".$_SERVER[
"PHP_SELF"].($page_y ?
'?page_y='.$page_y :
''));
138if ($action ==
'warehouse') {
139 $value =
GETPOST(
'default_warehouse',
'alpha');
149if ($action ==
'specimen') {
150 $modele =
GETPOST(
'module',
'alpha');
158 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
159 foreach ($dirmodels as $reldir) {
160 $file =
dol_buildpath($reldir.
"core/modules/stock/doc/pdf_".$modele.
".modules.php", 0);
161 if (file_exists($file)) {
162 $classname =
"pdf_".$modele;
167 if ($classname !==
'') {
170 $module =
new $classname(
$db);
171 '@phan-var-force ModelePDFStock $module';
173 if ($module->write_file(
$object, $langs) > 0) {
174 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=stock&file=SPECIMEN.pdf");
182 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
184} elseif ($action ==
'set') {
187} elseif ($action ==
'del') {
194} elseif ($action ==
'setdoc') {
199 $conf->global->STOCK_ADDON_PDF = $value;
215$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
217llxHeader(
'', $langs->trans(
"StockSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-stock');
219$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
221print
load_fiche_titre($langs->trans(
"StockSetup"), $linkback,
'title_setup');
231$disableStockCalculateOn = array();
236 $disableStockCalculateOn[] =
'BILL';
237 $disableStockCalculateOn[] =
'VALIDATE_ORDER';
241 $disableStockCalculateOn[] =
'SUPPLIER_BILL';
242 $disableStockCalculateOn[] =
'SUPPLIER_VALIDATE_ORDER';
244 print
info_admin($langs->trans(
'WhenProductVirtualOnOptionAreForced'));
249 $langs->load(
"productbatch");
250 $disableStockCalculateOn[] =
'BILL';
251 $disableStockCalculateOn[] =
'VALIDATE_ORDER';
255 $disableStockCalculateOn[] =
'SUPPLIER_BILL';
256 $disableStockCalculateOn[] =
'SUPPLIER_VALIDATE_ORDER';
258 $descmode =
""; $incmode =
"";
267 print
info_admin($langs->transnoentitiesnoconv(
"WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
271print
info_admin($langs->trans(
"IfYouUsePointOfSaleCheckModule"));
275print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
276print
'<input type="hidden" name="token" value="'.newToken().
'">';
277print
'<input type="hidden" name="action" value="update">';
278print
'<input type="hidden" name="page_y" value="">';
281print
'<div class="div-table-responsive-no-min">';
282print
'<table class="noborder centpercent">';
283print
'<tr class="liste_titre">';
284print
"<td>".$langs->trans(
"RuleForStockManagementDecrease").
"</td>\n";
285print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
290print
'<!-- STOCK_CALCULATE_ON_BILL -->';
291print
'<tr class="oddeven">';
292print
'<td>'.$langs->trans(
"DeStockOnBill").
'</td>';
293print
'<td class="right">';
295 if (
$conf->use_javascript_ajax) {
296 if (in_array(
'BILL', $disableStockCalculateOn)) {
297 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
299 print ajax_constantonoff(
'STOCK_CALCULATE_ON_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
302 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
303 print $form->selectarray(
"STOCK_CALCULATE_ON_BILL", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_BILL'));
306 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module30Name")).
'</span>';
308print
"</td>\n</tr>\n";
312print
'<!-- STOCK_CALCULATE_ON_VALIDATE_ORDER -->';
313print
'<tr class="oddeven">';
314print
'<td>'.$langs->trans(
"DeStockOnValidateOrder").
'</td>';
315print
'<td class="right">';
317 if (
$conf->use_javascript_ajax) {
318 if (in_array(
'VALIDATE_ORDER', $disableStockCalculateOn)) {
319 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
321 print ajax_constantonoff(
'STOCK_CALCULATE_ON_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
324 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
325 print $form->selectarray(
"STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_VALIDATE_ORDER'));
328 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module25Name")).
'</span>';
330print
"</td>\n</tr>\n";
336print
'<!-- STOCK_CALCULATE_ON_SHIPMENT -->';
337print
'<tr class="oddeven">';
338print
'<td>'.$langs->trans(
"DeStockOnShipment").
'</td>';
339print
'<td class="right">';
341 if (
$conf->use_javascript_ajax) {
342 if (in_array(
'SHIPMENT', $disableStockCalculateOn)) {
343 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
345 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
348 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
349 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT'));
352 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
354print
"</td>\n</tr>\n";
357print
'<!-- STOCK_CALCULATE_ON_SHIPMENT_CLOSE -->';
358print
'<tr class="oddeven">';
359print
'<td>'.$langs->trans(
"DeStockOnShipmentOnClosing").
'</td>';
360print
'<td class="right">';
362 if (
$conf->use_javascript_ajax) {
363 if (in_array(
'SHIPMENT_CLOSE', $disableStockCalculateOn)) {
364 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
366 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
369 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
370 print $form->selectarray(
"STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SHIPMENT_CLOSE'));
373 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module80Name")).
'</span>';
375print
"</td>\n</tr>\n";
386print
'<div class="div-table-responsive-no-min">';
387print
'<table class="noborder centpercent">';
388print
'<tr class="liste_titre">';
389print
"<td>".$langs->trans(
"RuleForStockManagementIncrease").
"</td>\n";
390print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
395print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_BILL -->';
396print
'<tr class="oddeven">';
397print
'<td>'.$langs->trans(
"ReStockOnBill").
'</td>';
398print
'<td class="right">';
400 if (
$conf->use_javascript_ajax) {
401 if (in_array(
'SUPPLIER_BILL', $disableStockCalculateOn)) {
402 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
404 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_BILL', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
407 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
408 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_BILL'));
411 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
413print
"</td>\n</tr>\n";
417print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER -->';
418print
'<tr class="oddeven">';
419print
'<td>'.$langs->trans(
"ReStockOnValidateOrder").
'</td>';
420print
'<td class="right">';
422 if (
$conf->use_javascript_ajax) {
423 if (in_array(
'SUPPLIER_VALIDATE_ORDER', $disableStockCalculateOn)) {
424 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
426 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
429 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
430 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'));
433 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
435print
"</td>\n</tr>\n";
439 print
'<!-- STOCK_CALCULATE_ON_RECEPTION -->';
440 print
'<tr class="oddeven">';
441 print
'<td>'.$langs->trans(
"StockOnReception").
'</td>';
442 print
'<td class="right">';
444 if (
$conf->use_javascript_ajax) {
445 if (in_array(
'RECEPTION', $disableStockCalculateOn)) {
446 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
448 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
451 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
452 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION'));
455 print
"</td>\n</tr>\n";
458 print
'<!-- STOCK_CALCULATE_ON_RECEPTION_CLOSE -->';
459 print
'<tr class="oddeven">';
460 print
'<td>'.$langs->trans(
"StockOnReceptionOnClosing").
'</td>';
461 print
'<td class="right">';
463 if (
$conf->use_javascript_ajax) {
464 if (in_array(
'RECEPTION_CLOSE', $disableStockCalculateOn)) {
465 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
467 print ajax_constantonoff(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
470 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
471 print $form->selectarray(
"STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_RECEPTION_CLOSE'));
473 print
"</td>\n</tr>\n";
477 print
'<!-- STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER -->';
478 print
'<tr class="oddeven">';
479 print
'<td>'.$langs->trans(
"ReStockOnDispatchOrder").
'</td>';
480 print
'<td class="right">';
482 if (
$conf->use_javascript_ajax) {
483 if (in_array(
'SUPPLIER_DISPATCH_ORDER', $disableStockCalculateOn)) {
484 print
img_picto($langs->trans(
"Disabled"),
'off',
'class="opacitymedium"');
486 print ajax_constantonoff(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(),
null, 0, 0, 0, 2, 1, 0,
'',
'',
'reposition');
489 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
490 print $form->selectarray(
"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval,
getDolGlobalString(
'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'));
493 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"Module40Name")).
'</span>';
495 print
"</td>\n</tr>\n";
504print
'<div class="div-table-responsive-no-min">';
505print
'<table class="noborder centpercent">';
506print
'<tr class="liste_titre">';
507print
"<td>".$langs->trans(
"RuleForStockAvailability").
"</td>\n";
508print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
512print
'<tr class="oddeven">';
513print
'<td>'.$langs->trans(
"WarehouseAllowNegativeTransfer").
'</td>';
514print
'<td class="right">';
515if (
$conf->use_javascript_ajax) {
516 print ajax_constantonoff(
'STOCK_DISALLOW_NEGATIVE_TRANSFER', array(),
null, 1);
518 $arrval = array(
'1' => $langs->trans(
"No"),
'0' => $langs->trans(
"Yes"));
519 print $form->selectarray(
"STOCK_DISALLOW_NEGATIVE_TRANSFER", $arrval,
getDolGlobalInt(
'STOCK_DISALLOW_NEGATIVE_TRANSFER'));
526 print
'<tr class="oddeven">';
527 print
'<td>'.$langs->trans(
"StockMustBeEnoughForInvoice").
'</td>';
528 print
'<td class="right">';
529 if (
$conf->use_javascript_ajax) {
530 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE');
532 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
533 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_INVOICE'));
540 print
'<tr class="oddeven">';
541 print
'<td>'.$langs->trans(
"StockMustBeEnoughForOrder").
'</td>';
542 print
'<td class="right">';
543 if (
$conf->use_javascript_ajax) {
544 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER');
546 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
547 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_ORDER'));
554 print
'<tr class="oddeven">';
555 print
'<td>'.$langs->trans(
"StockMustBeEnoughForShipment").
'</td>';
556 print
'<td class="right">';
557 if (
$conf->use_javascript_ajax) {
558 print ajax_constantonoff(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT');
560 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
561 print $form->selectarray(
"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval,
getDolGlobalString(
'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'));
571$virtualdiffersfromphysical = 0;
578 $virtualdiffersfromphysical = 1;
581if ($virtualdiffersfromphysical) {
582 print
'<div class="div-table-responsive-no-min">';
583 print
'<table class="noborder centpercent">';
584 print
'<tr class="liste_titre">';
585 print
"<td>".$langs->trans(
"RuleForStockReplenishment").
" ".
img_help(1, $langs->trans(
"VirtualDiffersFromPhysical")).
"</td>\n";
586 print
'<td class="right">'.$langs->trans(
"Status").
'</td>'.
"\n";
589 print
'<tr class="oddeven">';
591 print $form->textwithpicto($langs->trans(
"UseRealStockByDefault"), $langs->trans(
"ReplenishmentCalculation"));
593 print
'<td class="right">';
594 if (
$conf->use_javascript_ajax) {
595 print ajax_constantonoff(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT');
597 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
598 print $form->selectarray(
"STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT", $arrval,
getDolGlobalString(
'STOCK_USE_REAL_STOCK_BY_DEFAULT_FOR_REPLENISHMENT'));
608if (empty(
$conf->use_javascript_ajax)) {
610 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Save").
'">';
627$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
628$sql .=
" WHERE type = '".$db->escape($type).
"'";
629$sql .=
" AND entity = ".((int)
$conf->entity);
630$resql =
$db->query($sql);
633 $num_rows =
$db->num_rows($resql);
634 while ($i < $num_rows) {
635 $array =
$db->fetch_array($resql);
636 if (is_array($array)) {
637 array_push($def, $array[0]);
646print
'<div class="div-table-responsive-no-min">';
647print
'<table class="noborder centpercent">'.
"\n";
648print
'<tr class="liste_titre">'.
"\n";
649print
'<td>'.$langs->trans(
"Name").
'</td>';
650print
'<td>'.$langs->trans(
"Description").
'</td>';
651print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
652print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
653print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
654print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
659foreach ($dirmodels as $reldir) {
660 foreach (array(
'',
'/doc') as $valdir) {
661 $realpath = $reldir.
"core/modules/stock".$valdir;
665 $handle = opendir($dir);
666 if (is_resource($handle)) {
668 while (($file = readdir($handle)) !==
false) {
674 foreach ($filelist as $file) {
675 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
676 if (file_exists($dir.
'/'.$file)) {
677 $name = substr($file, 4,
dol_strlen($file) - 16);
678 $classname = substr($file, 0,
dol_strlen($file) - 12);
680 require_once $dir.
'/'.$file;
681 $module =
new $classname(
$db);
682 '@phan-var-force ModelePDFStock $module';
684 $modulequalified = 1;
685 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
686 $modulequalified = 0;
688 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
689 $modulequalified = 0;
692 if ($modulequalified) {
693 print
'<tr class="oddeven"><td width="100">';
694 print(empty($module->name) ? $name : $module->
name);
696 if (method_exists($module,
'info')) {
697 print $module->info($langs);
699 print $module->description;
704 if (in_array($name, $def)) {
705 print
'<td class="center">'.
"\n";
706 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
707 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
711 print
'<td class="center">'.
"\n";
712 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
717 print
'<td class="center">';
719 print
img_picto($langs->trans(
"Default"),
'on');
721 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
726 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
727 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
728 if ($module->type ==
'pdf') {
729 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
731 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
733 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
734 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
735 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
738 print
'<td class="center">';
739 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
743 print
'<td class="center">';
744 if ($module->type ==
'pdf') {
745 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
747 print
img_object($langs->transnoentitiesnoconv(
"PreviewNotAvailable"),
'generic');
767print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
768print
'<input type="hidden" name="token" value="'.newToken().
'">';
769print
'<input type="hidden" name="action" value="warehouse">';
770print
'<input type="hidden" name="page_y" value="">';
774print
'<div class="div-table-responsive-no-min">';
775print
'<table class="noborder centpercent">';
777print
'<tr class="liste_titre">';
778print
"<td>".$langs->trans(
"Parameter").
"</td>\n";
779print
'<td class="right"></td>'.
"\n";
782print
'<tr class="oddeven">';
783print
'<td>'.$langs->trans(
"MainDefaultWarehouse").
'</td>';
784print
'<td class="right">';
785print $formproduct->selectWarehouses(
getDolGlobalInt(
'MAIN_DEFAULT_WAREHOUSE', -1),
'default_warehouse',
'', 1, 0, 0,
'', 0, 0, array(),
'left reposition');
786print
'<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans(
"Modify").
'">';
790print
'<tr class="oddeven">';
791print
'<td>'.$langs->trans(
"UserDefaultWarehouse").
'</td>';
792print
'<td class="right">';
793if (
$conf->use_javascript_ajax) {
794 print ajax_constantonoff(
'MAIN_DEFAULT_WAREHOUSE_USER', array(),
null, 0, 0, 1);
796 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
797 print $form->selectarray(
"MAIN_DEFAULT_WAREHOUSE_USER", $arrval,
getDolGlobalString(
'MAIN_DEFAULT_WAREHOUSE_USER'));
803 print
'<tr class="oddeven">';
804 print
'<td>'.$langs->trans(
"UserWarehouseAutoCreate").
'</td>';
805 print
'<td class="right">';
806 if (
$conf->use_javascript_ajax) {
807 print ajax_constantonoff(
'STOCK_USERSTOCK_AUTOCREATE');
809 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
810 print $form->selectarray(
"STOCK_USERSTOCK_AUTOCREATE", $arrval,
getDolGlobalString(
'STOCK_USERSTOCK_AUTOCREATE'));
816print
'<tr class="oddeven">';
817print
'<td>'.$langs->trans(
"WarehouseAskWarehouseOnThirparty").
'</td>';
818print
'<td class="right">';
819if (
$conf->use_javascript_ajax) {
820 print ajax_constantonoff(
'SOCIETE_ASK_FOR_WAREHOUSE');
822 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
823 print $form->selectarray(
"SOCIETE_ASK_FOR_WAREHOUSE", $arrval,
getDolGlobalString(
'SOCIETE_ASK_FOR_WAREHOUSE'));
828print
'<tr class="oddeven">';
829print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringPropal").
'</td>';
830print
'<td class="right">';
831if (
$conf->use_javascript_ajax) {
832 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL');
834 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
835 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval,
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL'));
840print
'<tr class="oddeven">';
841print
'<td>'.$langs->trans(
"WarehouseAskWarehouseDuringOrder").
'</td>';
842print
'<td class="right">';
843if (
$conf->use_javascript_ajax) {
844 print ajax_constantonoff(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
846 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
847 print $form->selectarray(
"WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval,
getDolGlobalString(
'WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'));
866print
'<tr class="oddeven">';
868print $form->textwithpicto($langs->trans(
"StockSupportServices"), $langs->trans(
"StockSupportServicesDesc"));
870print
'<td class="right">';
871if (
$conf->use_javascript_ajax) {
872 print ajax_constantonoff(
'STOCK_SUPPORTS_SERVICES');
874 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
875 print $form->selectarray(
"STOCK_SUPPORTS_SERVICES", $arrval,
getDolGlobalString(
'STOCK_SUPPORTS_SERVICES'));
881print
'<tr class="oddeven">';
882print
'<td>'.$langs->trans(
"AllowAddLimitStockByWarehouse").
'</td>';
883print
'<td class="right">';
884if (
$conf->use_javascript_ajax) {
885 print ajax_constantonoff(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE');
887 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
888 print $form->selectarray(
"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE", $arrval,
getDolGlobalString(
'STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'));
893print
'<tr class="oddeven">';
894print
'<td>'.$langs->trans(
"AlwaysShowFullArbo").
'</td>';
895print
'<td class="right">';
896if (
$conf->use_javascript_ajax) {
897 print ajax_constantonoff(
'STOCK_ALWAYS_SHOW_FULL_ARBO');
899 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
900 print $form->selectarray(
"STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval,
getDolGlobalString(
'STOCK_ALWAYS_SHOW_FULL_ARBO'));
if(! $sortfield) if(! $sortorder) $object
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage warehouses.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
stock_admin_prepare_head()
Return array head with list of tabs to view object information.