dolibarr 20.0.0
setup.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) ---Put here your own copyright and developer email---
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26$res = 0;
27// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
28if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
29 $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
30}
31// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
32$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
33while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
34 $i--;
35 $j--;
36}
37if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
38 $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
39}
40if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
41 $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
42}
43// Try main.inc.php using relative path
44if (!$res && file_exists("../../main.inc.php")) {
45 $res = @include "../../main.inc.php";
46}
47if (!$res && file_exists("../../../main.inc.php")) {
48 $res = @include "../../../main.inc.php";
49}
50if (!$res) {
51 die("Include of main fails");
52}
53
54global $langs, $user;
55
56// Libraries
57require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
58require_once '../lib/mymodule.lib.php';
59//require_once "../class/myclass.class.php";
60
61// Translations
62$langs->loadLangs(array("admin", "mymodule@mymodule"));
63
64// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
65$hookmanager->initHooks(array('mymodulesetup', 'globalsetup'));
66
67// Parameters
68$action = GETPOST('action', 'aZ09');
69$backtopage = GETPOST('backtopage', 'alpha');
70$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
71
72$value = GETPOST('value', 'alpha');
73$label = GETPOST('label', 'alpha');
74$scandir = GETPOST('scan_dir', 'alpha');
75$type = 'myobject';
76
77$error = 0;
78$setupnotempty = 0;
79
80// Access control
81if (!$user->admin) {
83}
84
85
86// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
87$useFormSetup = 1;
88
89if (!class_exists('FormSetup')) {
90 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
91}
92$formSetup = new FormSetup($db);
93
94// Access control
95if (!$user->admin) {
97}
98
99
100// Enter here all parameters in your setup page
101
102// Setup conf for selection of an URL
103$item = $formSetup->newItem('MYMODULE_MYPARAM1');
104$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
105$item->cssClass = 'minwidth500';
106
107// Setup conf for selection of a simple string input
108$item = $formSetup->newItem('MYMODULE_MYPARAM2');
109$item->defaultFieldValue = 'default value';
110$item->fieldAttr['placeholder'] = 'A placeholder here';
111
112// Setup conf for selection of a simple textarea input but we replace the text of field title
113$item = $formSetup->newItem('MYMODULE_MYPARAM3');
114$item->nameText = $item->getNameText().' more html text ';
115
116// Setup conf for a selection of a thirdparty
117$item = $formSetup->newItem('MYMODULE_MYPARAM4');
118$item->setAsThirdpartyType();
119
120// Setup conf for a selection of a boolean
121$formSetup->newItem('MYMODULE_MYPARAM5')->setAsYesNo();
122
123// Setup conf for a selection of an email template of type thirdparty
124$formSetup->newItem('MYMODULE_MYPARAM6')->setAsEmailTemplate('thirdparty');
125
126// Setup conf for a selection of a secured key
127//$formSetup->newItem('MYMODULE_MYPARAM7')->setAsSecureKey();
128
129// Setup conf for a selection of a product
130$formSetup->newItem('MYMODULE_MYPARAM8')->setAsProduct();
131
132// Add a title for a new section
133$formSetup->newItem('NewSection')->setAsTitle();
134
135$TField = array(
136 'test01' => $langs->trans('test01'),
137 'test02' => $langs->trans('test02'),
138 'test03' => $langs->trans('test03'),
139 'test04' => $langs->trans('test04'),
140 'test05' => $langs->trans('test05'),
141 'test06' => $langs->trans('test06'),
142);
143
144// Setup conf for a simple combo list
145$formSetup->newItem('MYMODULE_MYPARAM9')->setAsSelect($TField);
146
147// Setup conf for a multiselect combo list
148$item = $formSetup->newItem('MYMODULE_MYPARAM10');
149$item->setAsMultiSelect($TField);
150$item->helpText = $langs->transnoentities('MYMODULE_MYPARAM10');
151
152// Setup conf for a category selection
153$formSetup->newItem('MYMODULE_CATEGORY_ID_XXX')->setAsCategory('product');
154
155// Setup conf MYMODULE_MYPARAM10
156$item = $formSetup->newItem('MYMODULE_MYPARAM10');
157$item->setAsColor();
158$item->defaultFieldValue = '#FF0000';
159$item->nameText = $item->getNameText().' more html text ';
160$item->fieldInputOverride = '';
161$item->helpText = $langs->transnoentities('AnHelpMessage');
162//$item->fieldValue = '';
163//$item->fieldAttr = array() ; // fields attribute only for compatible fields like input text
164//$item->fieldOverride = false; // set this var to override field output will override $fieldInputOverride and $fieldOutputOverride too
165//$item->fieldInputOverride = false; // set this var to override field input
166//$item->fieldOutputOverride = false; // set this var to override field output
167
168
169$setupnotempty += count($formSetup->items);
170
171
172$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
173
174$moduledir = 'mymodule';
175$myTmpObjects = array();
176// TODO Scan list of objects to fill this array
177$myTmpObjects['myobject'] = array('label'=>'MyObject', 'includerefgeneration'=>0, 'includedocgeneration'=>0, 'class'=>'MyObject');
178
179$tmpobjectkey = GETPOST('object', 'aZ09');
180if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) {
181 accessforbidden('Bad value for object. Hack attempt ?');
182}
183
184
185/*
186 * Actions
187 */
188
189// For retrocompatibility Dolibarr < 15.0
190if (versioncompare(explode('.', DOL_VERSION), array(15)) < 0 && $action == 'update' && !empty($user->admin)) {
191 $formSetup->saveConfFromPost();
192}
193
194include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
195
196if ($action == 'updateMask') {
197 $maskconst = GETPOST('maskconst', 'aZ09');
198 $maskvalue = GETPOST('maskvalue', 'alpha');
199
200 if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
201 $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
202 if (!($res > 0)) {
203 $error++;
204 }
205 }
206
207 if (!$error) {
208 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
209 } else {
210 setEventMessages($langs->trans("Error"), null, 'errors');
211 }
212} elseif ($action == 'specimen' && $tmpobjectkey) {
213 $modele = GETPOST('module', 'alpha');
214
215 $className = $myTmpObjects[$tmpobjectkey]['class'];
216 $tmpobject = new $className($db);
217 $tmpobject->initAsSpecimen();
218
219 // Search template files
220 $file = '';
221 $className = '';
222 $filefound = 0;
223 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
224 foreach ($dirmodels as $reldir) {
225 $file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
226 if (file_exists($file)) {
227 $filefound = 1;
228 $className = "pdf_".$modele."_".strtolower($tmpobjectkey);
229 break;
230 }
231 }
232
233 if ($filefound) {
234 require_once $file;
235
236 $module = new $className($db);
237
238 if ($module->write_file($tmpobject, $langs) > 0) {
239 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=mymodule-".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
240 return;
241 } else {
242 setEventMessages($module->error, null, 'errors');
243 dol_syslog($module->error, LOG_ERR);
244 }
245 } else {
246 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
247 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
248 }
249} elseif ($action == 'setmod') {
250 // TODO Check if numbering module chosen can be activated by calling method canBeActivated
251 if (!empty($tmpobjectkey)) {
252 $constforval = 'MYMODULE_'.strtoupper($tmpobjectkey)."_ADDON";
253 dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
254 }
255} elseif ($action == 'set') {
256 // Activate a model
257 $ret = addDocumentModel($value, $type, $label, $scandir);
258} elseif ($action == 'del') {
259 $ret = delDocumentModel($value, $type);
260 if ($ret > 0) {
261 if (!empty($tmpobjectkey)) {
262 $constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
263 if (getDolGlobalString($constforval) == "$value") {
264 dolibarr_del_const($db, $constforval, $conf->entity);
265 }
266 }
267 }
268} elseif ($action == 'setdoc') {
269 // Set or unset default model
270 if (!empty($tmpobjectkey)) {
271 $constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
272 if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
273 // The constant that was read before the new set
274 // We therefore requires a variable to have a coherent view
275 $conf->global->{$constforval} = $value;
276 }
277
278 // We disable/enable the document template (into llx_document_model table)
279 $ret = delDocumentModel($value, $type);
280 if ($ret > 0) {
281 $ret = addDocumentModel($value, $type, $label, $scandir);
282 }
283 }
284} elseif ($action == 'unsetdoc') {
285 if (!empty($tmpobjectkey)) {
286 $constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
287 dolibarr_del_const($db, $constforval, $conf->entity);
288 }
289}
290
291$action = 'edit';
292
293
294/*
295 * View
296 */
297
298$form = new Form($db);
299
300$help_url = '';
301$title = "MyModuleSetup";
302
303llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-mymodule page-admin');
304
305// Subheader
306$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
307
308print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
309
310// Configuration header
312print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "mymodule@mymodule");
313
314// Setup page goes here
315echo '<span class="opacitymedium">'.$langs->trans("MyModuleSetupPage").'</span><br><br>';
316
317
318/*if ($action == 'edit') {
319 print $formSetup->generateOutput(true);
320 print '<br>';
321 } elseif (!empty($formSetup->items)) {
322 print $formSetup->generateOutput();
323 print '<div class="tabsAction">';
324 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
325 print '</div>';
326 }
327 */
328if (!empty($formSetup->items)) {
329 print $formSetup->generateOutput(true);
330 print '<br>';
331} else {
332 print '<br>'.$langs->trans("NothingToSetup");
333}
334
335
336foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
337 if (!empty($myTmpObjectArray['includerefgeneration'])) {
338 /*
339 * Orders Numbering model
340 */
341 $setupnotempty++;
342
343 print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectArray['label']), '', '');
344
345 print '<table class="noborder centpercent">';
346 print '<tr class="liste_titre">';
347 print '<td>'.$langs->trans("Name").'</td>';
348 print '<td>'.$langs->trans("Description").'</td>';
349 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
350 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
351 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
352 print '</tr>'."\n";
353
354 clearstatcache();
355
356 foreach ($dirmodels as $reldir) {
357 $dir = dol_buildpath($reldir."core/modules/".$moduledir);
358
359 if (is_dir($dir)) {
360 $handle = opendir($dir);
361 if (is_resource($handle)) {
362 while (($file = readdir($handle)) !== false) {
363 if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
364 $file = substr($file, 0, dol_strlen($file) - 4);
365
366 require_once $dir.'/'.$file.'.php';
367
368 $module = new $file($db);
369
370 // Show modules according to features level
371 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
372 continue;
373 }
374 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
375 continue;
376 }
377
378 if ($module->isEnabled()) {
379 dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
380
381 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
382 print $module->info($langs);
383 print '</td>';
384
385 // Show example of numbering model
386 print '<td class="nowrap">';
387 $tmp = $module->getExample();
388 if (preg_match('/^Error/', $tmp)) {
389 $langs->load("errors");
390 print '<div class="error">'.$langs->trans($tmp).'</div>';
391 } elseif ($tmp == 'NotConfigured') {
392 print $langs->trans($tmp);
393 } else {
394 print $tmp;
395 }
396 print '</td>'."\n";
397
398 print '<td class="center">';
399 $constforvar = 'MYMODULE_'.strtoupper($myTmpObjectKey).'_ADDON';
400 if (getDolGlobalString($constforvar) == $file) {
401 print img_picto($langs->trans("Activated"), 'switch_on');
402 } else {
403 print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
404 print img_picto($langs->trans("Disabled"), 'switch_off');
405 print '</a>';
406 }
407 print '</td>';
408
409 $className = $myTmpObjectArray['class'];
410 $mytmpinstance = new $className($db);
411 $mytmpinstance->initAsSpecimen();
412
413 // Info
414 $htmltooltip = '';
415 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
416
417 $nextval = $module->getNextValue($mytmpinstance);
418 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
419 $htmltooltip .= ''.$langs->trans("NextValue").': ';
420 if ($nextval) {
421 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
422 $nextval = $langs->trans($nextval);
423 }
424 $htmltooltip .= $nextval.'<br>';
425 } else {
426 $htmltooltip .= $langs->trans($module->error).'<br>';
427 }
428 }
429
430 print '<td class="center">';
431 print $form->textwithpicto('', $htmltooltip, 1, 0);
432 print '</td>';
433
434 print "</tr>\n";
435 }
436 }
437 }
438 closedir($handle);
439 }
440 }
441 }
442 print "</table><br>\n";
443 }
444
445 if (!empty($myTmpObjectArray['includedocgeneration'])) {
446 /*
447 * Document templates generators
448 */
449 $setupnotempty++;
450 $type = strtolower($myTmpObjectKey);
451
452 print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
453
454 // Load array def with activated templates
455 $def = array();
456 $sql = "SELECT nom";
457 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
458 $sql .= " WHERE type = '".$db->escape($type)."'";
459 $sql .= " AND entity = ".$conf->entity;
460 $resql = $db->query($sql);
461 if ($resql) {
462 $i = 0;
463 $num_rows = $db->num_rows($resql);
464 while ($i < $num_rows) {
465 $array = $db->fetch_array($resql);
466 array_push($def, $array[0]);
467 $i++;
468 }
469 } else {
470 dol_print_error($db);
471 }
472
473 print '<table class="noborder centpercent">'."\n";
474 print '<tr class="liste_titre">'."\n";
475 print '<td>'.$langs->trans("Name").'</td>';
476 print '<td>'.$langs->trans("Description").'</td>';
477 print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
478 print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
479 print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
480 print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
481 print "</tr>\n";
482
483 clearstatcache();
484
485 foreach ($dirmodels as $reldir) {
486 foreach (array('', '/doc') as $valdir) {
487 $realpath = $reldir."core/modules/".$moduledir.$valdir;
488 $dir = dol_buildpath($realpath);
489
490 if (is_dir($dir)) {
491 $handle = opendir($dir);
492 if (is_resource($handle)) {
493 while (($file = readdir($handle)) !== false) {
494 $filelist[] = $file;
495 }
496 closedir($handle);
497 arsort($filelist);
498
499 foreach ($filelist as $file) {
500 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
501 if (file_exists($dir.'/'.$file)) {
502 $name = substr($file, 4, dol_strlen($file) - 16);
503 $className = substr($file, 0, dol_strlen($file) - 12);
504
505 require_once $dir.'/'.$file;
506 $module = new $className($db);
507
508 $modulequalified = 1;
509 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
510 $modulequalified = 0;
511 }
512 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
513 $modulequalified = 0;
514 }
515
516 if ($modulequalified) {
517 print '<tr class="oddeven"><td width="100">';
518 print(empty($module->name) ? $name : $module->name);
519 print "</td><td>\n";
520 if (method_exists($module, 'info')) {
521 print $module->info($langs);
522 } else {
523 print $module->description;
524 }
525 print '</td>';
526
527 // Active
528 if (in_array($name, $def)) {
529 print '<td class="center">'."\n";
530 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
531 print img_picto($langs->trans("Enabled"), 'switch_on');
532 print '</a>';
533 print '</td>';
534 } else {
535 print '<td class="center">'."\n";
536 print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
537 print "</td>";
538 }
539
540 // Default
541 print '<td class="center">';
542 $constforvar = 'MYMODULE_'.strtoupper($myTmpObjectKey).'_ADDON_PDF';
543 if (getDolGlobalString($constforvar) == $name) {
544 //print img_picto($langs->trans("Default"), 'on');
545 // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
546 print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
547 } else {
548 print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
549 }
550 print '</td>';
551
552 // Info
553 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
554 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
555 if ($module->type == 'pdf') {
556 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
557 }
558 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
559
560 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
561 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
562 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
563
564 print '<td class="center">';
565 print $form->textwithpicto('', $htmltooltip, 1, 0);
566 print '</td>';
567
568 // Preview
569 print '<td class="center">';
570 if ($module->type == 'pdf') {
571 $newname = preg_replace('/_'.preg_quote(strtolower($myTmpObjectKey), '/').'/', '', $name);
572 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($newname).'&object='.urlencode($myTmpObjectKey).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
573 } else {
574 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
575 }
576 print '</td>';
577
578 print "</tr>\n";
579 }
580 }
581 }
582 }
583 }
584 }
585 }
586 }
587
588 print '</table>';
589 }
590}
591
592if (empty($setupnotempty)) {
593 print '<br>'.$langs->trans("NothingToSetup");
594}
595
596// Page end
597print dol_get_fiche_end();
598
599llxFooter();
600$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition admin.lib.php:68
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.
This class help you create setup render.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
mymoduleAdminPrepareHead()
Prepare admin pages header.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.