28 if (!$res && !empty($_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) {
29 $res = @include $_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
32 $tmp = empty($_SERVER[
'SCRIPT_FILENAME']) ?
'' : $_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
33 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
36 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
37 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
39 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) {
40 $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
43 if (!$res && file_exists(
"../main.inc.php")) {
44 $res = @include
"../main.inc.php";
46 if (!$res && file_exists(
"../../main.inc.php")) {
47 $res = @include
"../../main.inc.php";
49 if (!$res && file_exists(
"../../../main.inc.php")) {
50 $res = @include
"../../../main.inc.php";
53 die(
"Include of main fails");
59 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
60 require_once DOL_DOCUMENT_ROOT.
'/webhook/lib/webhook.lib.php';
63 $langs->loadLangs(array(
"admin",
"webhook"));
66 $hookmanager->initHooks(array(
'webhooksetup',
'globalsetup'));
74 $action =
GETPOST(
'action',
'aZ09');
75 $backtopage =
GETPOST(
'backtopage',
'alpha');
76 $modulepart =
GETPOST(
'modulepart',
'aZ09');
78 $value =
GETPOST(
'value',
'alpha');
79 $label =
GETPOST(
'label',
'alpha');
80 $scandir =
GETPOST(
'scan_dir',
'alpha');
83 $arrayofparameters = array(
84 'WEBHOOK_MYPARAM1'=>array(
'type'=>
'string',
'css'=>
'minwidth500' ,
'enabled'=>0),
100 if ($useFormSetup && (
float) DOL_VERSION >= 15) {
101 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
105 $formSetup->addItemsFromParamsArray($arrayofparameters);
139 $setupnotempty = count($formSetup->items);
143 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
150 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
152 if ($action ==
'updateMask') {
153 $maskconst =
GETPOST(
'maskconst',
'aZ09');
154 $maskvalue =
GETPOST(
'maskvalue',
'alpha');
156 if ($maskconst && preg_match(
'/_MASK$/', $maskconst)) {
157 $res =
dolibarr_set_const($db, $maskconst, $maskvalue,
'chaine', 0,
'', $conf->entity);
168 } elseif ($action ==
'specimen') {
169 $modele =
GETPOST(
'module',
'alpha');
170 $tmpobjectkey =
GETPOST(
'object');
172 $tmpobject =
new $tmpobjectkey($db);
173 $tmpobject->initAsSpecimen();
176 $file =
''; $classname =
''; $filefound = 0;
177 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
178 foreach ($dirmodels as $reldir) {
179 $file =
dol_buildpath($reldir.
"core/modules/webhook/doc/pdf_".$modele.
"_".strtolower($tmpobjectkey).
".modules.php", 0);
180 if (file_exists($file)) {
182 $classname =
"pdf_".$modele;
190 $module =
new $classname($db);
192 if ($module->write_file($tmpobject, $langs) > 0) {
193 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=".strtolower($tmpobjectkey).
"&file=SPECIMEN.pdf");
201 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
203 } elseif ($action ==
'setmod') {
205 $tmpobjectkey =
GETPOST(
'object');
206 if (!empty($tmpobjectkey)) {
207 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
"_ADDON";
210 } elseif ($action ==
'set') {
213 } elseif ($action ==
'del') {
216 $tmpobjectkey =
GETPOST(
'object');
217 if (!empty($tmpobjectkey)) {
218 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
219 if ($conf->global->$constforval ==
"$value") {
224 } elseif ($action ==
'setdoc') {
226 $tmpobjectkey =
GETPOST(
'object');
227 if (!empty($tmpobjectkey)) {
228 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
232 $conf->global->$constforval = $value;
241 } elseif ($action ==
'unsetdoc') {
242 $tmpobjectkey =
GETPOST(
'object');
243 if (!empty($tmpobjectkey)) {
244 $constforval =
'WEBHOOK_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
258 $page_name =
"WebhookSetup";
263 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
265 print
load_fiche_titre($langs->trans($page_name), $linkback,
'title_setup');
269 print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
"webhook@webhook");
272 echo
'<span class="opacitymedium">'.$langs->trans(
"WebhookSetupPage").
'</span><br><br>';
275 if ($action ==
'edit') {
276 if ($useFormSetup && (
float) DOL_VERSION >= 15) {
277 print $formSetup->generateOutput(
true);
279 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
280 print
'<input type="hidden" name="token" value="'.newToken().
'">';
281 print
'<input type="hidden" name="action" value="update">';
283 print
'<table class="noborder centpercent">';
284 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
286 foreach ($arrayofparameters as $constname => $val) {
287 if ($val[
'enabled']==1) {
289 print
'<tr class="oddeven"><td>';
290 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
291 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.
$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
294 if ($val[
'type'] ==
'textarea') {
295 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
297 print
"</textarea>\n";
298 } elseif ($val[
'type']==
'html') {
299 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
300 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false, $conf->fckeditor->enabled, ROWS_5,
'90%');
301 $doleditor->Create();
302 } elseif ($val[
'type'] ==
'yesno') {
304 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
305 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
308 $tmp = explode(
':', $val[
'type']);
309 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
311 $arrayofmessagename = array();
312 if (is_array($formmail->lines_model)) {
313 foreach ($formmail->lines_model as $modelmail) {
316 if (!empty($arrayofmessagename[$modelmail->label])) {
317 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
320 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
323 print
$form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname},
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
324 } elseif (preg_match(
'/category:/', $val[
'type'])) {
325 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
326 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
329 $tmp = explode(
':', $val[
'type']);
330 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
331 print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
332 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
333 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
335 print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
336 } elseif ($val[
'type'] ==
'securekey') {
337 print
'<input required="required" type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') : $conf->global->{$constname}).
'" size="40">';
338 if (!empty($conf->use_javascript_ajax)) {
339 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
343 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
345 } elseif ($val[
'type'] ==
'product') {
347 $selected = (empty($conf->global->$constname) ?
'' : $conf->global->$constname);
348 $form->select_produits($selected, $constname,
'', 0);
351 print
'<input name="'.$constname.
'" class="flat '.(empty($val[
'css']) ?
'minwidth200' : $val[
'css']).
'" value="'.$conf->global->{$constname}.
'">';
358 print
'<br><div class="center">';
359 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
367 if ($useFormSetup && (
float) DOL_VERSION >= 15) {
368 if (!empty($formSetup->items)) {
369 print $formSetup->generateOutput();
372 if (!empty($arrayofparameters)) {
373 print
'<table class="noborder centpercent">';
374 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
376 foreach ($arrayofparameters as $constname => $val) {
377 if ($val[
'enabled']==1) {
379 print
'<tr class="oddeven"><td>';
380 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
381 print
$form->textwithpicto($langs->trans($constname), $tooltiphelp);
384 if ($val[
'type'] ==
'textarea') {
386 } elseif ($val[
'type']==
'html') {
388 } elseif ($val[
'type'] ==
'yesno') {
390 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
391 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
394 $tmp = explode(
':', $val[
'type']);
396 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalString($constname));
400 print $langs->trans($template->label);
401 } elseif (preg_match(
'/category:/', $val[
'type'])) {
406 } elseif ($result > 0 ) {
407 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
409 foreach ($ways as $way) {
410 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
412 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
414 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
416 print $langs->trans(
"Prospect");
418 print $langs->trans(
"ProspectCustomer");
420 print $langs->trans(
"Customer");
422 print $langs->trans(
"NorProspectNorCustomer");
424 } elseif ($val[
'type'] ==
'product') {
429 } elseif ($resprod < 0) {
443 if ($setupnotempty) {
444 print
'<div class="tabsAction">';
445 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
453 $moduledir =
'webhook';
454 $myTmpObjects[
'MyObject'] = array(
'includerefgeneration'=>0,
'includedocgeneration'=>0);
457 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
458 if ($myTmpObjectKey ==
'MyObject') {
461 if ($myTmpObjectArray[
'includerefgeneration']) {
467 print
load_fiche_titre($langs->trans(
"NumberingModules", $myTmpObjectKey),
'',
'');
469 print
'<table class="noborder centpercent">';
470 print
'<tr class="liste_titre">';
471 print
'<td>'.$langs->trans(
"Name").
'</td>';
472 print
'<td>'.$langs->trans(
"Description").
'</td>';
473 print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
474 print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
475 print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
480 foreach ($dirmodels as $reldir) {
484 $handle = opendir($dir);
485 if (is_resource($handle)) {
486 while (($file = readdir($handle)) !==
false) {
487 if (strpos($file,
'mod_'.strtolower($myTmpObjectKey).
'_') === 0 && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
488 $file = substr($file, 0,
dol_strlen($file) - 4);
490 require_once $dir.
'/'.$file.
'.php';
492 $module =
new $file($db);
495 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
498 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
502 if ($module->isEnabled()) {
503 dol_include_once(
'/'.$moduledir.
'/class/'.strtolower($myTmpObjectKey).
'.class.php');
505 print
'<tr class="oddeven"><td>'.$module->name.
"</td><td>\n";
506 print $module->info();
510 print
'<td class="nowrap">';
511 $tmp = $module->getExample();
512 if (preg_match(
'/^Error/', $tmp)) {
513 $langs->load(
"errors");
514 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
515 } elseif ($tmp ==
'NotConfigured') {
516 print $langs->trans($tmp);
522 print
'<td class="center">';
523 $constforvar =
'WEBHOOK_'.strtoupper($myTmpObjectKey).
'_ADDON';
524 if ($conf->global->$constforvar == $file) {
525 print
img_picto($langs->trans(
"Activated"),
'switch_on');
527 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&object='.strtolower($myTmpObjectKey).
'&value='.urlencode($file).
'">';
528 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
533 $mytmpinstance =
new $myTmpObjectKey($db);
534 $mytmpinstance->initAsSpecimen();
538 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
540 $nextval = $module->getNextValue($mytmpinstance);
541 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
542 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
544 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
545 $nextval = $langs->trans($nextval);
547 $htmltooltip .= $nextval.
'<br>';
549 $htmltooltip .= $langs->trans($module->error).
'<br>';
553 print
'<td class="center">';
554 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
565 print
"</table><br>\n";
568 if ($myTmpObjectArray[
'includedocgeneration']) {
573 $type = strtolower($myTmpObjectKey);
575 print
load_fiche_titre($langs->trans(
"DocumentModules", $myTmpObjectKey),
'',
'');
580 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
581 $sql .=
" WHERE type = '".$db->escape($type).
"'";
582 $sql .=
" AND entity = ".$conf->entity;
583 $resql = $db->query($sql);
586 $num_rows = $db->num_rows(
$resql);
587 while ($i < $num_rows) {
588 $array = $db->fetch_array(
$resql);
589 array_push($def, $array[0]);
596 print
"<table class=\"noborder\" width=\"100%\">\n";
597 print
"<tr class=\"liste_titre\">\n";
598 print
'<td>'.$langs->trans(
"Name").
'</td>';
599 print
'<td>'.$langs->trans(
"Description").
'</td>';
600 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
601 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
602 print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
603 print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
608 foreach ($dirmodels as $reldir) {
609 foreach (array(
'',
'/doc') as $valdir) {
610 $realpath = $reldir.
"core/modules/".$moduledir.$valdir;
614 $handle = opendir($dir);
615 if (is_resource($handle)) {
616 while (($file = readdir($handle)) !==
false) {
622 foreach ($filelist as $file) {
623 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
624 if (file_exists($dir.
'/'.$file)) {
625 $name = substr($file, 4,
dol_strlen($file) - 16);
626 $classname = substr($file, 0,
dol_strlen($file) - 12);
628 require_once $dir.
'/'.$file;
629 $module =
new $classname($db);
631 $modulequalified = 1;
632 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
633 $modulequalified = 0;
635 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
636 $modulequalified = 0;
639 if ($modulequalified) {
640 print
'<tr class="oddeven"><td width="100">';
641 print (empty($module->name) ? $name : $module->name);
643 if (method_exists($module,
'info')) {
644 print $module->info($langs);
646 print $module->description;
651 if (in_array($name, $def)) {
652 print
'<td class="center">'.
"\n";
653 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.urlencode($name).
'">';
654 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
658 print
'<td class="center">'.
"\n";
659 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>';
664 print
'<td class="center">';
665 $constforvar =
'WEBHOOK_'.strtoupper($myTmpObjectKey).
'_ADDON';
666 if ($conf->global->$constforvar == $name) {
669 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetdoc&token='.
newToken().
'&object='.urlencode(strtolower($myTmpObjectKey)).
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'&type='.urlencode($type).
'" alt="'.$langs->trans(
"Disable").
'">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
671 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.
newToken().
'&object='.urlencode(strtolower($myTmpObjectKey)).
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
676 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
677 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
678 if ($module->type ==
'pdf') {
679 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
681 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
683 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
684 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
685 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
687 print
'<td class="center">';
688 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
692 print
'<td class="center">';
693 if ($module->type ==
'pdf') {
694 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'&object='.$myTmpObjectKey.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
696 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
714 if (empty($setupnotempty)) {
715 print
'<br>'.$langs->trans(
"NothingToSetup");
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage categories.
Class to manage a WYSIWYG editor.
Class to manage products or services.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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_get_fiche_end($notab=0)
Return tab footer of a card.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return 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.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token')
Ouput javacript to autoset a generated password using default module into a HTML element.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
webhookAdminPrepareHead()
Prepare admin pages header.