28require
'../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/asset.lib.php';
37require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
42$langs->loadLangs(array(
"admin",
"assets"));
50$action =
GETPOST(
'action',
'aZ09');
51$backtopage =
GETPOST(
'backtopage',
'alpha');
53$value =
GETPOST(
'value',
'alpha');
54$label =
GETPOST(
'label',
'alpha');
55$scandir =
GETPOST(
'scan_dir',
'alpha');
58$arrayofparameters = array(
59 'ASSET_ACCOUNTANCY_CATEGORY' => array(
'type' =>
'accountancy_category',
'enabled' => 1),
60 'ASSET_DEPRECIATION_DURATION_PER_YEAR' => array(
'type' =>
'string',
'css' =>
'minwidth200',
'enabled' => 1),
72$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
76 'asset' => array(
'label' =>
'Asset',
'includerefgeneration' => 1,
'includedocgeneration' => 0,
'class' =>
'Asset')
79$tmpobjectkey =
GETPOST(
'object',
'aZ09');
80if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
89include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
91if ($action ==
'updateMask') {
92 $maskconst =
GETPOST(
'maskconst',
'alpha');
93 $mask =
GETPOST(
'mask',
'alpha');
95 if ($maskconst && preg_match(
'/_MASK$/', $maskconst)) {
107} elseif ($action ==
'specimen' && $tmpobjectkey) {
108 $modele =
GETPOST(
'module',
'alpha');
110 $className = $myTmpObjects[$tmpobjectkey][
'class'];
111 $tmpobject =
new $className(
$db);
112 $tmpobject->initAsSpecimen();
117 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
118 foreach ($dirmodels as $reldir) {
119 $file =
dol_buildpath($reldir.
"core/modules/asset/doc/pdf_".$modele.
"_".strtolower($tmpobjectkey).
".modules.php", 0);
120 if (file_exists($file)) {
121 $classname =
"pdf_".$modele;
126 if ($classname !==
'') {
129 $module =
new $classname(
$db);
130 '@phan-var-force ModelePDFAsset $module';
132 if ($module->write_file($tmpobject, $langs) > 0) {
133 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=".strtolower($tmpobjectkey).
"&file=SPECIMEN.pdf");
141 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
143} elseif ($action ==
'setmod') {
145 if (!empty($tmpobjectkey)) {
146 $constforval =
'ASSET_'.strtoupper($tmpobjectkey).
"_ADDON";
149} elseif ($action ==
'set') {
152} elseif ($action ==
'del') {
155 if (!empty($tmpobjectkey)) {
156 $constforval =
'ASSET_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
162} elseif ($action ==
'setdoc') {
164 if (!empty($tmpobjectkey)) {
165 $constforval =
'ASSET_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
169 $conf->global->$constforval = $value;
178} elseif ($action ==
'unsetdoc') {
179 if (!empty($tmpobjectkey)) {
180 $constforval =
'ASSET_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
194$page_name =
"AssetSetup";
196llxHeader(
'', $langs->trans($page_name), $help_url);
199$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
207foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
208 if ($myTmpObjectArray[
'includerefgeneration']) {
212 print
load_fiche_titre($langs->trans(
"AssetNumberingModules", $myTmpObjectKey),
'',
'');
214 print
'<table class="noborder centpercent">';
215 print
'<tr class="liste_titre">';
216 print
'<td>'.$langs->trans(
"Name").
'</td>';
217 print
'<td>'.$langs->trans(
"Description").
'</td>';
218 print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
219 print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
220 print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
225 foreach ($dirmodels as $reldir) {
229 $handle = opendir($dir);
230 if (is_resource($handle)) {
231 while (($file = readdir($handle)) !==
false) {
232 if (strpos($file,
'mod_'.strtolower($myTmpObjectKey).
'_') === 0 && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
233 $file = substr($file, 0,
dol_strlen($file) - 4);
235 require_once $dir.
'/'.$file.
'.php';
237 $module =
new $file(
$db);
238 '@phan-var-force ModeleNumRefAsset $module';
241 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
244 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
248 if ($module->isEnabled()) {
249 dol_include_once(
'/'.$moduledir.
'/class/'.strtolower($myTmpObjectKey).
'.class.php');
251 print
'<tr class="oddeven"><td>'.$module->name.
"</td><td>\n";
252 print $module->info($langs);
256 print
'<td class="nowrap">';
257 $tmp = $module->getExample();
258 if (preg_match(
'/^Error/', $tmp)) {
259 $langs->load(
"errors");
260 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
261 } elseif ($tmp ==
'NotConfigured') {
262 print $langs->trans($tmp);
268 print
'<td class="center">';
269 $constforvar =
'ASSET_'.strtoupper($myTmpObjectKey).
'_ADDON';
270 $defaultifnotset =
'mod_asset_standard';
272 if ($activenumberingmodel == $file) {
273 print
img_picto($langs->trans(
"Activated"),
'switch_on');
275 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.newToken().
'&object='.strtolower($myTmpObjectKey).
'&value='.urlencode($file).
'">';
276 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
281 $className = $myTmpObjectArray[
'class'];
282 $mytmpinstance =
new $className(
$db);
283 $mytmpinstance->initAsSpecimen();
287 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
289 $nextval = $module->getNextValue($mytmpinstance);
290 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
291 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
293 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
294 $nextval = $langs->trans($nextval);
296 $htmltooltip .= $nextval.
'<br>';
298 $htmltooltip .= $langs->trans($module->error).
'<br>';
302 print
'<td class="center">';
303 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
314 print
"</table><br>\n";
317 if ($myTmpObjectArray[
'includedocgeneration']) {
321 $type = strtolower($myTmpObjectKey);
323 print
load_fiche_titre($langs->trans(
"DocumentModules", $myTmpObjectKey),
'',
'');
329 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
330 $sql .=
" WHERE type = '".$db->escape($type).
"'";
331 $sql .=
" AND entity = ".((int)
$conf->entity);
332 $resql =
$db->query($sql);
335 $num_rows =
$db->num_rows($resql);
336 while ($i < $num_rows) {
337 $array =
$db->fetch_array($resql);
338 if (is_array($array)) {
339 array_push($def, $array[0]);
347 print
"<table class=\"noborder\" width=\"100%\">\n";
348 print
"<tr class=\"liste_titre\">\n";
349 print
'<td>'.$langs->trans(
"Name").
'</td>';
350 print
'<td>'.$langs->trans(
"Description").
'</td>';
351 print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
352 print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
353 print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
354 print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
359 foreach ($dirmodels as $reldir) {
360 foreach (array(
'',
'/doc') as $valdir) {
361 $realpath = $reldir.
"core/modules/".$moduledir.$valdir;
365 $handle = opendir($dir);
366 if (is_resource($handle)) {
368 while (($file = readdir($handle)) !==
false) {
374 foreach ($filelist as $file) {
375 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
376 if (file_exists($dir.
'/'.$file)) {
377 $name = substr($file, 4,
dol_strlen($file) - 16);
378 $classname = substr($file, 0,
dol_strlen($file) - 12);
380 require_once $dir.
'/'.$file;
381 $module =
new $classname(
$db);
382 '@phan-var-force ModelePDFAsset $module';
384 $modulequalified = 1;
385 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
386 $modulequalified = 0;
388 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
389 $modulequalified = 0;
392 if ($modulequalified) {
393 print
'<tr class="oddeven"><td width="100">';
394 print(empty($module->name) ? $name : $module->
name);
396 if (method_exists($module,
'info')) {
397 print $module->info($langs);
399 print $module->description;
404 if (in_array($name, $def)) {
405 print
'<td class="center">'.
"\n";
406 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
407 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
411 print
'<td class="center">'.
"\n";
412 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>';
417 print
'<td class="center">';
418 $constforvar =
'ASSET_'.strtoupper($myTmpObjectKey).
'_ADDON';
422 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>';
424 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>';
429 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
430 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
431 if ($module->type ==
'pdf') {
432 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
434 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
436 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
437 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
438 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
440 print
'<td class="center">';
441 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
445 print
'<td class="center">';
446 if ($module->type ==
'pdf') {
447 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'&object='.$myTmpObjectKey.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
449 print
img_object($langs->transnoentitiesnoconv(
"PreviewNotAvailable"),
'generic');
467if ($action ==
'edit') {
468 print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
469 print
'<input type="hidden" name="token" value="'.newToken().
'">';
470 print
'<input type="hidden" name="action" value="update">';
472 print
'<table class="noborder centpercent">';
473 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
475 foreach ($arrayofparameters as $constname => $val) {
476 if ($val[
'enabled'] == 1) {
477 print
'<tr class="oddeven"><td>';
478 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
479 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
482 if ($val[
'type'] ==
'textarea') {
483 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
485 print
"</textarea>\n";
486 } elseif ($val[
'type'] ==
'html') {
487 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
488 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false,
isModEnabled(
'fckeditor'), ROWS_5,
'90%');
489 $doleditor->Create();
490 } elseif ($val[
'type'] ==
'yesno') {
492 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
493 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
496 $tmp = explode(
':', $val[
'type']);
497 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
499 $arrayofmessagename = array();
500 if (is_array($formmail->lines_model)) {
501 foreach ($formmail->lines_model as $modelmail) {
504 if (!empty($arrayofmessagename[$modelmail->label])) {
505 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
508 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
511 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
512 } elseif (preg_match(
'/category:/', $val[
'type'])) {
513 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
514 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
517 $tmp = explode(
':', $val[
'type']);
518 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
519 print $formother->select_categories($tmp[1],
getDolGlobalInt($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
520 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
521 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
523 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname);
524 } elseif ($val[
'type'] ==
'securekey') {
525 print
'<input required="required" type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') :
getDolGlobalString($constname)).
'" size="40">';
526 if (!empty(
$conf->use_javascript_ajax)) {
527 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
531 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
533 } elseif ($val[
'type'] ==
'product') {
536 $form->select_produits($selected, $constname,
'', 0);
538 } elseif ($val[
'type'] ==
'accountancy_code') {
541 require_once DOL_DOCUMENT_ROOT .
'/core/class/html.formaccounting.class.php';
543 print $formaccounting->select_account($selected, $constname, 1, array(), 1, 1,
'minwidth150 maxwidth300',
'1');
545 print
'<input name="' . $constname .
'" class="maxwidth200" value="' .
dol_escape_htmltag($selected) .
'">';
547 } elseif ($val[
'type'] ==
'accountancy_category') {
550 print
'<input type="text" name="' . $constname .
'" list="pcg_type_datalist" value="' . $selected .
'">';
552 print
'<datalist id="pcg_type_datalist">';
553 require_once DOL_DOCUMENT_ROOT .
'/accountancy/class/accountancysystem.class.php';
556 $sql =
'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX .
'accounting_account';
557 $sql .=
" WHERE fk_pcg_version = '" .
$db->escape($accountsystem->ref) .
"'";
558 $sql .=
' AND entity in ('.getEntity(
'accounting_account', 0).
')';
559 $sql .=
' LIMIT 50000';
560 $resql =
$db->query($sql);
562 while ($obj =
$db->fetch_object($resql)) {
568 print
'<input name="' . $constname .
'" class="maxwidth200" value="' .
dol_escape_htmltag($selected) .
'">';
571 print
'<input name="'.$constname.
'" class="flat '.(empty($val[
'css']) ?
'minwidth200' : $val[
'css']).
'" value="'.
getDolGlobalString($constname).
'">';
578 print
'<br><div class="center">';
579 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
585 if (!empty($arrayofparameters)) {
586 print
'<table class="noborder centpercent">';
587 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td></td></tr>';
589 foreach ($arrayofparameters as $constname => $val) {
590 if ($val[
'enabled'] == 1) {
591 print
'<tr class="oddeven"><td>';
592 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
593 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
596 if ($val[
'type'] ==
'textarea') {
598 } elseif ($val[
'type'] ==
'html') {
600 } elseif ($val[
'type'] ==
'yesno') {
601 print ajax_constantonoff($constname);
602 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
603 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
606 $tmp = explode(
':', $val[
'type']);
608 $template = $formmail->getEMailTemplate(
$db, $tmp[1], $user, $langs,
getDolGlobalInt($constname));
612 print $langs->trans($template->label);
613 } elseif (preg_match(
'/category:/', $val[
'type'])) {
618 } elseif ($result > 0) {
619 $ways =
$c->print_all_ways(
'auto',
'none', 0, 1);
621 foreach ($ways as $way) {
622 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . (
$c->color ?
' style="background: #' .
$c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
624 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
626 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
628 print $langs->trans(
"Prospect");
630 print $langs->trans(
"ProspectCustomer");
632 print $langs->trans(
"Customer");
634 print $langs->trans(
"NorProspectNorCustomer");
636 } elseif ($val[
'type'] ==
'product') {
641 } elseif ($resprod < 0) {
644 } elseif ($val[
'type'] ==
'accountancy_code') {
646 require_once DOL_DOCUMENT_ROOT .
'/accountancy/class/accountingaccount.class.php';
650 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
663 print
'<div class="tabsAction">';
664 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>';
667 print
'<br>'.$langs->trans(
"NothingToSetup");
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.
assetAdminPrepareHead()
Prepare admin pages header.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 accountancy systems.
Class to manage accounting accounts.
Class to manage categories.
Class to manage a WYSIWYG editor.
Class to manage products or services.
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, $allowothertags=array())
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, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
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.
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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a 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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
$conf db name
Only used if Module[ID]Name translation string is not found.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Output javascript 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.