33 require
'../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbarcode.class.php';
40 $langs->loadLangs(array(
"admin",
"products"));
43 if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) {
47 $action =
GETPOST(
'action',
'aZ09');
48 $value =
GETPOST(
'value',
'alpha');
49 $modulepart =
GETPOST(
'modulepart',
'aZ09');
51 $label =
GETPOST(
'label',
'alpha');
52 $scandir =
GETPOST(
'scan_dir',
'alpha');
56 $select_pricing_rules = array(
57 'PRODUCT_PRICE_UNIQ'=>$langs->trans(
'PriceCatalogue'),
58 'PRODUIT_MULTIPRICES'=>$langs->trans(
'MultiPricesAbility'),
59 'PRODUIT_CUSTOMER_PRICES'=>$langs->trans(
'PriceByCustomer'),
61 $keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
62 if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || !empty($conf->global->$keyforparam)) {
63 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
65 $keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
66 if ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->$keyforparam)) {
67 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans(
'MultiPricesAbility').
'+'.$langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
71 if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {
72 dolibarr_set_const($db,
'PRODUIT_MULTIPRICES_LIMIT', 5,
'chaine', 0,
'', $conf->entity);
82 $nomessageinsetmoduleoptions = 1;
83 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
85 if ($action ==
'setcodeproduct') {
86 if (
dolibarr_set_const($db,
"PRODUCT_CODEPRODUCT_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0) {
87 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
94 if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_LIMIT_SIZE') >= 0) {
95 $res =
dolibarr_set_const($db,
"PRODUIT_LIMIT_SIZE",
GETPOST(
'value_PRODUIT_LIMIT_SIZE'),
'chaine', 0,
'', $conf->entity);
100 if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT') > 0) {
101 $res =
dolibarr_set_const($db,
"PRODUIT_MULTIPRICES_LIMIT",
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT'),
'chaine', 0,
'', $conf->entity);
106 if ($action ==
'other') {
107 $princingrules =
GETPOST(
'princingrule',
'alpha');
108 foreach ($select_pricing_rules as $rule => $label) {
109 if ($rule == $princingrules) {
110 if ($princingrules ==
'PRODUCT_PRICE_UNIQ') {
111 $res =
dolibarr_set_const($db,
'PRODUIT_MULTIPRICES', 0,
'chaine', 0,
'', $conf->entity);
112 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0,
'chaine', 0,
'', $conf->entity);
113 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES', 0,
'chaine', 0,
'', $conf->entity);
116 $multirule = explode(
'&', $princingrules);
117 foreach ($multirule as $rulesselected) {
123 if (strpos($rule,
'&') ===
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(
'activate_viewProdDescInForm',
'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 $value =
GETPOST(
'PRODUIT_FOURN_TEXTS',
'alpha');
151 $res =
dolibarr_set_const($db,
"PRODUIT_FOURN_TEXTS", $value,
'chaine', 0,
'', $conf->entity);
153 $value =
GETPOST(
'PRODUCT_USE_SUPPLIER_PACKAGING',
'alpha');
154 $res =
dolibarr_set_const($db,
"PRODUCT_USE_SUPPLIER_PACKAGING", $value,
'chaine', 0,
'', $conf->entity);
158 if ($action ==
'specimen') {
159 $modele =
GETPOST(
'module',
'alpha');
162 $product->initAsSpecimen();
165 $file =
''; $classname =
''; $filefound = 0;
166 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
167 foreach ($dirmodels as $reldir) {
168 $file =
dol_buildpath($reldir.
"core/modules/product/doc/pdf_".$modele.
".modules.php", 0);
169 if (file_exists($file)) {
171 $classname =
"pdf_".$modele;
179 $module =
new $classname($db);
181 if ($module->write_file($product, $langs,
'') > 0) {
182 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=product&file=SPECIMEN.pdf");
190 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
195 if ($action ==
'set') {
199 if ($action ==
'del') {
202 if ($conf->global->PRODUCT_ADDON_PDF ==
"$value") {
209 if ($action ==
'setdoc') {
210 if (
dolibarr_set_const($db,
"PRODUCT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
213 $conf->global->PRODUCT_ADDON_PDF = $value;
224 if ($action ==
'set') {
225 $const =
"PRODUCT_SPECIAL_".strtoupper(
GETPOST(
'spe',
'alpha'));
227 if (
GETPOST(
'value',
'alpha')) {
238 if (preg_match(
'/set_(.+)/', $action, $reg)) {
239 $keyforvar = $reg[1];
247 if (preg_match(
'/del_(.+)/', $action, $reg)) {
248 $keyforvar = $reg[1];
268 $title = $langs->trans(
'ProductServiceSetup');
269 $tab = $langs->trans(
"ProductsAndServices");
270 if (empty($conf->product->enabled)) {
271 $title = $langs->trans(
'ServiceSetup');
272 $tab = $langs->trans(
'Services');
273 } elseif (empty($conf->service->enabled)) {
274 $title = $langs->trans(
'ProductSetup');
275 $tab = $langs->trans(
'Products');
280 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
289 $dirproduct = array(
'/core/modules/product/');
290 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
294 print
'<div class="div-table-responsive-no-min">';
295 print
'<table class="noborder centpercent">'.
"\n";
296 print
'<tr class="liste_titre">'.
"\n";
297 print
' <td>'.$langs->trans(
"Name").
'</td>';
298 print
' <td>'.$langs->trans(
"Description").
'</td>';
299 print
' <td>'.$langs->trans(
"Example").
'</td>';
300 print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
301 print
' <td class="center"></td>';
304 foreach ($dirproduct as $dirroot) {
307 $handle = @opendir($dir);
308 if (is_resource($handle)) {
310 while (($file = readdir($handle)) !==
false) {
311 if (substr($file, 0, 16) ==
'mod_codeproduct_' && substr($file, -3) ==
'php') {
312 $file = substr($file, 0,
dol_strlen($file) - 4);
320 $modCodeProduct =
new $file;
323 if ($modCodeProduct->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
326 if ($modCodeProduct->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
330 print
'<tr class="oddeven">'.
"\n";
331 print
'<td width="140">'.$modCodeProduct->name.
'</td>'.
"\n";
332 print
'<td>'.$modCodeProduct->info($langs).
'</td>'.
"\n";
333 print
'<td class="nowrap"><span class="opacitymedium">'.$modCodeProduct->getExample($langs).
'</span></td>'.
"\n";
335 if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) {
336 print
'<td class="center">'.
"\n";
337 print
img_picto($langs->trans(
"Activated"),
'switch_on');
341 if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] == $conf->entity) ?
false :
true) {
343 print
'<td class="center">';
345 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeproduct&token='.
newToken().
'&value='.urlencode($file).
'">';
347 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
354 print
'<td class="center">';
355 $s = $modCodeProduct->getToolTip($langs,
null, -1);
356 print
$form->textwithpicto(
'', $s, 1);
371 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
372 $sql .=
" WHERE type = '".$db->escape($type).
"'";
373 $sql .=
" AND entity = ".$conf->entity;
374 $resql = $db->query($sql);
377 $num_rows = $db->num_rows(
$resql);
378 while ($i < $num_rows) {
379 $array = $db->fetch_array(
$resql);
380 array_push($def, $array[0]);
391 print
'<div class="div-table-responsive-no-min">';
392 print
'<table class="noborder centpercent">';
393 print
'<tr class="liste_titre">';
394 print
'<td>'.$langs->trans(
"Name").
'</td>';
395 print
'<td>'.$langs->trans(
"Description").
'</td>';
396 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
397 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
398 print
'<td class="center"></td>';
399 print
'<td class="center" width="80">'.$langs->trans(
"Preview").
'</td>';
404 foreach ($dirmodels as $reldir) {
405 foreach (array(
'',
'/doc') as $valdir) {
406 $dir =
dol_buildpath($reldir.
"core/modules/product".$valdir);
408 $handle = opendir($dir);
409 if (is_resource($handle)) {
410 while (($file = readdir($handle)) !==
false) {
416 foreach ($filelist as $file) {
417 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
418 if (file_exists($dir.
'/'.$file)) {
419 $name = substr($file, 4,
dol_strlen($file) - 16);
420 $classname = substr($file, 0,
dol_strlen($file) - 12);
422 require_once $dir.
'/'.$file;
423 $module =
new $classname($db);
425 $modulequalified = 1;
426 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
427 $modulequalified = 0;
429 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
430 $modulequalified = 0;
433 if ($modulequalified) {
434 print
'<tr class="oddeven"><td width="100">';
435 print (empty($module->name) ? $name : $module->name);
437 if (method_exists($module,
'info')) {
438 print $module->info($langs);
440 print $module->description;
445 if (in_array($name, $def)) {
446 print
'<td class="center">'.
"\n";
447 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
448 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
452 print
'<td class="center">'.
"\n";
453 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>';
458 print
'<td class="center">';
459 if ($conf->global->PRODUCT_ADDON_PDF == $name) {
460 print
img_picto($langs->trans(
"Default"),
'on');
462 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>';
467 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
468 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
469 if ($module->type ==
'pdf') {
470 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
472 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
473 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
474 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
477 print
'<td class="center">';
478 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
482 print
'<td class="center">';
483 if ($module->type ==
'pdf') {
484 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'contract').
'</a>';
486 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
512 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
513 print
'<input type="hidden" name="token" value="'.newToken().
'">';
514 print
'<input type="hidden" name="action" value="other">';
515 print
'<input type="hidden" name="page_y" value="">';
521 print
'<div class="div-table-responsive-no-min">';
522 print
'<table class="noborder centpercent">';
523 print
'<tr class="liste_titre">';
524 print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
525 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
531 print
'<tr class="oddeven">';
532 print
'<td>'.$langs->trans(
"AssociatedProductsAbility").
'</td>';
533 print
'<td class="right">';
542 print
'<tr class="oddeven">';
543 print
'<td>'.$langs->trans(
"VariantsAbility").
'</td>';
544 print
'<td class="right">';
547 if (empty($conf->variants->enabled)) {
548 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
'</span>';
550 print
yn(1).
' <span class="opacitymedium">('.$langs->trans(
"ModuleIsEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
')</span>';
558 print
'<tr class="oddeven">';
559 if (empty($conf->multicompany->enabled)) {
560 print
'<td>'.$langs->trans(
"PricingRule").
'</td>';
562 print
'<td>'.$form->textwithpicto($langs->trans(
"PricingRule"), $langs->trans(
"SamePriceAlsoForSharedCompanies"), 1).
'</td>';
564 print
'<td class="right">';
565 $current_rule =
'PRODUCT_PRICE_UNIQ';
566 if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
567 $current_rule =
'PRODUIT_MULTIPRICES';
569 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
570 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
572 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
573 $current_rule =
'PRODUIT_CUSTOMER_PRICES';
575 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
576 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
578 print
$form->selectarray(
"princingrule", $select_pricing_rules, $current_rule, 0, 0, 0,
'', 1, 0, 0,
'',
'maxwidth400', 1);
584 if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
585 print
'<tr class="oddeven">';
586 print
'<td>'.$langs->trans(
"MultiPricesNumPrices").
'</td>';
587 print
'<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.
'"></td>';
592 print
'<tr class="oddeven">';
593 print
'<td>'.$langs->trans(
"DefaultPriceType").
'</td>';
594 print
'<td class="right">';
595 print
$form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE,
"price_base_type");
600 if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
601 print
'<tr class="oddeven">';
602 print
'<td>'.$form->textwithpicto($langs->trans(
"UseProductSupplierPackaging"), $langs->trans(
"PackagingForThisProductDesc")).
'</td>';
603 print
'<td align="right">';
604 print
ajax_constantonoff(
"PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0);
609 print
'<tr class="oddeven">';
610 print
'<td>'.$langs->trans(
"UseProductFournDesc").
'</td>';
611 print
'<td class="right">';
621 print
'<div class="center">';
622 print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
629 print
'<div class="div-table-responsive-no-min">';
630 print
'<table class="noborder centpercent">';
631 print
'<tr class="liste_titre">';
632 print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
633 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
638 print
'<tr class="oddeven">';
639 print
'<td>'.$form->textwithpicto($langs->trans(
"UseSearchToSelectProduct"), $langs->trans(
'UseSearchToSelectProductTooltip'), 1).
'</td>';
640 if (empty($conf->use_javascript_ajax)) {
641 print
'<td class="nowrap right">';
642 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
645 print
'<td class="right">';
647 '0'=>$langs->trans(
"No"),
648 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
649 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
650 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
652 print
$form->selectarray(
"activate_usesearchtoselectproduct", $arrval, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
657 if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
658 print
'<tr class="oddeven">';
659 print
'<td>'.$langs->trans(
"NumberOfProductShowInSelect").
'</td>';
660 print
'<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="'.$conf->global->PRODUIT_LIMIT_SIZE.
'"></td>';
665 print
'<tr class="oddeven">';
666 print
'<td>'.$langs->trans(
"OnProductSelectAddProductDesc").
'</td>';
667 print
'<td class="right">';
668 print
'<!-- PRODUIT_AUTOFILL_DESC -->';
669 print
$form->selectarray(
670 "activate_FillProductDescAuto",
671 array(0=>
'DoNotAutofillButAutoConcat', 1=>
'AutoFillFormFieldBeforeSubmit', 2=>
'DoNotUseDescriptionOfProdut'),
672 empty($conf->global->PRODUIT_AUTOFILL_DESC) ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
681 'minwidth100imp maxwidth400',
688 print
'<tr class="oddeven">';
689 print
'<td>'.$langs->trans(
"ViewProductDescInFormAbility").
'</td>';
690 print
'<td class="right">';
691 print
$form->selectyesno(
"activate_viewProdDescInForm", $conf->global->PRODUIT_DESC_IN_FORM, 1);
718 if (!empty($conf->global->MAIN_MULTILANGS)) {
719 print
'<tr class="oddeven">';
720 print
'<td>'.$langs->trans(
"ViewProductDescInThirdpartyLanguageAbility").
'</td>';
721 print
'<td class="right">';
722 print
$form->selectyesno(
"activate_viewProdTextsInThirdpartyLanguage", (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
728 if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
730 $dir = DOL_DOCUMENT_ROOT.
"/product/canvas/";
732 print
'<tr class="liste_titre">';
733 print
'<td>'.$langs->trans(
"ProductSpecial").
'</td>'.
"\n";
734 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
738 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
740 $handle = opendir($dir);
741 if (is_resource($handle)) {
742 while (($file = readdir($handle)) !==
false) {
743 if (file_exists($dir.$file.
'/product.'.$file.
'.class.php')) {
744 $classfile = $dir.$file.
'/product.'.$file.
'.class.php';
745 $classname =
'Product'.ucfirst($file);
747 require_once $classfile;
748 $object =
new $classname();
750 $module = $object->module;
752 if ($conf->$module->enabled) {
753 print
'<tr class="oddeven"><td>';
755 print $object->description;
757 print
'</td><td class="right">';
759 $const =
"PRODUCT_SPECIAL_".strtoupper($file);
761 if ($conf->global->$const) {
762 print
img_picto($langs->trans(
"Active"),
'tick');
763 print
'</td><td class="right">';
764 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=0">'.$langs->trans(
"Disable").
'</a>';
766 print
' </td><td class="right">';
767 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=1">'.$langs->trans(
"Activate").
'</a>';
784 print
'<div class="center">';
785 print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';