28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
38$langs->loadLangs(array(
"admin",
"other",
"agenda"));
41$actionsave =
GETPOST(
'save',
'alpha');
43$MAIN_AGENDA_EXPORT_PAST_DELAY =
getDolGlobalInt(
'MAIN_AGENDA_EXPORT_PAST_DELAY');
47if (GETPOSTISSET(
'MAIN_AGENDA_XCAL_EXPORTKEY')) {
48 $MAIN_AGENDA_XCAL_EXPORTKEY = trim(
GETPOST(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'alpha'));
50if (GETPOSTISSET(
'MAIN_AGENDA_EXPORT_PAST_DELAY')) {
51 $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(
GETPOST(
'MAIN_AGENDA_EXPORT_PAST_DELAY',
'int'));
53if (GETPOSTISSET(
'MAIN_AGENDA_EXPORT_CACHE')) {
54 $MAIN_AGENDA_EXPORT_CACHE = intval(
GETPOST(
'MAIN_AGENDA_EXPORT_CACHE',
'int'));
56if (GETPOSTISSET(
'AGENDA_EXPORT_FIX_TZ')) {
57 $AGENDA_EXPORT_FIX_TZ = trim(
GETPOST(
'AGENDA_EXPORT_FIX_TZ',
'alpha'));
66 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_XCAL_EXPORTKEY', $MAIN_AGENDA_XCAL_EXPORTKEY,
'chaine', 0,
'', $conf->entity);
67 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_EXPORT_PAST_DELAY', $MAIN_AGENDA_EXPORT_PAST_DELAY,
'chaine', 0,
'', $conf->entity);
68 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_EXPORT_CACHE', $MAIN_AGENDA_EXPORT_CACHE,
'chaine', 0,
'', $conf->entity);
69 $i +=
dolibarr_set_const($db,
'AGENDA_EXPORT_FIX_TZ', $AGENDA_EXPORT_FIX_TZ,
'chaine', 0,
'', $conf->entity);
86if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
87 $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100;
90$wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
93$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
94print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
97print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
98print
'<input type="hidden" name="token" value="'.newToken().
'">';
104print
'<span class="opacitymedium">'.$langs->trans(
"AgendaSetupOtherDesc").
"</span><br>\n";
107print
'<table class="noborder centpercent">';
109print
'<tr class="liste_titre">';
110print
"<td>".$langs->trans(
"Parameter").
"</td>";
111print
"<td>".$langs->trans(
"Value").
"</td>";
113print
"<td> </td>";
116print
'<tr class="oddeven">';
117print
'<td class="fieldrequired">'.$langs->trans(
"PasswordTogetVCalExport").
"</td>";
118print
'<td><input required="required" type="text" class="flat" id="MAIN_AGENDA_XCAL_EXPORTKEY" name="MAIN_AGENDA_XCAL_EXPORTKEY" value="'.dol_escape_htmltag($MAIN_AGENDA_XCAL_EXPORTKEY).
'" size="40">';
119if (!empty($conf->use_javascript_ajax)) {
120 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
123print
"<td> </td>";
126print
'<tr class="oddeven">';
127print
"<td>".$langs->trans(
"PastDelayVCalExport").
"</td>";
128print
"<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_PAST_DELAY\" value=\"".$MAIN_AGENDA_EXPORT_PAST_DELAY.
"\" size=\"10\"> ".$langs->trans(
"days").
"</td>";
129print
"<td> </td>";
132print
'<tr class="oddeven">';
133print
"<td>".$langs->trans(
"UseACacheDelay").
"</td>";
134print
"<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"".$MAIN_AGENDA_EXPORT_CACHE.
"\" size=\"10\"></td>";
135print
"<td> </td>";
142print
'<table class="noborder centpercent">';
144print
'<tr class="liste_titre">';
145print
'<td width="25%">'.$langs->trans(
"Parameter").
"</td>";
146print
"<td>".$langs->trans(
"Value").
"</td>";
148print
'<tr class="oddeven">';
149print
'<td>'.$langs->trans(
"FixTZ").
"</td>";
151print
'<input class="flat" type="text" size="4" name="AGENDA_EXPORT_FIX_TZ" value="'.dol_escape_htmltag($AGENDA_EXPORT_FIX_TZ).
'">';
152print
' '.$langs->trans(
"FillThisOnlyIfRequired");
160print $form->buttonsSaveCancel(
"Save",
'');
172$urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
173$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
175$getentity = ($conf->entity > 1 ?
"&entity=".$conf->entity :
"");
180$urlvcal =
'<a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'" target="_blank" rel="noopener noreferrer">';
181$urlvcal .= $urlwithroot.
'/public/agenda/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'KEYNOTDEFINED').
'</a>';
182$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlvcal,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'vcal',
'').
'</span>');
183$message .=
'<div class="urllink">';
184$message .=
'<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">';
185if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
186 $message .=
' <a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
192$urlical =
'<a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'" target="_blank" rel="noopener noreferrer">';
193$urlical .= $urlwithroot.
'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'KEYNOTDEFINED').
'</a>';
194$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlical,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'ical/ics',
'').
'</span>');
195$message .=
'<div class="urllink">';
196$message .=
'<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">';
197if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
198 $message .=
' <a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=ical'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
204$urlrss =
'<a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'" target="_blank" rel="noopener noreferrer">';
205$urlrss .= $urlwithroot.
'/public/agenda/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'KEYNOTDEFINED').
'</a>';
206$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlrss,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'rss',
'').
'</span>');
207$message .=
'<div class="urllink">';
208$message .=
'<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">';
209if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
210 $message .=
' <a href="'.$urlwithroot.
'/public/agenda/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
218$message = $langs->trans(
"AgendaUrlOptions1", $user->login, $user->login).
'<br>';
219$message .= $langs->trans(
"AgendaUrlOptions3", $user->login, $user->login).
'<br>';
220$message .= $langs->trans(
"AgendaUrlOptionsNotAdmin", $user->login, $user->login).
'<br>';
221$message .= $langs->trans(
"AgendaUrlOptions4", $user->login, $user->login).
'<br>';
222$message .= $langs->trans(
"AgendaUrlOptionsProject", $user->login, $user->login).
'<br>';
223$message .= $langs->trans(
"AgendaUrlOptionsNotAutoEvent",
'systemauto',
'systemauto').
'<br>';
224$message .= $langs->trans(
"AgendaUrlOptionsIncludeHolidays",
'1',
'1').
'<br>';
228$constname =
'MAIN_AGENDA_XCAL_EXPORTKEY';
231include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
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).
agenda_prepare_head()
Prepare array with list of tabs.
if(GETPOSTISSET( 'MAIN_AGENDA_XCAL_EXPORTKEY')) if(GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) if(GETPOSTISSET( 'MAIN_AGENDA_EXPORT_CACHE')) if(GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) if( $actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
load_fiche_titre($titre, $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.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
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_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
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.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Ouput javacript to autoset a generated password using default module into a HTML element.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.