25if (!defined(
'NOREQUIREMENU')) {
26 define(
'NOREQUIREMENU',
'1');
28if (!defined(
'NOTOKENRENEWAL')) {
29 define(
'NOTOKENRENEWAL',
'1');
34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
40$langs->loadLangs(array(
'errors',
'admin',
'modulebuilder',
'exports'));
42$mode =
GETPOST(
'mode',
'alpha');
43$action =
GETPOST(
'action',
'aZ09');
49if (empty($user->admin)) {
68$help_url =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
69llxHeader(
'', $langs->trans(
"Setup"), $help_url);
71print
'<!-- Force style container -->'.
"\n".
'<style>
80$arrayofnatures = array(
'core'=>$langs->transnoentitiesnoconv(
"Core"),
'external'=>$langs->transnoentitiesnoconv(
"External").
' - '.$langs->trans(
"AllPublishers"));
93$modNameLoaded = array();
95foreach ($modulesdir as $dir) {
98 dol_syslog(
"Scan directory ".$dir.
" for module descriptor files (modXXX.class.php)");
99 $handle = @opendir($dir);
100 if (is_resource($handle)) {
101 while (($file = readdir($handle)) !==
false) {
103 if (is_readable($dir.$file) && substr($file, 0, 3) ==
'mod' && substr($file,
dol_strlen($file) - 10) ==
'.class.php') {
104 $modName = substr($file, 0,
dol_strlen($file) - 10);
107 if (!empty($modNameLoaded[$modName])) {
108 $mesg =
"Error: Module ".$modName.
" was found twice: Into ".$modNameLoaded[$modName].
" and ".$dir.
". You probably have an old file on your disk.<br>";
115 $res = include_once $dir.$file;
116 if (class_exists($modName)) {
118 $objMod =
new $modName($db);
119 $modNameLoaded[$modName] = $dir;
121 if (!$objMod->numero > 0 && $modName !=
'modUser') {
122 dol_syslog(
'The module descriptor '.$modName.
' must have a numero property', LOG_ERR);
124 $j = $objMod->numero;
126 $modulequalified = 1;
129 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
131 $modulequalified = 0;
134 $modulequalified = 0;
137 $modulequalified = 0;
143 if ($modulequalified > 0) {
145 $external = ($objMod->isCoreOrExternalModule() ==
'external');
148 $arrayofnatures[
'external_'.$publisher] = $langs->trans(
"External").
' - '.$publisher;
150 $arrayofnatures[
'external_'] = $langs->trans(
"External").
' - '.$langs->trans(
"UnknownPublishers");
153 ksort($arrayofnatures);
157 if ($modulequalified > 0) {
158 $modules[$i] = $objMod;
159 $filename[$i] = $modName;
162 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
163 if (!is_array($familyinfo)) {
164 $familyinfo = array();
166 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
167 $familykey = key($objMod->familyinfo);
169 $familykey = $objMod->family;
172 $moduleposition = ($objMod->module_position ? $objMod->module_position :
'50');
173 if ($moduleposition ==
'50' && ($objMod->isCoreOrExternalModule() ==
'external')) {
174 $moduleposition =
'80';
177 if (empty($familyinfo[$familykey][
'position'])) {
178 $familyinfo[$familykey][
'position'] =
'0';
181 $orders[$i] = $familyinfo[$familykey][
'position'].
"_".$familykey.
"_".$moduleposition.
"_".$j;
185 $specialstring =
'unknown';
186 if ($objMod->version ==
'development' || $objMod->version ==
'experimental') {
187 $specialstring =
'expdev';
189 if (isset($categ[$specialstring])) {
190 $categ[$specialstring]++;
192 $categ[$specialstring] = 1;
197 dol_syslog(
"Module ".get_class($objMod).
" not qualified");
200 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
203 print
"Warning bad descriptor file : ".$dir.$file.
" (Class ".$modName.
" not found into file)<br>";
206 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
213 dol_syslog(
"htdocs/admin/modulehelp.php: Failed to open directory ".$dir.
". See permission and open_basedir option.", LOG_WARNING);
225foreach ($orders as $tmpkey => $tmpvalue) {
226 $tmpMod = $modules[$tmpkey];
227 if ($tmpMod->numero == $id) {
229 $modName = $filename[$tmpkey];
230 $dirofmodule = $dirmod[$tmpkey];
236$value = $orders[$key];
237$tab = explode(
'_', $value);
238$familyposition = $tab[0]; $familykey = $tab[1]; $module_position = $tab[2]; $numero = $tab[3];
245$modulename = $objMod->getName();
246$moduledesc = $objMod->getDesc();
247$moduleauthor = $objMod->getPublisher();
248$moduledir = strtolower(preg_replace(
'/^mod/i',
'', get_class($objMod)));
250$const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
252$text =
'<span class="opacitymedium">'.$langs->trans(
"LastActivationDate").
':</span> ';
254 $text .=
dol_print_date($objMod->getLastActivationDate(),
'dayhour');
256 $text .= $langs->trans(
"Disabled");
258$tmp = $objMod->getLastActivationInfo();
259$authorid = (empty($tmp[
'authorid']) ?
'' : $tmp[
'authorid']);
261 $tmpuser =
new User($db);
262 $tmpuser->fetch($authorid);
263 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationAuthor").
':</span> ';
264 $text .= $tmpuser->getNomUrl(-1);
266$ip = (empty($tmp[
'ip']) ?
'' : $tmp[
'ip']);
268 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationIP").
':</span> ';
271$lastactivationversion = (empty($tmp[
'lastactivationversion']) ?
'' : $tmp[
'lastactivationversion']);
272if ($lastactivationversion) {
273 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationVersion").
':</span> ';
274 $text .= $lastactivationversion;
279$title = ($modulename ? $modulename : $moduledesc);
281print
'<div class="centpercent">';
283$picto =
'object_'.$objMod->picto;
285print
load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0,
'',
'titlemodulehelp');
291 dol_syslog(
"Error for module ".$key.
" - Property name of module looks empty", LOG_WARNING);
295if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
296 foreach ($objMod->langfiles as $domain) {
297 $langs->load($domain);
305$version = $objMod->getVersion(0);
307if (preg_match(
'/development/i', $version)) {
308 $versiontrans .=
img_warning($langs->trans(
"Development"),
'style="float: left"');
310if (preg_match(
'/experimental/i', $version)) {
311 $versiontrans .=
img_warning($langs->trans(
"Experimental"),
'style="float: left"');
313if (preg_match(
'/deprecated/i', $version)) {
314 $versiontrans .=
img_warning($langs->trans(
"Deprecated"),
'style="float: left"');
316$versiontrans .= $objMod->getVersion(1);
320if ($objMod->isCoreOrExternalModule() ==
'external') {
321 $imginfo =
"info_black";
327if ($mode ==
'desc') {
329 $text .=
'<br>'.$moduledesc.
'<br><br><br>';
332 $moduledescriptorfile = get_class($objMod).
'.class.php';
333 $text .=
'<span class="opacitymedium">'.$langs->trans(
"DescriptorFile").
':</span> '.$moduledescriptorfile;
335 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"IdModule").
':</span> '.$objMod->numero;
337 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"Version").
':</span> '.$version;
340 if ($objMod->isCoreOrExternalModule() ==
'external') {
341 $tmpdirofmoduletoshow = preg_replace(
'/^'.preg_quote(DOL_DOCUMENT_ROOT,
'/').
'/',
'', $dirofmodule);
342 $textexternal .=
'<br><span class="opacitymedium">'.$langs->trans(
"Origin").
':</span> '.$langs->trans(
"ExternalModule").
' - '.$langs->trans(
"InstalledInto", $tmpdirofmoduletoshow);
344 global $dolibarr_allow_download_external_modules;
345 if (!empty($dolibarr_allow_download_external_modules) && preg_match(
'/\/custom\//', $dirofmodule)) {
347 $textexternal .=
' <a href="'.DOL_URL_ROOT.
'/admin/tools/export_files.php?export_type=externalmodule&what='.urlencode($moduledir).
'&compression=zip&zipfilename_template=module_'.$moduledir.
'-'.$version.
'.notorig" target="_blank" rel="noopener">'.
img_picto(
'',
'download').
'</a>';
350 if ($objMod->editor_name !=
'dolibarr') {
351 $textexternal .=
'<br><span class="opacitymedium">'.$langs->trans(
"Publisher").
':</span> '.(empty($objMod->editor_name) ? $langs->trans(
"Unknown") : $objMod->editor_name);
353 $editor_url = $objMod->editor_url;
354 if (!preg_match(
'/^http/', $editor_url)) {
355 $editor_url =
'http://'.$editor_url;
357 if (!empty($objMod->editor_url) && !preg_match(
'/dolibarr\.org/i', $objMod->editor_url)) {
358 $textexternal .= ($objMod->editor_name !=
'dolibarr' ?
' - ' :
'').
img_picto(
'',
'globe').
' <a href="'.$editor_url.
'" target="_blank" rel="noopener noreferrer external">'.$objMod->editor_url.
'</a>';
360 $text .= $textexternal;
363 $text .=
'<br><span class="opacitymedium">'.$langs->trans(
"Origin").
':</span> '.$langs->trans(
"Core").
'<br>';
366 $moduledesclong = $objMod->getDescLong();
367 if ($moduledesclong) {
368 $text .=
'<br><hr><div class="moduledesclong">'.$moduledesclong.
'<div>';
372if ($mode ==
'feature') {
373 $text .=
'<br><strong>'.$langs->trans(
"DependsOn").
':</strong> ';
374 if (is_array($objMod->depends) && count($objMod->depends)) {
376 foreach ($objMod->depends as $modulestringorarray) {
377 if (is_array($modulestringorarray)) {
378 $text .= ($i ?
', ' :
'').join(
', ', $modulestringorarray);
380 $text .= ($i ?
', ' :
'').$modulestringorarray;
385 $text .=
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
389 $text .=
'<br><strong>'.$langs->trans(
"RequiredBy").
':</strong> ';
390 if (is_array($objMod->requiredby) && count($objMod->requiredby)) {
392 foreach ($objMod->requiredby as $modulestringorarray) {
393 if (is_array($modulestringorarray)) {
394 $text .= ($i ?
', ' :
'').join(
', ', $modulestringorarray);
396 $text .= ($i ?
', ' :
'').$modulestringorarray;
401 $text .=
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
406 $text .=
'<br><strong>'.$langs->trans(
"AddDataTables").
':</strong> ';
407 $listofsqlfiles1 =
dol_dir_list(DOL_DOCUMENT_ROOT.
'/install/mysql/tables/',
'files', 0,
'llx.*-'.$moduledir.
'\.sql', array(
'\.key\.sql',
'\.sql\.back'));
408 $listofsqlfiles2 =
dol_dir_list(
dol_buildpath($moduledir.
'/sql/'),
'files', 0,
'llx.*\.sql', array(
'\.key\.sql',
'\.sql\.back'));
409 $sqlfiles = array_merge($listofsqlfiles1, $listofsqlfiles2);
411 if (count($sqlfiles) > 0) {
413 foreach ($sqlfiles as $val) {
414 $text .= ($i ?
', ' :
'').preg_replace(
'/\-'.$moduledir.
'$/',
'', preg_replace(
'/\.sql$/',
'', preg_replace(
'/llx_/',
'', $val[
'name'])));
418 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
423 $text .=
'<br><strong>'.$langs->trans(
"AddDictionaries").
':</strong> ';
424 if (isset($objMod->dictionaries) && isset($objMod->dictionaries[
'tablib']) && is_array($objMod->dictionaries[
'tablib']) && count($objMod->dictionaries[
'tablib'])) {
426 foreach ($objMod->dictionaries[
'tablib'] as $val) {
427 $text .= ($i ?
', ' :
'').$val;
431 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
436 $text .=
'<br><strong>'.$langs->trans(
"AddData").
':</strong> ';
439 $text .= $langs->trans(
"Yes").
' <span class="opacitymedium">('.$moduledir.
'/sql/data.sql)</span>';
441 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
446 $text .=
'<br><strong>'.$langs->trans(
"AddRemoveTabs").
':</strong> ';
447 if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) {
449 foreach ($objMod->tabs as $val) {
450 if (is_array($val)) {
453 if (is_string($val)) {
454 $tmp = explode(
':', $val, 3);
455 $text .= ($i ?
', ' :
'').$tmp[0].
':'.$tmp[1];
460 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
465 $text .=
'<br><strong>'.$langs->trans(
"AddModels").
':</strong> ';
466 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'models']) && $objMod->module_parts[
'models']) {
467 $text .= $langs->trans(
"Yes");
469 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
474 $text .=
'<br><strong>'.$langs->trans(
"AddSubstitutions").
':</strong> ';
475 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'substitutions']) && $objMod->module_parts[
'substitutions']) {
476 $text .= $langs->trans(
"Yes");
478 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
483 $text .=
'<br><strong>'.$langs->trans(
"AddSheduledJobs").
':</strong> ';
484 if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs)) {
486 foreach ($objMod->cronjobs as $val) {
487 $text .= ($i ?
', ' :
'').($val[
'label']);
491 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
496 $text .=
'<br><strong>'.$langs->trans(
"AddTriggers").
':</strong> ';
497 $moreinfoontriggerfile =
'';
498 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'triggers']) && $objMod->module_parts[
'triggers']) {
501 $yesno =
'<span class="opacitymedium">No</span>';
503 require_once DOL_DOCUMENT_ROOT.
'/core/class/interfaces.class.php';
505 $triggers = $interfaces->getTriggersList(array((($objMod->isCoreOrExternalModule() ==
'external') ?
'/'.$moduledir :
'').
'/core/triggers'));
506 foreach ($triggers as $triggercursor) {
507 if ($triggercursor[
'module'] == $moduledir) {
509 $moreinfoontriggerfile =
' ('.$triggercursor[
'relpath'].
')';
513 $text .= $langs->trans($yesno).$moreinfoontriggerfile;
517 $text .=
'<br><strong>'.$langs->trans(
"AddBoxes").
':</strong> ';
518 if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) {
520 foreach ($objMod->boxes as $val) {
521 $boxstring = (empty($val[
'file']) ? (empty($val[0]) ?
'' : $val[0]) : $val[
'file']);
523 $text .= ($i ?
', ' :
'').$boxstring;
528 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
533 $text .=
'<br><strong>'.$langs->trans(
"AddHooks").
':</strong> ';
534 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'hooks']) && is_array($objMod->module_parts[
'hooks']) && count($objMod->module_parts[
'hooks'])) {
536 foreach ($objMod->module_parts[
'hooks'] as $key => $val) {
537 if ($key ===
'entity') {
542 if ($key ===
'data') {
543 if (is_array($val)) {
544 foreach ($val as $value) {
545 $text .= ($i ?
', ' :
'').($value);
553 $text .= ($i ?
', ' :
'').($val);
557 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
562 $text .=
'<br><strong>'.$langs->trans(
"AddPermissions").
':</strong> ';
563 if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights)) {
565 foreach ($objMod->rights as $val) {
566 $text .= ($i ?
', ' :
'').($val[1]);
570 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
575 $text .=
'<br><strong>'.$langs->trans(
"AddMenus").
':</strong> ';
576 if (isset($objMod->menu) && !empty($objMod->menu)) {
577 $text .= $langs->trans(
"Yes");
579 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
584 $text .=
'<br><strong>'.$langs->trans(
"AddExportProfiles").
':</strong> ';
585 if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label)) {
587 foreach ($objMod->export_label as $val) {
588 $text .= ($i ?
', ' :
'').($val);
592 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
597 $text .=
'<br><strong>'.$langs->trans(
"AddImportProfiles").
':</strong> ';
598 if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label)) {
600 foreach ($objMod->import_label as $val) {
601 $text .= ($i ?
', ' :
'').($val);
605 $text .=
'<span class="opacitymedium">'.$langs->trans(
"No").
'</span>';
610 $text .=
'<br><strong>'.$langs->trans(
"AddOtherPagesOrServices").
':</strong> ';
611 $text .=
'<span class="opacitymedium">'.$langs->trans(
"DetectionNotPossible").
'</span>';
615if ($mode ==
'changelog') {
616 $changelog = $objMod->getChangeLog();
618 $text .=
'<div class="moduledesclong">'.$changelog.
'<div>';
620 $text .=
'<div class="moduledesclong"><span class="opacitymedium">'.$langs->trans(
"NotAvailable").
'</span></div>';
modulehelp_prepare_head($object)
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.
Class to manage triggers.
Class to manage Dolibarr users.
dol_is_file($pathoffile)
Return if path is a file.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dolGetModulesDirs($subdir='')
Return list of modules directories.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return a 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)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.