30require
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
50$langs->loadLangs(array(
'agenda',
'admin',
'other'));
53$action =
GETPOST(
'action',
'alpha');
58$colorlist = array(
'BECEDD',
'DDBECE',
'BFDDBE',
'F598B4',
'F68654',
'CBF654',
'A4A4A5');
70if (preg_match(
'/set_(.*)/', $action, $reg)) {
79 $errors[] =
$db->lasterror();
88 header(
'Location: ' . $_SERVER[
"PHP_SELF"]);
91} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
99 $errors[] =
$db->lasterror();
108 header(
'Location: ' . $_SERVER[
"PHP_SELF"]);
111} elseif ($action ==
'save') {
114 $disableext =
GETPOST(
'AGENDA_DISABLE_EXT',
'alpha');
121 while ($i <= $MAXAGENDA) {
122 $name = trim(
GETPOST(
'AGENDA_EXT_NAME'.$i,
'alpha'));
123 $src = trim(
GETPOST(
'AGENDA_EXT_SRC'.$i,
'alpha'));
124 $offsettz = trim(
GETPOST(
'AGENDA_EXT_OFFSETTZ'.$i,
'alpha'));
125 $color = trim(
GETPOST(
'AGENDA_EXT_COLOR'.$i,
'alpha'));
126 if ($color ==
'-1') {
129 $enabled = trim(
GETPOST(
'AGENDA_EXT_ENABLED'.$i,
'alpha'));
168 if (empty($errorsaved)) {
183$arrayofcss = array();
185$wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
186llxHeader(
'', $langs->trans(
"AgendaSetup"), $wikihelp,
'', 0, 0, $arrayofjs, $arrayofcss,
'',
'mod-admin page-agenda-extsites');
188$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
190print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
192print
'<form name="extsitesconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
193print
'<input type="hidden" name="token" value="'.newToken().
'">';
194print
'<input type="hidden" name="action" value="save">';
200print
'<span class="opacitymedium">'.$langs->trans(
"AgendaExtSitesDesc").
"</span><br>\n";
204print
'<div class="div-table-responsive">';
205print
'<table class="noborder centpercent">'.
"\n";
207print
'<tr class="liste_titre">';
208print
'<td class="center">'.$langs->trans(
"AgendaExtNb",
"").
"</td>";
209print
"<td>".$langs->trans(
"Name").
"</td>";
210print
"<td>".$langs->trans(
"ExtSiteUrlAgenda");
211print
'<br><span class="hideonsmartphone opacitymedium">('.$langs->trans(
"Example").
': http://yoursite/agenda/agenda.ics)</span></td>';
212print
"<td>".$form->textwithpicto($langs->trans(
"FixTZ"), $langs->trans(
"FillFixTZOnlyIfRequired"), 1).
'</td>';
213print
'<td class="right">'.$langs->trans(
"Color").
'</td>';
214print
'<td class="center">'.$langs->trans(
"Enabled").
'</td>';
215print
'<td class="center">'.$langs->trans(
"ActiveByDefault").
'</td>';
219while ($i <= $MAXAGENDA) {
221 $name =
'AGENDA_EXT_NAME' . $key;
222 $src =
'AGENDA_EXT_SRC' . $key;
223 $offsettz =
'AGENDA_EXT_OFFSETTZ' . $key;
224 $color =
'AGENDA_EXT_COLOR' . $key;
225 $enabled =
'AGENDA_EXT_ENABLED' . $key;
226 $default =
'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
228 print
'<tr class="oddeven">';
231 print
'<td width="180" class="nowrap center">' . ((int) $key) .
"</td>";
234 print
'<td><input type="text" class="flat hideifnotset minwidth100 maxwidth100onsmartphone" name="AGENDA_EXT_NAME' . $key .
'" value="' . (
GETPOST(
'AGENDA_EXT_NAME' . $key) ?
GETPOST(
'AGENDA_EXT_NAME' . $key,
'alpha') :
getDolGlobalString($name)) .
'" size="28"></td>';
237 print
'<td><input type="url" class="flat hideifnotset width300" name="AGENDA_EXT_SRC' . $key .
'" value="' . (
GETPOST(
'AGENDA_EXT_SRC' . $key) ?
GETPOST(
'AGENDA_EXT_SRC' . $key,
'alpha') :
getDolGlobalString($src)) .
'" size="60"></td>';
240 print
'<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ' . $key .
'" value="' . (
GETPOST(
'AGENDA_EXT_OFFSETTZ' . $key) ?
GETPOST(
'AGENDA_EXT_OFFSETTZ' . $key) :
getDolGlobalString($offsettz)) .
'" size="2"></td>';
243 print
'<td class="nowraponall right">';
244 print $formother->selectColor((
GETPOST(
"AGENDA_EXT_COLOR" . $key) ?
GETPOST(
"AGENDA_EXT_COLOR" . $key) :
getDolGlobalString($color)),
"AGENDA_EXT_COLOR" . $key,
'', 1, array(),
'hideifnotset');
248 print
'<td class="nowrap center">';
249 if (!empty(
$conf->use_javascript_ajax)) {
250 print ajax_constantonoff(
'AGENDA_EXT_ENABLED' . $key, array(),
null, 0, 0, 1);
254 print
'<a href="' . $_SERVER[
'PHP_SELF'] .
'?action=del_AGENDA_EXT_ENABLED' . $key .
'&token='.newToken().
'">' .
img_picto($langs->trans(
"Disabled"),
'off') .
'</a>';
256 print
'<a href="' . $_SERVER[
'PHP_SELF'] .
'?action=set_AGENDA_EXT_ENABLED' . $key .
'&token='.newToken().
'">' .
img_picto($langs->trans(
"Enabled"),
'on') .
'</a>';
262 print
'<td class="nowrap center">';
263 if (!empty(
$conf->use_javascript_ajax)) {
266 print ajax_constantonoff(
'EMPTYPARAM', array(),
null, 0, 0, 1, 2, 0, 0,
'',
'',
'inline-block', 0,
'', $disabled);
268 print ajax_constantonoff(
'AGENDA_EXT_ACTIVEBYDEFAULT' . $key, array(),
null, 0, 0, 1, 2, 0, 0,
'',
'',
'inline-block', 0,
'');
273 print
'<a href="' . $_SERVER[
'PHP_SELF'] .
'?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key .
'&token='.newToken().
'">' .
img_picto($langs->trans(
"Disabled"),
'off') .
'</a>';
275 print
'<a href="' . $_SERVER[
'PHP_SELF'] .
'?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key .
'&token='.newToken().
'">' .
img_picto($langs->trans(
"Enabled"),
'on') .
'</a>';
288print
'<div class="center">';
289print
'<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans(
"Save").
'">';
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.
agenda_prepare_head()
Prepare array with list of tabs.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
dol_is_url($uri)
Return if path is an URI (the name of the method is misleading).
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a 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.