2011-04-22 10:50:25 +02:00
|
|
|
<?php
|
2015-06-30 21:50:24 +02:00
|
|
|
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
2015-05-09 13:25:40 +02:00
|
|
|
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
2015-04-18 19:47:09 +02:00
|
|
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
2016-01-08 14:47:46 +01:00
|
|
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
2024-11-04 23:53:20 +01:00
|
|
|
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
2024-03-17 14:48:32 +01:00
|
|
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
2011-04-22 10:50:25 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2011-04-22 10:50:25 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2011-04-22 10:50:25 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \file htdocs/admin/agenda_extsites.php
|
|
|
|
|
* \ingroup agenda
|
|
|
|
|
* \brief Page to setup external calendars for agenda module
|
|
|
|
|
*/
|
|
|
|
|
|
2022-09-07 20:08:59 +02:00
|
|
|
// Load Dolibarr environment
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
2014-03-22 13:00:23 +01:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2024-11-04 23:53:20 +01:00
|
|
|
/**
|
|
|
|
|
* @var Conf $conf
|
|
|
|
|
* @var DoliDB $db
|
|
|
|
|
* @var HookManager $hookmanager
|
|
|
|
|
* @var Translate $langs
|
|
|
|
|
* @var User $user
|
|
|
|
|
*/
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!$user->admin) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2018-05-26 18:41:16 +02:00
|
|
|
// Load translation files required by the page
|
|
|
|
|
$langs->loadLangs(array('agenda', 'admin', 'other'));
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2011-05-19 19:29:44 +02:00
|
|
|
$def = array();
|
2021-08-31 18:14:16 +02:00
|
|
|
$action = GETPOST('action', 'alpha');
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2023-10-24 17:00:13 +02:00
|
|
|
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
2021-02-26 22:04:03 +01:00
|
|
|
$conf->global->AGENDA_EXT_NB = 5;
|
|
|
|
|
}
|
2024-01-05 04:18:53 +01:00
|
|
|
$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2019-09-14 20:58:12 +02:00
|
|
|
// List of available colors
|
2020-04-10 10:59:32 +02:00
|
|
|
$colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', 'A4A4A5');
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2024-08-24 14:25:51 +02:00
|
|
|
$reg = array();
|
|
|
|
|
|
2018-03-04 19:39:46 +01:00
|
|
|
|
2011-05-19 19:29:44 +02:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2018-03-04 19:39:46 +01:00
|
|
|
|
2021-08-31 18:14:16 +02:00
|
|
|
$error = 0;
|
|
|
|
|
$errors = array();
|
|
|
|
|
|
2021-08-31 18:34:26 +02:00
|
|
|
if (preg_match('/set_(.*)/', $action, $reg)) {
|
2021-08-31 18:30:11 +02:00
|
|
|
$db->begin();
|
|
|
|
|
|
|
|
|
|
$code = $reg[1];
|
|
|
|
|
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
|
|
|
|
|
|
|
|
|
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
2022-08-12 15:54:50 +02:00
|
|
|
if (!($res > 0)) {
|
2021-08-31 18:30:11 +02:00
|
|
|
$error++;
|
|
|
|
|
$errors[] = $db->lasterror();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($error) {
|
|
|
|
|
$db->rollback();
|
|
|
|
|
setEventMessages('', $errors, 'errors');
|
|
|
|
|
} else {
|
|
|
|
|
$db->commit();
|
|
|
|
|
setEventMessage($langs->trans('SetupSaved'));
|
|
|
|
|
header('Location: ' . $_SERVER["PHP_SELF"]);
|
|
|
|
|
exit();
|
|
|
|
|
}
|
2021-08-31 18:34:26 +02:00
|
|
|
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
2021-08-31 18:30:11 +02:00
|
|
|
$db->begin();
|
|
|
|
|
|
|
|
|
|
$code = $reg[1];
|
|
|
|
|
|
|
|
|
|
$res = dolibarr_del_const($db, $code, $conf->entity);
|
2022-08-12 15:54:50 +02:00
|
|
|
if (!($res > 0)) {
|
2021-08-31 18:30:11 +02:00
|
|
|
$error++;
|
|
|
|
|
$errors[] = $db->lasterror();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($error) {
|
|
|
|
|
$db->rollback();
|
|
|
|
|
setEventMessages('', $errors, 'errors');
|
|
|
|
|
} else {
|
|
|
|
|
$db->commit();
|
|
|
|
|
setEventMessage($langs->trans('SetupSaved'));
|
|
|
|
|
header('Location: ' . $_SERVER["PHP_SELF"]);
|
|
|
|
|
exit();
|
|
|
|
|
}
|
2021-08-31 18:14:16 +02:00
|
|
|
} elseif ($action == 'save') {
|
2020-10-31 14:32:18 +01:00
|
|
|
$db->begin();
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2020-10-31 14:32:18 +01:00
|
|
|
$disableext = GETPOST('AGENDA_DISABLE_EXT', 'alpha');
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_DISABLE_EXT', $disableext, 'chaine', 0, '', $conf->entity);
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2023-12-04 11:41:14 +01:00
|
|
|
$i = 1;
|
|
|
|
|
$errorsaved = 0;
|
2011-05-19 19:29:44 +02:00
|
|
|
|
|
|
|
|
// Save agendas
|
2021-02-26 22:04:03 +01:00
|
|
|
while ($i <= $MAXAGENDA) {
|
2020-04-10 10:59:32 +02:00
|
|
|
$name = trim(GETPOST('AGENDA_EXT_NAME'.$i, 'alpha'));
|
|
|
|
|
$src = trim(GETPOST('AGENDA_EXT_SRC'.$i, 'alpha'));
|
|
|
|
|
$offsettz = trim(GETPOST('AGENDA_EXT_OFFSETTZ'.$i, 'alpha'));
|
|
|
|
|
$color = trim(GETPOST('AGENDA_EXT_COLOR'.$i, 'alpha'));
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($color == '-1') {
|
|
|
|
|
$color = '';
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$enabled = trim(GETPOST('AGENDA_EXT_ENABLED'.$i, 'alpha'));
|
|
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!empty($src) && !dol_is_url($src)) {
|
2015-10-23 12:58:30 +02:00
|
|
|
setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors');
|
2013-03-01 18:10:19 +01:00
|
|
|
$error++;
|
|
|
|
|
$errorsaved++;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-03-13 23:05:34 +01:00
|
|
|
|
2014-05-23 04:28:57 +02:00
|
|
|
//print '-name='.$name.'-color='.$color;
|
2024-03-07 20:16:48 +01:00
|
|
|
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_NAME'.$i, $name, 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_SRC'.$i, $src, 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_OFFSETTZ'.$i, $offsettz, 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_ENABLED'.$i, $enabled, 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2011-05-19 19:29:44 +02:00
|
|
|
$i++;
|
|
|
|
|
}
|
2013-03-13 23:05:34 +01:00
|
|
|
|
2011-05-19 19:29:44 +02:00
|
|
|
// Save nb of agenda
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!$error) {
|
2024-03-17 14:48:32 +01:00
|
|
|
$res = dolibarr_set_const($db, 'AGENDA_EXT_NB', GETPOSTINT('AGENDA_EXT_NB'), 'chaine', 0, '', $conf->entity);
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!($res > 0)) {
|
|
|
|
|
$error++;
|
|
|
|
|
}
|
2023-10-24 17:00:13 +02:00
|
|
|
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
2021-02-26 22:04:03 +01:00
|
|
|
$conf->global->AGENDA_EXT_NB = 5;
|
|
|
|
|
}
|
2024-01-05 03:41:22 +01:00
|
|
|
$MAXAGENDA = getDolGlobalInt('AGENDA_EXT_NB', 5);
|
2013-03-01 18:10:19 +01:00
|
|
|
}
|
2013-03-13 23:05:34 +01:00
|
|
|
|
2021-02-26 22:04:03 +01:00
|
|
|
if (!$error) {
|
2020-10-31 14:32:18 +01:00
|
|
|
$db->commit();
|
|
|
|
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
|
|
|
|
} else {
|
|
|
|
|
$db->rollback();
|
2021-02-26 22:04:03 +01:00
|
|
|
if (empty($errorsaved)) {
|
|
|
|
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
|
|
|
|
}
|
2020-10-31 14:32:18 +01:00
|
|
|
}
|
2011-05-19 19:29:44 +02:00
|
|
|
}
|
2011-04-22 10:50:25 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$form = new Form($db);
|
|
|
|
|
$formadmin = new FormAdmin($db);
|
|
|
|
|
$formother = new FormOther($db);
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$arrayofjs = array();
|
|
|
|
|
$arrayofcss = array();
|
2011-06-11 04:25:05 +02:00
|
|
|
|
2023-02-16 17:52:41 +01:00
|
|
|
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
2024-06-08 14:53:14 +02:00
|
|
|
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-admin page-agenda-extsites');
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
2019-01-27 11:55:16 +01:00
|
|
|
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2015-06-30 21:50:24 +02:00
|
|
|
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
2019-12-18 23:12:31 +01:00
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
2015-06-30 21:50:24 +02:00
|
|
|
print '<input type="hidden" name="action" value="save">';
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$head = agenda_prepare_head();
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2020-10-22 22:50:03 +02:00
|
|
|
print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action');
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2019-04-10 15:45:55 +02:00
|
|
|
print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span><br>\n";
|
2013-03-13 23:05:34 +01:00
|
|
|
print "<br>\n";
|
|
|
|
|
|
2021-08-31 18:14:16 +02:00
|
|
|
|
2023-02-08 12:18:46 +01:00
|
|
|
$selectedvalue = getDolGlobalInt('AGENDA_DISABLE_EXT');
|
2024-03-07 20:16:48 +01:00
|
|
|
if ($selectedvalue == 1) {
|
|
|
|
|
$selectedvalue = 0;
|
2023-12-04 11:41:14 +01:00
|
|
|
} else {
|
2024-03-07 20:16:48 +01:00
|
|
|
$selectedvalue = 1;
|
2023-12-04 11:41:14 +01:00
|
|
|
}
|
2021-08-31 18:14:16 +02:00
|
|
|
|
2024-11-29 14:17:53 +01:00
|
|
|
print "<table class=\"noborder centpercent\">";
|
2011-04-22 10:50:25 +02:00
|
|
|
|
2011-05-19 19:29:44 +02:00
|
|
|
print "<tr class=\"liste_titre\">";
|
2013-03-13 23:05:34 +01:00
|
|
|
print '<td>'.$langs->trans("Parameter")."</td>";
|
2024-11-29 14:17:53 +01:00
|
|
|
print '<td class="center"></td>';
|
2011-05-19 19:29:44 +02:00
|
|
|
print "</tr>";
|
|
|
|
|
|
2013-03-13 23:05:34 +01:00
|
|
|
// Show external agenda
|
2017-04-14 11:22:48 +02:00
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
2013-03-13 23:05:34 +01:00
|
|
|
print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>";
|
2019-02-23 21:57:35 +01:00
|
|
|
print '<td class="center">';
|
2021-02-26 22:04:03 +01:00
|
|
|
if ($conf->use_javascript_ajax) {
|
2024-03-07 20:16:48 +01:00
|
|
|
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled' => array(0 => '.hideifnotset')), null, 1);
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2023-10-24 17:00:13 +02:00
|
|
|
if (!getDolGlobalString('AGENDA_DISABLE_EXT')) {
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
2020-05-21 09:35:30 +02:00
|
|
|
} else {
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<a href="'.$_SERVER['PHP_SELF'].'?save=1&AGENDA_DISABLE_EXT=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
2013-03-30 14:27:13 +01:00
|
|
|
}
|
|
|
|
|
}
|
2011-05-19 19:29:44 +02:00
|
|
|
print "</td>";
|
|
|
|
|
print "</tr>";
|
|
|
|
|
|
2013-03-13 23:05:34 +01:00
|
|
|
// Nb of agenda
|
2017-04-14 11:22:48 +02:00
|
|
|
|
|
|
|
|
print '<tr class="oddeven">';
|
2013-03-30 14:27:13 +01:00
|
|
|
print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>";
|
2019-02-23 21:57:35 +01:00
|
|
|
print '<td class="center">';
|
2024-05-07 14:13:57 +02:00
|
|
|
print '<input class="flat hideifnotset width50 center" type="text" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="' . getDolGlobalString('AGENDA_EXT_NB').'">';
|
2013-03-30 14:27:13 +01:00
|
|
|
print "</td>";
|
|
|
|
|
print "</tr>";
|
2013-03-13 23:05:34 +01:00
|
|
|
|
2011-05-19 19:29:44 +02:00
|
|
|
print "</table>";
|
|
|
|
|
print "<br>";
|
|
|
|
|
|
2024-05-07 14:07:29 +02:00
|
|
|
print '<div class="div-table-responsive">';
|
|
|
|
|
print '<table class="noborder centpercent">'."\n";
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2024-05-07 14:07:29 +02:00
|
|
|
print '<tr class="liste_titre">';
|
2011-05-19 19:29:44 +02:00
|
|
|
print "<td>".$langs->trans("Parameter")."</td>";
|
|
|
|
|
print "<td>".$langs->trans("Name")."</td>";
|
2011-06-08 22:45:09 +02:00
|
|
|
print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>';
|
2016-03-25 15:24:57 +01:00
|
|
|
print "<td>".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).'</td>';
|
2019-01-22 11:37:23 +01:00
|
|
|
print '<td class="right">'.$langs->trans("Color").'</td>';
|
2021-08-31 18:14:16 +02:00
|
|
|
print '<td class="right">'.$langs->trans("ActiveByDefault").'</td>';
|
2011-05-19 19:29:44 +02:00
|
|
|
print "</tr>";
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$i = 1;
|
2021-02-26 22:04:03 +01:00
|
|
|
while ($i <= $MAXAGENDA) {
|
2020-04-10 10:59:32 +02:00
|
|
|
$key = $i;
|
2021-08-31 18:35:56 +02:00
|
|
|
$name = 'AGENDA_EXT_NAME' . $key;
|
|
|
|
|
$src = 'AGENDA_EXT_SRC' . $key;
|
|
|
|
|
$offsettz = 'AGENDA_EXT_OFFSETTZ' . $key;
|
|
|
|
|
$color = 'AGENDA_EXT_COLOR' . $key;
|
|
|
|
|
$enabled = 'AGENDA_EXT_ENABLED' . $key;
|
|
|
|
|
$default = 'AGENDA_EXT_ACTIVEBYDEFAULT' . $key;
|
2017-08-22 08:12:30 +02:00
|
|
|
|
2017-04-14 11:22:48 +02:00
|
|
|
print '<tr class="oddeven">';
|
2024-03-07 20:16:48 +01:00
|
|
|
// Nb @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
2021-08-31 18:35:56 +02:00
|
|
|
print '<td width="180" class="nowrap">' . $langs->trans("AgendaExtNb", $key) . "</td>";
|
2013-03-01 18:10:19 +01:00
|
|
|
// Name
|
2021-08-31 18:35:56 +02:00
|
|
|
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') : getDolGlobalString($name)) . '" size="28"></td>';
|
2013-03-01 18:10:19 +01:00
|
|
|
// URL
|
2021-08-31 18:35:56 +02:00
|
|
|
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') : getDolGlobalString($src)) . '" size="60"></td>';
|
2015-07-28 18:12:45 +02:00
|
|
|
// Offset TZ
|
2021-08-31 18:35:56 +02:00
|
|
|
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>';
|
2013-03-01 18:10:19 +01:00
|
|
|
// Color (Possible colors are limited by Google)
|
2024-05-07 14:07:29 +02:00
|
|
|
print '<td class="nowraponall right">';
|
2024-09-18 03:27:25 +02:00
|
|
|
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR" . $key) ? GETPOST("AGENDA_EXT_COLOR" . $key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR" . $key, 'extsitesconfig', 1, array(), 'hideifnotset');
|
2011-05-19 19:29:44 +02:00
|
|
|
print '</td>';
|
2021-08-31 18:14:16 +02:00
|
|
|
// Calendar active by default
|
|
|
|
|
print '<td class="nowrap right">';
|
2022-12-09 15:57:18 +01:00
|
|
|
if (!empty($conf->use_javascript_ajax)) {
|
2021-08-31 18:34:26 +02:00
|
|
|
print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key);
|
2021-08-31 18:14:16 +02:00
|
|
|
} else {
|
2024-03-07 20:16:48 +01:00
|
|
|
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
2022-12-09 15:57:18 +01:00
|
|
|
if (getDolGlobalString($default)) {
|
2021-09-19 14:41:46 +02:00
|
|
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
2022-12-09 15:57:18 +01:00
|
|
|
} else {
|
|
|
|
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_AGENDA_EXT_ACTIVEBYDEFAULT' . $key . '&token='.newToken().'">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
|
2021-08-31 18:14:16 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
2011-05-19 19:29:44 +02:00
|
|
|
print "</tr>";
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</table>';
|
2024-05-07 14:07:29 +02:00
|
|
|
print '</div>';
|
2015-06-30 21:50:24 +02:00
|
|
|
|
2020-10-27 18:19:31 +01:00
|
|
|
print dol_get_fiche_end();
|
2011-05-19 19:29:44 +02:00
|
|
|
|
2014-11-25 20:13:43 +01:00
|
|
|
print '<div class="center">';
|
2020-11-19 20:23:38 +01:00
|
|
|
print '<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans("Save").'">';
|
2014-11-25 20:13:43 +01:00
|
|
|
print '</div>';
|
2011-04-22 10:50:25 +02:00
|
|
|
|
|
|
|
|
print "</form>\n";
|
|
|
|
|
|
2018-07-28 14:29:28 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2013-03-01 18:10:19 +01:00
|
|
|
$db->close();
|