28require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
32require_once
'../lib/bookcal.lib.php';
43$langs->loadLangs(array(
"admin",
"agenda"));
46$hookmanager->initHooks(array(
'bookcalsetup',
'globalsetup'));
54$action =
GETPOST(
'action',
'aZ09');
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$modulepart =
GETPOST(
'modulepart',
'aZ09');
58$value =
GETPOST(
'value',
'alpha');
59$label =
GETPOST(
'label',
'alpha');
60$scandir =
GETPOST(
'scan_dir',
'alpha');
70if (!class_exists(
'FormSetup')) {
71 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
78$item = $formSetup->newItem(
'BOOKCAL_PUBLIC_INTERFACE_TOPIC');
79$item->defaultFieldValue =
'MyBigCompany public interface for Bookcal';
81$setupnotempty = + count($formSetup->items);
84$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
92if (
versioncompare(explode(
'.', DOL_VERSION), array(15)) < 0 && $action ==
'update' && !empty($user->admin)) {
93 $formSetup->saveConfFromPost();
96include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
98if ($action ==
'updateMask') {
99 $maskconst =
GETPOST(
'maskconst',
'aZ09');
100 $maskvalue =
GETPOST(
'maskvalue',
'alpha');
102 if ($maskconst && preg_match(
'/_MASK$/', $maskconst)) {
114} elseif ($action ==
'setmod') {
116 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
117 if (!empty($tmpobjectkey)) {
118 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
"_ADDON";
121} elseif ($action ==
'set') {
124} elseif ($action ==
'del') {
127 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
128 if (!empty($tmpobjectkey)) {
129 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
135} elseif ($action ==
'setdoc') {
137 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
138 if (!empty($tmpobjectkey)) {
139 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
143 $conf->global->$constforval = $value;
152} elseif ($action ==
'unsetdoc') {
153 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
154 if (!empty($tmpobjectkey)) {
155 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
166$form =
new Form($db);
169$page_name =
"BookCalSetup";
171llxHeader(
'', $langs->trans($page_name), $help_url,
'', 0, 0,
'',
'',
'',
'mod-bookcal page-admin_setup');
174$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
180print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
"fa-calendar-check");
185if ($action ==
'edit') {
186 print $formSetup->generateOutput(
true);
188} elseif (!empty($formSetup->items)) {
189 print $formSetup->generateOutput();
190 print
'<div class="tabsAction">';
191 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
194 print
'<br>'.$langs->trans(
"NothingToSetup");
198if (empty($setupnotempty)) {
199 print
'<br>'.$langs->trans(
"NothingToSetup");
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).
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.
bookcalAdminPrepareHead()
Prepare admin pages header.
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.
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.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.