24 if (! defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
32 $langs->loadLangs(array(
'errors',
'admin'));
35 $action=
GETPOST(
'action',
'alpha');
37 if (empty($mode)) $mode=
'desc';
55 $form =
new Form($db);
57 $help_url=
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
58 llxHeader(
'',$langs->trans(
"Setup"),$help_url);
60 print '<!-- Force style container -->'.
"\n".
'<style> 66 $arrayofnatures=array(
'core'=>$langs->transnoentitiesnoconv(
"Core"),
'external'=>$langs->transnoentitiesnoconv(
"External").
' - '.$langs->trans(
"AllPublishers"));
79 $modNameLoaded=array();
81 foreach ($modulesdir as $dir)
85 dol_syslog(
"Scan directory ".$dir.
" for module descriptor files (modXXX.class.php)");
86 $handle=@opendir($dir);
87 if (is_resource($handle))
89 while (($file = readdir($handle))!==
false)
92 if (is_readable($dir.$file) && substr($file, 0, 3) ==
'mod' && substr($file,
dol_strlen($file) - 10) ==
'.class.php')
94 $modName = substr($file, 0,
dol_strlen($file) - 10);
98 if (! empty($modNameLoaded[$modName]))
100 $mesg=
"Error: Module ".$modName.
" was found twice: Into ".$modNameLoaded[$modName].
" and ".$dir.
". You probably have an old file on your disk.<br>";
108 $res=include_once $dir.$file;
109 if (class_exists($modName))
112 $objMod =
new $modName($db);
113 $modNameLoaded[$modName]=$dir;
115 if (! $objMod->numero > 0 && $modName !=
'modUser')
117 dol_syslog(
'The module descriptor '.$modName.
' must have a numero property', LOG_ERR);
119 $j = $objMod->numero;
124 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'',get_class($objMod)));
125 if ($objMod->version ==
'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
126 if ($objMod->version ==
'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
127 if (preg_match(
'/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) $modulequalified=0;
130 if (! empty($objMod->hidden)) $modulequalified=0;
132 if ($modulequalified > 0)
135 $external=($objMod->isCoreOrExternalModule() ==
'external');
140 $arrayofnatures[
'external_'.$publisher]=$langs->trans(
"External").
' - '.$publisher;
144 $arrayofnatures[
'external_']=$langs->trans(
"External").
' - '.$langs->trans(
"UnknownPublishers");
147 ksort($arrayofnatures);
151 if ($modulequalified > 0)
153 $modules[$i] = $objMod;
154 $filename[$i]= $modName;
157 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
158 if (!is_array($familyinfo)) $familyinfo=array();
159 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
160 $familykey = key($objMod->familyinfo);
162 $familykey = $objMod->family;
165 $moduleposition = ($objMod->module_position?$objMod->module_position:
'50');
166 if ($moduleposition ==
'50' && ($objMod->isCoreOrExternalModule() ==
'external'))
168 $moduleposition =
'80';
171 $orders[$i] = $familyinfo[$familykey][
'position'].
"_".$familykey.
"_".$moduleposition.
"_".$j;
175 $specialstring =
'unknown';
176 if ($objMod->version ==
'development' || $objMod->version ==
'experimental') $specialstring=
'expdev';
177 if (isset($categ[$specialstring])) $categ[$specialstring]++;
178 else $categ[$specialstring]=1;
182 else dol_syslog(
"Module ".get_class($objMod).
" not qualified");
186 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
191 print "Warning bad descriptor file : ".$dir.$file.
" (Class ".$modName.
" not found into file)<br>";
196 dol_syslog(
"Failed to load ".$dir.$file.
" ".$e->getMessage(), LOG_ERR);
205 dol_syslog(
"htdocs/admin/modulehelp.php: Failed to open directory ".$dir.
". See permission and open_basedir option.", LOG_WARNING);
216 foreach($orders as $tmpkey => $tmpvalue)
218 $objMod = $modules[$tmpkey];
219 if ($objMod->numero == $id)
222 $modName = $filename[$tmpkey];
223 $dirofmodule = $dirmod[$tmpkey];
228 $value = $orders[$key];
229 $tab=explode(
'_',$value);
230 $familyposition=$tab[0]; $familykey=$tab[1]; $module_position=$tab[2]; $numero=$tab[3];
236 $head[$h][0] = DOL_URL_ROOT.
"/admin/modulehelp.php?id=".$id.
'&mode=desc';
237 $head[$h][1] = $langs->trans(
"Description");
238 $head[$h][2] =
'desc';
241 $head[$h][0] = DOL_URL_ROOT.
"/admin/modulehelp.php?id=".$id.
'&mode=feature';
242 $head[$h][1] = $langs->trans(
"TechnicalServicesProvided");
243 $head[$h][2] =
'feature';
246 if ($objMod->isCoreOrExternalModule() ==
'external')
248 $head[$h][0] = DOL_URL_ROOT.
"/admin/modulehelp.php?id=".$id.
'&mode=changelog';
249 $head[$h][1] = $langs->trans(
"ChangeLog");
250 $head[$h][2] =
'changelog';
255 $modulename=$objMod->getName();
256 $moduledesc=$objMod->getDesc();
257 $moduleauthor=$objMod->getPublisher();
258 $moduledir=strtolower(preg_replace(
'/^mod/i',
'',get_class($objMod)));
261 print '<div class="centpercent">';
270 dol_syslog(
"Error for module ".$key.
" - Property name of module looks empty", LOG_WARNING);
273 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'',get_class($objMod)));
276 if (isset($objMod->langfiles) && is_array($objMod->langfiles))
278 foreach($objMod->langfiles as $domain)
280 $langs->load($domain);
288 $version=$objMod->getVersion(0);
290 if (preg_match(
'/development/i', $version)) $versiontrans.=
img_warning($langs->trans(
"Development"),
'style="float: left"');
291 if (preg_match(
'/experimental/i', $version)) $versiontrans.=
img_warning($langs->trans(
"Experimental"),
'style="float: left"');
292 if (preg_match(
'/deprecated/i', $version)) $versiontrans.=
img_warning($langs->trans(
"Deprecated"),
'style="float: left"');
293 $versiontrans.=$objMod->getVersion(1);
297 if ($objMod->isCoreOrExternalModule() ==
'external')
299 $imginfo=
"info_black";
307 if ($moduledesc) $text.=$moduledesc.
'<br><br>';
309 $text.=
'<strong>'.$langs->trans(
"Version").
':</strong> '.$version;
312 if ($objMod->isCoreOrExternalModule() ==
'external')
314 $textexternal.=
'<br><strong>'.$langs->trans(
"Origin").
':</strong> '.$langs->trans(
"ExternalModule",$dirofmodule);
315 if ($objMod->editor_name !=
'dolibarr') $textexternal.=
'<br><strong>'.$langs->trans(
"Publisher").
':</strong> '.(empty($objMod->editor_name)?$langs->trans(
"Unknown"):$objMod->editor_name);
316 $editor_url = $objMod->editor_url;
317 if (! preg_match(
'/^http/', $editor_url)) $editor_url =
'http://'.$editor_url;
318 if (! empty($objMod->editor_url) && ! preg_match(
'/dolibarr\.org/i',$objMod->editor_url)) $textexternal.=
'<br><strong>'.$langs->trans(
"Url").
':</strong> <a href="'.$editor_url.
'" target="_blank">'.$objMod->editor_url.
'</a>';
319 $text.=$textexternal;
324 $text.=
'<br><strong>'.$langs->trans(
"Origin").
':</strong> '.$langs->trans(
"Core").
'<br>';
326 $text.=
'<br><strong>'.$langs->trans(
"LastActivationDate").
':</strong> ';
327 if (! empty($conf->global->$const_name)) $text.=
dol_print_date($objMod->getLastActivationDate(),
'dayhour');
328 else $text.=$langs->trans(
"Disabled");
331 $tmp = $objMod->getLastActivationInfo();
332 $authorid = $tmp[
'authorid'];
335 $tmpuser =
new User($db);
336 $tmpuser->fetch($authorid);
337 $text.=
'<strong>'.$langs->trans(
"LastActivationAuthor").
':</strong> ';
338 $text.= $tmpuser->getNomUrl(1);
344 $text.=
'<strong>'.$langs->trans(
"LastActivationIP").
':</strong> ';
349 $moduledesclong=$objMod->getDescLong();
350 if ($moduledesclong) $text.=
'<br><hr><div class="moduledesclong">'.$moduledesclong.
'<div>';
353 if ($mode ==
'feature')
355 $text.=
'<br><strong>'.$langs->trans(
"DependsOn").
':</strong> ';
356 if (count($objMod->depends)) $text.=join(
',', $objMod->depends);
357 else $text.=$langs->trans(
"None");
358 $text.=
'<br><strong>'.$langs->trans(
"RequiredBy").
':</strong> ';
359 if (count($objMod->requiredby)) $text.=join(
',', $objMod->requiredby);
360 else $text.=$langs->trans(
"None");
364 $text.=
'<br><strong>'.$langs->trans(
"AddDataTables").
':</strong> ';
366 if (count($sqlfiles) > 0)
368 $text.=$langs->trans(
"Yes").
' (';
370 foreach($sqlfiles as $val)
372 $text.=($i?
', ':
'').preg_replace(
'/\.sql$/',
'',preg_replace(
'/llx_/',
'',$val[
'name']));
377 else $text.=$langs->trans(
"No");
381 $text.=
'<br><strong>'.$langs->trans(
"AddDictionaries").
':</strong> ';
382 if (isset($objMod->dictionaries) && isset($objMod->dictionaries[
'tablib']) && is_array($objMod->dictionaries[
'tablib']) && count($objMod->dictionaries[
'tablib']))
385 foreach($objMod->dictionaries[
'tablib'] as $val)
387 $text.=($i?
', ':
'').$val;
391 else $text.=$langs->trans(
"No");
395 $text.=
'<br><strong>'.$langs->trans(
"AddData").
':</strong> ';
399 $text.=$langs->trans(
"Yes").
' ('.$moduledir.
'/sql/data.sql'.
')';
401 else $text.=$langs->trans(
"No");
405 $text.=
'<br><strong>'.$langs->trans(
"AddRemoveTabs").
':</strong> ';
406 if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs))
409 foreach($objMod->tabs as $val)
411 if (is_array($val)) $val=$val[
'data'];
414 $tmp=explode(
':',$val,3);
415 $text.=($i?
', ':
'').$tmp[0].
':'.$tmp[1];
420 else $text.=$langs->trans(
"No");
424 $text.=
'<br><strong>'.$langs->trans(
"AddModels").
':</strong> ';
425 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'models']) && $objMod->module_parts[
'models'])
427 $text.=$langs->trans(
"Yes");
429 else $text.=$langs->trans(
"No");
433 $text.=
'<br><strong>'.$langs->trans(
"AddSubstitutions").
':</strong> ';
434 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'substitutions']) && $objMod->module_parts[
'substitutions'])
436 $text.=$langs->trans(
"Yes");
438 else $text.=$langs->trans(
"No");
442 $text.=
'<br><strong>'.$langs->trans(
"AddSheduledJobs").
':</strong> ';
443 if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs))
446 foreach($objMod->cronjobs as $val)
448 $text.=($i?
', ':
'').($val[
'label']);
452 else $text.=$langs->trans(
"No");
456 $text.=
'<br><strong>'.$langs->trans(
"AddTriggers").
':</strong> ';
457 $moreinfoontriggerfile=
'';
458 if (isset($objMod->module_parts) && isset($objMod->module_parts[
'triggers']) && $objMod->module_parts[
'triggers'])
466 require_once DOL_DOCUMENT_ROOT.
'/core/class/interfaces.class.php';
468 $triggers = $interfaces->getTriggersList(array((($objMod->isCoreOrExternalModule() ==
'external')?
'/'.$moduledir:
'').
'/core/triggers'));
469 foreach($triggers as $triggercursor)
471 if ($triggercursor[
'module'] == $moduledir)
474 $moreinfoontriggerfile=
' ('.$triggercursor[
'relpath'].
')';
478 $text.=$langs->trans($yesno).$moreinfoontriggerfile;
482 $text.=
'<br><strong>'.$langs->trans(
"AddBoxes").
':</strong> ';
483 if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes))
486 foreach($objMod->boxes as $val)
488 $text.=($i?
', ':
'').($val[
'file']?$val[
'file']:$val[0]);
492 else $text.=$langs->trans(
"No");
496 $text.=
'<br><strong>'.$langs->trans(
"AddHooks").
':</strong> ';
497 if (isset($objMod->module_parts) && is_array($objMod->module_parts[
'hooks']) && count($objMod->module_parts[
'hooks']))
500 foreach($objMod->module_parts[
'hooks'] as $key => $val)
502 if ($key ===
'entity')
continue;
509 foreach($val as $value)
511 $text.=($i?
', ':
'').($value);
519 $text.=($i?
', ':
'').($val);
523 else $text.=$langs->trans(
"No");
527 $text.=
'<br><strong>'.$langs->trans(
"AddPermissions").
':</strong> ';
528 if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights))
531 foreach($objMod->rights as $val)
533 $text.=($i?
', ':
'').($val[1]);
537 else $text.=$langs->trans(
"No");
541 $text.=
'<br><strong>'.$langs->trans(
"AddMenus").
':</strong> ';
542 if (isset($objMod->menu) && ! empty($objMod->menu))
544 $text.=$langs->trans(
"Yes");
546 else $text.=$langs->trans(
"No");
550 $text.=
'<br><strong>'.$langs->trans(
"AddExportProfiles").
':</strong> ';
551 if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label))
554 foreach($objMod->export_label as $val)
556 $text.=($i?
', ':
'').($val);
560 else $text.=$langs->trans(
"No");
564 $text.=
'<br><strong>'.$langs->trans(
"AddImportProfiles").
':</strong> ';
565 if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label))
568 foreach($objMod->import_label as $val)
570 $text.=($i?
', ':
'').($val);
574 else $text.=$langs->trans(
"No");
578 $text.=
'<br><strong>'.$langs->trans(
"AddOtherPagesOrServices").
':</strong> ';
579 $text.=$langs->trans(
"DetectionNotPossible");
583 if ($mode ==
'changelog')
585 $changelog=$objMod->getChangeLog();
586 if ($changelog) $text.=
'<div class="moduledesclong">'.$changelog.
'<div>';
587 else $text.=
'<div class="moduledesclong">'.$langs->trans(
"NotAvailable").
'</div>';
img_warning($titlealt='default', $moreatt='')
Show warning logo.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
Class to manage Dolibarr users.
dolGetModulesDirs($subdir='')
Return list of modules directories.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
dol_fiche_end($notab=0)
Show tab footer of a card.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
dol_is_file($pathoffile)
Return if path is a file.
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='')
Show tab header of a card.
Class to manage triggers.