33if (!defined(
'CSRFCHECK_WITH_TOKEN') && (empty($_GET[
'action']) || $_GET[
'action'] !=
'reset')) {
34 define(
'CSRFCHECK_WITH_TOKEN',
'1');
38require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/admin/dolistore/class/dolistore.class.php';
46@phan-var-force string $dolibarr_main_url_root_alt
50$langs->loadLangs(array(
"errors",
"admin",
"modulebuilder"));
53if (GETPOSTISSET(
'mode')) {
54 $mode =
GETPOST(
'mode',
'alpha');
55 if ($mode ==
'common' || $mode ==
'commonkanban') {
56 dolibarr_set_const($db,
"MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode,
'chaine', 0,
'', $conf->entity);
62$action =
GETPOST(
'action',
'aZ09');
63$value =
GETPOST(
'value',
'alpha');
65$search_keyword =
GETPOST(
'search_keyword',
'alpha');
66$search_status =
GETPOST(
'search_status',
'alpha');
67$search_nature =
GETPOST(
'search_nature',
'alpha');
68$search_version =
GETPOST(
'search_version',
'alpha');
73$options[
'per_page'] = 20;
77$options[
'search'] =
GETPOST(
'search_keyword',
'alpha');
86 'hr' => array(
'position' =>
'001',
'label' => $langs->trans(
"ModuleFamilyHr")),
87 'crm' => array(
'position' =>
'006',
'label' => $langs->trans(
"ModuleFamilyCrm")),
88 'srm' => array(
'position' =>
'007',
'label' => $langs->trans(
"ModuleFamilySrm")),
89 'financial' => array(
'position' =>
'009',
'label' => $langs->trans(
"ModuleFamilyFinancial")),
90 'products' => array(
'position' =>
'012',
'label' => $langs->trans(
"ModuleFamilyProducts")),
91 'projects' => array(
'position' =>
'015',
'label' => $langs->trans(
"ModuleFamilyProjects")),
92 'ecm' => array(
'position' =>
'018',
'label' => $langs->trans(
"ModuleFamilyECM")),
93 'technic' => array(
'position' =>
'021',
'label' => $langs->trans(
"ModuleFamilyTechnic")),
94 'portal' => array(
'position' =>
'040',
'label' => $langs->trans(
"ModuleFamilyPortal")),
95 'interface' => array(
'position' =>
'050',
'label' => $langs->trans(
"ModuleFamilyInterface")),
96 'base' => array(
'position' =>
'060',
'label' => $langs->trans(
"ModuleFamilyBase")),
97 'other' => array(
'position' =>
'100',
'label' => $langs->trans(
"ModuleFamilyOther")),
101if (!
GETPOST(
'buttonreset',
'alpha')) {
102 if ($search_keyword) {
103 $param .=
'&search_keyword='.urlencode($search_keyword);
105 if ($search_status && $search_status !=
'-1') {
106 $param .=
'&search_status='.urlencode($search_status);
108 if ($search_nature && $search_nature !=
'-1') {
109 $param .=
'&search_nature='.urlencode($search_nature);
111 if ($search_version && $search_version !=
'-1') {
112 $param .=
'&search_version='.urlencode($search_version);
116$dirins = DOL_DOCUMENT_ROOT.
'/custom';
117$urldolibarrmodules =
'https://www.dolistore.com/';
120$hookmanager->initHooks(array(
'adminmodules',
'globaladmin'));
123$max_execution_time_for_deploy =
getDolGlobalInt(
'MODULE_UPLOAD_MAX_EXECUTION_TIME', 300);
124if (!empty($max_execution_time_for_deploy)) {
125 $err = error_reporting();
128 @set_time_limit($max_execution_time_for_deploy);
129 error_reporting($err);
132$max_time = @ini_get(
"max_execution_time");
133if ($max_time && $max_time < $max_execution_time_for_deploy) {
134 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.");
135 @ini_set(
"max_execution_time", $max_execution_time_for_deploy);
139$dolibarrdataroot = preg_replace(
'/([\\/]+)$/i',
'', DOL_DATA_ROOT);
140$allowonlineinstall =
true;
142if (
dol_is_file($dolibarrdataroot.
'/installmodules.lock')) {
143 $allowonlineinstall =
false;
153$parameters = array();
154$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
159if (
GETPOST(
'buttonreset',
'alpha')) {
160 $search_keyword =
'';
163 $search_version =
'';
166if ($action ==
'install' && $allowonlineinstall) {
170 $original_file = basename($_FILES[
"fileinstall"][
"name"]);
171 $original_file = preg_replace(
'/\s*\(\d+\)\.zip$/i',
'.zip', $original_file);
172 $newfile = $conf->admin->dir_temp.
'/'.$original_file.
'/'.$original_file;
174 if (!$original_file) {
175 $langs->load(
"Error");
176 setEventMessages($langs->trans(
"ErrorModuleFileRequired"),
null,
'warnings');
179 if (!$error && !preg_match(
'/\.zip$/i', $original_file)) {
180 $langs->load(
"errors");
181 setEventMessages($langs->trans(
"ErrorFileMustBeADolibarrPackage", $original_file),
null,
'errors');
184 if (!$error && !preg_match(
'/^(module[a-zA-Z0-9]*_|theme_|).*\-([0-9][0-9\.]*)(\s\(\d+\)\s)?\.zip$/i', $original_file)) {
185 $langs->load(
"errors");
186 setEventMessages($langs->trans(
"ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file,
'modulename-x[.y.z].zip'),
null,
'errors');
189 if (empty($_FILES[
'fileinstall'][
'tmp_name'])) {
190 $langs->load(
"errors");
197 if ($original_file) {
199 dol_mkdir($conf->admin->dir_temp.
'/'.$original_file);
202 $tmpdir = preg_replace(
'/\.zip$/i',
'', $original_file).
'.dir';
205 dol_mkdir($conf->admin->dir_temp.
'/'.$tmpdir);
208 $result =
dol_move_uploaded_file($_FILES[
'fileinstall'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'fileinstall'][
'error']);
210 $result =
dol_uncompress($newfile, $conf->admin->dir_temp.
'/'.$tmpdir);
212 if (!empty($result[
'error'])) {
213 $langs->load(
"errors");
214 setEventMessages($langs->trans($result[
'error'], $original_file),
null,
'errors');
218 $modulename = preg_replace(
'/module_/',
'', $original_file);
219 $modulename = preg_replace(
'/\-([0-9][0-9\.]*)\.zip$/i',
'', $modulename);
221 $modulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/'.$modulename;
224 $modulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulename;
227 setEventMessages($langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat").
'<br>'.$langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat2", $modulename,
'htdocs/'.$modulename),
null,
'errors');
232 dol_syslog(
"Uncompress of module file is a success.");
271 if (
GETPOST(
'checkforcompliance') ==
'on') {
273 $res = include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
275 $checkRes = $dolibarrmodule->checkForcompliance($modulename);
277 if (!is_numeric($checkRes) && $checkRes !=
'') {
278 $langs->load(
"errors");
279 setEventMessages($modulename.
' : '.$langs->trans($checkRes),
null,
'errors');
294 $modulenamearrays = array();
295 if (
dol_is_file($modulenamedir.
'/metapackage.conf')) {
297 $metafile = file_get_contents($modulenamedir.
'/metapackage.conf');
298 $modulenamearrays = explode(
"\n", $metafile);
300 $modulenamearrays[$modulename] = $modulename;
305 foreach ($modulenamearrays as $modulenameval) {
306 if (strpos($modulenameval,
'#') === 0) {
309 if (strpos($modulenameval,
'//') === 0) {
312 if (!trim($modulenameval)) {
319 $submodulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/'.$modulenameval;
321 $submodulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulenameval;
323 dol_syslog(
"We copy now directory ".$submodulenamedir.
" into target dir ".$dirins.
'/'.$modulenameval);
324 $result =
dolCopyDir($submodulenamedir, $dirins.
'/'.$modulenameval,
'0444', 1);
326 dol_syslog(
'Failed to call dolCopyDir result='.$result.
" with param ".$submodulenamedir.
" and ".$dirins.
'/'.$modulenameval, LOG_WARNING);
327 $langs->load(
"errors");
328 setEventMessages($langs->trans(
"ErrorFailToCopyDir", $submodulenamedir, $dirins.
'/'.$modulenameval),
null,
'errors');
336 setEventMessages($langs->trans(
"ErrorFailToRenameFile", $_FILES[
'fileinstall'][
'tmp_name'], $newfile),
null,
'errors');
366 $searchParams = array(
367 'search_keyword' => $modulenameval,
368 'search_status' =>
'-1',
369 'search_nature' =>
'-1',
370 'search_version' =>
'-1'
372 $queryString = http_build_query($searchParams);
373 $redirectUrl = DOL_URL_ROOT .
'/admin/modules.php?' . $queryString;
375 $message = $langs->trans(
"SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv(
"Home").
' - '.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Modules"));
379} elseif ($action ==
'install' && !$allowonlineinstall) {
380 httponly_accessforbidden(
"You try to bypass the protection to disallow deployment of an external module. Hack attempt ?");
383if ($action ==
'set' && $user->admin) {
388 if ($checkOldValue !=
getDolGlobalInt(
'CHECKLASTVERSION_EXTERNALMODULE')) {
389 setEventMessage($langs->trans(
'WarningModuleHasChangedLastVersionCheckParameter', $value),
'warnings');
391 if ($csrfCheckOldValue !=
getDolGlobalInt(
'MAIN_SECURITY_CSRF_WITH_TOKEN')) {
392 setEventMessage($langs->trans(
'WarningModuleHasChangedSecurityCsrfParameter', $value),
'warnings');
396 if (!empty($resarray[
'errors'])) {
400 if ($resarray[
'nbperms'] > 0) {
401 $tmpsql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"user WHERE admin <> 1";
402 $resqltmp = $db->query($tmpsql);
404 $obj = $db->fetch_object($resqltmp);
406 if ($obj && $obj->nb > 1) {
407 $msg = $langs->trans(
'ModuleEnabledAdminMustCheckRights');
415 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
417} elseif ($action ==
'reset' && $user->admin &&
GETPOST(
'confirm') ==
'yes') {
423 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
425} elseif (
getDolGlobalInt(
"MAIN_FEATURES_LEVEL") > 1 && $action ==
'reload' && $user->admin &&
GETPOST(
'confirm') ==
'yes') {
430 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
434 if (!empty($resarray[
'errors'])) {
437 if ($resarray[
'nbperms'] > 0) {
438 $tmpsql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"user WHERE admin <> 1";
439 $resqltmp = $db->query($tmpsql);
441 $obj = $db->fetch_object($resqltmp);
442 if ($obj && $obj->nb > 1) {
443 $msg = $langs->trans(
'ModuleEnabledAdminMustCheckRights');
451 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
462$form =
new Form($db);
465$morecss = array(
"/admin/dolistore/css/dolistore.css");
473$help_url =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
474llxHeader(
'', $langs->trans(
"Setup"), $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-admin page-modules');
480$arrayofnatures = array(
481 'core' => array(
'label' => $langs->transnoentitiesnoconv(
"NativeModules")),
482 'external' => array(
'label' => $langs->transnoentitiesnoconv(
"External").
' - ['.$langs->trans(
"AllPublishers").
']')
484$arrayofwarnings = array();
485$arrayofwarningsext = array();
490$publisherlogoarray = array();
494$modNameLoaded = array();
496foreach ($modulesdir as $dir) {
499 dol_syslog(
"Scan directory ".$dir.
" for module descriptor files (modXXX.class.php)");
500 $handle = @opendir($dir);
501 if (is_resource($handle)) {
502 while (($file = readdir($handle)) !==
false) {
504 if (is_readable($dir.$file) && substr($file, 0, 3) ==
'mod' && substr($file,
dol_strlen($file) - 10) ==
'.class.php') {
505 $modName = substr($file, 0,
dol_strlen($file) - 10);
508 if (!empty($modNameLoaded[$modName])) {
509 $mesg =
"Error: Module ".$modName.
" was found twice: Into ".$modNameLoaded[$modName].
" and ".$dir.
". You probably have an old file on your disk.<br>";
516 $res = include_once $dir.$file;
517 if (class_exists($modName)) {
518 $objMod =
new $modName($db);
519 '@phan-var-force DolibarrModules $objMod';
520 $modNameLoaded[$modName] = $dir;
521 if (!$objMod->numero > 0 && $modName !=
'modUser') {
522 dol_syslog(
'The module descriptor '.$modName.
' must have a numero property', LOG_ERR);
524 $j = $objMod->numero;
526 $modulequalified = 1;
529 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
531 $modulequalified = 0;
534 $modulequalified = 0;
537 $modulequalified = 0;
541 if (!empty($objMod->hidden)) {
542 $modulequalified = 0;
545 if ($modulequalified > 0) {
547 $external = ($objMod->isCoreOrExternalModule() ==
'external');
557 $arrayofnatures[
'external_'.$publisher] = array(
'label' => $langs->trans(
"External").
' - '.$publisher,
'data-html' => $langs->trans(
"External").
' - <span class="opacitymedium inine-block valignmiddle">'.$publisher.
'</span>');
559 $arrayofnatures[
'external_'] = array(
'label' => $langs->trans(
"External").
' - ['.$langs->trans(
"UnknownPublishers").
']');
562 ksort($arrayofnatures);
565 $filename[$i] = $modName;
566 $modules[$modName] = $objMod;
569 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
570 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
571 $familykey = key($objMod->familyinfo);
573 $familykey = $objMod->family;
575 '@phan-var-force string $familykey';
577 $moduleposition = ($objMod->module_position ? $objMod->module_position :
'50');
578 if ($objMod->isCoreOrExternalModule() ==
'external' && $moduleposition < 100000) {
580 $moduleposition =
'80';
584 if (!empty($objMod->warnings_activation)) {
585 $arrayofwarnings[$modName] = $objMod->warnings_activation;
587 if (!empty($objMod->warnings_activation_ext)) {
588 $arrayofwarningsext[$modName] = $objMod->warnings_activation_ext;
591 $familyposition = (empty($familyinfo[$familykey][
'position']) ?
'0' : $familyinfo[$familykey][
'position']);
592 $listOfOfficialModuleGroups = array(
'hr',
'technic',
'interface',
'technic',
'portal',
'financial',
'crm',
'base',
'products',
'srm',
'ecm',
'projects',
'other');
593 if ($external && !in_array($familykey, $listOfOfficialModuleGroups)) {
595 if (is_numeric($familyposition)) {
596 $familyposition = sprintf(
"%03d", (
int) $familyposition + 100);
600 $orders[$i] = $familyposition.
"_".$familykey.
"_".$moduleposition.
"_".$j;
603 $specialstring =
'unknown';
604 if ($objMod->version ==
'development' || $objMod->version ==
'experimental') {
605 $specialstring =
'expdev';
607 if (isset($categ[$specialstring])) {
608 $categ[$specialstring]++;
610 $categ[$specialstring] = 1;
615 dol_syslog(
"Module ".get_class($objMod).
" not qualified");
618 print
info_admin(
"admin/modules.php Warning bad descriptor file : ".$dir.$file.
" (Class ".$modName.
" not found into file)", 0, 0,
'1',
'warning');
621 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
628 dol_syslog(
"htdocs/admin/modules.php: Failed to open directory ".$dir.
". See permission and open_basedir option.", LOG_WARNING);
632'@phan-var-force array<string,DolibarrModules> $modules';
634if ($action ==
'reset_confirm' && $user->admin) {
635 if (!empty($modules[$value])) {
636 $objMod = $modules[$value];
638 if (!empty($objMod->langfiles)) {
639 $langs->loadLangs($objMod->langfiles);
642 $form =
new Form($db);
643 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?value='.$value.
'&mode='.$mode.$param, $langs->trans(
'ConfirmUnactivation'), $langs->trans(
GETPOST(
'confirm_message_code')),
'reset',
'',
'no', 1);
647if ($action ==
'reload_confirm' && $user->admin) {
648 if (!empty($modules[$value])) {
649 $objMod = $modules[$value];
651 if (!empty($objMod->langfiles)) {
652 $langs->loadLangs($objMod->langfiles);
655 $form =
new Form($db);
656 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?value='.$value.
'&mode='.$mode.$param, $langs->trans(
'ConfirmReload'), $langs->trans(
GETPOST(
'confirm_message_code')),
'reload',
'',
'no', 1);
667$nbofactivatedmodules = count($conf->modules);
670$nbmodulesnotautoenabled = count($conf->modules);
671$listofmodulesautoenabled = array(
'agenda',
'fckeditor',
'export',
'import');
672foreach ($listofmodulesautoenabled as $moduleautoenable) {
673 if (in_array($moduleautoenable, $conf->modules)) {
674 $nbmodulesnotautoenabled--;
682if ($mode ==
'common' || $mode ==
'commonkanban') {
683 $desc = $langs->trans(
"ModulesDesc",
'{picto}');
684 $desc .=
' '.$langs->trans(
"ModulesDesc2",
'{picto2}');
685 $desc = str_replace(
'{picto}',
img_picto(
'',
'switch_off',
'class="size15x"'), $desc);
686 $desc = str_replace(
'{picto2}',
img_picto(
'',
'setup',
'class="size15x"'), $desc);
687 if ($nbmodulesnotautoenabled <=
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
688 $deschelp .=
'<div class="info hideonsmartphone">'.$desc.
"<br></div>\n";
691 $deschelp .=
'<div class="info">'.$langs->trans(
getDolGlobalString(
'MAIN_SETUP_MODULES_INFO')).
"<br></div>\n";
700if ($mode ==
'deploy') {
701 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDeployDesc", $langs->transnoentitiesnoconv(
"AvailableModules")).
"<br></div><br>\n";
703if ($mode ==
'develop') {
704 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDevelopDesc").
"<br></div><br>\n";
710if ($mode ==
'common' || $mode ==
'commonkanban') {
713 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
714 print
'<input type="hidden" name="token" value="'.newToken().
'">';
715 if (isset($optioncss) && $optioncss !=
'') {
716 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
718 if (isset($sortfield) && $sortfield !=
'') {
719 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
721 if (isset($sortorder) && $sortorder !=
'') {
722 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
724 if (isset($page) && $page !=
'') {
725 print
'<input type="hidden" name="page" value="'.$page.
'">';
727 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
733 $moreforfilter =
'<div class="valignmiddle">';
735 $moreforfilter .=
'<div class="floatright right pagination paddingtop --module-list"><ul><li>';
736 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'CheckForModuleUpdate'), $langs->trans(
'CheckForModuleUpdate').
'<br><br>'.
img_warning(
'',
'',
'paddingright').$langs->trans(
'CheckForModuleUpdateHelp').$langs->trans(
'CheckForModuleUpdateHelp'),
'fa fa-sync', $_SERVER[
"PHP_SELF"].
'?action=checklastversion&token='.
newToken().
'&mode='.$mode.$param,
'', 1, array(
'morecss' =>
'reposition'));
738 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.$param,
'', ($mode ==
'common' ? 2 : 1), array(
'morecss' =>
'reposition'));
739 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=commonkanban'.$param,
'', ($mode ==
'commonkanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
740 $moreforfilter .=
'</li></ul></div>';
742 $moreforfilter .=
'<div class="divfilteralone colorbacktimesheet float valignmiddle">';
743 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
744 $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).
'" placeholder="'.
dol_escape_htmltag($langs->trans(
'Keyword')).
'">';
745 $moreforfilter .=
'</div>';
746 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
747 $moreforfilter .= $form->selectarray(
'search_nature', $arrayofnatures,
dol_escape_htmltag($search_nature), $langs->trans(
'Origin'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth250', 1);
748 $moreforfilter .=
'</div>';
751 $array_version = array(
'stable' => $langs->transnoentitiesnoconv(
"Stable"));
753 $array_version[
'deprecated'] = $langs->trans(
"Deprecated");
756 $array_version[
'experimental'] = $langs->trans(
"Experimental");
759 $array_version[
'development'] = $langs->trans(
"Development");
761 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
762 $moreforfilter .= $form->selectarray(
'search_version', $array_version, $search_version, $langs->transnoentitiesnoconv(
'Version'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
763 $moreforfilter .=
'</div>';
765 $array_status = array(
'active' => $langs->transnoentitiesnoconv(
"Enabled"),
'disabled' => $langs->transnoentitiesnoconv(
"Disabled"));
766 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
767 $moreforfilter .= $form->selectarray(
'search_status', $array_status, $search_status, $langs->transnoentitiesnoconv(
'Status'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
768 $moreforfilter .=
'</div>';
769 $moreforfilter .=
' ';
770 $moreforfilter .=
'<div class="divsearchfield valignmiddle inline-block">';
771 $moreforfilter .=
'<input type="submit" name="buttonsubmit" class="button small nomarginleft" value="'.dol_escape_htmltag($langs->trans(
"Refresh")).
'">';
772 if ($search_keyword || ($search_nature && $search_nature !=
'-1') || ($search_version && $search_version !=
'-1') || ($search_status && $search_status !=
'-1')) {
773 $moreforfilter .=
' ';
774 $moreforfilter .=
'<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dol_escape_htmltag($langs->trans(
"Reset")).
'">';
776 $moreforfilter .=
'</div>';
777 $moreforfilter .=
'</div>';
779 $moreforfilter .=
'</div>';
781 if (!empty($moreforfilter)) {
782 print $moreforfilter;
783 $parameters = array();
784 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters,
$object, $action);
785 print $hookmanager->resPrint;
790 print
'<div class="clearboth"></div><br>';
793 $parameters = array();
794 $reshook = $hookmanager->executeHooks(
'insertExtraHeader', $parameters,
$object, $action);
799 $disabled_modules = array();
800 if (!empty($_SESSION[
"disablemodules"])) {
801 $disabled_modules = explode(
',', $_SESSION[
"disablemodules"]);
806 $foundoneexternalmodulewithupdate = 0;
808 $atleastonequalified = 0;
809 $atleastoneforfamily = 0;
811 foreach ($orders as $key => $value) {
813 $tab = explode(
'_', $value);
814 $familykey = $tab[1];
815 $module_position = $tab[2];
817 $modName = $filename[$key];
820 $objMod = $modules[$modName];
822 if (!is_object($objMod)) {
827 if ($mode ==
'expdev' && $objMod->version !=
'development' && $objMod->version !=
'experimental') {
831 if (!$objMod->getName()) {
832 dol_syslog(
"Error for module ".$key.
" - Property name of module looks empty", LOG_WARNING);
836 $modulenameshort = strtolower(preg_replace(
'/^mod/i',
'', get_class($objMod)));
837 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
840 $modulename = $objMod->getName();
841 $moduletechnicalname = $objMod->name;
842 $moduledesc = $objMod->getDesc();
843 $moduledesclong = $objMod->getDescLong();
844 $moduleauthor = $objMod->getPublisher();
847 if ($search_keyword) {
849 if (preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $modulename)
850 || preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduletechnicalname)
851 || ($moduledesc && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduledesc))
852 || ($moduledesclong && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduledesclong))
853 || ($moduleauthor && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduleauthor))
861 if ($search_status) {
869 if ($search_nature) {
870 if (preg_match(
'/^external/', $search_nature) && $objMod->isCoreOrExternalModule() !=
'external') {
874 if (preg_match(
'/^external_(.*)$/', $search_nature, $reg)) {
880 if (!$reg[1] && !empty($publisher)) {
884 if ($search_nature ==
'core' && $objMod->isCoreOrExternalModule() ==
'external') {
888 if ($search_version) {
889 if (($objMod->version ==
'development' || $objMod->version ==
'experimental' || preg_match(
'/deprecated/', $objMod->version)) && $search_version ==
'stable') {
892 if ($objMod->version !=
'development' && ($search_version ==
'development')) {
895 if ($objMod->version !=
'experimental' && ($search_version ==
'experimental')) {
898 if (!preg_match(
'/deprecated/', $objMod->version) && ($search_version ==
'deprecated')) {
903 $atleastonequalified++;
906 if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
907 foreach ($objMod->langfiles as $domain) {
908 $langs->load($domain);
913 if ($familykey != $oldfamily) {
915 print
'</table></div><br>';
918 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
922 if ($mode ==
'commonkanban') {
923 print
'<div class="box-flex-container kanban">';
925 print
'<div class="div-table-responsive">';
926 print
'<table class="tagtable liste" summary="list_of_modules">'.
"\n";
929 $atleastoneforfamily = 0;
932 $atleastoneforfamily++;
934 if ($familykey != $oldfamily) {
935 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
936 $oldfamily = $familykey;
940 $version = $objMod->getVersion(0);
943 if (preg_match(
'/development/i', $version)) {
944 $warningstring = $langs->trans(
"Development");
946 if (preg_match(
'/experimental/i', $version)) {
947 $warningstring = $langs->trans(
"Experimental");
949 if (preg_match(
'/deprecated/i', $version)) {
950 $warningstring = $langs->trans(
"Deprecated");
953 if ($objMod->isCoreOrExternalModule() ==
'external' || preg_match(
'/development|experimental|deprecated/i', $version)) {
954 $versiontrans .= $objMod->getVersion(1);
957 if ($objMod->isCoreOrExternalModule() ==
'external' && ($action ==
'checklastversion' ||
getDolGlobalString(
'CHECKLASTVERSION_EXTERNALMODULE'))) {
961 $checkRes = $objMod->checkForUpdate();
963 setEventMessages($objMod->getName().
' : '.preg_replace(
'/[^a-z0-9_\.\-\s]/i',
'', $versiontrans).
' -> '.preg_replace(
'/[^a-z0-9_\.\-\s]/i',
'', $objMod->lastVersion),
null,
'warnings');
964 } elseif ($checkRes < 0) {
965 setEventMessages($objMod->getName().
' '.$langs->trans(
'CheckVersionFail'),
null,
'errors');
969 if ($objMod->isCoreOrExternalModule() ==
'external' && $action ==
'checklastversion' && !
getDolGlobalString(
'DISABLE_CHECK_ON_MALWARE_MODULES')) {
970 $checkRes = $objMod->checkForCompliance();
971 if (!is_numeric($checkRes) && $checkRes !=
'') {
972 $langs->load(
"errors");
973 setEventMessages($objMod->getName().
' : '.$langs->trans($checkRes),
null,
'errors');
979 if ($objMod->isCoreOrExternalModule() ==
'external') {
980 $imginfo =
"info_black";
983 $codeenabledisable =
'';
987 if (in_array($modulenameshort, $disabled_modules)) {
988 $objMod->disabled =
true;
995 if (!empty($arrayofwarnings[$modName])) {
996 $codeenabledisable .=
'<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
999 if (!empty($objMod->disabled)) {
1000 $codeenabledisable .= $langs->trans(
"Disabled");
1001 } elseif (is_object($objMod)
1002 && (!empty($objMod->always_enabled) || ((isModEnabled(
'multicompany') && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))) {
1004 if (method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
1005 $codeenabledisable .= $langs->trans(
"Used");
1007 $codeenabledisable .=
img_picto($langs->trans(
"Required"),
'switch_on',
'', 0, 0, 0,
'',
'opacitymedium valignmiddle');
1010 if (isModEnabled(
'multicompany') && $user->entity) {
1015 if (is_object($objMod) && !empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
1016 $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.
'">';
1017 $codeenabledisable .=
img_picto($langs->trans(
"Activated").($warningstring ?
' '.$warningstring :
''),
'switch_on');
1018 $codeenabledisable .=
'</a>';
1020 $codeenabledisable .=
' ';
1021 $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.
'">';
1022 $codeenabledisable .=
img_picto($langs->trans(
"Reload"),
'refresh',
'class="opacitymedium"');
1023 $codeenabledisable .=
'</a>';
1026 $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.
'">';
1027 $codeenabledisable .=
img_picto($langs->trans(
"Activated").($warningstring ?
' '.$warningstring :
''),
'switch_on');
1028 $codeenabledisable .=
'</a>';
1030 $codeenabledisable .=
' ';
1031 $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.
'">';
1032 $codeenabledisable .=
img_picto($langs->trans(
"Reload"),
'refresh',
'class="opacitymedium"');
1033 $codeenabledisable .=
'</a>';
1039 if (!empty($objMod->config_page_url) && !$disableSetup) {
1040 $backtourlparam =
'';
1041 if ($search_keyword !=
'') {
1042 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_keyword='.urlencode($search_keyword);
1044 if ($search_nature > -1) {
1045 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_nature='.urlencode($search_nature);
1047 if ($search_version > -1) {
1048 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_version='.urlencode($search_version);
1050 if ($search_status > -1) {
1051 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_status='.urlencode($search_status);
1053 $backtourl = $_SERVER[
"PHP_SELF"].$backtourlparam;
1056 if (is_array($objMod->config_page_url)) {
1058 foreach ($objMod->config_page_url as $page) {
1061 $codetoconfig .=
'<a href="'.$urlpage.
'" title="'.$langs->trans($page).
'">'.
img_picto(ucfirst($page),
"setup").
'</a>';
1064 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) {
1065 $urltouse =
dol_buildpath(
'/'.$regs[2].
'/admin/'.$regs[1], 1);
1066 $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>';
1068 $urltouse = $urlpage;
1069 $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>';
1073 } elseif (preg_match(
'/^([^@]+)@([^@]+)$/i', (
string) $objMod->config_page_url, $regs)) {
1074 $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>';
1076 $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>';
1079 $codetoconfig .=
img_picto($langs->trans(
"NothingToSetup"),
"setup",
'class="opacitytransp" style="padding-right: 6px"', 0, 0, 0,
'',
'fa-15');
1083 if (!empty($objMod->always_enabled)) {
1085 $codeenabledisable .=
'<!-- Message to show: an always_enabled module has been disabled -->'.
"\n";
1086 $codeenabledisable .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=set&token='.
newToken().
'&value='.$modName.
'&mode='.$mode.$param.
'"';
1087 $codeenabledisable .=
'>';
1088 $codeenabledisable .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
1089 $codeenabledisable .=
"</a>\n";
1090 } elseif (!empty($objMod->disabled)) {
1091 $codeenabledisable .= $langs->trans(
"Disabled");
1094 $warningmessage =
'';
1095 if (!empty($arrayofwarnings[$modName])) {
1096 $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";
1097 foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) {
1098 if (preg_match(
'/^always/', $keycountry) || ($mysoc->country_code && preg_match(
'/^'.$mysoc->country_code.
'/', $keycountry))) {
1099 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
1103 if ($objMod->isCoreOrExternalModule() ==
'external' && !empty($arrayofwarningsext)) {
1104 $codeenabledisable .=
'<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
1105 foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) {
1106 $keymodulelowercase = strtolower(preg_replace(
'/^mod/',
'', $keymodule));
1107 if (in_array($keymodulelowercase, $conf->modules)) {
1108 foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) {
1109 if (preg_match(
'/^always/', $keycountry) || ($mysoc->country_code && preg_match(
'/^'.$mysoc->country_code.
'/', $keycountry))) {
1110 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
1111 $warningmessage .= ($warningmessage ?
"\n" :
"").($warningmessage ?
"\n" :
"").$langs->trans(
"Module").
' : '.$objMod->getName();
1112 if (!empty($objMod->editor_name)) {
1113 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"Publisher").
' : '.$objMod->editor_name;
1115 if (!empty($objMod->editor_name)) {
1116 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"ModuleTriggeringThisWarning").
' : '.$modules[$keymodule]->getName();
1123 $codeenabledisable .=
'<!-- Message to show: '.$warningmessage.
' -->'.
"\n";
1124 $codeenabledisable .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$objMod->numero.
'&token='.
newToken().
'&module_position='.$module_position.
'&action=set&token='.
newToken().
'&value='.$modName.
'&mode='.$mode.$param.
'"';
1125 if ($warningmessage) {
1126 $codeenabledisable .=
' onclick="return confirm(\''.dol_escape_js($warningmessage).
'\');
"';
1128 $codeenabledisable .= '>';
1129 $codeenabledisable .= img_picto($langs->trans("Disabled
"), 'switch_off');
1130 $codeenabledisable .= "</a>\n
";
1133 // Set $codetoconfig
1134 $codetoconfig .= img_picto($langs->trans("NothingToSetup
"), "setup
", 'class="opacitytransp
" style="padding-right: 6px
"');
1137 if ($mode == 'commonkanban') {
1139 print $objMod->getKanbanView($codeenabledisable, $codetoconfig);
1141 print '<tr class="oddeven
'.($warningstring ? ' info-box-content-warning
' : '').'">'."\n
";
1142 if (getDolGlobalString('MAIN_MODULES_SHOW_LINENUMBERS')) {
1143 print '<td class="width50
">'.$linenum.'</td>';
1146 // Picto + Name of module
1147 print ' <td class="tdoverflowmax200 minwidth200imp
" title="'.dol_escape_htmltag($objMod->getName()).'">';
1149 //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
1150 //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
1151 if (!empty($objMod->picto)) {
1152 if (preg_match('/^\//i', $objMod->picto)) {
1153 print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"', 1);
1155 print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"');
1158 print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly
"');
1160 print ' <span class="valignmiddle
">'.$objMod->getName().'</span>';
1164 print '<td class="valignmiddle tdoverflowmax300 minwidth200imp
">';
1165 print nl2br($objMod->getDesc());
1169 print '<td class="center nowrap
" style="width: 82px;
">';
1170 //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
1171 print '<a href="javascript:
document_preview(\
''.DOL_URL_ROOT.
'/admin/modulehelp.php?id='.((
int) $objMod->numero).
'\',\
'text/html\',\''.dol_escape_js($langs->trans(
"Module")).
'\')
">'.img_picto(($objMod->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule
").' - ' : '').$langs->trans("ClickToShowDescription
"), $imginfo).'</a>';
1175 print '<td class="center nowrap width150
" title="'.dol_escape_htmltag(dol_string_nohtmltag($versiontrans)).'">';
1176 if ($objMod->needUpdate) {
1177 $versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
1178 print '<span class="badge badge-warning classfortooltip
" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
1180 print $versiontrans;
1184 // Link enable/disable
1185 print '<td class="center valignmiddle left nowraponall
" width="60px
">';
1186 print $codeenabledisable;
1190 print '<td class="tdsetuppicto right valignmiddle
" width="60px
">';
1191 print $codetoconfig;
1196 if ($objMod->needUpdate) {
1197 $foundoneexternalmodulewithupdate++;
1201 if ($action == 'checklastversion') {
1202 if ($foundoneexternalmodulewithupdate) {
1203 setEventMessages($langs->trans("ModuleUpdateAvailable
"), null, 'warnings', '', 0, 1);
1205 setEventMessages($langs->trans("NoExternalModuleWithUpdate
"), null, 'mesgs');
1210 if ($mode == 'commonkanban') {
1218 if (!$atleastonequalified) {
1219 print '<br><span class="opacitymedium
">'.$langs->trans("NoDeployedModulesFoundWithThisSearchCriteria
").'</span><br><br>';
1222 print dol_get_fiche_end();
1226 // Show warning about external users
1227 print info_admin(showModulesExludedForExternal($modules))."\n
";
1232if ($mode == 'marketplace') {
1233 print dol_get_fiche_head($head, $mode, '', -1);
1240 print '<div class="div-
table-responsive-no-min
">';
1241 print '<table summary="list_of_modules
" class="noborder centpercent
">'."\n
";
1242 print '<tr class="liste_titre
">'."\n
";
1243 print '<td class="hideonsmartphone
">'.$form->textwithpicto($langs->trans("Provider
"), $langs->trans("WebSiteDesc
")).'</td>';
1245 print '<td>'.$langs->trans("URL
").'</td>';
1248 print '<tr class="oddeven
">'."\n
";
1249 $url = 'https://www.dolistore.com';
1250 print '<td class="hideonsmartphone
"><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
"><img border="0
" class="imgautosize imgmaxwidth180
" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png
"></a></td>';
1251 print '<td><span class="opacitymedium
">'.$langs->trans("DoliStoreDesc
").'</span></td>';
1252 print '<td><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">'.$url.'</a></td>';
1258 print dol_get_fiche_end();
1262 if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
1263 // $options is array with filter criteria
1264 //var_dump($options);
1265 $dolistore->getRemoteCategories();
1266 $dolistore->getRemoteProducts($options);
1268 print '<span class="opacitymedium
">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
1270 $previouslink = $dolistore->get_previous_link();
1271 $nextlink = $dolistore->get_next_link();
1273 print '<div class="liste_titre liste_titre_bydiv centpercent
"><div class="divsearchfield
">';
1275 print '<form method="POST
" class="centpercent
" id="searchFormList
" action="'.$dolistore->url.'">'; ?>
1276 <input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
1277 <input type="hidden
" name="mode
" value="marketplace
">
1278 <div class="divsearchfield
">
1279 <input name="search_keyword
" placeholder="<?php echo $langs->trans(
'Keyword') ?>
" id="search_keyword
" type="text
" class="minwidth200
" value="<?php echo
dol_escape_htmltag($options[
'search']) ?>
"><br>
1281 <div class="divsearchfield
">
1282 <input class="button buttongen
" value="<?php echo $langs->trans(
'Rechercher') ?>
" type="submit
">
1283 <a class="buttonreset
" href="<?php echo urlencode($dolistore->url) ?>
"><?php echo $langs->trans('Reset') ?></a>
1288 print $previouslink;
1292 print '</div></div>';
1293 print '<div class="clearboth
"></div>';
1296 <div id="category-tree-left
">
1299 echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content?>
1302 <div id="listing-content
">
1303 <table summary="list_of_modules
" id="list_of_modules
" class="productlist centpercent
">
1304 <tbody id="listOfModules
">
1305 <?php echo $dolistore->get_products(); ?>
1314// Form to install an external module
1316if ($mode == 'deploy') {
1317 print dol_get_fiche_head($head, $mode, '', -1);
1319 $fullurl = '<a href="'.$urldolibarrmodules.'" target="_blank
" rel="noopener noreferrer
">'.$urldolibarrmodules.'</a>';
1321 if ($allowonlineinstall) {
1322 if (!in_array('/custom', explode(',', $dolibarr_main_url_root_alt))) {
1323 $message = info_admin($langs->trans("ConfFileMustContainCustom
", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
1327 if (!is_writable(dol_osencode($dirins))) {
1328 $langs->load("errors
");
1329 $message = info_admin($langs->trans("ErrorFailedToWriteInDir
", $dirins), 0, 0, '1', 'warning');
1333 $message = info_admin($langs->trans("NotExistsDirect
", $dirins).$langs->trans("InfDirAlt
").$langs->trans("InfDirExample
"));
1338 if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
1339 // Show clean message
1340 if (!is_numeric(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US'))) {
1341 $message = info_admin($langs->trans(getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')), 0, 0, 'warning');
1343 $message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'), 0, 0, 'warning');
1346 // Show technical message
1347 $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile
", $dolibarrdataroot.'/installmodules.lock'), 0, 0, 'warning');
1354 if ($allowfromweb < 1) {
1355 print $langs->trans("SomethingMakeInstallFromWebNotPossible
");
1357 //print $langs->trans("SomethingMakeInstallFromWebNotPossible2
");
1361 // $allowfromweb = -1 if installation or setup not correct, 0 if not allowed, 1 if allowed
1362 if ($allowfromweb >= 0) {
1363 if ($allowfromweb == 1) {
1364 //print $langs->trans("ThisIsProcessToFollow
").'<br>';
1368 print $langs->trans("ThisIsAlternativeProcessToFollow
").'<br>';
1369 print '<b>'.$langs->trans("StepNb
", 1).'</b>: ';
1370 print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite
", '{s1}')).'<br>';
1371 print '<b>'.$langs->trans("StepNb
", 2).'</b>: ';
1372 print str_replace('{s1}', $fullurl, $langs->trans("DownloadPackageFromWebSite
", '{s1}')).'<br>';
1373 print '<b>'.$langs->trans("StepNb
", 3).'</b>: ';
1376 if ($allowfromweb == 1) {
1377 print '<form enctype="multipart/form-data
" method="POST
" class="noborder
" action="'.$_SERVER["PHP_SELF"].'" name="forminstall
">';
1378 print '<input type="hidden
" name="token
" value="'.newToken().'">';
1379 print '<input type="hidden
" name="action
" value="install
">';
1380 print '<input type="hidden
" name="mode
" value="deploy
">';
1382 print $langs->trans("YouCanSubmitFile
").'<br><br><br>';
1384 print '<span class="opacitymedium
"><input class="paddingright
" type="checkbox
" name="checkforcompliance
" id="checkforcompliance
"'.(getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES') ? ' disabled="disabled"' : 'checked="checked
"').'>';
1385 print '<label for="checkforcompliance
">'.$form->textwithpicto($langs->trans("CheckIfModuleIsNotBlackListed
"), $langs->trans("CheckIfModuleIsNotBlackListedHelp
")).'</label>';
1386 print '</span><br><br>';
1388 $max = getDolGlobalString('MAIN_UPLOAD_DOC'); // In Kb
1389 $maxphp = @ini_get('upload_max_filesize'); // In unknown
1390 if (preg_match('/k$/i', $maxphp)) {
1391 $maxphp = preg_replace('/k$/i', '', $maxphp);
1394 if (preg_match('/m$/i', $maxphp)) {
1395 $maxphp = preg_replace('/m$/i', '', $maxphp);
1398 if (preg_match('/g$/i', $maxphp)) {
1399 $maxphp = preg_replace('/g$/i', '', $maxphp);
1400 $maxphp *= 1024 * 1024;
1402 if (preg_match('/t$/i', $maxphp)) {
1403 $maxphp = preg_replace('/t$/i', '', $maxphp);
1404 $maxphp *= 1024 * 1024 * 1024;
1406 $maxphp2 = @ini_get('post_max_size'); // In unknown
1407 if (preg_match('/k$/i', $maxphp2)) {
1408 $maxphp2 = preg_replace('/k$/i', '', $maxphp2);
1411 if (preg_match('/m$/i', $maxphp2)) {
1412 $maxphp2 = preg_replace('/m$/i', '', $maxphp2);
1415 if (preg_match('/g$/i', $maxphp2)) {
1416 $maxphp2 = preg_replace('/g$/i', '', $maxphp2);
1417 $maxphp2 *= 1024 * 1024;
1419 if (preg_match('/t$/i', $maxphp2)) {
1420 $maxphp2 = preg_replace('/t$/i', '', $maxphp2);
1421 $maxphp2 *= 1024 * 1024 * 1024;
1423 // Now $max and $maxphp and $maxphp2 are in Kb
1425 $maxphptoshow = $maxphptoshowparam = '';
1427 $maxmin = min($max, $maxphp);
1428 $maxphptoshow = $maxphp;
1429 $maxphptoshowparam = 'upload_max_filesize';
1432 $maxmin = min($max, $maxphp2);
1433 if ($maxphp2 < $maxphp) {
1434 $maxphptoshow = $maxphp2;
1435 $maxphptoshowparam = 'post_max_size';
1440 print '<script type="text/javascript
">
1441 $(document).ready(function() {
1442 jQuery("#fileinstall
").on("change
", function() {
1443 if(this.files[0].size > '.($maxmin * 1024).') {
1444 alert("'.dol_escape_js($langs->transnoentitiesnoconv("ErrorFileSizeTooLarge")).'");
1450 // MAX_FILE_SIZE doit précéder le champ input de type file
1451 print '<input type="hidden
" name="MAX_FILE_SIZE
" value="'.($maxmin * 1024).'">';
1454 print '<input class="flat minwidth400
" type="file
" name="fileinstall
" id="fileinstall
">';
1456 print '<input type="submit
" name="send
" value="'.dol_escape_htmltag($langs->trans("Upload")).'" class="button small
">';
1458 if (getDolGlobalString('MAIN_UPLOAD_DOC')) {
1460 $langs->load('other');
1462 print info_admin($langs->trans("ThisLimitIsDefinedInSetup
", $max, $maxphptoshow, $maxphptoshowparam), 1);
1465 print ' ('.$langs->trans("UploadDisabled
").')';
1473 print '<div class="center
"><div class="logo_setup
"></div></div>';
1475 print $langs->trans("UnpackPackageInModulesRoot
", $dirins).'<br>';
1476 print '<b>'.$langs->trans("StepNb
", 4).'</b>: ';
1477 print $langs->trans("SetupIsReadyForUse
", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home
").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules
")).'<br>';
1481 if (!empty($result['return'])) {
1484 foreach ($result['return'] as $value) {
1489 print dol_get_fiche_end();
1492if ($mode == 'develop') {
1493 print dol_get_fiche_head($head, $mode, '', -1);
1500 print '<table summary="list_of_modules
" class="noborder centpercent
">'."\n
";
1501 print '<tr class="liste_titre
">'."\n
";
1502 //print '<td>'.$langs->trans("Logo
").'</td>';
1503 print '<td colspan="2
">'.$langs->trans("DevelopYourModuleDesc
").'</td>';
1504 print '<td>'.$langs->trans("URL
").'</td>';
1507 print '<tr class="oddeven
" height="80
">'."\n
";
1508 print '<td class="center
">';
1509 print '<div class="imgmaxheight50 logo_setup
"></div>';
1511 print '<td>'.$langs->trans("TryToUseTheModuleBuilder
", $langs->transnoentitiesnoconv("ModuleBuilder
")).'</td>';
1512 print '<td class="maxwidth300
">';
1513 if (isModEnabled('modulebuilder')) {
1514 print $langs->trans("SeeTopRightMenu
");
1516 print '<span class="opacitymedium
">'.$langs->trans("ModuleMustBeEnabledFirst
", $langs->transnoentitiesnoconv("ModuleBuilder
")).'</span>';
1521 print '<tr class="oddeven
" height="80
">'."\n
";
1522 $url = 'https://partners.dolibarr.org';
1523 print '<td class="center
">';
1524 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>';
1526 print '<td>'.$langs->trans("DoliPartnersDesc
").'</td>';
1527 print '<td><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">';
1528 print img_picto('', 'url', 'class="pictofixedwidth
"');
1529 print $url.'</a></td>';
1534 print dol_get_fiche_end();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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).
unActivateModule($value, $requiredby=1)
Disable a module.
activateModule($value, $withdeps=1, $noconfverification=0)
Enable a module.
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.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
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.
dolGetModulesDirs($subdir='')
Return list of directories that contain modules.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
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'.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
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...
treeview li table
No Email.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
document_preview(file, type, title)
Function show document preview.
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.