32 if (!defined(
'CSRFCHECK_WITH_TOKEN') && (empty($_GET[
'action']) || $_GET[
'action'] !=
'reset')) {
33 define(
'CSRFCHECK_WITH_TOKEN',
'1');
37 require
'../main.inc.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/admin/dolistore/class/dolistore.class.php';
45 $langs->loadLangs(array(
"errors",
"admin",
"modulebuilder"));
49 $mode =
GETPOST(
'mode',
'alpha');
50 if ($mode ==
'common' || $mode ==
'commonkanban')
51 dolibarr_set_const($db,
"MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode,
'chaine', 0,
'', $conf->entity);
53 $mode = (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ?
'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT);
56 $action =
GETPOST(
'action',
'aZ09');
57 $value =
GETPOST(
'value',
'alpha');
58 $page_y =
GETPOST(
'page_y',
'int');
59 $search_keyword =
GETPOST(
'search_keyword',
'alpha');
60 $search_status =
GETPOST(
'search_status',
'alpha');
61 $search_nature =
GETPOST(
'search_nature',
'alpha');
62 $search_version =
GETPOST(
'search_version',
'alpha');
67 $options[
'per_page'] = 20;
68 $options[
'categorie'] = ((int) (
GETPOST(
'categorie',
'int') ?
GETPOST(
'categorie',
'int') : 0));
69 $options[
'start'] = ((int) (
GETPOST(
'start',
'int') ?
GETPOST(
'start',
'int') : 0));
70 $options[
'end'] = ((int) (
GETPOST(
'end',
'int') ?
GETPOST(
'end',
'int') : 0));
71 $options[
'search'] =
GETPOST(
'search_keyword',
'alpha');
80 'hr'=>array(
'position'=>
'001',
'label'=>$langs->trans(
"ModuleFamilyHr")),
81 'crm'=>array(
'position'=>
'006',
'label'=>$langs->trans(
"ModuleFamilyCrm")),
82 'srm'=>array(
'position'=>
'007',
'label'=>$langs->trans(
"ModuleFamilySrm")),
83 'financial'=>array(
'position'=>
'009',
'label'=>$langs->trans(
"ModuleFamilyFinancial")),
84 'products'=>array(
'position'=>
'012',
'label'=>$langs->trans(
"ModuleFamilyProducts")),
85 'projects'=>array(
'position'=>
'015',
'label'=>$langs->trans(
"ModuleFamilyProjects")),
86 'ecm'=>array(
'position'=>
'018',
'label'=>$langs->trans(
"ModuleFamilyECM")),
87 'technic'=>array(
'position'=>
'021',
'label'=>$langs->trans(
"ModuleFamilyTechnic")),
88 'portal'=>array(
'position'=>
'040',
'label'=>$langs->trans(
"ModuleFamilyPortal")),
89 'interface'=>array(
'position'=>
'050',
'label'=>$langs->trans(
"ModuleFamilyInterface")),
90 'base'=>array(
'position'=>
'060',
'label'=>$langs->trans(
"ModuleFamilyBase")),
91 'other'=>array(
'position'=>
'100',
'label'=>$langs->trans(
"ModuleFamilyOther")),
95 if (!
GETPOST(
'buttonreset',
'alpha')) {
96 if ($search_keyword) {
97 $param .=
'&search_keyword='.urlencode($search_keyword);
99 if ($search_status && $search_status !=
'-1') {
100 $param .=
'&search_status='.urlencode($search_status);
102 if ($search_nature && $search_nature !=
'-1') {
103 $param .=
'&search_nature='.urlencode($search_nature);
105 if ($search_version && $search_version !=
'-1') {
106 $param .=
'&search_version='.urlencode($search_version);
110 $dirins = DOL_DOCUMENT_ROOT.
'/custom';
111 $urldolibarrmodules =
'https://www.dolistore.com/';
114 $hookmanager->initHooks(array(
'adminmodules',
'globaladmin'));
123 $parameters = array();
124 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
129 if (
GETPOST(
'buttonreset',
'alpha')) {
130 $search_keyword =
'';
133 $search_version =
'';
136 if ($action ==
'install') {
140 $original_file = basename($_FILES[
"fileinstall"][
"name"]);
141 $original_file = preg_replace(
'/\s*\(\d+\)\.zip$/i',
'.zip', $original_file);
142 $newfile = $conf->admin->dir_temp.
'/'.$original_file.
'/'.$original_file;
144 if (!$original_file) {
145 $langs->load(
"Error");
146 setEventMessages($langs->trans(
"ErrorModuleFileRequired"),
null,
'warnings');
149 if (!$error && !preg_match(
'/\.zip$/i', $original_file)) {
150 $langs->load(
"errors");
151 setEventMessages($langs->trans(
"ErrorFileMustBeADolibarrPackage", $original_file),
null,
'errors');
154 if (!$error && !preg_match(
'/^(module[a-zA-Z0-9]*|theme)_.*\-([0-9][0-9\.]*)\.zip$/i', $original_file)) {
155 $langs->load(
"errors");
156 setEventMessages($langs->trans(
"ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file,
'module_*-x.y*.zip'),
null,
'errors');
159 if (empty($_FILES[
'fileinstall'][
'tmp_name'])) {
160 $langs->load(
"errors");
167 if ($original_file) {
169 dol_mkdir($conf->admin->dir_temp.
'/'.$original_file);
172 $tmpdir = preg_replace(
'/\.zip$/i',
'', $original_file).
'.dir';
175 dol_mkdir($conf->admin->dir_temp.
'/'.$tmpdir);
178 $result =
dol_move_uploaded_file($_FILES[
'fileinstall'][
'tmp_name'], $newfile, 1, 0, $_FILES[
'fileinstall'][
'error']);
180 $result =
dol_uncompress($newfile, $conf->admin->dir_temp.
'/'.$tmpdir);
182 if (!empty($result[
'error'])) {
183 $langs->load(
"errors");
184 setEventMessages($langs->trans($result[
'error'], $original_file),
null,
'errors');
188 $modulename = preg_replace(
'/module_/',
'', $original_file);
189 $modulename = preg_replace(
'/\-([0-9][0-9\.]*)\.zip$/i',
'', $modulename);
191 $modulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/'.$modulename;
194 $modulenamedir = $conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulename;
197 setEventMessages($langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat").
'<br>'.$langs->trans(
"ErrorModuleFileSeemsToHaveAWrongFormat2", $modulename,
'htdocs/'.$modulename),
null,
'errors');
206 dol_syslog(
"Uncompress of module file is a success.");
208 $modulenamearrays = array();
209 if (
dol_is_file($modulenamedir.
'/metapackage.conf')) {
211 $metafile = file_get_contents($modulenamedir.
'/metapackage.conf');
212 $modulenamearrays = explode(
"\n", $metafile);
214 $modulenamearrays[$modulename] = $modulename;
217 foreach ($modulenamearrays as $modulenameval) {
218 if (strpos($modulenameval,
'#') === 0) {
221 if (strpos($modulenameval,
'//') === 0) {
224 if (!trim($modulenameval)) {
231 dol_syslog(
"We copy now directory ".$conf->admin->dir_temp.
'/'.$tmpdir.
'/htdocs/'.$modulenameval.
" into target dir ".$dirins.
'/'.$modulenameval);
232 $result =
dolCopyDir($modulenamedir, $dirins.
'/'.$modulenameval,
'0444', 1);
234 dol_syslog(
'Failed to call dolCopyDir result='.$result.
" with param ".$modulenamedir.
" and ".$dirins.
'/'.$modulenameval, LOG_WARNING);
235 $langs->load(
"errors");
236 setEventMessages($langs->trans(
"ErrorFailToCopyDir", $modulenamedir, $dirins.
'/'.$modulenameval),
null,
'errors');
243 setEventMessages($langs->trans(
"ErrorFailToRenameFile", $_FILES[
'fileinstall'][
'tmp_name'], $newfile),
null,
'errors');
249 setEventMessages($langs->trans(
"SetupIsReadyForUse", DOL_URL_ROOT.
'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv(
"Home").
' - '.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Modules")),
null,
'warnings');
253 if ($action ==
'set' && $user->admin) {
255 dolibarr_set_const($db,
"MAIN_IHM_PARAMS_REV", (
int) $conf->global->MAIN_IHM_PARAMS_REV + 1,
'chaine', 0,
'', $conf->entity);
256 if (!empty($resarray[
'errors'])) {
260 if ($resarray[
'nbperms'] > 0) {
261 $tmpsql =
"SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.
"user WHERE admin <> 1";
262 $resqltmp = $db->query($tmpsql);
264 $obj = $db->fetch_object($resqltmp);
266 if ($obj && $obj->nb > 1) {
267 $msg = $langs->trans(
'ModuleEnabledAdminMustCheckRights');
275 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
277 } elseif ($action ==
'reset' && $user->admin &&
GETPOST(
'confirm') ==
'yes') {
279 dolibarr_set_const($db,
"MAIN_IHM_PARAMS_REV", (
int) $conf->global->MAIN_IHM_PARAMS_REV + 1,
'chaine', 0,
'', $conf->entity);
283 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mode=".$mode.$param.($page_y ?
'&page_y='.$page_y :
''));
296 $morecss = array(
"/admin/dolistore/css/dolistore.css");
304 $help_url =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
305 llxHeader(
'', $langs->trans(
"Setup"),
$help_url,
'',
'',
'', $morejs, $morecss, 0, 0);
311 $arrayofnatures = array(
'core'=>$langs->transnoentitiesnoconv(
"NativeModules"),
'external'=>$langs->transnoentitiesnoconv(
"External").
' - ['.$langs->trans(
"AllPublishers").
']');
312 $arrayofwarnings = array();
313 $arrayofwarningsext = array();
321 $modNameLoaded = array();
323 foreach ($modulesdir as $dir) {
326 dol_syslog(
"Scan directory ".$dir.
" for module descriptor files (modXXX.class.php)");
327 $handle = @opendir($dir);
328 if (is_resource($handle)) {
329 while (($file = readdir($handle)) !==
false) {
331 if (is_readable($dir.$file) && substr($file, 0, 3) ==
'mod' && substr($file,
dol_strlen($file) - 10) ==
'.class.php') {
332 $modName = substr($file, 0,
dol_strlen($file) - 10);
335 if (!empty($modNameLoaded[$modName])) {
336 $mesg =
"Error: Module ".$modName.
" was found twice: Into ".$modNameLoaded[$modName].
" and ".$dir.
". You probably have an old file on your disk.<br>";
343 $res = include_once $dir.$file;
344 if (class_exists($modName)) {
346 $objMod =
new $modName($db);
347 $modNameLoaded[$modName] = $dir;
348 if (!$objMod->numero > 0 && $modName !=
'modUser') {
349 dol_syslog(
'The module descriptor '.$modName.
' must have a numero property', LOG_ERR);
351 $j = $objMod->numero;
353 $modulequalified = 1;
356 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
357 if ($objMod->version ==
'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) {
358 $modulequalified = 0;
360 if ($objMod->version ==
'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) {
361 $modulequalified = 0;
363 if (preg_match(
'/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
364 $modulequalified = 0;
368 if (!empty($objMod->hidden)) {
369 $modulequalified = 0;
372 if ($modulequalified > 0) {
374 $external = ($objMod->isCoreOrExternalModule() ==
'external');
377 $arrayofnatures[
'external_'.$publisher] = $langs->trans(
"External").
' - '.$publisher;
379 $arrayofnatures[
'external_'] = $langs->trans(
"External").
' - '.$langs->trans(
"UnknownPublishers");
382 ksort($arrayofnatures);
385 $filename[$i] = $modName;
386 $modules[$modName] = $objMod;
389 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
390 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
391 $familykey = key($objMod->familyinfo);
393 $familykey = $objMod->family;
396 $moduleposition = ($objMod->module_position ? $objMod->module_position :
'50');
397 if ($objMod->isCoreOrExternalModule() ==
'external' && $moduleposition < 100000) {
399 $moduleposition =
'80';
403 if (!empty($objMod->warnings_activation)) {
404 $arrayofwarnings[$modName] = $objMod->warnings_activation;
406 if (!empty($objMod->warnings_activation_ext)) {
407 $arrayofwarningsext[$modName] = $objMod->warnings_activation_ext;
410 $familyposition = (empty($familyinfo[$familykey][
'position']) ? 0 : $familyinfo[$familykey][
'position']);
411 $listOfOfficialModuleGroups = array(
'hr',
'technic',
'interface',
'technic',
'portal',
'financial',
'crm',
'base',
'products',
'srm',
'ecm',
'projects',
'other');
412 if ($external && !in_array($familykey, $listOfOfficialModuleGroups)) {
414 if (is_numeric($familyposition)) {
415 $familyposition = sprintf(
"%03d", (
int) $familyposition + 100);
419 $orders[$i] = $familyposition.
"_".$familykey.
"_".$moduleposition.
"_".$j;
422 $specialstring =
'unknown';
423 if ($objMod->version ==
'development' || $objMod->version ==
'experimental') {
424 $specialstring =
'expdev';
426 if (isset($categ[$specialstring])) {
427 $categ[$specialstring]++;
429 $categ[$specialstring] = 1;
434 dol_syslog(
"Module ".get_class($objMod).
" not qualified");
437 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
440 print
"Warning bad descriptor file : ".$dir.$file.
" (Class ".$modName.
" not found into file)<br>";
443 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
450 dol_syslog(
"htdocs/admin/modules.php: Failed to open directory ".$dir.
". See permission and open_basedir option.", LOG_WARNING);
454 if ($action ==
'reset_confirm' && $user->admin) {
455 if (!empty($modules[$value])) {
456 $objMod = $modules[$value];
458 if (!empty($objMod->langfiles)) {
459 $langs->loadLangs($objMod->langfiles);
463 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?value='.$value.
'&mode='.$mode.$param, $langs->trans(
'ConfirmUnactivation'), $langs->trans(
GETPOST(
'confirm_message_code')),
'reset',
'',
'no', 1);
474 $nbofactivatedmodules = count($conf->modules);
487 if ($mode ==
'common' || $mode ==
'commonkanban') {
488 $desc = $langs->trans(
"ModulesDesc",
'{picto}');
489 $desc .=
' '.$langs->trans(
"ModulesDesc2",
'{picto2}');
490 $desc = str_replace(
'{picto}',
img_picto(
'',
'switch_off',
'class="size15x"'), $desc);
491 $desc = str_replace(
'{picto2}',
img_picto(
'',
'setup',
'class="size15x"'), $desc);
492 if (!count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) {
493 $deschelp =
'<div class="info hideonsmartphone">'.$desc.
"<br></div><br>\n";
496 if ($mode ==
'marketplace') {
499 if ($mode ==
'deploy') {
500 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDeployDesc", $langs->transnoentitiesnoconv(
"AvailableModules")).
"<br></div><br>\n";
502 if ($mode ==
'develop') {
503 $deschelp =
'<div class="info hideonsmartphone">'.$langs->trans(
"ModulesDevelopDesc").
"<br></div><br>\n";
509 if ($mode ==
'common' || $mode ==
'commonkanban') {
512 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
513 print
'<input type="hidden" name="token" value="'.newToken().
'">';
514 if (isset($optioncss) && $optioncss !=
'') {
515 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
517 if (isset($sortfield) && $sortfield !=
'') {
518 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
520 if (isset($sortorder) && $sortorder !=
'') {
521 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
523 if (isset($page) && $page !=
'') {
524 print
'<input type="hidden" name="page" value="'.$page.
'">';
526 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
532 $moreforfilter =
'<div class="valignmiddle">';
534 $moreforfilter .=
'<div class="floatright right pagination paddingtop --module-list"><ul><li>';
535 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'CheckForModuleUpdate'), $langs->trans(
'CheckForModuleUpdate').
'<br>'.$langs->trans(
'CheckForModuleUpdateHelp'),
'fa fa-sync', $_SERVER[
"PHP_SELF"].
'?action=checklastversion&token='.
newToken().
'&mode='.$mode.$param,
'', 1, array(
'morecss'=>
'reposition'));
537 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.$param,
'', ($mode ==
'common' ? 2 : 1), array(
'morecss'=>
'reposition'));
538 $moreforfilter .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=commonkanban'.$param,
'', ($mode ==
'commonkanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
539 $moreforfilter .=
'</li></ul></div>';
543 $moreforfilter .=
'<div class="divfilteralone colorbacktimesheet float valignmiddle">';
544 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
545 $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')).
'">';
546 $moreforfilter .=
'</div>';
547 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
548 $moreforfilter .=
$form->selectarray(
'search_nature', $arrayofnatures,
dol_escape_htmltag($search_nature), $langs->trans(
'Origin'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth250', 1);
549 $moreforfilter .=
'</div>';
551 $array_version = array(
'stable'=>$langs->transnoentitiesnoconv(
"Stable"));
552 if ($conf->global->MAIN_FEATURES_LEVEL < 0) {
553 $array_version[
'deprecated'] = $langs->trans(
"Deprecated");
555 if ($conf->global->MAIN_FEATURES_LEVEL > 0) {
556 $array_version[
'experimental'] = $langs->trans(
"Experimental");
558 if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
559 $array_version[
'development'] = $langs->trans(
"Development");
561 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
562 $moreforfilter .=
$form->selectarray(
'search_version', $array_version, $search_version, $langs->trans(
'Version'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
563 $moreforfilter .=
'</div>';
565 $moreforfilter .=
'<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
566 $moreforfilter .=
$form->selectarray(
'search_status', array(
'active'=>$langs->transnoentitiesnoconv(
"Enabled"),
'disabled'=>$langs->transnoentitiesnoconv(
"Disabled")), $search_status, $langs->trans(
'Status'), 0, 0,
'', 0, 0, 0,
'',
'maxwidth150', 1);
567 $moreforfilter .=
'</div>';
568 $moreforfilter .=
' ';
569 $moreforfilter .=
'<div class="divsearchfield valignmiddle inline-block">';
570 $moreforfilter .=
'<input type="submit" name="buttonsubmit" class="button small" value="'.dol_escape_htmltag($langs->trans(
"Refresh")).
'">';
571 if ($search_keyword || ($search_nature && $search_nature !=
'-1') || ($search_version && $search_version !=
'-1') || ($search_status && $search_status !=
'-1')) {
572 $moreforfilter .=
' ';
573 $moreforfilter .=
'<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dol_escape_htmltag($langs->trans(
"Reset")).
'">';
575 $moreforfilter .=
'</div>';
576 $moreforfilter .=
'</div>';
578 $moreforfilter .=
'</div>';
580 if (!empty($moreforfilter)) {
581 print $moreforfilter;
582 $parameters = array();
583 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
584 print $hookmanager->resPrint;
589 print
'<div class="clearboth"></div><br>';
591 $object =
new stdClass();
592 $parameters = array();
593 $reshook = $hookmanager->executeHooks(
'insertExtraHeader', $parameters, $object, $action);
598 $disabled_modules = array();
599 if (!empty($_SESSION[
"disablemodules"])) {
600 $disabled_modules = explode(
',', $_SESSION[
"disablemodules"]);
605 $foundoneexternalmodulewithupdate = 0;
607 $atleastonequalified = 0;
608 $atleastoneforfamily = 0;
610 foreach ($orders as $key => $value) {
612 $tab = explode(
'_', $value);
613 $familykey = $tab[1];
614 $module_position = $tab[2];
616 $modName = $filename[$key];
619 $objMod = $modules[$modName];
622 if ($mode ==
'expdev' && $objMod->version !=
'development' && $objMod->version !=
'experimental') {
626 if (!$objMod->getName()) {
627 dol_syslog(
"Error for module ".$key.
" - Property name of module looks empty", LOG_WARNING);
631 $modulenameshort = strtolower(preg_replace(
'/^mod/i',
'', get_class($objMod)));
632 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
635 $modulename = $objMod->getName();
636 $moduletechnicalname = $objMod->name;
637 $moduledesc = $objMod->getDesc();
638 $moduledesclong = $objMod->getDescLong();
639 $moduleauthor = $objMod->getPublisher();
642 if ($search_keyword) {
644 if (preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $modulename)
645 || preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduletechnicalname)
646 || ($moduledesc && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduledesc))
647 || ($moduledesclong && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduledesclong))
648 || ($moduleauthor && preg_match(
'/'.preg_quote($search_keyword,
'/').
'/i', $moduleauthor))
656 if ($search_status) {
657 if ($search_status ==
'active' && empty($conf->global->$const_name)) {
660 if ($search_status ==
'disabled' && !empty($conf->global->$const_name)) {
664 if ($search_nature) {
665 if (preg_match(
'/^external/', $search_nature) && $objMod->isCoreOrExternalModule() !=
'external') {
669 if (preg_match(
'/^external_(.*)$/', $search_nature, $reg)) {
675 if (!$reg[1] && !empty($publisher)) {
679 if ($search_nature ==
'core' && $objMod->isCoreOrExternalModule() ==
'external') {
683 if ($search_version) {
684 if (($objMod->version ==
'development' || $objMod->version ==
'experimental' || preg_match(
'/deprecated/', $objMod->version)) && $search_version ==
'stable') {
687 if ($objMod->version !=
'development' && ($search_version ==
'development')) {
690 if ($objMod->version !=
'experimental' && ($search_version ==
'experimental')) {
693 if (!preg_match(
'/deprecated/', $objMod->version) && ($search_version ==
'deprecated')) {
698 $atleastonequalified++;
701 if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
702 foreach ($objMod->langfiles as $domain) {
703 $langs->load($domain);
708 if ($familykey != $oldfamily) {
710 print
'</table></div><br>';
713 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
717 if ($mode ==
'commonkanban') {
718 print
'<div class="box-flex-container">';
720 print
'<div class="div-table-responsive">';
721 print
'<table class="tagtable liste" summary="list_of_modules">'.
"\n";
724 $atleastoneforfamily = 0;
727 $atleastoneforfamily++;
729 if ($familykey != $oldfamily) {
730 $familytext = empty($familyinfo[$familykey][
'label']) ? $familykey : $familyinfo[$familykey][
'label'];
731 $oldfamily = $familykey;
735 $version = $objMod->getVersion(0);
737 if (preg_match(
'/development/i', $version)) {
738 $versiontrans .=
img_warning($langs->trans(
"Development"),
'',
'floatleft paddingright');
740 if (preg_match(
'/experimental/i', $version)) {
741 $versiontrans .=
img_warning($langs->trans(
"Experimental"),
'',
'floatleft paddingright');
743 if (preg_match(
'/deprecated/i', $version)) {
744 $versiontrans .=
img_warning($langs->trans(
"Deprecated"),
'',
'floatleft paddingright');
746 if ($objMod->isCoreOrExternalModule() ==
'external' || preg_match(
'/development|experimental|deprecated/i', $version)) {
747 $versiontrans .= $objMod->getVersion(1);
750 if ($objMod->isCoreOrExternalModule() ==
'external'
752 $action ==
'checklastversion'
755 || !empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)
758 $checkRes = $objMod->checkForUpdate();
760 setEventMessage($objMod->getName().
' : '.$versiontrans.
' -> '.$objMod->lastVersion);
761 } elseif ($checkRes < 0) {
762 setEventMessage($objMod->getName().
' '.$langs->trans(
'CheckVersionFail'),
'warnings');
768 if ($objMod->isCoreOrExternalModule() ==
'external') {
769 $imginfo =
"info_black";
772 $codeenabledisable =
'';
776 if (in_array($modulenameshort, $disabled_modules)) {
777 $objMod->disabled =
true;
781 if (!empty($conf->global->$const_name)) {
784 if (!empty($arrayofwarnings[$modName])) {
785 $codeenabledisable .=
'<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
788 if (!empty($objMod->disabled)) {
789 $codeenabledisable .= $langs->trans(
"Disabled");
790 } elseif (!empty($objMod->always_enabled) || ((
isModEnabled(
'multicompany') && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) {
791 if (method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
792 $codeenabledisable .= $langs->trans(
"Used");
794 $codeenabledisable .=
img_picto($langs->trans(
"Required"),
'switch_on',
'',
false, 0, 0,
'',
'opacitymedium valignmiddle');
801 if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod,
'alreadyUsed') && $objMod->alreadyUsed()) {
802 $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.
'">';
803 $codeenabledisable .=
img_picto($langs->trans(
"Activated"),
'switch_on');
804 $codeenabledisable .=
'</a>';
806 $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.
'">';
807 $codeenabledisable .=
img_picto($langs->trans(
"Activated"),
'switch_on');
808 $codeenabledisable .=
'</a>';
813 if (!empty($objMod->config_page_url) && !$disableSetup) {
814 $backtourlparam =
'';
815 if ($search_keyword !=
'') {
816 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_keyword='.urlencode($search_keyword);
818 if ($search_nature > -1) {
819 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_nature='.urlencode($search_nature);
821 if ($search_version > -1) {
822 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_version='.urlencode($search_version);
824 if ($search_status > -1) {
825 $backtourlparam .= ($backtourlparam ?
'&' :
'?').
'search_status='.urlencode($search_status);
827 $backtourl = $_SERVER[
"PHP_SELF"].$backtourlparam;
830 if (is_array($objMod->config_page_url)) {
832 foreach ($objMod->config_page_url as $page) {
835 $codetoconfig .=
'<a href="'.$urlpage.
'" title="'.$langs->trans($page).
'">'.
img_picto(ucfirst($page),
"setup").
'</a>';
838 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) {
839 $urltouse =
dol_buildpath(
'/'.$regs[2].
'/admin/'.$regs[1], 1);
840 $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"',
false, 0, 0,
'',
'fa-15').
'</a>';
842 $urltouse = $urlpage;
843 $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"',
false, 0, 0,
'',
'fa-15').
'</a>';
847 } elseif (preg_match(
'/^([^@]+)@([^@]+)$/i', (
string) $objMod->config_page_url, $regs)) {
848 $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"',
false, 0, 0,
'',
'fa-15').
'</a>';
850 $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"',
false, 0, 0,
'',
'fa-15').
'</a>';
853 $codetoconfig .=
img_picto($langs->trans(
"NothingToSetup"),
"setup",
'class="opacitytransp" style="padding-right: 6px"',
false, 0, 0,
'',
'fa-15');
857 if (!empty($objMod->always_enabled)) {
859 } elseif (!empty($objMod->disabled)) {
860 $codeenabledisable .= $langs->trans(
"Disabled");
863 $warningmessage =
'';
864 if (!empty($arrayofwarnings[$modName])) {
865 $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";
866 foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage) {
867 if (preg_match(
'/^always/', $keycountry) || ($mysoc->country_code && preg_match(
'/^'.$mysoc->country_code.
'/', $keycountry))) {
868 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
872 if ($objMod->isCoreOrExternalModule() ==
'external' && !empty($arrayofwarningsext)) {
873 $codeenabledisable .=
'<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.
') -->'.
"\n";
874 foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry) {
875 $keymodulelowercase = strtolower(preg_replace(
'/^mod/',
'', $keymodule));
876 if (in_array($keymodulelowercase, $conf->modules)) {
877 foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage) {
878 if (preg_match(
'/^always/', $keycountry) || ($mysoc->country_code && preg_match(
'/^'.$mysoc->country_code.
'/', $keycountry))) {
879 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
880 $warningmessage .= ($warningmessage ?
"\n" :
"").($warningmessage ?
"\n" :
"").$langs->trans(
"Module").
' : '.$objMod->getName();
881 if (!empty($objMod->editor_name)) {
882 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"Publisher").
' : '.$objMod->editor_name;
884 if (!empty($objMod->editor_name)) {
885 $warningmessage .= ($warningmessage ?
"\n" :
"").$langs->trans(
"ModuleTriggeringThisWarning").
' : '.$modules[$keymodule]->getName();
892 $codeenabledisable .=
'<!-- Message to show: '.$warningmessage.
' -->'.
"\n";
893 $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.
'"';
894 if ($warningmessage) {
895 $codeenabledisable .=
' onclick="return confirm(\''.dol_escape_js($warningmessage).
'\');
"';
897 $codeenabledisable .= '>';
898 $codeenabledisable .= img_picto($langs->trans("Disabled
"), 'switch_off');
899 $codeenabledisable .= "</a>\n
";
903 $codetoconfig .= img_picto($langs->trans("NothingToSetup
"), "setup
", 'class="opacitytransp
" style="padding-right: 6px
"');
906 if ($mode == 'commonkanban') {
908 print $objMod->getKanbanView($codeenabledisable, $codetoconfig);
910 print '<tr class="oddeven
">'."\n
";
911 if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) {
912 print '<td class="width50
">'.$linenum.'</td>';
915 // Picto + Name of module
916 print ' <td class="tdoverflowmax300
" title="'.dol_escape_htmltag($objMod->getName()).'">';
918 //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
919 //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
920 if (!empty($objMod->picto)) {
921 if (preg_match('/^\//i', $objMod->picto)) {
922 print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"', 1);
924 print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule paddingrightonly
"');
927 print img_object($alttext, 'generic', 'class="valignmiddle paddingrightonly
"');
929 print ' <span class="valignmiddle
">'.$objMod->getName().'</span>';
933 print '<td class="valignmiddle tdoverflowmax300
">';
934 print nl2br($objMod->getDesc());
938 print '<td class="center nowrap
" style="width: 82px;
">';
939 //print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
940 print '<a href="javascript:
document_preview(\
''.DOL_URL_ROOT.
'/admin/modulehelp.php?id='.$objMod->numero.
'\',\
'text/html\',\''.dol_escape_js($langs->trans(
"Module")).
'\')
">'.img_picto(($objMod->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule
").' - ' : '').$langs->trans("ClickToShowDescription
"), $imginfo).'</a>';
944 print '<td class="center nowrap
" width="120px
">';
945 if ($objMod->needUpdate) {
946 $versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
947 print '<span class="badge badge-warning classfortooltip
" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
953 // Link enable/disable
954 print '<td class="center valignmiddle
" width="60px
">';
955 print $codeenabledisable;
959 print '<td class="tdsetuppicto right valignmiddle
" width="60px
">';
965 if ($objMod->needUpdate) {
966 $foundoneexternalmodulewithupdate++;
970 if ($action == 'checklastversion') {
971 if ($foundoneexternalmodulewithupdate) {
972 setEventMessages($langs->trans("ModuleUpdateAvailable
"), null, 'mesgs');
974 setEventMessages($langs->trans("NoExternalModuleWithUpdate
"), null, 'mesgs');
979 if ($mode == 'commonkanban') {
987 if (!$atleastonequalified) {
988 print '<br><span class="opacitymedium
">'.$langs->trans("NoDeployedModulesFoundWithThisSearchCriteria
").'</span><br><br>';
991 print dol_get_fiche_end();
995 // Show warning about external users
996 print info_admin(showModulesExludedForExternal($modules))."\n
";
1001 if ($mode == 'marketplace') {
1002 print dol_get_fiche_head($head, $mode, '', -1);
1009 print '<div class="div-table-responsive-no-min
">';
1010 print '<table summary="list_of_modules
" class="noborder centpercent
">'."\n
";
1011 print '<tr class="liste_titre
">'."\n
";
1012 print '<td class="hideonsmartphone
">'.$form->textwithpicto($langs->trans("Provider
"), $langs->trans("WebSiteDesc
")).'</td>';
1014 print '<td>'.$langs->trans("URL
").'</td>';
1017 print '<tr class="oddeven
">'."\n
";
1018 $url = 'https://www.dolistore.com';
1019 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>';
1020 print '<td><span class="opacitymedium
">'.$langs->trans("DoliStoreDesc
").'</span></td>';
1021 print '<td><a href="'.$url.'" target="_blank
" rel="noopener noreferrer external
">'.$url.'</a></td>';
1027 print dol_get_fiche_end();
1031 if (empty($conf->global->MAIN_DISABLE_DOLISTORE_SEARCH) && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
1032 // $options is array with filter criterias
1033 //var_dump($options);
1034 $dolistore->getRemoteCategories();
1035 $dolistore->getRemoteProducts($options);
1037 print '<span class="opacitymedium
">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
1039 $previouslink = $dolistore->get_previous_link();
1040 $nextlink = $dolistore->get_next_link();
1042 print '<div class="liste_titre liste_titre_bydiv centpercent
"><div class="divsearchfield
">';
1044 print '<form method="POST
" class="centpercent
" id="searchFormList
" action="'.urlencode($dolistore->url).'">';
1046 <input type="hidden
" name="token
" value="<?php echo
newToken(); ?>
">
1047 <input type="hidden
" name="mode
" value="marketplace
">
1048 <div class="divsearchfield
">
1049 <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>
1051 <div class="divsearchfield
">
1052 <input class="button buttongen
" value="<?php echo $langs->trans(
'Rechercher') ?>
" type="submit
">
1053 <a class="buttonreset
" href="<?php echo urlencode($dolistore->url) ?>
"><?php echo $langs->trans('Reset') ?></a>
1058 print $previouslink;
1063 print '</div></div>';
1064 print '<div class="clearboth
"></div>';
1068 <div id="category-tree-left
">
1071 echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content
1075 <div id="listing-content
">
1076 <table summary="list_of_modules
" id="list_of_modules
" class="productlist centpercent
">
1077 <tbody id="listOfModules
">
1078 <?php echo $dolistore->get_products(); ?>
1088 // Install external module
1090 if ($mode == 'deploy') {
1091 print dol_get_fiche_head($head, $mode, '', -1);
1095 $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
1096 $allowonlineinstall = true;
1098 if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) {
1099 $allowonlineinstall = false;
1102 $fullurl = '<a href="'.$urldolibarrmodules.'" target="_blank
" rel="noopener noreferrer
">'.$urldolibarrmodules.'</a>';
1104 if (!empty($allowonlineinstall)) {
1105 if (!in_array('/custom', explode(',', $dolibarr_main_url_root_alt))) {
1106 $message = info_admin($langs->trans("ConfFileMustContainCustom
", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
1110 if (!is_writable(dol_osencode($dirins))) {
1111 $langs->load("errors
");
1112 $message = info_admin($langs->trans("ErrorFailedToWriteInDir
", $dirins), 0, 0, '1', 'warning');
1116 $message = info_admin($langs->trans("NotExistsDirect
", $dirins).$langs->trans("InfDirAlt
").$langs->trans("InfDirExample
"));
1121 if (getDolGlobalString('MAIN_MESSAGE_INSTALL_MODULES_DISABLED_CONTACT_US')) {
1122 // Show clean message
1123 $message = info_admin($langs->trans('InstallModuleFromWebHasBeenDisabledContactUs'));
1125 // Show technical message
1126 $message = info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile
", $dolibarrdataroot.'/installmodules.lock'));
1131 if ($allowfromweb < 1) {
1132 print $langs->trans("SomethingMakeInstallFromWebNotPossible
");
1134 //print $langs->trans("SomethingMakeInstallFromWebNotPossible2
");
1140 if ($allowfromweb >= 0) {
1141 if ($allowfromweb == 1) {
1142 //print $langs->trans("ThisIsProcessToFollow
").'<br>';
1144 print $langs->trans("ThisIsAlternativeProcessToFollow
").'<br>';
1145 print '<b>'.$langs->trans("StepNb
", 1).'</b>: ';
1146 print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite
", '{s1}')).'<br>';
1147 print '<b>'.$langs->trans("StepNb
", 2).'</b>: ';
1148 print str_replace('{s1}', $fullurl, $langs->trans("DownloadPackageFromWebSite
", '{s1}')).'<br>';
1149 print '<b>'.$langs->trans("StepNb
", 3).'</b>: ';
1152 if ($allowfromweb == 1) {
1153 print '<span class="opacitymedium
">'.$langs->trans("UnpackPackageInModulesRoot
", $dirins).'</span><br>';
1157 print '<form enctype="multipart/form-data
" method="POST
" class="noborder
" action="'.$_SERVER["PHP_SELF"].'" name="forminstall
">';
1158 print '<input type="hidden
" name="token
" value="'.newToken().'">';
1159 print '<input type="hidden
" name="action
" value="install
">';
1160 print '<input type="hidden
" name="mode
" value="deploy
">';
1162 print $langs->trans("YouCanSubmitFile
");
1164 $max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
1165 $maxphp = @ini_get('upload_max_filesize'); // In unknown
1166 if (preg_match('/k$/i', $maxphp)) {
1167 $maxphp = preg_replace('/k$/i', '', $maxphp);
1168 $maxphp = $maxphp * 1;
1170 if (preg_match('/m$/i', $maxphp)) {
1171 $maxphp = preg_replace('/m$/i', '', $maxphp);
1172 $maxphp = $maxphp * 1024;
1174 if (preg_match('/g$/i', $maxphp)) {
1175 $maxphp = preg_replace('/g$/i', '', $maxphp);
1176 $maxphp = $maxphp * 1024 * 1024;
1178 if (preg_match('/t$/i', $maxphp)) {
1179 $maxphp = preg_replace('/t$/i', '', $maxphp);
1180 $maxphp = $maxphp * 1024 * 1024 * 1024;
1182 $maxphp2 = @ini_get('post_max_size'); // In unknown
1183 if (preg_match('/k$/i', $maxphp2)) {
1184 $maxphp2 = preg_replace('/k$/i', '', $maxphp2);
1185 $maxphp2 = $maxphp2 * 1;
1187 if (preg_match('/m$/i', $maxphp2)) {
1188 $maxphp2 = preg_replace('/m$/i', '', $maxphp2);
1189 $maxphp2 = $maxphp2 * 1024;
1191 if (preg_match('/g$/i', $maxphp2)) {
1192 $maxphp2 = preg_replace('/g$/i', '', $maxphp2);
1193 $maxphp2 = $maxphp2 * 1024 * 1024;
1195 if (preg_match('/t$/i', $maxphp2)) {
1196 $maxphp2 = preg_replace('/t$/i', '', $maxphp2);
1197 $maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
1199 // Now $max and $maxphp and $maxphp2 are in Kb
1201 $maxphptoshow = $maxphptoshowparam = '';
1203 $maxmin = min($max, $maxphp);
1204 $maxphptoshow = $maxphp;
1205 $maxphptoshowparam = 'upload_max_filesize';
1208 $maxmin = min($max, $maxphp2);
1209 if ($maxphp2 < $maxphp) {
1210 $maxphptoshow = $maxphp2;
1211 $maxphptoshowparam = 'post_max_size';
1216 print '<script type="text/javascript
">
1217 $(document).ready(function() {
1218 jQuery("#fileinstall
").on("change
", function() {
1219 if(this.files[0].size > '.($maxmin * 1024).') {
1220 alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'");
1226 // MAX_FILE_SIZE doit précéder le champ input de type file
1227 print '<input type="hidden
" name="MAX_FILE_SIZE
" value="'.($maxmin * 1024).'">';
1230 print '<input class="flat minwidth400
" type="file
" name="fileinstall
" id="fileinstall
"> ';
1232 print '<input type="submit
" name="send
" value="'.dol_escape_htmltag($langs->trans("Upload")).'" class="button">';
1234 if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
1236 $langs->load('other');
1238 print info_admin($langs->trans("ThisLimitIsDefinedInSetup
", $max, $maxphptoshow, $maxphptoshowparam), 1);
1241 print ' ('.$langs->trans("UploadDisabled
").')';
1249 print '<div class="center
"><div class="logo_setup
"></div></div>';
1251 print $langs->trans("UnpackPackageInModulesRoot
", $dirins).'<br>';
1252 print '<b>'.$langs->trans("StepNb
", 4).'</b>: ';
1253 print $langs->trans("SetupIsReadyForUse
").'<br>';
1257 if (!empty($result['return'])) {
1260 foreach ($result['return'] as $value) {
1265 print dol_get_fiche_end();
1268 if ($mode == 'develop') {
1269 print dol_get_fiche_head($head, $mode, '', -1);
1276 print "<table summary=\
"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
1277 print
"<tr class=\"liste_titre\">\n";
1279 print
'<td colspan="2">'.$langs->trans(
"DevelopYourModuleDesc").
'</td>';
1280 print
'<td>'.$langs->trans(
"URL").
'</td>';
1283 print
'<tr class="oddeven" height="80">'.
"\n";
1284 print
'<td class="left">';
1285 print
'<div class="imgmaxheight50 logo_setup"></div>';
1287 print
'<td>'.$langs->trans(
"TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv(
"ModuleBuilder")).
'</td>';
1288 print
'<td class="maxwidth300">';
1290 print $langs->trans(
"SeeTopRightMenu");
1292 print
'<span class="opacitymedium">'.$langs->trans(
"ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv(
"ModuleBuilder")).
'</span>';
1297 print
'<tr class="oddeven" height="80">'.
"\n";
1298 $url =
'https://partners.dolibarr.org';
1299 print
'<td class="left">';
1300 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>';
1302 print
'<td>'.$langs->trans(
"DoliPartnersDesc").
'</td>';
1303 print
'<td><a href="'.$url.
'" target="_blank" rel="noopener noreferrer external">'.$url.
'</a></td>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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)
Enable a module.
modules_prepare_head($nbofactivatedmodules, $nboftotalmodules)
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()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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='')
Make control on an uploaded file from an GUI page and move it to final destination.
dol_uncompress($inputfile, $outputdir)
Uncompress a file.
dol_is_file($pathoffile)
Return if path is a file.
dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement=null, $excludesubdir=0, $excludefileext=null)
Copy a dir to another dir.
dol_is_dir($folder)
Test if filename is a directory.
dolGetModulesDirs($subdir='')
Return list of modules directories.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
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)
document_preview(file, type, title)
Function show document preview.
$formconfirm
if ($action == 'delbookkeepingyear') {
table tableforfield button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.