28require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
34require_once
'../lib/bookcal.lib.php';
38$langs->loadLangs(array(
"admin",
"agenda"));
41$hookmanager->initHooks(array(
'bookcalsetup',
'globalsetup'));
49$action =
GETPOST(
'action',
'aZ09');
50$backtopage =
GETPOST(
'backtopage',
'alpha');
51$modulepart =
GETPOST(
'modulepart',
'aZ09');
53$value =
GETPOST(
'value',
'alpha');
54$label =
GETPOST(
'label',
'alpha');
55$scandir =
GETPOST(
'scan_dir',
'alpha');
65if (!class_exists(
'FormSetup')) {
66 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
73$item = $formSetup->newItem(
'BOOKCAL_PUBLIC_INTERFACE_TOPIC');
74$item->defaultFieldValue =
'MyBigCompany public interface for Bookcal';
76$setupnotempty = + count($formSetup->items);
79$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
87if (
versioncompare(explode(
'.', DOL_VERSION), array(15)) < 0 && $action ==
'update' && !empty($user->admin)) {
88 $formSetup->saveConfFromPost();
91include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
93if ($action ==
'updateMask') {
94 $maskconst =
GETPOST(
'maskconst',
'aZ09');
95 $maskvalue =
GETPOST(
'maskvalue',
'alpha');
97 if ($maskconst && preg_match(
'/_MASK$/', $maskconst)) {
98 $res =
dolibarr_set_const($db, $maskconst, $maskvalue,
'chaine', 0,
'', $conf->entity);
109} elseif ($action ==
'setmod') {
111 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
112 if (!empty($tmpobjectkey)) {
113 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
"_ADDON";
116} elseif ($action ==
'set') {
119} elseif ($action ==
'del') {
122 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
123 if (!empty($tmpobjectkey)) {
124 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
130} elseif ($action ==
'setdoc') {
132 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
133 if (!empty($tmpobjectkey)) {
134 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
138 $conf->global->$constforval = $value;
147} elseif ($action ==
'unsetdoc') {
148 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
149 if (!empty($tmpobjectkey)) {
150 $constforval =
'BOOKCAL_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
161$form =
new Form($db);
164$page_name =
"BookCalSetup";
166llxHeader(
'', $langs->trans($page_name), $help_url);
169$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
175print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
"fa-calendar-check");
180if ($action ==
'edit') {
181 print $formSetup->generateOutput(
true);
183} elseif (!empty($formSetup->items)) {
184 print $formSetup->generateOutput();
185 print
'<div class="tabsAction">';
186 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
189 print
'<br>'.$langs->trans(
"NothingToSetup");
193if (empty($setupnotempty)) {
194 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()
Empty header.
bookcalAdminPrepareHead()
Prepare admin pages header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.