27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
37 $langs->loadLangs(array(
"admin",
"other",
"agenda"));
40 $actionsave =
GETPOST(
'save',
'alpha');
48 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_XCAL_EXPORTKEY', trim(
GETPOST(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'alpha')),
'chaine', 0,
'', $conf->entity);
49 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_EXPORT_PAST_DELAY', trim(
GETPOST(
'MAIN_AGENDA_EXPORT_PAST_DELAY',
'alpha')),
'chaine', 0,
'', $conf->entity);
50 $i +=
dolibarr_set_const($db,
'MAIN_AGENDA_EXPORT_CACHE', trim(
GETPOST(
'MAIN_AGENDA_EXPORT_CACHE',
'alpha')),
'chaine', 0,
'', $conf->entity);
51 $i +=
dolibarr_set_const($db,
'AGENDA_EXPORT_FIX_TZ', trim(
GETPOST(
'AGENDA_EXPORT_FIX_TZ',
'alpha')),
'chaine', 0,
'', $conf->entity);
68 if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
69 $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100;
72 $wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
75 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
76 print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
79 print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
80 print
'<input type="hidden" name="token" value="'.newToken().
'">';
86 print
'<span class="opacitymedium">'.$langs->trans(
"AgendaSetupOtherDesc").
"</span><br>\n";
89 print
'<table class="noborder centpercent">';
91 print
'<tr class="liste_titre">';
92 print
"<td>".$langs->trans(
"Parameter").
"</td>";
93 print
"<td>".$langs->trans(
"Value").
"</td>";
95 print
"<td> </td>";
98 print
'<tr class="oddeven">';
99 print
'<td class="fieldrequired">'.$langs->trans(
"PasswordTogetVCalExport").
"</td>";
100 print
'<td><input required="required" type="text" class="flat" id="MAIN_AGENDA_XCAL_EXPORTKEY" name="MAIN_AGENDA_XCAL_EXPORTKEY" value="'.(GETPOST(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'alpha') ?
GETPOST(
'MAIN_AGENDA_XCAL_EXPORTKEY',
'alpha') : $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY).
'" size="40">';
101 if (!empty($conf->use_javascript_ajax)) {
102 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
105 print
"<td> </td>";
108 print
'<tr class="oddeven">';
109 print
"<td>".$langs->trans(
"PastDelayVCalExport").
"</td>";
110 print
"<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_PAST_DELAY\" value=\"".(GETPOST(
'MAIN_AGENDA_EXPORT_PAST_DELAY',
'alpha') ?
GETPOST(
'MAIN_AGENDA_EXPORT_PAST_DELAY',
'alpha') : $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY).
"\" size=\"10\"> ".$langs->trans(
"days").
"</td>";
111 print
"<td> </td>";
114 print
'<tr class="oddeven">';
115 print
"<td>".$langs->trans(
"UseACacheDelay").
"</td>";
116 print
"<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_EXPORT_CACHE\" value=\"".(GETPOST(
'MAIN_AGENDA_EXPORT_CACHE',
'alpha') ?
GETPOST(
'MAIN_AGENDA_EXPORT_CACHE',
'alpha') : $conf->global->MAIN_AGENDA_EXPORT_CACHE).
"\" size=\"10\"></td>";
117 print
"<td> </td>";
124 print
'<table class="noborder centpercent">';
126 print
'<tr class="liste_titre">';
127 print
'<td width="25%">'.$langs->trans(
"Parameter").
"</td>";
128 print
"<td>".$langs->trans(
"Value").
"</td>";
130 print
'<tr class="oddeven">';
131 print
'<td>'.$langs->trans(
"FixTZ").
"</td>";
133 print
'<input class="flat" type="text" size="4" name="AGENDA_EXPORT_FIX_TZ" value="'.$conf->global->AGENDA_EXPORT_FIX_TZ.
'">';
134 print
' '.$langs->trans(
"FillThisOnlyIfRequired");
142 print
$form->buttonsSaveCancel(
"Save",
'');
154 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
155 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
157 $getentity = ($conf->entity > 1 ?
"&entity=".$conf->entity :
"");
162 $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">';
163 $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>';
164 $message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlvcal,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'vcal',
'').
'</span>');
165 $message .=
'<div class="urllink">';
166 $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) :
'...').
'">';
167 if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
168 $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>';
170 $message .=
'</div>';
174 $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">';
175 $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>';
176 $message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlical,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'ical/ics',
'').
'</span>');
177 $message .=
'<div class="urllink">';
178 $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) :
'...').
'">';
179 if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
180 $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>';
182 $message .=
'</div>';
186 $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">';
187 $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>';
188 $message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlrss,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'rss',
'').
'</span>');
189 $message .=
'<div class="urllink">';
190 $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) :
'...').
'">';
191 if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
192 $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>';
194 $message .=
'</div>';
200 $message = $langs->trans(
"AgendaUrlOptions1", $user->login, $user->login).
'<br>';
201 $message .= $langs->trans(
"AgendaUrlOptions3", $user->login, $user->login).
'<br>';
202 $message .= $langs->trans(
"AgendaUrlOptionsNotAdmin", $user->login, $user->login).
'<br>';
203 $message .= $langs->trans(
"AgendaUrlOptions4", $user->login, $user->login).
'<br>';
204 $message .= $langs->trans(
"AgendaUrlOptionsProject", $user->login, $user->login).
'<br>';
205 $message .= $langs->trans(
"AgendaUrlOptionsNotAutoEvent",
'systemauto',
'systemauto').
'<br>';
206 $message .= $langs->trans(
"AgendaUrlOptionsIncludeHolidays",
'1',
'1').
'<br>';
210 if (!empty($conf->use_javascript_ajax)) {
211 print
"\n".
'<script type="text/javascript">';
212 print
'$(document).ready(function () {
213 $("#generate_token").click(function() {
214 $.get( "'.DOL_URL_ROOT.
'/core/ajax/security.php", {
215 action: \'getrandompassword\',
219 $("#MAIN_AGENDA_XCAL_EXPORTKEY").val(token);
if($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
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(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
ajax_autoselect($htmlname, $addlink= '', $textonlink= 'Link')
Make content of an input box selected when we click into input field.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= 'hideonsmartphone', $textfordropdown= '')
Show information for admin users or standard users.
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)
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.