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)))
46 $action =
GETPOST(
'action',
'aZ09');
47 $value =
GETPOST(
'value',
'alpha');
48 $label =
GETPOST(
'label',
'alpha');
49 $scandir =
GETPOST(
'scan_dir',
'alpha');
53 $select_pricing_rules = array(
54 'PRODUCT_PRICE_UNIQ'=>$langs->trans(
'PriceCatalogue'),
55 'PRODUIT_MULTIPRICES'=>$langs->trans(
'MultiPricesAbility'),
56 'PRODUIT_CUSTOMER_PRICES'=>$langs->trans(
'PriceByCustomer'),
58 $keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
59 if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || !empty($conf->global->$keyforparam)) $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
60 $keyforparam =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
61 if ($conf->global->MAIN_FEATURES_LEVEL >= 2 || !empty($conf->global->$keyforparam)) $select_pricing_rules[
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'] = $langs->trans(
'MultiPricesAbility').
'+'.$langs->trans(
'PriceByQuantity').
' ('.$langs->trans(
"VersionExperimental").
')';
64 if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) {
65 dolibarr_set_const($db,
'PRODUIT_MULTIPRICES_LIMIT', 5,
'chaine', 0,
'', $conf->entity);
75 $nomessageinsetmoduleoptions = 1;
76 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
78 if ($action ==
'setcodeproduct')
80 if (
dolibarr_set_const($db,
"PRODUCT_CODEPRODUCT_ADDON", $value,
'chaine', 0,
'', $conf->entity) > 0)
82 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
89 if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_LIMIT_SIZE') >= 0)
91 $res =
dolibarr_set_const($db,
"PRODUIT_LIMIT_SIZE",
GETPOST(
'value_PRODUIT_LIMIT_SIZE'),
'chaine', 0,
'', $conf->entity);
92 if (!($res > 0)) $error++;
94 if ($action ==
'other' &&
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT') > 0)
96 $res =
dolibarr_set_const($db,
"PRODUIT_MULTIPRICES_LIMIT",
GETPOST(
'value_PRODUIT_MULTIPRICES_LIMIT'),
'chaine', 0,
'', $conf->entity);
97 if (!($res > 0)) $error++;
99 if ($action ==
'other')
101 $princingrules =
GETPOST(
'princingrule',
'alpha');
102 foreach ($select_pricing_rules as $rule => $label)
104 if ($rule == $princingrules)
106 if ($princingrules ==
'PRODUCT_PRICE_UNIQ')
108 $res =
dolibarr_set_const($db,
'PRODUIT_MULTIPRICES', 0,
'chaine', 0,
'', $conf->entity);
109 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0,
'chaine', 0,
'', $conf->entity);
110 $res =
dolibarr_set_const($db,
'PRODUIT_CUSTOMER_PRICES', 0,
'chaine', 0,
'', $conf->entity);
113 $multirule = explode(
'&', $princingrules);
114 foreach ($multirule as $rulesselected)
121 if (strpos($rule,
'&') ===
false) {
127 $value =
GETPOST(
'price_base_type',
'alpha');
128 $res =
dolibarr_set_const($db,
"PRODUCT_PRICE_BASE_TYPE", $value,
'chaine', 0,
'', $conf->entity);
133 $value =
GETPOST(
'activate_viewProdDescInForm',
'alpha');
134 $res =
dolibarr_set_const($db,
"PRODUIT_DESC_IN_FORM", $value,
'chaine', 0,
'', $conf->entity);
136 $value =
GETPOST(
'activate_viewProdTextsInThirdpartyLanguage',
'alpha');
137 $res =
dolibarr_set_const($db,
"PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE", $value,
'chaine', 0,
'', $conf->entity);
139 $value =
GETPOST(
'activate_mergePropalProductCard',
'alpha');
140 $res =
dolibarr_set_const($db,
"PRODUIT_PDF_MERGE_PROPAL", $value,
'chaine', 0,
'', $conf->entity);
142 $value =
GETPOST(
'activate_usesearchtoselectproduct',
'alpha');
143 $res =
dolibarr_set_const($db,
"PRODUIT_USE_SEARCH_TO_SELECT", $value,
'chaine', 0,
'', $conf->entity);
145 $value =
GETPOST(
'activate_useProdFournDesc',
'alpha');
146 $res =
dolibarr_set_const($db,
"PRODUIT_FOURN_TEXTS", $value,
'chaine', 0,
'', $conf->entity);
149 $sql_test =
"SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price WHERE 1";
150 $resql = $db->query($sql_test);
151 if (!
$resql && $db->lasterrno ==
'DB_ERROR_NOSUCHFIELD')
153 $sql_new =
"ALTER TABLE ".MAIN_DB_PREFIX.
"product_fournisseur_price ADD COLUMN desc_fourn text";
154 $resql_new = $db->query($sql_new);
158 $value =
GETPOST(
'activate_useProdSupplierPackaging',
'alpha');
159 $res =
dolibarr_set_const($db,
"PRODUCT_USE_SUPPLIER_PACKAGING", $value,
'chaine', 0,
'', $conf->entity);
161 $sql_test =
"SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX.
"product_fournisseur_price WHERE 1";
162 $resql = $db->query($sql_test);
163 if (!
$resql && $db->lasterrno ==
'DB_ERROR_NOSUCHFIELD')
165 $sql_new =
"ALTER TABLE ".MAIN_DB_PREFIX.
"product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1";
166 $resql_new = $db->query($sql_new);
171 if ($action ==
'specimen')
173 $modele =
GETPOST(
'module',
'alpha');
176 $product->initAsSpecimen();
179 $file =
''; $classname =
''; $filefound = 0;
180 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
181 foreach ($dirmodels as $reldir)
183 $file =
dol_buildpath($reldir.
"core/modules/product/doc/pdf_".$modele.
".modules.php", 0);
184 if (file_exists($file))
187 $classname =
"pdf_".$modele;
196 $module =
new $classname($db);
198 if ($module->write_file($product, $langs,
'') > 0)
200 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=product&file=SPECIMEN.pdf");
208 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
213 if ($action ==
'set')
218 if ($action ==
'del')
223 if ($conf->global->PRODUCT_ADDON_PDF ==
"$value")
dolibarr_del_const($db,
'PRODUCT_ADDON_PDF', $conf->entity);
228 if ($action ==
'setdoc')
230 if (
dolibarr_set_const($db,
"PRODUCT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity))
234 $conf->global->PRODUCT_ADDON_PDF = $value;
246 if ($action ==
'set')
248 $const =
"PRODUCT_SPECIAL_".strtoupper(
GETPOST(
'spe',
'alpha'));
252 if (!($res > 0)) $error++;
278 $title = $langs->trans(
'ProductServiceSetup');
279 $tab = $langs->trans(
"ProductsAndServices");
280 if (empty($conf->product->enabled))
282 $title = $langs->trans(
'ServiceSetup');
283 $tab = $langs->trans(
'Services');
284 } elseif (empty($conf->service->enabled))
286 $title = $langs->trans(
'ProductSetup');
287 $tab = $langs->trans(
'Products');
292 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
298 $form =
new Form($db);
301 $dirproduct = array(
'/core/modules/product/');
302 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
306 print '<table class="noborder centpercent">'.
"\n";
307 print '<tr class="liste_titre">'.
"\n";
308 print ' <td>'.$langs->trans(
"Name").
'</td>';
309 print ' <td>'.$langs->trans(
"Description").
'</td>';
310 print ' <td>'.$langs->trans(
"Example").
'</td>';
311 print ' <td class="center" width="80">'.$langs->trans(
"Status").
'</td>';
312 print ' <td class="center" width="60">'.$langs->trans(
"ShortInfo").
'</td>';
315 foreach ($dirproduct as $dirroot)
319 $handle = @opendir($dir);
320 if (is_resource($handle))
323 while (($file = readdir($handle)) !==
false)
325 if (substr($file, 0, 16) ==
'mod_codeproduct_' && substr($file, -3) ==
'php')
327 $file = substr($file, 0,
dol_strlen($file) - 4);
336 $modCodeProduct =
new $file;
339 if ($modCodeProduct->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2)
continue;
340 if ($modCodeProduct->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1)
continue;
342 print '<tr class="oddeven">'.
"\n";
343 print '<td width="140">'.$modCodeProduct->name.
'</td>'.
"\n";
344 print '<td>'.$modCodeProduct->info($langs).
'</td>'.
"\n";
345 print '<td class="nowrap">'.$modCodeProduct->getExample($langs).
'</td>'.
"\n";
347 if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file)
349 print '<td class="center">'.
"\n";
354 if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings[
'referent']) && $mc->sharings[
'referent'] == $conf->entity) ?
false :
true);
355 print '<td class="center">';
356 if (!$disabled)
print '<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=setcodeproduct&token='.
newToken().
'&value='.$file.
'">';
358 if (!$disabled)
print '</a>';
362 print '<td class="center">';
363 $s = $modCodeProduct->getToolTip($langs, null, -1);
364 print $form->textwithpicto(
'', $s, 1);
378 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
379 $sql .=
" WHERE type = '".$db->escape($type).
"'";
380 $sql .=
" AND entity = ".$conf->entity;
381 $resql = $db->query($sql);
385 $num_rows = $db->num_rows(
$resql);
386 while ($i < $num_rows)
388 $array = $db->fetch_array(
$resql);
389 array_push($def, $array[0]);
400 print '<table class="noborder centpercent">';
401 print
'<tr class="liste_titre">';
402 print
'<td>'.$langs->trans(
"Name").
'</td>';
403 print
'<td>'.$langs->trans(
"Description").
'</td>';
404 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
405 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
406 print
'<td class="center" width="80">'.$langs->trans(
"ShortInfo").
'</td>';
407 print
'<td class="center" width="80">'.$langs->trans(
"Preview").
'</td>';
412 foreach ($dirmodels as $reldir)
414 foreach (array(
'',
'/doc') as $valdir)
416 $dir =
dol_buildpath($reldir.
"core/modules/product".$valdir);
419 $handle = opendir($dir);
420 if (is_resource($handle))
422 while (($file = readdir($handle)) !==
false)
429 foreach ($filelist as $file)
431 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file))
433 if (file_exists($dir.
'/'.$file))
435 $name = substr($file, 4,
dol_strlen($file) - 16);
436 $classname = substr($file, 0,
dol_strlen($file) - 12);
438 require_once $dir.
'/'.$file;
439 $module =
new $classname($db);
441 $modulequalified = 1;
442 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
443 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
445 if ($modulequalified)
447 print
'<tr class="oddeven"><td width="100">';
448 print (empty($module->name) ? $name : $module->name);
450 if (method_exists($module,
'info')) print $module->info($langs);
451 else print $module->description;
455 if (in_array($name, $def))
457 print
'<td class="center">'.
"\n";
458 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&value='.$name.
'">';
459 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
463 print
'<td class="center">'.
"\n";
464 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
469 print
'<td class="center">';
470 if ($conf->global->PRODUCT_ADDON_PDF == $name)
472 print
img_picto($langs->trans(
"Default"),
'on');
474 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
479 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
480 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
481 if ($module->type ==
'pdf')
483 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
485 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
486 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
487 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
490 print
'<td class="center">';
491 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
495 print
'<td class="center">';
496 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');
526 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
527 print
'<input type="hidden" name="token" value="'.newToken().
'">';
528 print
'<input type="hidden" name="action" value="other">';
529 print
'<input type="hidden" name="page_y" value="">';
531 print
'<table class="noborder centpercent">';
532 print
'<tr class="liste_titre">';
533 print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
534 print
'<td class="right" width="60">'.$langs->trans(
"Value").
'</td>'.
"\n";
540 print
'<tr class="oddeven">';
541 print
'<td>'.$langs->trans(
"AssociatedProductsAbility").
'</td>';
542 print
'<td class="right">';
551 print
'<tr class="oddeven">';
552 print
'<td>'.$langs->trans(
"VariantsAbility").
'</td>';
553 print
'<td class="right">';
556 if (empty($conf->variants->enabled)) {
557 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
'</span>';
559 print
yn(1).
' <span class="opacitymedium">('.$langs->trans(
"ModuleIsEnabled", $langs->transnoentitiesnoconv(
"Module610Name")).
')</span>';
567 print
'<tr class="oddeven">';
568 if (empty($conf->multicompany->enabled))
570 print
'<td>'.$langs->trans(
"PricingRule").
'</td>';
572 print
'<td>'.$form->textwithpicto($langs->trans(
"PricingRule"), $langs->trans(
"SamePriceAlsoForSharedCompanies"), 1).
'</td>';
574 print
'<td class="right">';
575 $current_rule =
'PRODUCT_PRICE_UNIQ';
576 if (!empty($conf->global->PRODUIT_MULTIPRICES)) $current_rule =
'PRODUIT_MULTIPRICES';
577 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY';
578 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule =
'PRODUIT_CUSTOMER_PRICES';
579 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $current_rule =
'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
580 print $form->selectarray(
"princingrule", $select_pricing_rules, $current_rule);
586 if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
588 print
'<tr class="oddeven">';
589 print
'<td>'.$langs->trans(
"MultiPricesNumPrices").
'</td>';
590 print
'<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.
'"></td>';
595 print
'<tr class="oddeven">';
596 print
'<td>'.$langs->trans(
"DefaultPriceType").
'</td>';
597 print
'<td class="right">';
598 print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE,
"price_base_type");
604 print
'<tr class="oddeven">';
605 print
'<td>'.$form->textwithpicto($langs->trans(
"UseSearchToSelectProduct"), $langs->trans(
'UseSearchToSelectProductTooltip'), 1).
'</td>';
606 if (empty($conf->use_javascript_ajax))
608 print
'<td class="nowrap right">';
609 print $langs->trans(
"NotAvailableWhenAjaxDisabled");
612 print
'<td class="right">';
614 '0'=>$langs->trans(
"No"),
615 '1'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 1).
')',
616 '2'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 2).
')',
617 '3'=>$langs->trans(
"Yes").
' ('.$langs->trans(
"NumberOfKeyToSearch", 3).
')',
619 print $form->selectarray(
"activate_usesearchtoselectproduct", $arrval, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
624 if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
626 print
'<tr class="oddeven">';
627 print
'<td>'.$langs->trans(
"NumberOfProductShowInSelect").
'</td>';
628 print
'<td class="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="'.$conf->global->PRODUIT_LIMIT_SIZE.
'"></td>';
633 print
'<tr class="oddeven">';
634 print
'<td>'.$langs->trans(
"ViewProductDescInFormAbility").
'</td>';
635 print
'<td class="right">';
636 print $form->selectyesno(
"activate_viewProdDescInForm", $conf->global->PRODUIT_DESC_IN_FORM, 1);
663 if (!empty($conf->global->MAIN_MULTILANGS))
665 print
'<tr class="oddeven">';
666 print
'<td>'.$langs->trans(
"ViewProductDescInThirdpartyLanguageAbility").
'</td>';
667 print
'<td class="right">';
668 print $form->selectyesno(
"activate_viewProdTextsInThirdpartyLanguage", (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) ? $conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE : 0), 1);
673 if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
675 print
'<tr class="oddeven">';
676 print
'<td>'.$langs->trans(
"UseProductFournDesc").
'</td>';
677 print
'<td class="right">';
678 print $form->selectyesno(
"activate_useProdFournDesc", (!empty($conf->global->PRODUIT_FOURN_TEXTS) ? $conf->global->PRODUIT_FOURN_TEXTS : 0), 1);
682 print
'<tr class="oddeven">';
683 print
'<td>'.$langs->trans(
"UseProductSupplierPackaging").
'</td>';
684 print
'<td align="right">';
685 print $form->selectyesno(
"activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1);
691 if (!empty($conf->global->PRODUCT_CANVAS_ABILITY))
694 $dir = DOL_DOCUMENT_ROOT.
"/product/canvas/";
696 print
'<tr class="liste_titre">';
697 print
'<td>'.$langs->trans(
"ProductSpecial").
'</td>'.
"\n";
698 print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
703 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
705 $handle = opendir($dir);
706 if (is_resource($handle))
708 while (($file = readdir($handle)) !==
false)
710 if (file_exists($dir.$file.
'/product.'.$file.
'.class.php'))
712 $classfile = $dir.$file.
'/product.'.$file.
'.class.php';
713 $classname =
'Product'.ucfirst($file);
715 require_once $classfile;
716 $object =
new $classname();
718 $module = $object->module;
720 if ($conf->$module->enabled)
722 print
'<tr class="oddeven"><td>';
724 print $object->description;
726 print
'</td><td class="right">';
728 $const =
"PRODUCT_SPECIAL_".strtoupper($file);
730 if ($conf->global->$const)
732 print
img_picto($langs->trans(
"Active"),
'tick');
733 print
'</td><td class="right">';
734 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=0">'.$langs->trans(
"Disable").
'</a>';
736 print
' </td><td class="right">';
737 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&spe='.urlencode($file).
'&value=1">'.$langs->trans(
"Activate").
'</a>';
753 print
'<div class="center">';
754 print
'<input type="submit" class="button reposition" value="'.$langs->trans(
"Modify").
'">';
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.
delDocumentModel($name, $type)
Delete document model used by doc generator.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Class to manage products or services.
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).
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
product_admin_prepare_head()
Return array head with list of tabs to view object informations.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.