34if (!defined(
'CSRFCHECK_WITH_TOKEN') && (empty($_GET[
'action']) || $_GET[
'action'] !=
'reset')) {
35 define(
'CSRFCHECK_WITH_TOKEN',
'1');
41if (!isset($_GET[
'mainmenu']) && !isset($_POST[
'mainmenu'])) {
42 $_GET[
'mainmenu'] =
'home';
46require
'../main.inc.php';
58@phan-var-force string $dolibarr_main_url_root_alt
60require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
61require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
62require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
63require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
64require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
65require_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
66require_once DOL_DOCUMENT_ROOT.
'/admin/remotestore/class/externalModules.class.php';
70$langs->loadLangs(array(
"errors",
"admin",
"modulebuilder"));
72$action =
GETPOST(
'action',
'aZ09');
75$optioncss =
GETPOST(
'optioncss',
'aZ09');
76$sortfield =
GETPOST(
'sortfield',
'aZ09');
77$sortorder =
GETPOST(
'sortorder',
'aZ09');
79$mode =
GETPOST(
'mode',
'alpha');
80$value =
GETPOST(
'value',
'alpha');
81$search_keyword =
GETPOST(
'search_keyword',
'alpha');
82$search_status =
GETPOST(
'search_status',
'alpha');
83$search_nature =
GETPOST(
'search_nature',
'alpha');
84$search_version =
GETPOST(
'search_version',
'alpha');
89$options[
'per_page'] = 11;
92$options[
'search'] =
GETPOST(
'search_keyword',
'alpha');
95if (
GETPOST(
'buttonsubmit',
'alphanohtml', 2)) {
96 $options[
'no_page'] = 1;
100$options[
'search_source_dolistore'] =
getDolGlobalInt(
'MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
102$options[
'search_source_github'] =
getDolGlobalInt(
'MAIN_ENABLE_EXTERNALMODULES_COMMUNITY');
109 'hr' => array(
'position' =>
'001',
'label' => $langs->trans(
"ModuleFamilyHr")),
110 'crm' => array(
'position' =>
'006',
'label' => $langs->trans(
"ModuleFamilyCrm")),
111 'srm' => array(
'position' =>
'007',
'label' => $langs->trans(
"ModuleFamilySrm")),
112 'financial' => array(
'position' =>
'009',
'label' => $langs->trans(
"ModuleFamilyFinancial")),
113 'products' => array(
'position' =>
'012',
'label' => $langs->trans(
"ModuleFamilyProducts")),
114 'projects' => array(
'position' =>
'015',
'label' => $langs->trans(
"ModuleFamilyProjects")),
115 'ecm' => array(
'position' =>
'018',
'label' => $langs->trans(
"ModuleFamilyECM")),
116 'technic' => array(
'position' =>
'021',
'label' => $langs->trans(
"ModuleFamilyTechnic")),
117 'portal' => array(
'position' =>
'040',
'label' => $langs->trans(
"ModuleFamilyPortal")),
118 'interface' => array(
'position' =>
'050',
'label' => $langs->trans(
"ModuleFamilyInterface")),
119 'base' => array(
'position' =>
'060',
'label' => $langs->trans(
"ModuleFamilyBase")),
120 'other' => array(
'position' =>
'100',
'label' => $langs->trans(
"ModuleFamilyOther")),
124if (!
GETPOST(
'buttonreset',
'alpha')) {
125 if ($search_keyword) {
126 $param .=
'&search_keyword='.urlencode($search_keyword);
128 if ($search_status && $search_status !=
'-1') {
129 $param .=
'&search_status='.urlencode($search_status);
131 if ($search_nature && $search_nature !=
'-1') {
132 $param .=
'&search_nature='.urlencode($search_nature);
134 if ($search_version && $search_version !=
'-1') {
135 $param .=
'&search_version='.urlencode($search_version);
139$dirins = DOL_DOCUMENT_ROOT.
'/custom';
140$urldolibarrmodules =
'https://www.dolistore.com/';
143$hookmanager->initHooks(array(
'adminmodules',
'globaladmin'));
146$max_execution_time_for_deploy =
getDolGlobalInt(
'MODULE_UPLOAD_MAX_EXECUTION_TIME', 300);
147if (!empty($max_execution_time_for_deploy)) {
148 $err = error_reporting();
151 @set_time_limit($max_execution_time_for_deploy);
152 error_reporting($err);
155$max_time = @ini_get(
"max_execution_time");
156if ($max_time && $max_time < $max_execution_time_for_deploy) {
157 dol_syslog(
"max_execution_time=".$max_time.
" is lower than max_execution_time_for_deploy=".$max_execution_time_for_deploy.
". We try to increase it dynamically.");
158 @ini_set(
"max_execution_time", $max_execution_time_for_deploy);
162$dolibarrdataroot = preg_replace(
'/([\\/]+)$/i',
'', DOL_DATA_ROOT);
163$allowonlineinstall =
true;
165if (
dol_is_file($dolibarrdataroot.
'/installmodules.lock')) {
166 $allowonlineinstall =
false;
172if ($mode ==
'marketplace') {
177 $remotestore->loadRemoteSources(
false);
191$parameters = array();
192$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
199 $mode =
GETPOST(
'mode',
'alpha');
200 if ($mode ==
'common' && !
getDolGlobalString(
'MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT')) {
207if (
GETPOST(
'buttonreset',
'alpha')) {
208 $search_keyword =
'';
211 $search_version =
'';
214if ($action ==
'install' && $allowonlineinstall) {
218 $isExternalDownload = 0;
219 $producttoinstall =
GETPOST(
'producttoinstall',
'array');
222 if ($producttoinstall) {
223 $isExternalDownload = 1;
224 $tmpExternalModuleZipFile = $remotestore->getModuleZIP($producttoinstall);
225 if ($tmpExternalModuleZipFile) {
227 $_FILES[
'fileinstall'] = array(
228 'name' => basename($tmpExternalModuleZipFile),
229 'type' =>
'application/zip',
230 'tmp_name' => $tmpExternalModuleZipFile,
232 'size' => filesize($tmpExternalModuleZipFile)
237 $tmpfile = (
string) $_FILES[
'fileinstall'][
'tmp_name'];
238 $original_file = basename($_FILES[
"fileinstall"][
"name"]);
239 $original_file = preg_replace(
'/\s*\(\d+\)\.zip$/i',
'.zip', $original_file);
242 if (empty($tmpfile)) {
243 $langs->load(
"errors");
248 if (!$original_file) {
249 $langs->load(
"Error");
250 if ($isExternalDownload) {
251 setEventMessages($langs->trans(
"ErrorFailToDownloadModuleFromSource", $producttoinstall[
'name']),
null,
'warnings');
253 setEventMessages($langs->trans(
"ErrorModuleFileRequired"),
null,
'warnings');
257 if (!$error && !preg_match(
'/\.zip$/i', $original_file)) {
258 $langs->load(
"errors");
259 setEventMessages($langs->trans(
"ErrorFileMustBeADolibarrPackage", $original_file),
null,
'errors');
262 if (!$error && !preg_match(
'/^(module[a-zA-Z0-9]*_|theme_|).*\-([0-9][0-9\.]*)(\s\(\d+\)\s)?\.zip$/i', $original_file)) {
263 $langs->load(
"errors");
264 setEventMessages($langs->trans(
"ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file,
'modulename-x[.y.z].zip'),
null,
'errors');
270 if ($original_file) {
275 $tmpdir = preg_replace(
'/\.zip$/i',
'', $original_file).
'.dir';
281 $result =
dol_move_uploaded_file($tmpfile, $newfile, 1, 0, $_FILES[
'fileinstall'][
'error'], 0,
'addedfile',
'', $isExternalDownload ? 1 : 0);
282 if ((
int) $result > 0) {
285 if (!empty($resultuncompress[
'error'])) {
286 $langs->load(
"errors");
287 setEventMessages($langs->trans($resultuncompress[
'error'], $original_file),
null,
'errors');
291 $modulename = preg_replace(
'/module_/',
'', $original_file);
292 $modulename = preg_replace(
'/\-([0-9][0-9\.]*)\.zip$/i',
'', $modulename);
294 $modulenamedir =
$conf->admin->dir_temp.
'/'.$tmpdir.
'/'.$modulename;
297 $modulenamedir =
$conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulename;
300 setEventMessages($langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat").
'<br>'.$langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat2", $modulename,
'htdocs/'.$modulename),
null,
'errors');
305 dol_syslog(
"Uncompress of module file is a success.");
344 if (
GETPOST(
'checkforcompliance') ==
'on') {
346 $res = include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
348 $checkRes = $dolibarrmodule->checkForcompliance($modulename);
350 if (!is_numeric($checkRes) && $checkRes !=
'') {
351 $langs->load(
"errors");
352 setEventMessages($modulename.
' : '.$langs->trans($checkRes),
null,
'errors');
367 $modulenamearrays = array();
368 if (
dol_is_file($modulenamedir.
'/metapackage.conf')) {
370 $metafile = file_get_contents($modulenamedir.
'/metapackage.conf');
371 $modulenamearrays = explode(
"\n", $metafile);
373 $modulenamearrays[$modulename] = $modulename;
378 foreach ($modulenamearrays as $modulenameval) {
379 if (strpos($modulenameval,
'#') === 0) {
382 if (strpos($modulenameval,
'//') === 0) {
385 if (!trim($modulenameval)) {
392 $submodulenamedir =
$conf->admin->dir_temp.
'/'.$tmpdir.
'/'.$modulenameval;
394 $submodulenamedir =
$conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulenameval;
396 dol_syslog(
"We copy now directory ".$submodulenamedir.
" into target dir ".$dirins.
'/'.$modulenameval);
397 $resultcopy =
dolCopyDir($submodulenamedir, $dirins.
'/'.$modulenameval,
'0444', 1);
398 if ($resultcopy <= 0) {
399 dol_syslog(
'Failed to call dolCopyDir result='.$resultcopy.
" with param ".$submodulenamedir.
" and ".$dirins.
'/'.$modulenameval, LOG_WARNING);
400 $langs->load(
"errors");
401 setEventMessages($langs->trans(
"ErrorFailToCopyDir", $submodulenamedir, $dirins.
'/'.$modulenameval),
null,
'errors');
409 setEventMessages($langs->trans(
"ErrorFailToRenameFile", $tmpfile, $newfile).
' - code = '.$result,
null,
'errors');
417 $text = $langs->trans(
"SecurityModuleDeploymentError",
dol_sanitizePathName($_FILES[
"fileinstall"][
"name"]));
418 $securityevent->type =
'MODULE_DEPLOYMENT_ERROR';
420 $text = $langs->trans(
"SecurityModuleDeploymentSuccess",
dol_sanitizePathName($_FILES[
"fileinstall"][
"name"]));
421 $securityevent->type =
'MODULE_DEPLOYMENT_SUCCESS';
423 $securityevent->dateevent = $now;
424 $securityevent->description = $text;
426 $resultcreateevent = $securityevent->create($user);
429 $searchParams = array(
430 'search_keyword' => $modulenameval,
431 'search_status' =>
'-1',
432 'search_nature' =>
'-1',
433 'search_version' =>
'-1'
435 $redirectUrl =
dolBuildUrl(DOL_URL_ROOT .
'/admin/modules.php', $searchParams);
437 $message = $langs->trans(
"SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv(
"Home").
' - '.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Modules"));
441} elseif ($action ==
'install' && !$allowonlineinstall) {
442 httponly_accessforbidden(
"You try to bypass the protection to disallow deployment of an external module. Hack attempt ?");
445if ($action ==
'set' && $user->admin) {
450 $resarray = activateModule($value, 1, 0,
'acceptredirect');
452 if ($checkOldValue !=
getDolGlobalInt(
'CHECKLASTVERSION_EXTERNALMODULE')) {
453 setEventMessage($langs->trans(
'WarningModuleHasChangedLastVersionCheckParameter', $value),
'warnings');
455 if ($csrfCheckOldValue !=
getDolGlobalInt(
'MAIN_SECURITY_CSRF_WITH_TOKEN')) {
456 setEventMessage($langs->trans(
'WarningModuleHasChangedSecurityCsrfParameter', $value),
'warnings');
460 if (!empty($resarray[
'errors'])) {
464 if ($resarray[
'nbperms'] > 0) {
465 $tmpsql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"user WHERE admin <> 1";
466 $resqltmp =
$db->query($tmpsql);
468 $obj =
$db->fetch_object($resqltmp);
470 if ($obj && $obj->nb > 1) {
471 $msg = $langs->trans(
'ModuleEnabledAdminMustCheckRights');
479 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
481} elseif ($action ==
'reset' && $user->admin &&
GETPOST(
'confirm') ==
'yes') {
482 $result = unActivateModule($value);
487 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
489} elseif (
getDolGlobalInt(
"MAIN_FEATURES_LEVEL") > 1 && $action ==
'reload' && $user->admin &&
GETPOST(
'confirm') ==
'yes') {
490 $result = unActivateModule($value, 0,
'newboxdefonly');
494 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
498 $resarray = activateModule($value, 0, 1,
'acceptredirect');
501 if (!empty($resarray[
'errors'])) {
504 if ($resarray[
'nbperms'] > 0) {
505 $tmpsql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"user WHERE admin <> 1";
506 $resqltmp =
$db->query($tmpsql);
508 $obj =
$db->fetch_object($resqltmp);
509 if ($obj && $obj->nb > 1) {
510 $msg = $langs->trans(
'ModuleEnabledAdminMustCheckRights');
518 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
530$morecss = array(
"/admin/remotestore/css/store.css");
538$help_url =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
539llxHeader(
'', $langs->trans(
"Setup"), $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-admin page-modules');
545$arrayofnatures = array(
546 'core' => array(
'label' => $langs->transnoentitiesnoconv(
"NativeModules")),
547 'external' => array(
'label' => $langs->transnoentitiesnoconv(
"External").
' - ['.$langs->trans(
"AllPublishers").
']')
549$arrayofwarnings = array();
550$arrayofwarningsext = array();
560$modNameLoaded = array();
563foreach ($modulesdir as $dir) {
566 dol_syslog(
"Scan directory ".$dir.
" for module descriptor files (modXXX.class.php)");
567 $handle = @opendir($dir);
568 $timestart = microtime(
true);
569 if (is_resource($handle)) {
570 while (($file = readdir($handle)) !==
false) {
572 if (is_readable($dir.$file) && substr($file, 0, 3) ==
'mod' && substr($file,
dol_strlen($file) - 10) ==
'.class.php') {
573 $modName = substr($file, 0,
dol_strlen($file) - 10);
576 if (!empty($modNameLoaded[$modName])) {
577 $mesg =
"Error: Module ".$modName.
" was found twice: Into ".$modNameLoaded[$modName].
" and ".$dir.
". You probably have an old file on your disk.<br>";
584 $res = include_once $dir.$file;
585 if (class_exists($modName)) {
586 $objMod =
new $modName(
$db);
587 '@phan-var-force DolibarrModules $objMod';
589 $modNameLoaded[$modName] = $dir;
590 if (!$objMod->numero > 0 && $modName !=
'modUser') {
591 dol_syslog(
'The module descriptor '.$modName.
' must have a numero property', LOG_ERR);
593 $j = $objMod->numero;
595 $modulequalified = 1;
598 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
600 $modulequalified = 0;
603 $modulequalified = 0;
606 $modulequalified = 0;
610 if (!empty($objMod->hidden)) {
611 $modulequalified = 0;
614 if ($modulequalified > 0) {
616 $external = ($objMod->isCoreOrExternalModule() ==
'external');
626 $arrayofnatures[
'external_'.$publisher] = array(
'label' => $langs->trans(
"External").
' - '.$publisher,
'data-html' => $langs->trans(
"External").
' - <span class="opacitymedium inine-block valignmiddle">'.$publisher.
'</span>');
628 $arrayofnatures[
'external_'] = array(
'label' => $langs->trans(
"External").
' - ['.$langs->trans(
"UnknownPublishers").
']');
631 ksort($arrayofnatures);
634 $filename[$i] = $modName;
635 $modules[$modName] = $objMod;
636 $timestoinit[$modName] = round((microtime(
true) - $timestart) * 1000, 3);
639 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
640 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
641 $familykey = key($objMod->familyinfo);
643 $familykey = $objMod->family;
645 '@phan-var-force string $familykey';
647 $moduleposition = ($objMod->module_position ? $objMod->module_position :
'50');
648 if ($objMod->isCoreOrExternalModule() ==
'external' && $moduleposition < 100000) {
650 $moduleposition =
'80';
654 if (!empty($objMod->warnings_activation)) {
655 $arrayofwarnings[$modName] = $objMod->warnings_activation;
657 if (!empty($objMod->warnings_activation_ext)) {
658 $arrayofwarningsext[$modName] = $objMod->warnings_activation_ext;
661 $familyposition = (empty($familyinfo[$familykey][
'position']) ?
'0' : $familyinfo[$familykey][
'position']);
662 if ($external && !in_array($familykey, array_keys($familyinfo))) {
664 if (is_numeric($familyposition)) {
665 $familyposition = sprintf(
"%03d", (
int) $familyposition + 100);
669 $orders[$i] = $familyposition.
"_".$familykey.
"_".$moduleposition.
"_".$j;
672 $specialstring =
'unknown';
673 if ($objMod->version ==
'development' || $objMod->version ==
'experimental') {
674 $specialstring =
'expdev';
676 if (isset($categ[$specialstring])) {
677 $categ[$specialstring]++;
679 $categ[$specialstring] = 1;
684 dol_syslog(
"Module ".get_class($objMod).
" not qualified");
688 $silentModules = array(
'modSupplierOrder',
'modSupplierInvoice',
'modFournisseur');
689 if (!in_array($modName, $silentModules)) {
690 print
info_admin(
"admin/modules.php Warning bad descriptor file : ".$dir.$file.
" (Class ".$modName.
" not found into file)", 0, 0,
'1',
'warning');
694 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
701 dol_syslog(
"htdocs/admin/modules.php: Failed to open directory ".$dir.
". See permission and open_basedir option.", LOG_WARNING);
705'@phan-var-force array<string,DolibarrModules> $modules';
708if ($action ==
'reset_confirm' && $user->admin) {
709 if (!empty($modules[$value])) {
710 $objMod = $modules[$value];
712 if (!empty($objMod->langfiles)) {
713 $langs->loadLangs($objMod->langfiles);
717 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?value='.$value.
'&mode='.$mode.$param, $langs->trans(
'ConfirmUnactivation'), $langs->trans(
GETPOST(
'confirm_message_code')),
'reset',
'',
'no', 1, 300, 550);
721if ($action ==
'reload_confirm' && $user->admin) {
722 if (!empty($modules[$value])) {
723 $objMod = $modules[$value];
725 if (!empty($objMod->langfiles)) {
726 $langs->loadLangs($objMod->langfiles);
730 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?value='.$value.
'&mode='.$mode.$param, $langs->trans(
'ConfirmReload'), $langs->trans(
GETPOST(
'confirm_message_code')),
'reload',
'',
'no', 1);
741$nbofactivatedmodules = count(
$conf->modules);
744$nbmodulesnotautoenabled = count(
$conf->modules);
745$listofmodulesautoenabled = array(
'user',
'agenda',
'fckeditor',
'export',
'import');
746foreach ($listofmodulesautoenabled as $moduleautoenable) {
747 if (in_array($moduleautoenable,
$conf->modules)) {
748 $nbmodulesnotautoenabled--;
756if ($mode ==
'common' || $mode ==
'commonkanban') {
757 $desc = $langs->trans(
"ModulesDesc",
'{picto}');
758 $desc .=
' '.$langs->trans(
"ModulesDesc2",
'{picto2}');
759 $desc = str_replace(
'{picto}',
img_picto(
'',
'switch_off',
'class="size15x"'), $desc);
760 $desc = str_replace(
'{picto2}',
img_picto(
'',
'setup',
'class="size15x"'), $desc);
762 $deschelp .=
'<div class="info hideonsmartphone">'.$desc.
"<br></div>\n";
765 $deschelp .=
'<div class="info">'.$langs->trans(
getDolGlobalString(
'MAIN_SETUP_MODULES_INFO')).
"<br></div>\n";
771if ($mode ==
'deploy') {
772 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDeployDesc", $langs->transnoentitiesnoconv(
"AvailableModules")).
"<br></div><br>\n";
774if ($mode ==
'develop') {
775 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDevelopDesc").
"<br></div><br>\n";
781if ($mode ==
'common' || $mode ==
'commonkanban') {
784 print
'<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
785 print
'<input type="hidden" name="token" value="'.newToken().
'">';
786 if (isset($optioncss) && $optioncss !=
'') {
787 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
789 if (isset($sortfield) && $sortfield !=
'') {
790 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
792 if (isset($sortorder) && $sortorder !=
'') {
793 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
795 if (isset($page) && $page !=
'') {
796 print
'<input type="hidden" name="page" value="'.$page.
'">';
798 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
804 $moreforfilter =
'<div class="valignmiddle">';
806 $moreforfilter .=
'<div class="floatright right pagination paddingtop --module-list"><ul><li>';
807 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'CheckForModuleUpdate'), $langs->trans(
'CheckForModuleUpdate').
'<br><br>'.
img_warning(
'',
'',
'paddingright').$langs->trans(
'CheckForModuleUpdateHelp').
' '.$langs->trans(
'CheckForModuleUpdateHelp2', DolibarrModules::URL_FOR_BLACKLISTED_MODULES).
'<br>'.$langs->trans(
"YourIPWillBeRevealedToThisExternalProviders"),
'fa fa-sync', $_SERVER[
"PHP_SELF"].
'?action=checklastversion&token='.
newToken().
'&mode='.$mode.$param,
'', 1, array(
'morecss' =>
'reposition'));
809 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.$param,
'', ($mode ==
'common' ? 2 : 1), array(
'morecss' =>
'reposition'));
810 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=commonkanban'.$param,
'', ($mode ==
'commonkanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
811 $moreforfilter .=
'</li></ul></div>';
813 $moreforfilter .=
'<div class="divfilteralone colorbacktimesheet float valignmiddle nopaddingtopimp nopaddingbottomimp">';
814 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
815 $moreforfilter .=
img_picto($langs->trans(
"Filter"),
'filter',
'class="paddingright opacityhigh hideonsmartphone"').
'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.
dol_escape_htmltag($search_keyword).
'" spellcheck="false" placeholder="'.
dol_escape_htmltag($langs->trans(
'Keyword')).
'">';
816 $moreforfilter .=
'</div>';
817 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
818 $moreforfilter .= $form->selectarray(
'search_nature', $arrayofnatures,
dol_escape_htmltag($search_nature), $langs->trans(
'Origin'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth250', 1);
819 $moreforfilter .=
'</div>';
822 $array_version = array(
'stable' => $langs->transnoentitiesnoconv(
"Stable"));
824 $array_version[
'deprecated'] = $langs->trans(
"Deprecated");
827 $array_version[
'experimental'] = $langs->trans(
"Experimental");
830 $array_version[
'development'] = $langs->trans(
"Development");
832 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
833 $moreforfilter .= $form->selectarray(
'search_version', $array_version, $search_version, $langs->transnoentitiesnoconv(
'Version'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
834 $moreforfilter .=
'</div>';
836 $array_status = array(
'active' => $langs->transnoentitiesnoconv(
"Enabled"),
'disabled' => $langs->transnoentitiesnoconv(
"Disabled"));
837 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
838 $moreforfilter .= $form->selectarray(
'search_status', $array_status, $search_status, $langs->transnoentitiesnoconv(
'Status'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
839 $moreforfilter .=
'</div>';
840 $moreforfilter .=
' ';
841 $moreforfilter .=
'<div class="divsearchfield valignmiddle inline-block">';
842 $moreforfilter .=
'<input type="submit" name="buttonsubmit" class="button small nomarginleft" value="'.dolPrintHTMLForAttribute($langs->trans(
"Refresh")).
'">';
843 if ($search_keyword || ($search_nature && $search_nature !=
'-1') || ($search_version && $search_version !=
'-1') || ($search_status && $search_status !=
'-1')) {
844 $moreforfilter .=
' ';
845 $moreforfilter .=
'<input type="submit" name="buttonreset" class="buttonreset noborderall nomargintop nomarginbottom" value="'.dolPrintHTMLForAttribute($langs->trans(
"Reset")).
'">';
847 $moreforfilter .=
'</div>';
848 $moreforfilter .=
'</div>';
850 $moreforfilter .=
'</div>';
852 print $moreforfilter;
853 $parameters = array();
854 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
855 print $hookmanager->resPrint;
859 print
'<div class="clearboth"></div><br><br>';
862 $parameters = array();
863 $reshook = $hookmanager->executeHooks(
'insertExtraHeader', $parameters, $object, $action);
868 $disabled_modules = array();
869 if (!empty($_SESSION[
"disablemodules"])) {
870 $disabled_modules = explode(
',', $_SESSION[
"disablemodules"]);
875 $foundoneexternalmodulewithupdate = 0;
877 $atleastonequalified = 0;
878 $atleastoneforfamily = 0;
880 print
'<script type="text/javascript">
881 jQuery(document).ready(function() {
882 jQuery(".modulefamilygroup").each(function() {
883 var $group = jQuery(this);
884 var $title = $group.find(".titre.inline-block").first();
885 var $nextContainer = $group.nextAll(".div-table-responsive, .box-flex-container").first();
886 if ($title.length && !$title.children(".modulefamilytoggleicon").length) {
887 $title.prepend("<i class=\"fa modulefamilytoggleicon paddingleft paddingleftright\"></i> ");
889 var $icon = $title.children(".modulefamilytoggleicon").first();
890 var isVisible = $nextContainer.is(":visible");
891 if ($icon.length && $nextContainer.length) {
892 $icon.toggleClass("fa-folder-open", isVisible);
893 $icon.toggleClass("fa-folder", !isVisible);
897 jQuery(document).on("click", ".modulefamilygroup", function() {
898 var $group = jQuery(this);
899 var $nextContainer = $group.nextAll(".div-table-responsive, .box-flex-container").first();
900 if ($nextContainer.length) {
901 var $icon = $group.find(".modulefamilytoggleicon").first();
902 var isVisible = $nextContainer.is(":visible");
903 $nextContainer.stop(true, true).slideToggle(150);
905 $icon.toggleClass("fa-folder-open", !isVisible);
906 $icon.toggleClass("fa-folder", isVisible);
913 foreach ($orders as $key => $value) {
915 $tab = explode(
'_', $value);
916 $familykey = $tab[1];
917 $module_position = $tab[2];
919 $modName = $filename[$key];
922 $objMod = $modules[$modName];
924 if (!is_object($objMod)) {
929 if ($mode ==
'expdev' && $objMod->version !=
'development' && $objMod->version !=
'experimental') {
933 if (!$objMod->getName()) {
934 dol_syslog(
"Error for module ".$key.
" - Property name of module looks empty", LOG_WARNING);
938 $modulenameshort = strtolower(preg_replace(
'/^mod/i',
'', get_class($objMod)));
939 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
942 $modulename = $objMod->getName();
943 $moduletechnicalname = $objMod->name;
944 $moduledesc = $objMod->getDesc();
945 $moduledesclong = $objMod->getDescLong();
946 $moduleauthor = $objMod->getPublisher();
949 if ($search_keyword) {
951 $search_keyword_array = explode(
' ', $search_keyword);
953 foreach ($search_keyword_array as $word) {
954 if (!preg_match(
'/'.preg_quote($word,
'/').
'/i', $modulename)
955 && !preg_match(
'/'.preg_quote($word,
'/').
'/i', $moduletechnicalname)
956 && !($moduledesc && preg_match(
'/'.preg_quote($word,
'/').
'/i', $moduledesc))
957 && !($moduledesclong && preg_match(
'/'.preg_quote($word,
'/').
'/i', $moduledesclong))
958 && !($moduleauthor && preg_match(
'/'.preg_quote($word,
'/').
'/i', $moduleauthor))
970 if ($search_status) {
978 if ($search_nature) {
979 if (preg_match(
'/^external/', $search_nature) && $objMod->isCoreOrExternalModule() !=
'external') {
983 if (preg_match(
'/^external_(.*)$/', $search_nature, $reg)) {
989 if (!$reg[1] && !empty($publisher)) {
993 if ($search_nature ==
'core' && $objMod->isCoreOrExternalModule() ==
'external') {
997 if ($search_version) {
998 if (($objMod->version ==
'development' || $objMod->version ==
'experimental' || preg_match(
'/deprecated/', $objMod->version)) && $search_version ==
'stable') {
1001 if ($objMod->version !=
'development' && ($search_version ==
'development')) {
1004 if ($objMod->version !=
'experimental' && ($search_version ==
'experimental')) {
1007 if (!preg_match(
'/deprecated/', $objMod->version) && ($search_version ==
'deprecated')) {
1012 $atleastonequalified++;
1015 if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
1016 foreach ($objMod->langfiles as $domain) {
1017 $langs->load($domain);
1022 if ($familykey != $oldfamily) {
1024 print
'</table></div><br>';
1027 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
1031 if ($mode ==
'commonkanban') {
1032 print
'<div class="box-flex-container kanban">';
1034 print
'<div class="div-table-responsive">';
1035 print
'<table class="tagtable liste" summary="list_of_modules">'.
"\n";
1038 $atleastoneforfamily = 0;
1041 $atleastoneforfamily++;
1043 if ($familykey != $oldfamily) {
1044 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
1045 $oldfamily = $familykey;
1049 $version = $objMod->getVersion(0);
1051 $warningstring =
'';
1052 if (preg_match(
'/development/i', $version)) {
1053 $warningstring = $langs->trans(
"Development");
1055 if (preg_match(
'/experimental/i', $version)) {
1056 $warningstring = $langs->trans(
"Experimental");
1058 if (preg_match(
'/deprecated/i', $version)) {
1059 $warningstring = $langs->trans(
"Deprecated");
1062 if ($objMod->isCoreOrExternalModule() ==
'external' || preg_match(
'/development|experimental|deprecated/i', $version)) {
1063 $versiontrans .= $objMod->getVersion(1);
1066 if ($objMod->isCoreOrExternalModule() ==
'external' && ($action ==
'checklastversion' ||
getDolGlobalString(
'CHECKLASTVERSION_EXTERNALMODULE'))) {
1070 $checkRes = $objMod->checkForUpdate();
1071 if ($checkRes > 0) {
1072 setEventMessages($objMod->getName().
' : '.preg_replace(
'/[^a-z0-9_\.\-\s]/i',
'', $versiontrans).
' -> '.preg_replace(
'/[^a-z0-9_\.\-\s]/i',
'', $objMod->lastVersion),
null,
'warnings');
1073 } elseif ($checkRes < 0) {
1074 setEventMessages($objMod->getName().
' '.$langs->trans(
'CheckVersionFail'),
null,
'errors');
1078 if ($objMod->isCoreOrExternalModule() ==
'external' && $action ==
'checklastversion' && !
getDolGlobalString(
'DISABLE_CHECK_ON_MALWARE_MODULES')) {
1079 $checkRes = $objMod->checkForCompliance();
1080 if (!is_numeric($checkRes) && $checkRes !=
'') {
1081 $langs->load(
"errors");
1082 setEventMessages($objMod->getName().
' : '.$langs->trans($checkRes),
null,
'errors');
1088 if ($objMod->isCoreOrExternalModule() ==
'external') {
1089 $imginfo =
"info_black";
1092 $codeenabledisable =
'';
1096 if (in_array($modulenameshort, $disabled_modules)) {
1097 $objMod->disabled =
true;
1104 if (!empty($arrayofwarnings[$modName])) {
1105 $codeenabledisable .=
'<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
1108 if (!empty($objMod->disabled)) {
1109 $codeenabledisable .= $langs->trans(
"Disabled");
1110 } elseif (is_object($objMod)
1111 && (!empty($objMod->always_enabled) || ((
isModEnabled(
'multicompany') && $objMod->core_enabled) && ($user->entity ||
$conf->entity != 1)))) {
1113 if (method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
1114 $codeenabledisable .= $langs->trans(
"Used");
1116 $codeenabledisable .=
img_picto($langs->trans(
"Required"),
'switch_on',
'', 0, 0, 0,
'',
'opacitymedium valignmiddle');
1124 if (is_object($objMod) && !empty($objMod->warnings_unactivation[
$mysoc->country_code]) && method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
1125 $codeenabledisable .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=reset_confirm&confirm_message_code='.urlencode($objMod->warnings_unactivation[
$mysoc->country_code]).
'&value='.$modName.
'&mode='.$mode.$param.
'">';
1126 $codeenabledisable .=
img_picto($langs->trans(
"Activated").($warningstring ?
' '.$warningstring :
''),
'switch_on');
1127 $codeenabledisable .=
'</a>';
1129 $codeenabledisable .=
' ';
1130 $codeenabledisable .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=reload_confirm&value='.$modName.
'&mode='.$mode.
'&confirm=yes'.$param.
'">';
1131 $codeenabledisable .=
img_picto($langs->trans(
"Reload"),
'refresh',
'class="opacitymedium"');
1132 $codeenabledisable .=
'</a>';
1135 $codeenabledisable .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=reset&value='.$modName.
'&mode='.$mode.
'&confirm=yes'.$param.
'">';
1136 $codeenabledisable .=
img_picto($langs->trans(
"Activated").($warningstring ?
' '.$warningstring :
''),
'switch_on');
1137 $codeenabledisable .=
'</a>';
1139 $codeenabledisable .=
' ';
1140 $codeenabledisable .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=reload&value='.$modName.
'&mode='.$mode.
'&confirm=yes'.$param.
'">';
1141 $codeenabledisable .=
img_picto($langs->trans(
"Reload"),
'refresh',
'class="opacitymedium"');
1142 $codeenabledisable .=
'</a>';
1148 if (!empty($objMod->config_page_url) && !$disableSetup) {
1149 $backtourlquery = [];
1150 if ($search_keyword !=
'') {
1151 $backtourlquery += [
'search_keyword' => $search_keyword];
1153 if ($search_nature > -1) {
1154 $backtourlquery += [
'search_nature' => $search_nature];
1156 if ($search_version > -1) {
1157 $backtourlquery += [
'search_version' => $search_version];
1159 if ($search_status > -1) {
1160 $backtourlquery += [
'search_status' => $search_status];
1162 $backtourl =
dolBuildUrl($_SERVER[
"PHP_SELF"], $backtourlquery);
1166 'save_lastsearch_values' => 1,
1167 'backtopage' => $backtourl,
1169 if (is_array($objMod->config_page_url)) {
1171 foreach ($objMod->config_page_url as $page) {
1174 $codetoconfig .=
'<a href="'.$urlpage.
'" title="'.$langs->trans($page).
'">'.
img_picto(ucfirst($page),
"setup").
'</a>';
1177 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) {
1178 $urltouse =
dol_buildpath(
'/'.$regs[2].
'/admin/'.$regs[1], 1);
1179 $codetoconfig .=
'<a href="'.$urltouse.(preg_match(
'/\?/', $urltouse) ?
'&' :
'?').
'save_lastsearch_values=1&backtopage='.urlencode($backtourl).
'" title="'.$langs->trans(
"Setup").
'">'.
img_picto($langs->trans(
"Setup"),
"setup",
'style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15').
'</a>';
1181 $urltouse = $urlpage;
1182 $codetoconfig .=
'<a href="'.$urltouse.(preg_match(
'/\?/', $urltouse) ?
'&' :
'?').
'save_lastsearch_values=1&backtopage='.urlencode($backtourl).
'" title="'.$langs->trans(
"Setup").
'">'.
img_picto($langs->trans(
"Setup"),
"setup",
'style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15').
'</a>';
1186 } elseif (preg_match(
'/^([^@]+)@([^@]+)$/i', (
string) $objMod->config_page_url, $regs)) {
1187 $codetoconfig .=
'<a class="valignmiddle" href="'.dol_buildpath(
'/'.$regs[2].
'/admin/'.$regs[1], 1).
'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).
'" title="'.$langs->trans(
"Setup").
'">'.
img_picto($langs->trans(
"Setup"),
"setup",
'style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15').
'</a>';
1189 $codetoconfig .=
'<a class="valignmiddle" href="'.((string) $objMod->config_page_url).
'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).
'" title="'.$langs->trans(
"Setup").
'">'.
img_picto($langs->trans(
"Setup"),
"setup",
'style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15').
'</a>';
1192 $codetoconfig .=
img_picto($langs->trans(
"NothingToSetup"),
"setup",
'class="opacitytransp" style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15');
1196 if (!empty($objMod->always_enabled)) {
1198 $codeenabledisable .=
'<!-- Message to show: an always_enabled module has been disabled -->'.
"\n";
1199 $codeenabledisable .=
'<a class="reposition" id="idalways'.$objMod->numero.
'" data-alreadyclicked="0" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=set&token='.
newToken().
'&value='.$modName.
'&mode='.$mode.$param.
'"';
1200 $codeenabledisable .=
'>';
1201 $codeenabledisable .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
1202 $codeenabledisable .=
"</a>\n";
1203 } elseif (!empty($objMod->disabled)) {
1204 $codeenabledisable .= $langs->trans(
"Disabled");
1207 $warningmessage =
'';
1210 if (!empty($arrayofwarnings[$modName])) {
1211 $codeenabledisable .=
'<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
1212 foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) {
1213 if (preg_match(
'/^always/', $keycountry) || (
$mysoc->country_code && preg_match(
'/^'.
$mysoc->country_code.
'/', $keycountry))) {
1214 if (!is_array($cursorwarningmessage)) {
1215 $cursorwarningmessage = array($cursorwarningmessage);
1217 foreach ($cursorwarningmessage as $messagetoshow) {
1218 if (preg_match(
'/:1$/', $messagetoshow)) {
1221 $messagetoshow = preg_replace(
'/:1$/',
'', $messagetoshow);
1224 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($messagetoshow, $objMod->getName(),
$mysoc->country_code);
1229 if ($objMod->isCoreOrExternalModule() ==
'external' && !empty($arrayofwarningsext)) {
1230 $codeenabledisable .=
'<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
1231 foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) {
1232 $keymodulelowercase = strtolower(preg_replace(
'/^mod/',
'', $keymodule));
1233 if (preg_match(
'/^always/', $keymodulelowercase) || in_array($keymodulelowercase,
$conf->modules)) {
1234 foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) {
1235 if (preg_match(
'/^always/', $keycountry) || (
$mysoc->country_code && preg_match(
'/^'.
$mysoc->country_code.
'/', $keycountry))) {
1236 if (!is_array($cursorwarningmessage)) {
1237 $cursorwarningmessage = array($cursorwarningmessage);
1239 foreach ($cursorwarningmessage as $messagetoshow) {
1241 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($messagetoshow, $objMod->getName(),
$mysoc->country_code, $modules[$keymodule]->getName());
1243 $warningmessage .= ($warningmessage ?
"\n" :
"").($warningmessage ?
"\n" :
"").$langs->trans(
"Module").
' : '.$objMod->getName();
1244 if (!empty($objMod->editor_name)) {
1245 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"Publisher").
' : '.$objMod->editor_name;
1247 if ($keymodulelowercase !=
'always') {
1248 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"ModuleTriggeringThisWarning").
' : '.$modules[$keymodule]->getName();
1256 $urltogo = $_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=set&token='.
newToken().
'&value='.$modName.
'&mode='.$mode.$param;
1259 $codeenabledisable .=
'<!-- Message to show: '.$warningmessage.
' -->'.
"\n";
1260 $codeenabledisable .=
'<a class="reposition" id="idqualified'.$objMod->numero.
'" data-alreadyclicked="0" href="'.$urltogo.
'"';
1261 if ($warningmessage) {
1262 $codeenabledisable .=
' onclick="return confirmDolibarr(\''.dol_escape_js($warningmessage).
'\', \
'idqualified'.$objMod->numero.
'\',
'.$popupWidth.',
'.$popupHeight.',
'.$disableCancel.');
"';
1264 $codeenabledisable .= '>';
1265 $codeenabledisable .= img_picto($langs->trans("Disabled
"), 'switch_off');
1266 $codeenabledisable .= "</a>\n
";
1269 // Set $codetoconfig
1270 $codetoconfig .= img_picto($langs->trans("NothingToSetup
"), "setup
", 'class="opacitytransp
" style="padding-right: 6px
"');
1273 if ($mode == 'commonkanban') {
1275 print $objMod->getKanbanView($codeenabledisable, $codetoconfig);
1277 print '<tr class="oddeven
'.($warningstring ? ' info-box-content-warning
' : '').'">'."\n
";
1278 if (getDolGlobalString('MAIN_MODULES_SHOW_LINENUMBERS')) {
1279 print '<td class="width50
">'.$linenum.'</td>';
1282 // Picto + Name of module
1283 print ' <td class="tdoverflowmax200 minwidth200imp
" title="'.dol_escape_htmltag($objMod->getName()).'">';
1285 //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
1286 //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
1287 if (!empty($objMod->picto)) {
1288 if (preg_match('/^\//i', $objMod->picto)) {
1289 print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"', 1);
1291 print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"');
1294 print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly
"');
1296 print ' <span class="valignmiddle
">'.$objMod->getName().'</span>';
1300 print '<td class="valignmiddle tdoverflowmax300 minwidth200imp opacitylow
">';
1301 print nl2br($objMod->getDesc());
1305 print '<td class="center nowrap
" style="width: 82px;
">';
1306 print '<a href="javascript:
document_preview(\
''.DOL_URL_ROOT.
'/admin/modulehelp.php?id='.((
int) $objMod->numero).
'\',\
'text/html\',\''.dol_escape_js($langs->trans(
"Module")).
'\')
">';
1307 print img_picto(($objMod->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule
").' - ' : '').$langs->trans("ClickToShowDescription
"), $imginfo, '', 0, 0, 0, '', 'purple');
1309 print($timestoinit[$modName] > 500 ? img_picto($langs->trans('InitModuleIsSlow'), 'fa-exclamation-circle') : '');
1313 print '<td class="center nowrap width150
" title="'.dol_escape_htmltag(dol_string_nohtmltag($versiontrans)).'">';
1314 if ($objMod->needUpdate) {
1315 $versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
1316 print '<span class="badge badge-warning classfortooltip
" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
1318 print $versiontrans;
1322 // Link enable/disable
1323 print '<td class="center valignmiddle left nowraponall
" width="60px
">';
1324 print $codeenabledisable;
1328 print '<td class="tdsetuppicto right valignmiddle
" width="60px
">';
1329 print $codetoconfig;
1334 if ($objMod->needUpdate) {
1335 $foundoneexternalmodulewithupdate++;
1339 if ($action == 'checklastversion') {
1340 if ($foundoneexternalmodulewithupdate) {
1341 setEventMessages($langs->trans("ModuleUpdateAvailable
"), null, 'warnings', '', 0, 1);
1343 setEventMessages($langs->trans("NoExternalModuleWithUpdate
"), null, 'mesgs');
1348 if ($mode == 'commonkanban') {
1356 if (!$atleastonequalified) {
1357 print '<br><span class="opacitymedium
">'.$langs->trans("NoDeployedModulesFoundWithThisSearchCriteria
").'</span><br><br>';
1360 print dol_get_fiche_end();
1364 // Show warning about external users
1365 print info_admin(showModulesExludedForExternal($modules))."\n
";
1370if ($mode == 'marketplace') {
1371 print dol_get_fiche_head($head, $mode, '', -1);
1377 print '<!-- summary of sources -->';
1379 // Marketplace and community modules
1380 print '<div class="div-
table-responsive-no-min
">';
1381 print '<table summary="list_of_modules
" class="noborder centpercent
">'."\n
";
1382 print '<tr class="liste_titre
">'."\n
";
1383 print '<td colspan="2
">'.$form->textwithpicto($langs->trans("ModuleProviderSites
"), $langs->trans("WebSiteDesc
")).'</td>';
1384 print '<td class="hideonsmartphone
">';
1390 // Source Community github
1391 $url = 'https://github.com/Dolibarr/dolibarr-community-modules';
1393 print '<tr class="oddeven nohover
" height="100
">'."\n
";
1394 print '<td class="hideonsmartphone center width150 nopaddingleftimp nopaddingrightimp
"><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
"><img border="0
" class="imgautosize imgmaxwidth100
" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg
"></a></td>';
1395 print '<td class="minwidth500imp smallonsmartphone
"><span class="opacitymedium
">'.$langs->trans("CommunityModulesDesc
").'</span><br>';
1396 print img_picto('', 'url', 'class="pictofixedwidth
"').'<a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">'.$url.'</a></td>';
1398 print ajax_constantonoff('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY', array(), null, 0, 0, 1);
1400 print '<td class="center
">';
1401 if (!getDolGlobalString('MAIN_DISABLE_EXTERNALMODULES_COMMUNITY') && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) {
1402 $messagetoadd = '<br><br><span class="small
">Content of the repository index file '.$remotestore->file_source_url.' should be in the local cache file '.$remotestore->cache_file;
1403 $messagetoadd .= ' (Date: '.dol_print_date(dol_filemtime($remotestore->cache_file), 'dayhour', 'tzuserrel').')</span>';
1404 if ($remotestore->githubFileError) {
1405 $messagetoadd .= '<br><span class="error small
">'.$remotestore->githubFileError.'</span>';
1407 print $remotestore->libStatus($remotestore->githubFileStatus, 2, $messagetoadd);
1413 // Source Marketplace DoliStore
1414 $url = 'https://www.dolistore.com';
1416 print '<tr class="oddeven nohover
" height="100
">'."\n
";
1417 print '<td class="hideonsmartphone center width150 nopaddingleftimp nopaddingrightimp
"><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
"><img border="0
" class="imgautosize imgmaxwidth100
" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.svg
"></a></td>';
1418 print '<td class="minwidth500imp smallonsmartphone
"><span class="opacitymedium
">'.$langs->trans("DoliStoreDesc
").'</span><br>';
1419 print img_picto('', 'url', 'class="pictofixedwidth
"').'<a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">'.$url.'</a></td>';
1421 print ajax_constantonoff('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE', array(), null, 0, 0, 1);
1423 print '<td class="center
">';
1424 if (!getDolGlobalString('MAIN_DISABLE_EXTERNALMODULES_DOLISTORE') && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE')) {
1425 $messagetoadd = '<br><span class="small
">';
1426 if ($remotestore->dolistoreApiStatus <= 0) {
1427 $messagetoadd = '<br>'.$remotestore->dolistoreApiError.'<br>Failed to get answer of remote API server<br>';
1430 $messagetoadd .= '<br>Using Shop address MAIN_MODULE_DOLISTORE_SHOP_URL = '.$remotestore->shop_url;
1431 $messagetoadd .= '<br>Using Remote API address MAIN_MODULE_DOLISTORE_API_URL = '.$remotestore->dolistore_api_url;
1432 $messagetoadd .= '<br>Using API public key MAIN_MODULE_DOLISTORE_API_KEY = '.$remotestore->dolistore_api_key;
1433 // Add basic auth if needed
1434 $basicAuthLogin = getDolGlobalString('MAIN_MODULE_DOLISTORE_BASIC_LOGIN');
1435 $basicAuthPassword = getDolGlobalString('MAIN_MODULE_DOLISTORE_BASIC_PASSWORD');
1436 if ($basicAuthLogin) {
1437 $messagetoadd .= '<br>Using basic auth login: base64('.$basicAuthLogin.':'.$basicAuthPassword.')';
1439 $messagetoadd .= '</span>';
1441 print $remotestore->libStatus($remotestore->dolistoreApiStatus, 2, $messagetoadd);
1449 print dol_get_fiche_end();
1453 if ($remotestore->numberOfProviders > 0) {
1454 // $options is array with filter criteria
1455 $nbmaxtoshow = $options['per_page'];
1456 $options['per_page']++;
1458 //$remotestore->getRemoteCategories();
1459 //$remotestore->getRemoteProducts($options);
1461 //print '<span class="opacitymedium hideonsmartphone
">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
1463 $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories
1465 $products_list = $remotestore->getProducts($options); // Get list of product from all sources
1467 $previouslink = $remotestore->get_previous_link();
1469 $nextlink = $remotestore->get_next_link();
1472 print '<div class="liste_titre liste_titre_bydiv centpercent
"><div class="">';
1474 print '<form method="POST
" class="centpercent
" id="searchFormList
" action="'.$remotestore->url.'">'; ?>
1475 <input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
1476 <input type="hidden
" name="mode
" value="marketplace
">
1477 <input type="hidden
" name="page_y
" value="">
1478 <div class="divsearchfield
">
1479 <input name="search_keyword
" placeholder="<?php echo $langs->trans(
'Keyword') ?>
" id="search_keyword
" type="text
" class="minwidth200
" value="<?php echo
dolPrintHTMLForAttribute($options[
'search']) ?>
" spellcheck="false">
1481 <div class="divsearchfield
">
1482 <input name="buttonsubmit
" class="button buttongen reposition
" value="<?php echo $langs->trans(
'Search') ?>
" type="submit
">
1484 if ($search_keyword !== '') {
1485 print '<a class="buttonreset reposition
" href="'.$_SERVER["PHP_SELF"].'?mode=marketplace
">'.$langs->trans('Reset').'</a>';
1487 print $form->textwithpicto('', $langs->trans('DOLISTOREdescriptionLong'));
1493 $totalnboflines = '<span class="product-count opacitymedium paddingleft
">';
1494 $totalnboflines .= $langs->trans("itemFound
", $remotestore->numberTotalOfProducts);
1495 $totalnboflines .= '</span>';
1497 print $totalnboflines;
1498 print $remotestore->getPagination();
1502 print '<div class="clearboth
"></div>';
1505 <?php if (!empty($categories_tree)) { ?>
1506 <div id="category-tree-left
" class="paddingtop
">
1509 print $categories_tree; ?>
1514 <div id="listing-content
" class="div-
table-responsive
" <?php if (empty($categories_tree)) { ?>style="width:100%;
"<?php } ?>>
1515 <table summary="list_of_modules
" id="list_of_modules
" class="productlist centpercent
">
1516 <tbody id="listOfModules
">
1517 <!-- $product_list is $remotestore->getProducts($options) done previously -->
1518 <?php print $products_list; ?>
1522 <div style="clear: both;
"></div>
1523 <div><?php print $remotestore->getPagination(); ?></div>
1529// Form to install an external module
1531if ($mode == 'deploy') {
1532 print dol_get_fiche_head($head, $mode, '', -1);
1534 $fullurl = '<a href="'.$urldolibarrmodules.'" target="_blank
" rel="noopener noreferrer
">'.$urldolibarrmodules.'</a>';
1536 if ($allowonlineinstall) {
1537 if (!in_array('/custom', explode(',', $dolibarr_main_url_root_alt))) {
1538 $message = info_admin($langs->trans("ConfFileMustContainCustom
", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
1542 if (!is_writable(dol_osencode($dirins))) {
1543 $langs->load("errors
");
1544 $message = info_admin($langs->trans("ErrorFailedToWriteInDir
", $dirins), 0, 0, '1', 'warning');
1548 $message = info_admin($langs->trans("NotExistsDirect
", $dirins).$langs->trans("InfDirAlt
").$langs->trans("InfDirExample
"));
1553 if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
1554 // Show clean message
1555 if (!is_numeric(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US'))) {
1556 $message = info_admin($langs->trans(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')), 0, 0, 'warning');
1558 $message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'), 0, 0, 'warning');
1561 // Show technical message
1562 $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile
", $dolibarrdataroot.'/installmodules.lock'), 0, 0, 'warning');
1569 if ($allowfromweb < 1) {
1570 print $langs->trans("SomethingMakeInstallFromWebNotPossible
");
1572 //print $langs->trans("SomethingMakeInstallFromWebNotPossible2
");
1576 // $allowfromweb = -1 if installation or setup not correct, 0 if not allowed, 1 if allowed
1577 if ($allowfromweb >= 0) {
1578 if ($allowfromweb == 1) {
1579 //print $langs->trans("ThisIsProcessToFollow
").'<br>';
1583 print $langs->trans("ThisIsAlternativeProcessToFollow
").'<br>';
1584 print '<b>'.$langs->trans("StepNb
", 1).'</b>: ';
1585 print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite
", '{s1}')).'<br>';
1586 print '<b>'.$langs->trans("StepNb
", 2).'</b>: ';
1587 print str_replace('{s1}', $fullurl, $langs->trans("DownloadPackageFromWebSite
", '{s1}')).'<br>';
1588 print '<b>'.$langs->trans("StepNb
", 3).'</b>: ';
1591 if ($allowfromweb == 1) {
1592 print '<form enctype="multipart/form-data
" method="POST
" class="noborder
" action="'.$_SERVER["PHP_SELF"].'" name="forminstall
">';
1593 print '<input type="hidden
" name="token
" value="'.newToken().'">';
1594 print '<input type="hidden
" name="action
" value="install
">';
1595 print '<input type="hidden
" name="mode
" value="deploy
">';
1597 print $langs->trans("YouCanSubmitFile
").'<br><br><br>';
1599 print '<span class="opacitymedium
"><input class="paddingright
" type="checkbox
" name="checkforcompliance
" id="checkforcompliance
"'.(getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES') ? ' disabled="disabled"' : 'checked="checked
"').'>';
1600 print '<label for="checkforcompliance
">'.$form->textwithpicto($langs->trans("CheckIfModuleIsNotBlackListed
"), $langs->trans("CheckIfModuleIsNotBlackListedHelp
").'<br><br>'.DolibarrModules::URL_FOR_BLACKLISTED_MODULES).'</label>';
1601 print '</span><br><br>';
1603 $max = getDolGlobalString('MAIN_UPLOAD_DOC'); // In Kb
1604 $maxphp = @ini_get('upload_max_filesize'); // In unknown
1605 if (preg_match('/k$/i', $maxphp)) {
1606 $maxphp = preg_replace('/k$/i', '', $maxphp);
1609 if (preg_match('/m$/i', $maxphp)) {
1610 $maxphp = preg_replace('/m$/i', '', $maxphp);
1613 if (preg_match('/g$/i', $maxphp)) {
1614 $maxphp = preg_replace('/g$/i', '', $maxphp);
1615 $maxphp *= 1024 * 1024;
1617 if (preg_match('/t$/i', $maxphp)) {
1618 $maxphp = preg_replace('/t$/i', '', $maxphp);
1619 $maxphp *= 1024 * 1024 * 1024;
1621 $maxphp2 = @ini_get('post_max_size'); // In unknown
1622 if (preg_match('/k$/i', $maxphp2)) {
1623 $maxphp2 = preg_replace('/k$/i', '', $maxphp2);
1626 if (preg_match('/m$/i', $maxphp2)) {
1627 $maxphp2 = preg_replace('/m$/i', '', $maxphp2);
1630 if (preg_match('/g$/i', $maxphp2)) {
1631 $maxphp2 = preg_replace('/g$/i', '', $maxphp2);
1632 $maxphp2 *= 1024 * 1024;
1634 if (preg_match('/t$/i', $maxphp2)) {
1635 $maxphp2 = preg_replace('/t$/i', '', $maxphp2);
1636 $maxphp2 *= 1024 * 1024 * 1024;
1638 // Now $max and $maxphp and $maxphp2 are in Kb
1640 $maxphptoshow = $maxphptoshowparam = '';
1642 $maxmin = min($max, $maxphp);
1643 $maxphptoshow = $maxphp;
1644 $maxphptoshowparam = 'upload_max_filesize';
1647 $maxmin = min($max, $maxphp2);
1648 if ($maxphp2 < $maxphp) {
1649 $maxphptoshow = $maxphp2;
1650 $maxphptoshowparam = 'post_max_size';
1655 print '<script type="text/javascript
">
1656 $(document).ready(function() {
1657 jQuery("#fileinstall
").on("change
", function() {
1658 if(this.files[0].size > '.($maxmin * 1024).') {
1659 alert("'.dol_escape_js($langs->transnoentitiesnoconv("ErrorFileSizeTooLarge")).'");
1665 // MAX_FILE_SIZE must come before the file input field
1666 print '<input type="hidden
" name="MAX_FILE_SIZE
" value="'.($maxmin * 1024).'">';
1669 print '<input class="flat minwidth400
" type="file
" name="fileinstall
" id="fileinstall
">';
1671 print '<input type="submit
" name="send
" value="'.dol_escape_htmltag($langs->trans("Upload")).'" class="button small
">';
1673 if (getDolGlobalString('MAIN_UPLOAD_DOC')) {
1675 $langs->load('other');
1677 print info_admin($langs->trans("ThisLimitIsDefinedInSetup
", $max, $maxphptoshow, $maxphptoshowparam), 1);
1680 print ' ('.$langs->trans("UploadDisabled
").')';
1688 print '<div class="center
"><div class="logo_setup
"></div></div>';
1690 print $langs->trans("UnpackPackageInModulesRoot
", $dirins).'<br>';
1691 print '<b>'.$langs->trans("StepNb
", 4).'</b>: ';
1692 print $langs->trans("SetupIsReadyForUse
", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home
").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules
")).'<br>';
1696 print dol_get_fiche_end();
1699if ($mode == 'develop') {
1700 print dol_get_fiche_head($head, $mode, '', -1);
1707 print '<div class="div-
table-responsive-no-min
">';
1708 print '<table summary="list_of_modules
" class="noborder centpercent
">'."\n
";
1709 print '<tr class="liste_titre
">'."\n
";
1710 print '<td colspan="3
">'.$langs->trans("DevelopYourModuleDesc
").'</td>';
1713 print '<tr class="oddeven nohover
" height="100
">'."\n
";
1714 print '<td class="center hideonsmartphone
">';
1715 print '<div class="imgmaxheight50 logo_setup
"></div>';
1717 print '<td class="minwidth500imp smallonsmartphone
">'.$langs->trans("TryToUseTheModuleBuilder
", $langs->transnoentitiesnoconv("ModuleBuilder
")).'</td>';
1718 print '<td class="maxwidth300
">';
1719 if (isModEnabled('modulebuilder')) {
1720 print $langs->trans("SeeTopRightMenu
");
1722 print '<span class="opacitymedium
">'.$langs->trans("ModuleMustBeEnabledFirst
", $langs->transnoentitiesnoconv("ModuleBuilder
")).'</span>';
1727 print '<tr class="oddeven nohover
" height="100
">'."\n
";
1728 $url = 'https://partners.dolibarr.org';
1729 print '<td class="center hideonsmartphone
">';
1730 print'<a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
"><img border="0
" class="imgautosize imgmaxwidth180
" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner.png
"></a>';
1732 print '<td class="minwidth500imp smallonsmartphone
">'.$langs->trans("DoliPartnersDesc
").'</td>';
1733 print '<td><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">';
1734 print img_picto('', 'url', 'class="pictofixedwidth
"');
1735 print $url.'</a></td>';
1741 print dol_get_fiche_end();
if(! $sortfield) if(! $sortorder) $object
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).
modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodulesnotautoenabled)
Prepare array with list of tabs.
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.
document_preview(file, type, title)
Function to show a document preview popup.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0, $level=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_uncompress($inputfile, $outputdir)
Uncompress a file.
dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement=null, $excludesubdir=0, $excludefileext=null, $excludearchivefiles=0)
Copy a dir to another dir.
dol_is_file($pathoffile)
Return if path is a file.
dol_is_dir($folder)
Test if filename is a directory.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $keyforsourcefile='addedfile', $upload_dir='', $mode=0)
Check validity of a file upload from an GUI page, and move it to its final destination.
dolGetModulesDirs($subdir='')
Return list of directories that contain modules.
dol_now($mode='gmt')
Return date for now.
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)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
dol_sanitizePathName($str, $newstr='_', $unaccent=0, $allowdash=0)
Clean a string to use it as a path name.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_set_focus($selector)
Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
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...
multi select button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
treeview li table
No Email.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.