34require
'../../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbarcode.class.php';
41$langs->loadLangs(array(
"admin",
"products"));
44if (!$user->admin || (!isModEnabled(
"product") && !isModEnabled(
"service"))) {
48$action =
GETPOST(
'action',
'aZ09');
49$value =
GETPOST(
'value',
'alpha');
50$modulepart =
GETPOST(
'modulepart',
'aZ09');
52$label =
GETPOST(
'label',
'alpha');
53$scandir =
GETPOST(
'scan_dir',
'alpha');
57$select_pricing_rules = array(
58 'PRODUCT_PRICE_UNIQ'=>$langs->trans(
'PriceCatalogue'),
59 'PRODUIT_MULTIPRICES'=>$langs->trans(
'MultiPricesAbility'),
60 'PRODUIT_CUSTOMER_PRICES'=>$langs->trans(
'PriceByCustomer'),
62$keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
63if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || !empty($conf->global->$keyforparam)) {
64 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
66$keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
67if ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->$keyforparam)) {
68 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans(
'MultiPricesAbility').
'+'.$langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
72if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {
73 dolibarr_set_const($db,
'PRODUIT_MULTIPRICES_LIMIT', 5,
'chaine', 0,
'', $conf->entity);
83$nomessageinsetmoduleoptions = 1;
84include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
86if ($action ==
'setcodeproduct') {
87 if (
dolibarr_set_const($db,
"PRODUCT_CODEPRODUCT_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0) {
88 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
95if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_LIMIT_SIZE') >= 0) {
96 $res =
dolibarr_set_const($db,
"PRODUIT_LIMIT_SIZE",
GETPOST(
'value_PRODUIT_LIMIT_SIZE'),
'chaine', 0,
'', $conf->entity);
101if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT') > 0) {
102 $res =
dolibarr_set_const($db,
"PRODUIT_MULTIPRICES_LIMIT",
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT'),
'chaine', 0,
'', $conf->entity);
107if ($action ==
'other') {
108 $princingrules =
GETPOST(
'princingrule',
'alpha');
109 foreach ($select_pricing_rules as $tmprule => $tmplabel) {
110 if ($tmprule == $princingrules) {
111 if ($princingrules ==
'PRODUCT_PRICE_UNIQ') {
112 $res =
dolibarr_set_const($db,
'PRODUIT_MULTIPRICES', 0,
'chaine', 0,
'', $conf->entity);
113 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0,
'chaine', 0,
'', $conf->entity);
114 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES', 0,
'chaine', 0,
'', $conf->entity);
117 $multirule = explode(
'&', $princingrules);
118 foreach ($multirule as $rulesselected) {
123 if (strpos($tmprule,
'&') ===
false) {
129 $value =
GETPOST(
'price_base_type',
'alpha');
130 $res =
dolibarr_set_const($db,
"PRODUCT_PRICE_BASE_TYPE", $value,
'chaine', 0,
'', $conf->entity);
135 $value =
GETPOST(
'PRODUIT_DESC_IN_FORM',
'alpha');
136 $res =
dolibarr_set_const($db,
"PRODUIT_DESC_IN_FORM", $value,
'chaine', 0,
'', $conf->entity);
138 $value =
GETPOST(
'activate_viewProdTextsInThirdpartyLanguage',
'alpha');
139 $res =
dolibarr_set_const($db,
"PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE", $value,
'chaine', 0,
'', $conf->entity);
141 $value =
GETPOST(
'activate_mergePropalProductCard',
'alpha');
142 $res =
dolibarr_set_const($db,
"PRODUIT_PDF_MERGE_PROPAL", $value,
'chaine', 0,
'', $conf->entity);
144 $value =
GETPOST(
'activate_usesearchtoselectproduct',
'alpha');
145 $res =
dolibarr_set_const($db,
"PRODUIT_USE_SEARCH_TO_SELECT", $value,
'chaine', 0,
'', $conf->entity);
147 $value =
GETPOST(
'activate_FillProductDescAuto',
'alpha');
148 $res =
dolibarr_set_const($db,
"PRODUIT_AUTOFILL_DESC", $value,
'chaine', 0,
'', $conf->entity);
150 if (GETPOSTISSET(
'PRODUIT_FOURN_TEXTS')) {
151 $value =
GETPOST(
'PRODUIT_FOURN_TEXTS',
'alpha');
152 $res =
dolibarr_set_const($db,
"PRODUIT_FOURN_TEXTS", $value,
'chaine', 0,
'', $conf->entity);
155 if (GETPOSTISSET(
'PRODUCT_USE_SUPPLIER_PACKAGING')) {
156 $value =
GETPOST(
'PRODUCT_USE_SUPPLIER_PACKAGING',
'alpha');
157 $res =
dolibarr_set_const($db,
"PRODUCT_USE_SUPPLIER_PACKAGING", $value,
'chaine', 0,
'', $conf->entity);
162if ($action ==
'specimen') {
163 $modele =
GETPOST(
'module',
'alpha');
166 $product->initAsSpecimen();
169 $file =
''; $classname =
''; $filefound = 0;
170 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
171 foreach ($dirmodels as $reldir) {
172 $file =
dol_buildpath($reldir.
"core/modules/product/doc/pdf_".$modele.
".modules.php", 0);
173 if (file_exists($file)) {
175 $classname =
"pdf_".$modele;
183 $module =
new $classname($db);
185 if ($module->write_file($product, $langs,
'') > 0) {
186 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=product&file=SPECIMEN.pdf");
194 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
199if ($action ==
'set') {
203if ($action ==
'del') {
213if ($action ==
'setdoc') {
214 if (
dolibarr_set_const($db,
"PRODUCT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
217 $conf->global->PRODUCT_ADDON_PDF = $value;
228if ($action ==
'set') {
229 $const =
"PRODUCT_SPECIAL_".strtoupper(
GETPOST(
'spe',
'alpha'));
231 if (
GETPOST(
'value',
'alpha')) {
242if (preg_match(
'/set_(.+)/', $action, $reg)) {
243 $keyforvar = $reg[1];
251if (preg_match(
'/del_(.+)/', $action, $reg)) {
252 $keyforvar = $reg[1];
272$title = $langs->trans(
'ProductServiceSetup');
273$tab = $langs->trans(
"ProductsAndServices");
274if (!isModEnabled(
"product")) {
275 $title = $langs->trans(
'ServiceSetup');
276 $tab = $langs->trans(
'Services');
277} elseif (!isModEnabled(
"service")) {
278 $title = $langs->trans(
'ProductSetup');
279 $tab = $langs->trans(
'Products');
284$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
290$form =
new Form($db);
293$dirproduct = array(
'/core/modules/product/');
294$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
298print
'<div class="div-table-responsive-no-min">';
299print
'<table class="noborder centpercent">'.
"\n";
300print
'<tr class="liste_titre">'.
"\n";
301print
' <td>'.$langs->trans(
"Name").
'</td>';
302print
' <td>'.$langs->trans(
"Description").
'</td>';
303print
' <td>'.$langs->trans(
"Example").
'</td>';
304print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
305print
' <td class="center"></td>';
308foreach ($dirproduct as $dirroot) {
311 $handle = @opendir($dir);
312 if (is_resource($handle)) {
314 while (($file = readdir($handle)) !==
false) {
315 if (substr($file, 0, 16) ==
'mod_codeproduct_' && substr($file, -3) ==
'php') {
316 $file = substr($file, 0,
dol_strlen($file) - 4);
324 $modCodeProduct =
new $file;
327 if ($modCodeProduct->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
330 if ($modCodeProduct->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
334 print
'<tr class="oddeven">'.
"\n";
335 print
'<td width="140">'.$modCodeProduct->name.
'</td>'.
"\n";
336 print
'<td>'.$modCodeProduct->info($langs).
'</td>'.
"\n";
337 print
'<td class="nowrap"><span class="opacitymedium">'.$modCodeProduct->getExample($langs).
'</span></td>'.
"\n";
339 if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) {
340 print
'<td class="center">'.
"\n";
341 print
img_picto($langs->trans(
"Activated"),
'switch_on');
345 if (isModEnabled(
'multicompany') && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] == $conf->entity) ?
false : true) {
347 print
'<td class="center">';
349 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeproduct&token='.newToken().
'&value='.urlencode($file).
'">';
351 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
358 print
'<td class="center">';
359 $s = $modCodeProduct->getToolTip($langs,
null, -1);
360 print $form->textwithpicto(
'', $s, 1);
375$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
376$sql .=
" WHERE type = '".$db->escape($type).
"'";
377$sql .=
" AND entity = ".$conf->entity;
378$resql = $db->query($sql);
381 $num_rows = $db->num_rows($resql);
382 while ($i < $num_rows) {
383 $array = $db->fetch_array($resql);
384 array_push($def, $array[0]);
395print
'<div class="div-table-responsive-no-min">';
396print
'<table class="noborder centpercent">';
397print
'<tr class="liste_titre">';
398print
'<td>'.$langs->trans(
"Name").
'</td>';
399print
'<td>'.$langs->trans(
"Description").
'</td>';
400print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
401print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
402print
'<td class="center"></td>';
403print
'<td class="center" width="80">'.$langs->trans(
"Preview").
'</td>';
408foreach ($dirmodels as $reldir) {
409 foreach (array(
'',
'/doc') as $valdir) {
410 $dir =
dol_buildpath($reldir.
"core/modules/product".$valdir);
412 $handle = opendir($dir);
413 if (is_resource($handle)) {
414 while (($file = readdir($handle)) !==
false) {
420 foreach ($filelist as $file) {
421 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
422 if (file_exists($dir.
'/'.$file)) {
423 $name = substr($file, 4,
dol_strlen($file) - 16);
424 $classname = substr($file, 0,
dol_strlen($file) - 12);
426 require_once $dir.
'/'.$file;
427 $module =
new $classname($db);
429 $modulequalified = 1;
430 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
431 $modulequalified = 0;
433 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
434 $modulequalified = 0;
437 if ($modulequalified) {
438 print
'<tr class="oddeven"><td width="100">';
439 print (empty($module->name) ? $name : $module->
name);
441 if (method_exists($module,
'info')) {
442 print $module->info($langs);
444 print $module->description;
449 if (in_array($name, $def)) {
450 print
'<td class="center">'.
"\n";
451 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
452 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
456 print
'<td class="center">'.
"\n";
457 print
'<a 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>';
462 print
'<td class="center">';
464 print
img_picto($langs->trans(
"Default"),
'on');
466 print
'<a 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>';
471 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
472 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
473 if ($module->type ==
'pdf') {
474 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
476 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
477 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
478 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
481 print
'<td class="center">';
482 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
486 print
'<td class="center">';
487 if ($module->type ==
'pdf') {
488 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'contract').
'</a>';
490 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
516print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
517print
'<input type="hidden" name="token" value="'.newToken().
'">';
518print
'<input type="hidden" name="action" value="other">';
519print
'<input type="hidden" name="page_y" value="">';
525print
'<div class="div-table-responsive-no-min">';
526print
'<table class="noborder centpercent">';
527print
'<tr class="liste_titre">';
528print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
529print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
535print
'<tr class="oddeven">';
536print
'<td>'.$langs->trans(
"AssociatedProductsAbility").
'</td>';
537print
'<td class="right">';
538print ajax_constantonoff(
"PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0);
546print
'<tr class="oddeven">';
547print
'<td>'.$langs->trans(
"VariantsAbility").
'</td>';
548print
'<td class="right">';
551if (!isModEnabled(
'variants')) {
552 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
'</span>';
554 print
yn(1).
' <span class="opacitymedium">('.$langs->trans(
"ModuleIsEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
')</span>';
562print
'<tr class="oddeven">';
563if (!isModEnabled(
'multicompany')) {
564 print
'<td>'.$langs->trans(
"PricingRule").
'</td>';
566 print
'<td>'.$form->textwithpicto($langs->trans(
"PricingRule"), $langs->trans(
"SamePriceAlsoForSharedCompanies"), 1).
'</td>';
568print
'<td class="right">';
569$current_rule =
'PRODUCT_PRICE_UNIQ';
570if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
571 $current_rule =
'PRODUIT_MULTIPRICES';
573if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
574 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
576if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
577 $current_rule =
'PRODUIT_CUSTOMER_PRICES';
579if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
580 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
582print $form->selectarray(
"princingrule", $select_pricing_rules, $current_rule, 0, 0, 0,
'', 1, 0, 0,
'',
'maxwidth400', 1);
588if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
589 print
'<tr class="oddeven">';
590 print
'<td>'.$langs->trans(
"MultiPricesNumPrices").
'</td>';
591 print
'<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.
'"></td>';
596print
'<tr class="oddeven">';
597print
'<td>'.$langs->trans(
"DefaultPriceType").
'</td>';
598print
'<td class="right">';
599print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE,
"price_base_type");
604if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
605 print
'<tr class="oddeven">';
606 print
'<td>'.$form->textwithpicto($langs->trans(
"UseProductSupplierPackaging"), $langs->trans(
"PackagingForThisProductDesc")).
'</td>';
607 print
'<td align="right">';
608 print ajax_constantonoff(
"PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0);
613 print
'<tr class="oddeven">';
614 print
'<td>'.$langs->trans(
"UseProductFournDesc").
'</td>';
615 print
'<td class="right">';
616 print ajax_constantonoff(
"PRODUIT_FOURN_TEXTS", array(), $conf->entity, 0, 0, 0, 0);
625print
'<div class="center">';
626print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
633print
'<div class="div-table-responsive-no-min">';
634print
'<table class="noborder centpercent">';
635print
'<tr class="liste_titre">';
636print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
637print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
642print
'<tr class="oddeven">';
643print
'<td>'.$form->textwithpicto($langs->trans(
"UseSearchToSelectProduct"), $langs->trans(
'UseSearchToSelectProductTooltip'), 1).
'</td>';
644if (empty($conf->use_javascript_ajax)) {
645 print
'<td class="nowrap right">';
646 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
649 print
'<td class="right">';
651 '0'=>$langs->trans(
"No"),
652 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
653 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
654 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
656 print $form->selectarray(
"activate_usesearchtoselectproduct", $arrval, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
661if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
662 print
'<tr class="oddeven">';
663 print
'<td>'.$langs->trans(
"NumberOfProductShowInSelect").
'</td>';
664 print
'<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="'.$conf->global->PRODUIT_LIMIT_SIZE.
'"></td>';
669print
'<tr class="oddeven">';
670print
'<td>'.$langs->trans(
"OnProductSelectAddProductDesc").
'</td>';
671print
'<td class="right">';
672print
'<!-- PRODUIT_AUTOFILL_DESC -->';
673print $form->selectarray(
674 "activate_FillProductDescAuto",
675 array(0=>
'DoNotAutofillButAutoConcat', 1=>
'AutoFillFormFieldBeforeSubmit', 2=>
'DoNotUseDescriptionOfProdut'),
676 empty($conf->global->PRODUIT_AUTOFILL_DESC) ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
685 'minwidth100imp maxwidth400',
692print
'<tr class="oddeven">';
693print
'<td>'.$langs->trans(
"ViewProductDescInFormAbility").
'</td>';
694print
'<td class="right">';
695$arrayofchoices = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes").
' ('.$langs->trans(
"DesktopsOnly").
')',
'2' => $langs->trans(
"Yes").
' ('.$langs->trans(
"DesktopsAndSmartphones").
')');
696print $form->selectarray(
"PRODUIT_DESC_IN_FORM", $arrayofchoices,
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM'), 0);
724 print
'<tr class="oddeven">';
725 print
'<td>'.$langs->trans(
"ViewProductDescInThirdpartyLanguageAbility").
'</td>';
726 print
'<td class="right">';
727 print $form->selectyesno(
"activate_viewProdTextsInThirdpartyLanguage", (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
733if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
735 $dir = DOL_DOCUMENT_ROOT.
"/product/canvas/";
737 print
'<tr class="liste_titre">';
738 print
'<td>'.$langs->trans(
"ProductSpecial").
'</td>'.
"\n";
739 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
743 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
745 $handle = opendir($dir);
746 if (is_resource($handle)) {
747 while (($file = readdir($handle)) !==
false) {
748 if (file_exists($dir.$file.
'/product.'.$file.
'.class.php')) {
749 $classfile = $dir.$file.
'/product.'.$file.
'.class.php';
750 $classname =
'Product'.ucfirst($file);
752 require_once $classfile;
753 $object =
new $classname();
755 $module = $object->module;
757 if ($conf->$module->enabled) {
758 print
'<tr class="oddeven"><td>';
760 print $object->description;
762 print
'</td><td class="right">';
764 $const =
"PRODUCT_SPECIAL_".strtoupper($file);
766 if ($conf->global->$const) {
767 print
img_picto($langs->trans(
"Active"),
'tick');
768 print
'</td><td class="right">';
769 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&spe='.urlencode($file).
'&value=0">'.$langs->trans(
"Disable").
'</a>';
771 print
' </td><td class="right">';
772 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&spe='.urlencode($file).
'&value=1">'.$langs->trans(
"Activate").
'</a>';
789print
'<div class="center">';
790print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage products or services.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
product_admin_prepare_head()
Return array head with list of tabs to view object informations.
$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.