35require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbarcode.class.php';
42$langs->loadLangs(array(
"admin",
"products"));
45if (!$user->admin || (!isModEnabled(
"product") && !isModEnabled(
"service"))) {
49$action =
GETPOST(
'action',
'aZ09');
50$value =
GETPOST(
'value',
'alpha');
51$modulepart =
GETPOST(
'modulepart',
'aZ09');
53$label =
GETPOST(
'label',
'alpha');
54$scandir =
GETPOST(
'scan_dir',
'alpha');
58$select_pricing_rules = array(
59 'PRODUCT_PRICE_UNIQ' => $langs->trans(
'PriceCatalogue'),
60 'PRODUIT_MULTIPRICES' => $langs->trans(
'MultiPricesAbility'),
61 'PRODUIT_CUSTOMER_PRICES' => $langs->trans(
'PriceByCustomer'),
62 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'=>$langs->trans(
'PriceByCustomeAndMultiPricesAbility'),
64$keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
66 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
68$keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
70 $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans(
'MultiPricesAbility').
'+'.$langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
75 dolibarr_set_const($db,
'PRODUIT_MULTIPRICES_LIMIT', 5,
'chaine', 0,
'', $conf->entity);
85$nomessageinsetmoduleoptions = 1;
86include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
88if ($action ==
'setcodeproduct') {
89 if (
dolibarr_set_const($db,
"PRODUCT_CODEPRODUCT_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0) {
90 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
97if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_LIMIT_SIZE') >= 0) {
98 $res =
dolibarr_set_const($db,
"PRODUIT_LIMIT_SIZE",
GETPOST(
'value_PRODUIT_LIMIT_SIZE'),
'chaine', 0,
'', $conf->entity);
103if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT') > 0) {
104 $res =
dolibarr_set_const($db,
"PRODUIT_MULTIPRICES_LIMIT",
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT'),
'chaine', 0,
'', $conf->entity);
109if ($action ==
'other') {
110 $princingrules =
GETPOST(
'princingrule',
'alpha');
111 foreach ($select_pricing_rules as $tmprule => $tmplabel) {
112 if ($tmprule == $princingrules) {
113 if ($princingrules ==
'PRODUCT_PRICE_UNIQ') {
114 $res =
dolibarr_set_const($db,
'PRODUIT_MULTIPRICES', 0,
'chaine', 0,
'', $conf->entity);
115 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0,
'chaine', 0,
'', $conf->entity);
116 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES', 0,
'chaine', 0,
'', $conf->entity);
117 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES', 0,
'chaine', 0,
'', $conf->entity);
120 $multirule = explode(
'&', $princingrules);
121 foreach ($multirule as $rulesselected) {
126 if (strpos($tmprule,
'&') ===
false) {
132 $value =
GETPOST(
'price_base_type',
'alpha');
133 $res =
dolibarr_set_const($db,
"PRODUCT_PRICE_BASE_TYPE", $value,
'chaine', 0,
'', $conf->entity);
138 $value =
GETPOST(
'PRODUIT_DESC_IN_FORM',
'alpha');
139 $res =
dolibarr_set_const($db,
"PRODUIT_DESC_IN_FORM", $value,
'chaine', 0,
'', $conf->entity);
141 $value =
GETPOST(
'activate_viewProdTextsInThirdpartyLanguage',
'alpha');
142 $res =
dolibarr_set_const($db,
"PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE", $value,
'chaine', 0,
'', $conf->entity);
144 $value =
GETPOST(
'activate_mergePropalProductCard',
'alpha');
145 $res =
dolibarr_set_const($db,
"PRODUIT_PDF_MERGE_PROPAL", $value,
'chaine', 0,
'', $conf->entity);
147 $value =
GETPOST(
'activate_usesearchtoselectproduct',
'alpha');
148 $res =
dolibarr_set_const($db,
"PRODUIT_USE_SEARCH_TO_SELECT", $value,
'chaine', 0,
'', $conf->entity);
150 $value =
GETPOST(
'activate_FillProductDescAuto',
'alpha');
151 $res =
dolibarr_set_const($db,
"PRODUIT_AUTOFILL_DESC", $value,
'chaine', 0,
'', $conf->entity);
153 if (GETPOSTISSET(
'PRODUIT_FOURN_TEXTS')) {
154 $value =
GETPOST(
'PRODUIT_FOURN_TEXTS',
'alpha');
155 $res =
dolibarr_set_const($db,
"PRODUIT_FOURN_TEXTS", $value,
'chaine', 0,
'', $conf->entity);
158 if (GETPOSTISSET(
'PRODUCT_USE_SUPPLIER_PACKAGING')) {
159 $value =
GETPOST(
'PRODUCT_USE_SUPPLIER_PACKAGING',
'alpha');
160 $res =
dolibarr_set_const($db,
"PRODUCT_USE_SUPPLIER_PACKAGING", $value,
'chaine', 0,
'', $conf->entity);
165if ($action ==
'specimen') {
166 $modele =
GETPOST(
'module',
'alpha');
169 $product->initAsSpecimen();
174 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
175 foreach ($dirmodels as $reldir) {
176 $file =
dol_buildpath($reldir.
"core/modules/product/doc/pdf_".$modele.
".modules.php", 0);
177 if (file_exists($file)) {
178 $classname =
"pdf_".$modele;
183 if ($classname !==
'') {
186 $module =
new $classname($db);
188 '@phan-var-force ModelePDFProduct $module';
190 if ($module->write_file($product, $langs,
'') > 0) {
191 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=product&file=SPECIMEN.pdf");
199 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
204if ($action ==
'set') {
208if ($action ==
'del') {
218if ($action ==
'setdoc') {
219 if (
dolibarr_set_const($db,
"PRODUCT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
222 $conf->global->PRODUCT_ADDON_PDF = $value;
233if ($action ==
'set') {
234 $const =
"PRODUCT_SPECIAL_".strtoupper(
GETPOST(
'spe',
'alpha'));
236 if (
GETPOST(
'value',
'alpha')) {
247if (preg_match(
'/set_(.+)/', $action, $reg)) {
248 $keyforvar = $reg[1];
256if (preg_match(
'/del_(.+)/', $action, $reg)) {
257 $keyforvar = $reg[1];
277$title = $langs->trans(
'ProductServiceSetup');
278$tab = $langs->trans(
"ProductsAndServices");
279if (!isModEnabled(
"product")) {
280 $title = $langs->trans(
'ServiceSetup');
281 $tab = $langs->trans(
'Services');
282} elseif (!isModEnabled(
"service")) {
283 $title = $langs->trans(
'ProductSetup');
284 $tab = $langs->trans(
'Products');
287llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'mod-product page-admin_product');
289$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
295$form =
new Form($db);
298$dirproduct = array(
'/core/modules/product/');
299$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
303print
'<div class="div-table-responsive-no-min">';
304print
'<table class="noborder centpercent">'.
"\n";
305print
'<tr class="liste_titre">'.
"\n";
306print
' <td>'.$langs->trans(
"Name").
'</td>';
307print
' <td>'.$langs->trans(
"Description").
'</td>';
308print
' <td>'.$langs->trans(
"Example").
'</td>';
309print
' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
310print
' <td class="center"></td>';
313foreach ($dirproduct as $dirroot) {
316 $handle = @opendir($dir);
317 if (is_resource($handle)) {
319 while (($file = readdir($handle)) !==
false) {
320 if (substr($file, 0, 16) ==
'mod_codeproduct_' && substr($file, -3) ==
'php') {
321 $file = substr($file, 0,
dol_strlen($file) - 4);
329 $modCodeProduct =
new $file();
330 '@phan-var-force ModeleProductCode $modCodeProduct';
333 if ($modCodeProduct->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
336 if ($modCodeProduct->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
340 print
'<tr class="oddeven">'.
"\n";
341 print
'<td width="140">'.$modCodeProduct->name.
'</td>'.
"\n";
342 print
'<td>'.$modCodeProduct->info($langs).
'</td>'.
"\n";
343 print
'<td class="nowrap"><span class="opacitymedium">'.$modCodeProduct->getExample($langs).
'</span></td>'.
"\n";
346 print
'<td class="center">'.
"\n";
347 print
img_picto($langs->trans(
"Activated"),
'switch_on');
351 if (!(isModEnabled(
'multicompany') && ((is_object($mc) && !empty($mc->sharings[
'referent'])) && ($mc->sharings[
'referent'] == $conf->entity)))) {
353 print
'<td class="center">';
355 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeproduct&token='.
newToken().
'&value='.urlencode($file).
'">';
357 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
364 print
'<td class="center">';
365 $s = $modCodeProduct->getToolTip($langs,
'', -1);
366 print $form->textwithpicto(
'', $s, 1);
381$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
382$sql .=
" WHERE type = '".$db->escape($type).
"'";
383$sql .=
" AND entity = ".$conf->entity;
384$resql = $db->query($sql);
387 $num_rows = $db->num_rows($resql);
388 while ($i < $num_rows) {
389 $array = $db->fetch_array($resql);
390 if (is_array($array)) {
391 array_push($def, $array[0]);
403print
'<div class="div-table-responsive-no-min">';
404print
'<table class="noborder centpercent">';
405print
'<tr class="liste_titre">';
406print
'<td>'.$langs->trans(
"Name").
'</td>';
407print
'<td>'.$langs->trans(
"Description").
'</td>';
408print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
409print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
410print
'<td class="center"></td>';
411print
'<td class="center" width="80">'.$langs->trans(
"Preview").
'</td>';
417foreach ($dirmodels as $reldir) {
418 foreach (array(
'',
'/doc') as $valdir) {
419 $dir =
dol_buildpath($reldir.
"core/modules/product".$valdir);
421 $handle = opendir($dir);
422 if (is_resource($handle)) {
423 while (($file = readdir($handle)) !==
false) {
429 foreach ($filelist as $file) {
430 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
431 if (file_exists($dir.
'/'.$file)) {
432 $name = substr($file, 4,
dol_strlen($file) - 16);
433 $classname = substr($file, 0,
dol_strlen($file) - 12);
435 require_once $dir.
'/'.$file;
436 $module =
new $classname($db);
437 '@phan-var-force ModelePDFProduct $module';
439 $modulequalified = 1;
440 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
441 $modulequalified = 0;
443 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
444 $modulequalified = 0;
447 if ($modulequalified) {
448 print
'<tr class="oddeven"><td width="100">';
449 print(empty($module->name) ? $name : $module->
name);
451 if (method_exists($module,
'info')) {
452 print $module->info($langs);
454 print $module->description;
459 if (in_array($name, $def)) {
460 print
'<td class="center">'.
"\n";
461 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
462 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
466 print
'<td class="center">'.
"\n";
467 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>';
472 print
'<td class="center">';
474 print
img_picto($langs->trans(
"Default"),
'on');
476 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>';
481 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
482 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
483 if ($module->type ==
'pdf') {
484 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
486 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
487 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
488 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
491 print
'<td class="center">';
492 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
496 print
'<td class="center">';
497 if ($module->type ==
'pdf') {
498 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'contract').
'</a>';
500 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
526print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
527print
'<input type="hidden" name="token" value="'.newToken().
'">';
528print
'<input type="hidden" name="action" value="other">';
529print
'<input type="hidden" name="page_y" value="">';
535print
'<div class="div-table-responsive-no-min">';
536print
'<table class="noborder centpercent">';
537print
'<tr class="liste_titre">';
538print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
539print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
545print
'<tr class="oddeven">';
546print
'<td>'.$langs->trans(
"AssociatedProductsAbility").
'</td>';
547print
'<td class="right">';
548print ajax_constantonoff(
"PRODUIT_SOUSPRODUITS", array(), $conf->entity, 0, 0, 1, 0);
556print
'<tr class="oddeven">';
557print
'<td>'.$langs->trans(
"VariantsAbility").
'</td>';
558print
'<td class="right">';
561if (!isModEnabled(
'variants')) {
562 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
'</span>';
564 print
yn(1).
' <span class="opacitymedium">('.$langs->trans(
"ModuleIsEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
')</span>';
572print
'<tr class="oddeven">';
573if (!isModEnabled(
'multicompany')) {
574 print
'<td>'.$langs->trans(
"PricingRule").
'</td>';
576 print
'<td>'.$form->textwithpicto($langs->trans(
"PricingRule"), $langs->trans(
"SamePriceAlsoForSharedCompanies"), 1).
'</td>';
578print
'<td class="right">';
579$current_rule =
'PRODUCT_PRICE_UNIQ';
581 $current_rule =
'PRODUIT_MULTIPRICES';
584 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
587 $current_rule =
'PRODUIT_CUSTOMER_PRICES';
590 $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
593 $current_rule =
'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES';
595print $form->selectarray(
"princingrule", $select_pricing_rules, $current_rule, 0, 0, 0,
'', 1, 0, 0,
'',
'maxwidth400', 1);
602 print
'<tr class="oddeven">';
603 print
'<td>'.$langs->trans(
"MultiPricesNumPrices").
'</td>';
604 print
'<td class="right"><input size="3" type="text" class="flat right" name="value_PRODUIT_MULTIPRICES_LIMIT" value="' .
getDolGlobalString(
'PRODUIT_MULTIPRICES_LIMIT').
'"></td>';
609print
'<tr class="oddeven">';
610print
'<td>'.$langs->trans(
"DefaultPriceType").
'</td>';
611print
'<td class="right">';
612print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE,
"price_base_type");
617if (isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")) {
618 print
'<tr class="oddeven">';
619 print
'<td>'.$form->textwithpicto($langs->trans(
"UseProductSupplierPackaging"), $langs->trans(
"PackagingForThisProductDesc")).
'</td>';
620 print
'<td align="right">';
621 print ajax_constantonoff(
"PRODUCT_USE_SUPPLIER_PACKAGING", array(), $conf->entity, 0, 0, 0, 0);
626 print
'<tr class="oddeven">';
627 print
'<td>'.$langs->trans(
"UseProductFournDesc").
'</td>';
628 print
'<td class="right">';
629 print ajax_constantonoff(
"PRODUIT_FOURN_TEXTS", array(), $conf->entity, 0, 0, 0, 0);
638print
'<div class="center">';
639print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
646print
'<div class="div-table-responsive-no-min">';
647print
'<table class="noborder centpercent">';
648print
'<tr class="liste_titre">';
649print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
650print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
655print
'<tr class="oddeven">';
656print
'<td>'.$form->textwithpicto($langs->trans(
"UseSearchToSelectProduct"), $langs->trans(
'UseSearchToSelectProductTooltip'), 1).
'</td>';
657if (empty($conf->use_javascript_ajax)) {
658 print
'<td class="nowrap right">';
659 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
662 print
'<td class="right">';
664 '0' => $langs->trans(
"No"),
665 '1' => $langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
666 '2' => $langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
667 '3' => $langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
669 print $form->selectarray(
"activate_usesearchtoselectproduct", $arrval, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
675print
'<tr class="oddeven">';
676print
'<td>'.$langs->trans(
"NumberOfProductShowInSelect").
'</td>';
677print
'<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="' .
getDolGlobalString(
'PRODUIT_LIMIT_SIZE', 1000).
'"></td>';
682print
'<tr class="oddeven">';
683print
'<td>'.$langs->trans(
"OnProductSelectAddProductDesc").
'</td>';
684print
'<td class="right">';
685print
'<!-- PRODUIT_AUTOFILL_DESC -->';
686print $form->selectarray(
687 "activate_FillProductDescAuto",
688 array(0 =>
'DoNotAutofillButAutoConcat', 1 =>
'AutoFillFormFieldBeforeSubmit', 2 =>
'DoNotUseDescriptionOfProdut'),
689 !
getDolGlobalString(
'PRODUIT_AUTOFILL_DESC') ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
698 'minwidth100imp maxwidth400',
705print
'<tr class="oddeven">';
706print
'<td>'.$langs->trans(
"ViewProductDescInFormAbility").
'</td>';
707print
'<td class="right">';
708$arrayofchoices = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes").
' ('.$langs->trans(
"DesktopsOnly").
')',
'2' => $langs->trans(
"Yes").
' ('.$langs->trans(
"DesktopsAndSmartphones").
')');
709print $form->selectarray(
"PRODUIT_DESC_IN_FORM", $arrayofchoices,
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM'), 0);
737 print
'<tr class="oddeven">';
738 print
'<td>'.$langs->trans(
"ViewProductDescInThirdpartyLanguageAbility").
'</td>';
739 print
'<td class="right">';
740 print $form->selectyesno(
"activate_viewProdTextsInThirdpartyLanguage", (
getDolGlobalString(
'PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
748 $dir = DOL_DOCUMENT_ROOT.
"/product/canvas/";
750 print
'<tr class="liste_titre">';
751 print
'<td>'.$langs->trans(
"ProductSpecial").
'</td>'.
"\n";
752 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
756 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
758 $handle = opendir($dir);
759 if (is_resource($handle)) {
760 while (($file = readdir($handle)) !==
false) {
761 if (file_exists($dir.$file.
'/product.'.$file.
'.class.php')) {
762 $classfile = $dir.$file.
'/product.'.$file.
'.class.php';
763 $classname =
'Product'.ucfirst($file);
765 require_once $classfile;
770 if ($conf->$module->enabled) {
771 print
'<tr class="oddeven"><td>';
775 print
'</td><td class="right">';
777 $const =
"PRODUCT_SPECIAL_".strtoupper($file);
780 print
img_picto($langs->trans(
"Active"),
'tick');
781 print
'</td><td class="right">';
782 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=0">'.$langs->trans(
"Disable").
'</a>';
784 print
' </td><td class="right">';
785 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=1">'.$langs->trans(
"Activate").
'</a>';
802print
'<div class="center">';
803print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
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 products or services.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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...
getDolGlobalString($key, $default='')
Return a 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 information.
$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.