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