dolibarr 21.0.0-alpha
modulehelp.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
5 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
26if (!defined('NOREQUIREMENU')) {
27 define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
28}
29if (!defined('NOTOKENRENEWAL')) {
30 define('NOTOKENRENEWAL', '1'); // Disabled because this page is into a popup on module search page and we want to avoid to have an Anti CSRF token error (done if MAIN_SECURITY_CSRF_WITH_TOKEN is on) when we make a second search after closing popup.
31}
32
33
34// Load Dolibarr environment
35require '../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
39
40// Load translation files required by the page
41$langs->loadLangs(array('errors', 'admin', 'modulebuilder', 'exports'));
42
43$mode = GETPOST('mode', 'alpha');
44$action = GETPOST('action', 'aZ09');
45$id = GETPOSTINT('id');
46if (empty($mode)) {
47 $mode = 'desc';
48}
49
50if (empty($user->admin)) {
52}
53
54
55
56/*
57 * Actions
58 */
59
60// Nothing
61
62
63/*
64 * View
65 */
66
67$form = new Form($db);
68
69$help_url = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
70llxHeader('', $langs->trans("Setup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-modulehelp');
71
72print '<!-- Force style container -->'."\n".'<style>
73.id-container {
74 width: 100%;
75}
76#id-right {
77 padding-left: unset;
78}
79</style>';
80
81$arrayofnatures = array('core' => $langs->transnoentitiesnoconv("Core"), 'external' => $langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers"));
82
83// Search modules dirs
84$modulesdir = dolGetModulesDirs();
85
86
87$filename = array();
88'@phan-var-force DolibarrModules[] $modules';
89$modules = array();
90$orders = array();
91$categ = array();
92$dirmod = array();
93$i = 0; // is a sequencer of modules found
94$j = 0; // j is module number. Automatically affected if module number not defined.
95$modNameLoaded = array();
96$familyinfo = array();
97
98foreach ($modulesdir as $dir) {
99 // Load modules attributes in arrays (name, numero, orders) from dir directory
100 //print $dir."\n<br>";
101 dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)");
102 $handle = @opendir($dir);
103 if (is_resource($handle)) {
104 while (($file = readdir($handle)) !== false) {
105 //print "$i ".$file."\n<br>";
106 if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
107 $modName = substr($file, 0, dol_strlen($file) - 10);
108
109 if ($modName) {
110 if (!empty($modNameLoaded[$modName])) {
111 $mesg = "Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
112 setEventMessages($mesg, null, 'warnings');
113 dol_syslog($mesg, LOG_ERR);
114 continue;
115 }
116
117 try {
118 $res = include_once $dir.$file;
119 if (class_exists($modName)) {
120 try {
121 $objMod = new $modName($db);
122 '@phan-var-force DolibarrModules $objMod';
123 $modNameLoaded[$modName] = $dir;
124
125 if (!$objMod->numero > 0 && $modName != 'modUser') {
126 dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR);
127 }
128 $j = $objMod->numero;
129
130 $modulequalified = 1;
131
132 // We discard modules according to features level (PS: if module is activated we always show it)
133 $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
134 if ($objMod->version == 'development' && (!getDolGlobalString($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
135 $modulequalified = 0;
136 }
137 if ($objMod->version == 'experimental' && (!getDolGlobalString($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
138 $modulequalified = 0;
139 }
140 if (preg_match('/deprecated/', $objMod->version) && (!getDolGlobalString($const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 0))) {
141 $modulequalified = 0;
142 }
143
144 // We discard modules according to property disabled
145 //if (!empty($objMod->hidden)) $modulequalified=0;
146
147 if ($modulequalified > 0) {
148 $publisher = dol_escape_htmltag($objMod->getPublisher());
149 $external = ($objMod->isCoreOrExternalModule() == 'external');
150 if ($external) {
151 if ($publisher) {
152 $arrayofnatures['external_'.$publisher] = $langs->trans("External").' - '.$publisher;
153 } else {
154 $arrayofnatures['external_'] = $langs->trans("External").' - '.$langs->trans("UnknownPublishers");
155 }
156 }
157 ksort($arrayofnatures);
158 }
159
160 // Define an array $categ with categ with at least one qualified module
161 if ($modulequalified > 0) {
162 $modules[$i] = $objMod;
163 $filename[$i] = $modName;
164
165 // Gives the possibility to the module, to provide his own family info and position of this family
166 if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
167 $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
168 $familykey = key($objMod->familyinfo);
169 } else {
170 $familykey = $objMod->family;
171 }
172 if (empty($familykey) || $familykey === null) {
173 $familykey = 'other';
174 }
175
176 $moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
177 if ($moduleposition == '50' && ($objMod->isCoreOrExternalModule() == 'external')) {
178 $moduleposition = '80'; // External modules at end by default
179 }
180
181 if (empty($familyinfo[$familykey]['position'])) {
182 $familyinfo[$familykey]['position'] = '0';
183 }
184
185 $orders[$i] = $familyinfo[$familykey]['position']."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
186 $dirmod[$i] = $dir;
187 //print $i.'-'.$dirmod[$i].'<br>';
188 // Set categ[$i]
189 $specialstring = 'unknown';
190 if ($objMod->version == 'development' || $objMod->version == 'experimental') {
191 $specialstring = 'expdev';
192 }
193 if (isset($categ[$specialstring])) {
194 $categ[$specialstring]++; // Array of all different modules categories
195 } else {
196 $categ[$specialstring] = 1;
197 }
198 $j++;
199 $i++;
200 } else {
201 dol_syslog("Module ".get_class($objMod)." not qualified");
202 }
203 } catch (Exception $e) {
204 dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
205 }
206 } else {
207 print info_admin("Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)", 0, 0, '1', 'warning');
208 }
209 } catch (Exception $e) {
210 dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
211 }
212 }
213 }
214 }
215 closedir($handle);
216 } else {
217 dol_syslog("htdocs/admin/modulehelp.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
218 }
219}
220
221asort($orders);
222//var_dump($orders);
223//var_dump($categ);
224//var_dump($modules);
225
226
227$objMod = null;
228$dirofmodule = null;
229$key = -1;
230$i = 0;
231foreach ($orders as $tmpkey => $tmpvalue) {
232 $tmpMod = $modules[$tmpkey];
233 '@phan-var-force DolibarrModules $tmpMod';
234 if ($tmpMod->numero == $id) {
235 $key = $i;
236 $modName = $filename[$tmpkey];
237 $dirofmodule = $dirmod[$tmpkey];
238 $objMod = $tmpMod;
239 break;
240 }
241 $i++;
242}
243if (!is_object($objMod)) {
244 $msg = __FILE__." Module with no found for id:".$id;
245 dol_syslog($msg, LOG_ERR);
246 return;
247}
248
249$value = $orders[$key];
250$tab = explode('_', $value);
251$familyposition = $tab[0];
252$familykey = $tab[1];
253$module_position = $tab[2];
254$numero = $tab[3];
255
256
257
258$head = modulehelp_prepare_head($objMod);
259
260// Check filters
261$modulename = $objMod->getName();
262$moduledesc = $objMod->getDesc();
263$moduleauthor = $objMod->getPublisher();
264$moduledir = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
265
266$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
267
268$text = '<span class="opacitymedium">'.$langs->trans("LastActivationDate").':</span> ';
269if (getDolGlobalString($const_name)) {
270 $text .= dol_print_date($objMod->getLastActivationDate(), 'dayhour');
271} else {
272 $text .= $langs->trans("Disabled");
273}
274$tmp = $objMod->getLastActivationInfo();
275$authorid = (empty($tmp['authorid']) ? '' : $tmp['authorid']);
276if ($authorid > 0) {
277 $tmpuser = new User($db);
278 $tmpuser->fetch($authorid);
279 $text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationAuthor").':</span> ';
280 $text .= $tmpuser->getNomUrl(-1);
281}
282$ip = (empty($tmp['ip']) ? '' : $tmp['ip']);
283if ($ip) {
284 $text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationIP").':</span> ';
285 $text .= $ip;
286}
287$lastactivationversion = (empty($tmp['lastactivationversion']) ? '' : $tmp['lastactivationversion']);
288if ($lastactivationversion) {
289 $text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationVersion").':</span> ';
290 $text .= $lastactivationversion;
291}
292
293$moreinfo = $text;
294
295$title = ($modulename ? $modulename : $moduledesc);
296
297print '<div class="centpercent">';
298
299$picto = 'object_'.$objMod->picto;
300
301print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0, '', 'titlemodulehelp');
302print '<br>';
303
304print dol_get_fiche_head($head, $mode, '', -1);
305
306if (!$modulename) {
307 dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
308}
309
310// Load all lang files of module
311if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
312 foreach ($objMod->langfiles as $domain) {
313 $langs->load($domain);
314 }
315}
316
317
318
319
320// Version (with picto warning or not)
321$version = $objMod->getVersion(0);
322$versiontrans = '';
323if (preg_match('/development/i', $version)) {
324 $versiontrans .= img_warning($langs->trans("Development"), 'style="float: left"');
325}
326if (preg_match('/experimental/i', $version)) {
327 $versiontrans .= img_warning($langs->trans("Experimental"), 'style="float: left"');
328}
329if (preg_match('/deprecated/i', $version)) {
330 $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"');
331}
332$versiontrans .= $objMod->getVersion(1);
333
334// Define imginfo
335$imginfo = "info";
336if ($objMod->isCoreOrExternalModule() == 'external') {
337 $imginfo = "info_black";
338}
339
340// Define text of description of module
341$text = '';
342
343if ($mode == 'desc') {
344 if ($moduledesc) {
345 $text .= '<br>'.$moduledesc.'<br><br><br>';
346 }
347
348 $moduledescriptorfile = get_class($objMod).'.class.php';
349 $text .= '<span class="opacitymedium">'.$langs->trans("DescriptorFile").':</span> '.$moduledescriptorfile;
350
351 $text .= '<br><span class="opacitymedium">'.$langs->trans("IdModule").':</span> '.$objMod->numero;
352
353 $textexternal = '';
354 if ($objMod->isCoreOrExternalModule() == 'external') {
355 $tmpdirofmoduletoshow = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', (string) $dirofmodule);
356 $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $tmpdirofmoduletoshow);
357
358 global $dolibarr_allow_download_external_modules;
359 if (!empty($dolibarr_allow_download_external_modules) && preg_match('/\/custom\//', (string) $dirofmodule)) {
360 // Add a link to download a zip of the module
361 $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>';
362 }
363
364 if ($objMod->editor_name != 'dolibarr') {
365 $textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name);
366 }
367 $editor_url = $objMod->editor_url;
368 if (!preg_match('/^http/', $editor_url)) {
369 $editor_url = 'http://'.$editor_url;
370 }
371 if (!empty($objMod->editor_url) && !preg_match('/dolibarr\.org/i', $objMod->editor_url)) {
372 $textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' <a href="'.$editor_url.'" target="_blank" rel="noopener noreferrer external">'.$objMod->editor_url.'</a>';
373 }
374 $text .= $textexternal;
375 } else {
376 $text .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("Core");
377 if (empty($objMod->numero)) {
378 $text .= ' &nbsp; <span class="italic opacitymedium">('.$langs->trans("AlwaysEnabled").')</span>';
379 } elseif (!empty($objMod->enabled_bydefault)) {
380 $text .= ' &nbsp; <span class="italic opacitymedium">('.$langs->trans("EnabledByDefaultAtInstall").')</span>';
381 }
382 }
383
384 $text .= '<br><span class="opacitymedium">'.$langs->trans("Version").':</span> '.$version;
385
386 $text .= '<br>';
387
388 $moduledesclong = $objMod->getDescLong();
389 if ($moduledesclong) {
390 $text .= '<br><hr><div class="moduledesclong">'.$moduledesclong.'<div>';
391 }
392}
393
394if ($mode == 'feature') {
395 $text .= '<br><strong>'.$langs->trans("DependsOn").':</strong> ';
396 if (is_array($objMod->depends) && count($objMod->depends)) {
397 $i = 0;
398 foreach ($objMod->depends as $modulestringorarray) {
399 if (is_array($modulestringorarray)) {
400 $text .= ($i ? ', ' : '').implode(', ', $modulestringorarray);
401 } else {
402 $text .= ($i ? ', ' : '').$modulestringorarray;
403 }
404 $i++;
405 }
406 } else {
407 $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
408 }
409 $text .= '<br>';
410
411 $text .= '<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
412 if (is_array($objMod->requiredby) && count($objMod->requiredby)) {
413 $i = 0;
414 foreach ($objMod->requiredby as $modulestringorarray) {
415 if (is_array($modulestringorarray)) {
416 $text .= ($i ? ', ' : '').implode(', ', $modulestringorarray);
417 } else {
418 $text .= ($i ? ', ' : '').$modulestringorarray;
419 }
420 $i++;
421 }
422 } else {
423 $text .= '<span class="opacitymedium">'.$langs->trans("None").'</span>';
424 }
425
426 $text .= '<br><br>';
427
428 $text .= '<br><strong>'.$langs->trans("AddDataTables").':</strong> ';
429 $listofsqlfiles1 = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, 'llx.*-'.$moduledir.'\.sql', array('\.key\.sql', '\.sql\.back'));
430 $listofsqlfiles2 = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql', '\.sql\.back'));
431 $sqlfiles = array_merge($listofsqlfiles1, $listofsqlfiles2);
432
433 if (count($sqlfiles) > 0) {
434 $i = 0;
435 foreach ($sqlfiles as $val) {
436 $text .= ($i ? ', ' : '').preg_replace('/\-'.$moduledir.'$/', '', preg_replace('/\.sql$/', '', preg_replace('/llx_/', '', $val['name'])));
437 $i++;
438 }
439 } else {
440 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
441 }
442
443 $text .= '<br>';
444
445 $text .= '<br><strong>'.$langs->trans("AddDictionaries").':</strong> ';
446 if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib'])) {
447 $i = 0;
448 foreach ($objMod->dictionaries['tablib'] as $val) {
449 $text .= ($i ? ', ' : '').$val;
450 $i++;
451 }
452 } else {
453 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
454 }
455
456 $text .= '<br>';
457
458 $text .= '<br><strong>'.$langs->trans("AddData").':</strong> ';
459 $filedata = dol_buildpath($moduledir.'/sql/data.sql');
460 if (dol_is_file($filedata)) {
461 $text .= $langs->trans("Yes").' <span class="opacitymedium">('.$moduledir.'/sql/data.sql)</span>';
462 } else {
463 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
464 }
465
466 $text .= '<br>';
467
468 $text .= '<br><strong>'.$langs->trans("AddRemoveTabs").':</strong> ';
469 if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) {
470 $i = 0;
471 foreach ($objMod->tabs as $val) {
472 if (is_array($val)) {
473 $val = $val['data'];
474 }
475 if (is_string($val)) {
476 $tmp = explode(':', $val, 3);
477 $text .= ($i ? ', ' : '').$tmp[0].':'.$tmp[1];
478 $i++;
479 }
480 }
481 } else {
482 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
483 }
484
485 $text .= '<br>';
486
487 $text .= '<br><strong>'.$langs->trans("AddModels").':</strong> ';
488 if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) {
489 $text .= $langs->trans("Yes");
490 } else {
491 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
492 }
493
494 $text .= '<br>';
495
496 $text .= '<br><strong>'.$langs->trans("AddSubstitutions").':</strong> ';
497 if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) {
498 $text .= $langs->trans("Yes");
499 } else {
500 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
501 }
502
503 $text .= '<br>';
504
505 $text .= '<br><strong>'.$langs->trans("AddSheduledJobs").':</strong> ';
506 if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs)) {
507 $i = 0;
508 foreach ($objMod->cronjobs as $val) {
509 $text .= ($i ? ', ' : '').($val['label']);
510 $i++;
511 }
512 } else {
513 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
514 }
515
516 $text .= '<br>';
517
518 $text .= '<br><strong>'.$langs->trans("AddTriggers").':</strong> ';
519 $moreinfoontriggerfile = '';
520 if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers']) {
521 $yesno = 'Yes';
522 } else {
523 $yesno = '<span class="opacitymedium">No</span>';
524 }
525 require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
526 $interfaces = new Interfaces($db);
527 $triggers = $interfaces->getTriggersList(array((($objMod->isCoreOrExternalModule() == 'external') ? '/'.$moduledir : '').'/core/triggers'));
528 foreach ($triggers as $triggercursor) {
529 if ($triggercursor['module'] == $moduledir) {
530 $yesno = 'Yes';
531 $moreinfoontriggerfile = ' ('.$triggercursor['relpath'].')';
532 }
533 }
534
535 $text .= $langs->trans($yesno).$moreinfoontriggerfile;
536
537 $text .= '<br>';
538
539 $text .= '<br><strong>'.$langs->trans("AddBoxes").':</strong> ';
540 if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) {
541 $i = 0;
542 foreach ($objMod->boxes as $val) {
543 $boxstring = (empty($val['file']) ? (empty($val[0]) ? '' : $val[0]) : $val['file']);
544 if ($boxstring) {
545 $text .= ($i ? ', ' : '').$boxstring;
546 }
547 $i++;
548 }
549 } else {
550 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
551 }
552
553 $text .= '<br>';
554
555 $text .= '<br><strong>'.$langs->trans("AddHooks").':</strong> ';
556 if (isset($objMod->module_parts) && isset($objMod->module_parts['hooks']) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) {
557 $i = 0;
558 foreach ($objMod->module_parts['hooks'] as $key => $val) {
559 if ($key === 'entity') {
560 continue;
561 }
562
563 // For special values
564 if ($key === 'data') {
565 if (is_array($val)) {
566 foreach ($val as $value) {
567 $text .= ($i ? ', ' : '').($value);
568 $i++;
569 }
570
571 continue;
572 }
573 }
574
575 $text .= ($i ? ', ' : '').($val);
576 $i++;
577 }
578 } else {
579 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
580 }
581
582 $text .= '<br>';
583
584 $text .= '<br><strong>'.$langs->trans("AddPermissions").':</strong> ';
585 if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights)) {
586 $i = 0;
587 foreach ($objMod->rights as $val) {
588 $text .= ($i ? ', ' : '').($val[1]);
589 $i++;
590 }
591 } else {
592 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
593 }
594
595 $text .= '<br>';
596
597 $text .= '<br><strong>'.$langs->trans("AddMenus").':</strong> ';
598 if (isset($objMod->menu) && !empty($objMod->menu)) { // objMod can be an array or just an int 1
599 $text .= $langs->trans("Yes");
600 } else {
601 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
602 }
603
604 $text .= '<br>';
605
606 $text .= '<br><strong>'.$langs->trans("AddExportProfiles").':</strong> ';
607 if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label)) {
608 $i = 0;
609 foreach ($objMod->export_label as $val) {
610 $text .= ($i ? ', ' : '').($val);
611 $i++;
612 }
613 } else {
614 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
615 }
616
617 $text .= '<br>';
618
619 $text .= '<br><strong>'.$langs->trans("AddImportProfiles").':</strong> ';
620 if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label)) {
621 $i = 0;
622 foreach ($objMod->import_label as $val) {
623 $text .= ($i ? ', ' : '').($val);
624 $i++;
625 }
626 } else {
627 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
628 }
629
630 $text .= '<br>';
631
632 $text .= '<br><strong>'.$langs->trans("AddWebsiteTemplates").':</strong> ';
633 if (isset($objMod->module_parts) && isset($objMod->module_parts['websitetemplates']) && $objMod->module_parts['websitetemplates']) {
634 $text .= $langs->trans("Yes");
635 } else {
636 $text .= '<span class="opacitymedium">'.$langs->trans("No").'</span>';
637 }
638
639 $text .= '<br>';
640
641 $text .= '<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
642 $text .= '<span class="opacitymedium">'.$langs->trans("DetectionNotPossible").'</span>';
643}
644
645
646if ($mode == 'changelog') {
647 $changelog = $objMod->getChangeLog();
648 if ($changelog) {
649 $text .= '<div class="moduledesclong">'.$changelog.'<div>';
650 } else {
651 $text .= '<div class="moduledesclong"><span class="opacitymedium">'.$langs->trans("NotAvailable").'</span></div>';
652 }
653}
654
655print $text;
656
657
658print dol_get_fiche_end();
659
660print '</div>';
661
662// End of page
663llxFooter();
664$db->close();
$id
Definition account.php:39
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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage generation of HTML components Only common components must be here.
Class to manage triggers.
Class to manage Dolibarr users.
llxFooter()
Footer empty.
Definition document.php:107
dol_is_file($pathoffile)
Return if path is a file.
dol_dir_list($utf8_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.
Definition files.lib.php:63
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
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_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.