27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
38 $langs->loadLangs(array(
'agenda',
'admin',
'other'));
41 $actiontest =
GETPOST(
'test',
'alpha');
42 $actionsave =
GETPOST(
'save',
'alpha');
44 if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB = 5;
45 $MAXAGENDA = $conf->global->AGENDA_EXT_NB;
48 $colorlist = array(
'BECEDD',
'DDBECE',
'BFDDBE',
'F598B4',
'F68654',
'CBF654',
'A4A4A5');
59 $disableext =
GETPOST(
'AGENDA_DISABLE_EXT',
'alpha');
60 $res =
dolibarr_set_const($db,
'AGENDA_DISABLE_EXT', $disableext,
'chaine', 0,
'', $conf->entity);
62 $i = 1; $errorsaved = 0;
66 while ($i <= $MAXAGENDA)
68 $name = trim(
GETPOST(
'AGENDA_EXT_NAME'.$i,
'alpha'));
69 $src = trim(
GETPOST(
'AGENDA_EXT_SRC'.$i,
'alpha'));
70 $offsettz = trim(
GETPOST(
'AGENDA_EXT_OFFSETTZ'.$i,
'alpha'));
71 $color = trim(
GETPOST(
'AGENDA_EXT_COLOR'.$i,
'alpha'));
72 if ($color ==
'-1') $color =
'';
73 $enabled = trim(
GETPOST(
'AGENDA_EXT_ENABLED'.$i,
'alpha'));
84 $res =
dolibarr_set_const($db,
'AGENDA_EXT_NAME'.$i, $name,
'chaine', 0,
'', $conf->entity);
85 if (!($res > 0)) $error++;
86 $res =
dolibarr_set_const($db,
'AGENDA_EXT_SRC'.$i, $src,
'chaine', 0,
'', $conf->entity);
87 if (!($res > 0)) $error++;
88 $res =
dolibarr_set_const($db,
'AGENDA_EXT_OFFSETTZ'.$i, $offsettz,
'chaine', 0,
'', $conf->entity);
89 if (!($res > 0)) $error++;
90 $res =
dolibarr_set_const($db,
'AGENDA_EXT_COLOR'.$i, $color,
'chaine', 0,
'', $conf->entity);
91 if (!($res > 0)) $error++;
92 $res =
dolibarr_set_const($db,
'AGENDA_EXT_ENABLED'.$i, $enabled,
'chaine', 0,
'', $conf->entity);
93 if (!($res > 0)) $error++;
101 if (!($res > 0)) $error++;
102 if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB = 5;
103 $MAXAGENDA = empty($conf->global->AGENDA_EXT_NB) ? 5 : $conf->global->AGENDA_EXT_NB;
112 if (empty($errorsaved))
setEventMessages($langs->trans(
"Error"), null,
'errors');
120 $form =
new Form($db);
124 $arrayofjs = array();
125 $arrayofcss = array();
127 $wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
128 llxHeader(
'', $langs->trans(
"AgendaSetup"),
$wikihelp,
'', 0, 0, $arrayofjs, $arrayofcss);
130 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
133 print '<form name="extsitesconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
134 print '<input type="hidden" name="token" value="'.newToken().
'">';
135 print '<input type="hidden" name="action" value="save">';
141 print '<span class="opacitymedium">'.$langs->trans(
"AgendaExtSitesDesc").
"</span><br>\n";
145 $selectedvalue = $conf->global->AGENDA_DISABLE_EXT;
146 if ($selectedvalue == 1) $selectedvalue = 0;
else $selectedvalue = 1;
148 print "<table class=\"noborder\" width=\"100%\">";
150 print "<tr class=\"liste_titre\">";
151 print '<td>'.$langs->trans(
"Parameter").
"</td>";
152 print '<td class="center">'.$langs->trans(
"Value").
"</td>";
157 print '<tr class="oddeven">';
158 print "<td>".$langs->trans(
"ExtSitesEnableThisTool").
"</td>";
159 print '<td class="center">';
160 if ($conf->use_javascript_ajax)
164 if (empty($conf->global->AGENDA_DISABLE_EXT))
166 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?save=1&AGENDA_DISABLE_EXT=1">'.
img_picto($langs->trans(
"Enabled"),
'on').
'</a>';
168 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?save=1&AGENDA_DISABLE_EXT=0">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
176 print '<tr class="oddeven">';
177 print "<td>".$langs->trans(
"ExtSitesNbOfAgenda").
"</td>";
178 print '<td class="center">';
179 print '<input class="flat hideifnotset" type="text" size="2" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.
'">';
186 print "<table class=\"noborder\" width=\"100%\">";
188 print "<tr class=\"liste_titre\">";
189 print "<td>".$langs->trans(
"Parameter").
"</td>";
190 print "<td>".$langs->trans(
"Name").
"</td>";
191 print "<td>".$langs->trans(
"ExtSiteUrlAgenda").
" (".$langs->trans(
"Example").
': http://yoursite/agenda/agenda.ics)</td>';
192 print "<td>".$form->textwithpicto($langs->trans(
"FixTZ"), $langs->trans(
"FillFixTZOnlyIfRequired"), 1).
'</td>';
193 print '<td class="right">'.$langs->trans(
"Color").
'</td>';
197 while ($i <= $MAXAGENDA)
200 $name =
'AGENDA_EXT_NAME'.$key;
201 $src =
'AGENDA_EXT_SRC'.$key;
202 $offsettz =
'AGENDA_EXT_OFFSETTZ'.$key;
203 $color =
'AGENDA_EXT_COLOR'.$key;
204 $enabled =
'AGENDA_EXT_ENABLED'.$key;
207 print '<tr class="oddeven">';
209 print '<td width="180" class="nowrap">'.$langs->trans(
"AgendaExtNb", $key).
"</td>";
211 print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.
'" value="'.(
GETPOST(
'AGENDA_EXT_NAME'.$key) ?
GETPOST(
'AGENDA_EXT_NAME'.$key,
'alpha') : $conf->global->$name).
'" size="28"></td>';
213 print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.
'" value="'.(
GETPOST(
'AGENDA_EXT_SRC'.$key) ?
GETPOST(
'AGENDA_EXT_SRC'.$key,
'alpha') : $conf->global->$src).
'" size="60"></td>';
215 print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.
'" value="'.(
GETPOST(
'AGENDA_EXT_OFFSETTZ'.$key) ?
GETPOST(
'AGENDA_EXT_OFFSETTZ'.$key) : $conf->global->$offsettz).
'" size="2"></td>';
217 print '<td class="nowrap right">';
219 print $formother->selectColor((
GETPOST(
"AGENDA_EXT_COLOR".$key) ?
GETPOST(
"AGENDA_EXT_COLOR".$key) : $conf->global->$color),
"AGENDA_EXT_COLOR".$key,
'extsitesconfig', 1,
'',
'hideifnotset');
229 print '<div class="center">';
230 print '<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
agenda_prepare_head()
Prepare array with list of tabs.
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).
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
dol_is_url($url)
Return if path is an URL.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.