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