29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
39$langs->loadLangs(array(
"admin",
"other",
"agenda"));
42$actionsave =
GETPOST(
'save',
'alpha');
44$MAIN_FICHINTER_EXPORT_PAST_DELAY =
getDolGlobalString(
'MAIN_FICHINTER_EXPORT_PAST_DELAY', 100);
45$MAIN_FICHINTER_EXPORT_CACHE =
getDolGlobalInt(
'MAIN_FICHINTER_EXPORT_CACHE');
48if (GETPOSTISSET(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) {
49 $MAIN_FICHINTER_XCAL_EXPORTKEY = trim(
GETPOST(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'alpha'));
51if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_PAST_DELAY')) {
52 $MAIN_FICHINTER_EXPORT_PAST_DELAY = intval(
GETPOSTINT(
'MAIN_FICHINTER_EXPORT_PAST_DELAY'));
54if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_CACHE')) {
55 $MAIN_FICHINTER_EXPORT_CACHE = intval(
GETPOSTINT(
'MAIN_FICHINTER_EXPORT_CACHE'));
57if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_FIX_TZ')) {
58 $MAIN_FICHINTER_EXPORT_FIX_TZ = trim(
GETPOST(
'MAIN_FICHINTER_EXPORT_FIX_TZ',
'alpha'));
67 $i +=
dolibarr_set_const($db,
'MAIN_FICHINTER_XCAL_EXPORTKEY', $MAIN_FICHINTER_XCAL_EXPORTKEY,
'chaine', 0,
'', $conf->entity);
68 $i +=
dolibarr_set_const($db,
'MAIN_FICHINTER_EXPORT_PAST_DELAY', $MAIN_FICHINTER_EXPORT_PAST_DELAY,
'chaine', 0,
'', $conf->entity);
69 $i +=
dolibarr_set_const($db,
'MAIN_FICHINTER_EXPORT_CACHE', $MAIN_FICHINTER_EXPORT_CACHE,
'chaine', 0,
'', $conf->entity);
70 $i +=
dolibarr_set_const($db,
'MAIN_FICHINTER_EXPORT_FIX_TZ', $MAIN_FICHINTER_EXPORT_FIX_TZ,
'chaine', 0,
'', $conf->entity);
88 $conf->global->MAIN_FICHINTER_EXPORT_PAST_DELAY = 100;
91$wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
92llxHeader(
'', $langs->trans(
"AgendaSetup"),
$wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-agenda_xcal');
94$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
95print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
98print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
99print
'<input type="hidden" name="token" value="'.newToken().
'">';
105print
'<span class="opacitymedium">'.$langs->trans(
"AgendaSetupOtherDesc").
"</span><br>\n";
108print
'<div class="div-table-responsive">';
109print
'<table class="noborder centpercent">';
111print
'<tr class="liste_titre">';
112print
"<td>".$langs->trans(
"Parameter").
"</td>";
113print
"<td>".$langs->trans(
"Value").
"</td>";
115print
"<td> </td>";
118print
'<tr class="oddeven">';
119print
'<td class="fieldrequired">'.$langs->trans(
"PasswordTogetVCalExport").
"</td>";
120print
'<td><input required="required" type="text" class="flat minwidth100 maxwidth300 widthcentpercentminusx" id="MAIN_FICHINTER_XCAL_EXPORTKEY" name="MAIN_FICHINTER_XCAL_EXPORTKEY" value="'.dol_escape_htmltag($MAIN_FICHINTER_XCAL_EXPORTKEY).
'">';
121if (!empty($conf->use_javascript_ajax)) {
122 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
125print
"<td> </td>";
128print
'<tr class="oddeven">';
129print
"<td>".$langs->trans(
"PastDelayVCalExport").
"</td>";
130print
'<td><input type="text" class="flat width50 right" name="MAIN_FICHINTER_EXPORT_PAST_DELAY" value="'.$MAIN_FICHINTER_EXPORT_PAST_DELAY.
'"> '.$langs->trans(
"days").
"</td>";
131print
"<td> </td>";
134print
'<tr class="oddeven">';
135print
"<td>".$langs->trans(
"UseACacheDelay").
"</td>";
136print
'<td><input type="text" class="flat width50 right" name="MAIN_FICHINTER_EXPORT_CACHE" value="'.$MAIN_FICHINTER_EXPORT_CACHE.
'"></td>';
137print
"<td> </td>";
145print
'<div class="div-table-responsive">';
146print
'<table class="noborder centpercent">';
148print
'<tr class="liste_titre">';
149print
'<td width="25%">'.$langs->trans(
"Parameter").
"</td>";
150print
"<td>".$langs->trans(
"Value").
"</td>";
152print
'<tr class="oddeven">';
153print
'<td>'.$langs->trans(
"FixTZ").
"</td>";
155print
'<input class="flat" type="text" size="4" name="MAIN_FICHINTER_EXPORT_FIX_TZ" value="'.dol_escape_htmltag($MAIN_FICHINTER_EXPORT_FIX_TZ).
'">';
156print
' '.$langs->trans(
"FillThisOnlyIfRequired");
165print $form->buttonsSaveCancel(
"Save",
'');
177$urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
178$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
180$getentity = ($conf->entity > 1 ?
"&entity=".$conf->entity :
"");
185$urlvcal =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'" target="_blank" rel="noopener noreferrer">';
186$urlvcal .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'KEYNOTDEFINED').
'</a>';
187$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlvcal,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'vcal',
'').
'</span>');
188$message .=
'<div class="urllink">';
189$message .=
'<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">';
191 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
197$urlical =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'" target="_blank" rel="noopener noreferrer">';
198$urlical .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'KEYNOTDEFINED').
'</a>';
199$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlical,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'ical/ics',
'').
'</span>');
200$message .=
'<div class="urllink">';
201$message .=
'<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">';
203 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
209$urlrss =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'" target="_blank" rel="noopener noreferrer">';
210$urlrss .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'KEYNOTDEFINED').
'</a>';
211$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlrss,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'rss',
'').
'</span>');
212$message .=
'<div class="urllink">';
213$message .=
'<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">';
215 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.($conf->global->MAIN_FICHINTER_XCAL_EXPORTKEY ? urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) :
'...').
'">'.
img_picto(
'',
'download').
'</a>';
223$message = $langs->trans(
"AgendaUrlOptions1", $user->login, $user->login).
'<br>';
224$message .= $langs->trans(
"AgendaUrlOptions3", $user->login, $user->login, $user->login).
'<br>';
225$message .= $langs->trans(
"AgendaUrlOptions4", $user->login, $user->login).
'<br>';
226$message .= $langs->trans(
"AgendaUrlOptionsProject", $user->login, $user->login).
'<br>';
227$message .= $langs->trans(
"AgendaUrlOptionsType",
'systemauto|system').
'<br>';
228$message .= $langs->trans(
"AgendaUrlOptionsCode",
'AC_COMPANY_CREATE,AC_PROPAL_VALIDATE,AC_CODE...').
'<br>';
229$message .= $langs->trans(
"AgendaUrlOptionsIncludeHolidays",
'1',
'1').
'<br>';
232$message .= $langs->trans(
"AgendaUrlOptionsLimit",
'1000').
'<br>';
236$constname =
'MAIN_FICHINTER_XCAL_EXPORTKEY';
239include_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).
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.
fichinter_admin_prepare_head()
Return array head with list of tabs to view object information.
if(GETPOSTISSET( 'MAIN_FICHINTER_XCAL_EXPORTKEY')) if(GETPOSTISSET('MAIN_FICHINTER_EXPORT_PAST_DELAY')) if(GETPOSTISSET( 'MAIN_FICHINTER_EXPORT_CACHE')) if(GETPOSTISSET('MAIN_FICHINTER_EXPORT_FIX_TZ')) if( $actionsave) if(!getDolGlobalString("MAIN_FICHINTER_EXPORT_PAST_DELAY")) $wikihelp
View.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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 a Dolibarr global constant int value.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Output javascript 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.