30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
51$langs->loadLangs(array(
"admin",
"other",
"agenda"));
54$actionsave =
GETPOST(
'save',
'alpha');
56$MAIN_FICHINTER_EXPORT_PAST_DELAY =
getDolGlobalString(
'MAIN_FICHINTER_EXPORT_PAST_DELAY', 100);
57$MAIN_FICHINTER_EXPORT_CACHE =
getDolGlobalInt(
'MAIN_FICHINTER_EXPORT_CACHE');
60if (GETPOSTISSET(
'MAIN_FICHINTER_XCAL_EXPORTKEY')) {
61 $MAIN_FICHINTER_XCAL_EXPORTKEY = trim(
GETPOST(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'alpha'));
63if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_PAST_DELAY')) {
64 $MAIN_FICHINTER_EXPORT_PAST_DELAY = intval(
GETPOSTINT(
'MAIN_FICHINTER_EXPORT_PAST_DELAY'));
66if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_CACHE')) {
67 $MAIN_FICHINTER_EXPORT_CACHE = intval(
GETPOSTINT(
'MAIN_FICHINTER_EXPORT_CACHE'));
69if (GETPOSTISSET(
'MAIN_FICHINTER_EXPORT_FIX_TZ')) {
70 $MAIN_FICHINTER_EXPORT_FIX_TZ = trim(
GETPOST(
'MAIN_FICHINTER_EXPORT_FIX_TZ',
'alpha'));
79 $i +=
dolibarr_set_const(
$db,
'MAIN_FICHINTER_XCAL_EXPORTKEY', $MAIN_FICHINTER_XCAL_EXPORTKEY,
'chaine', 0,
'',
$conf->entity);
80 $i +=
dolibarr_set_const(
$db,
'MAIN_FICHINTER_EXPORT_PAST_DELAY', $MAIN_FICHINTER_EXPORT_PAST_DELAY,
'chaine', 0,
'',
$conf->entity);
100 $conf->global->MAIN_FICHINTER_EXPORT_PAST_DELAY = 100;
103$wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
104llxHeader(
'', $langs->trans(
"AgendaSetup"),
$wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-agenda_xcal');
106$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>';
108print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
111print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
112print
'<input type="hidden" name="token" value="'.newToken().
'">';
118print
'<span class="opacitymedium">'.$langs->trans(
"AgendaSetupOtherDesc").
"</span><br>\n";
121print
'<div class="div-table-responsive">';
122print
'<table class="noborder centpercent">';
124print
'<tr class="liste_titre">';
125print
"<td>".$langs->trans(
"Parameter").
"</td>";
126print
"<td>".$langs->trans(
"Value").
"</td>";
128print
"<td> </td>";
131print
'<tr class="oddeven">';
132print
'<td class="fieldrequired">'.$langs->trans(
"PasswordTogetVCalExport").
"</td>";
133print
'<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).
'">';
134if (!empty(
$conf->use_javascript_ajax)) {
135 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
138print
"<td> </td>";
141print
'<tr class="oddeven">';
142print
"<td>".$langs->trans(
"PastDelayVCalExport").
"</td>";
143print
'<td><input type="text" class="flat width50 right" name="MAIN_FICHINTER_EXPORT_PAST_DELAY" value="'.$MAIN_FICHINTER_EXPORT_PAST_DELAY.
'"> '.$langs->trans(
"days").
"</td>";
144print
"<td> </td>";
147print
'<tr class="oddeven">';
148print
"<td>".$langs->trans(
"UseACacheDelay").
"</td>";
149print
'<td><input type="text" class="flat width50 right" name="MAIN_FICHINTER_EXPORT_CACHE" value="'.$MAIN_FICHINTER_EXPORT_CACHE.
'"></td>';
150print
"<td> </td>";
158print
'<div class="div-table-responsive">';
159print
'<table class="noborder centpercent">';
161print
'<tr class="liste_titre">';
162print
'<td width="25%">'.$langs->trans(
"Parameter").
"</td>";
163print
"<td>".$langs->trans(
"Value").
"</td>";
165print
'<tr class="oddeven">';
166print
'<td>'.$langs->trans(
"FixTZ").
"</td>";
168print
'<input class="flat" type="text" size="4" name="MAIN_FICHINTER_EXPORT_FIX_TZ" value="'.dol_escape_htmltag($MAIN_FICHINTER_EXPORT_FIX_TZ).
'">';
169print
' '.$langs->trans(
"FillThisOnlyIfRequired");
178print $form->buttonsSaveCancel(
"Save",
'');
191$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
193$getentity = (
$conf->entity > 1 ?
"&entity=".$conf->entity :
"");
198$urlvcal =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'" target="_blank" rel="noopener noreferrer">';
199$urlvcal .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'KEYNOTDEFINED')).
'</a>';
200$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlvcal,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'vcal',
'').
'</span>');
201$message .=
'<div class="urllink">';
202$message .=
'<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">';
204 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=vcal'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">'.
img_picto(
'',
'download').
'</a>';
207$message .= ajax_autoselect(
'onlinepaymenturl1');
210$urlical =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'" target="_blank" rel="noopener noreferrer">';
211$urlical .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=ical&type=event'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'KEYNOTDEFINED')).
'</a>';
212$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlical,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'ical/ics',
'').
'</span>');
213$message .=
'<div class="urllink">';
214$message .=
'<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">';
216 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=ical'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">'.
img_picto(
'',
'download').
'</a>';
219$message .= ajax_autoselect(
'onlinepaymenturl2');
222$urlrss =
'<a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'" target="_blank" rel="noopener noreferrer">';
223$urlrss .= $urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'KEYNOTDEFINED')).
'</a>';
224$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $urlrss,
'<span class="opacitymedium">'.$langs->trans(
"WebCalUrlForVCalExport",
'rss',
'').
'</span>');
225$message .=
'<div class="urllink">';
226$message .=
'<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" spellcheck="false" value="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">';
228 $message .=
' <a href="'.$urlwithroot.
'/public/fichinter/agendaexport.php?format=rss'.$getentity.
'&exportkey='.urlencode(
getDolGlobalString(
'MAIN_FICHINTER_XCAL_EXPORTKEY',
'...')).
'">'.
img_picto(
'',
'download').
'</a>';
231$message .= ajax_autoselect(
'onlinepaymenturl3');
236$message = $langs->trans(
"AgendaUrlOptions1", $user->login, $user->login).
'<br>';
237$message .= $langs->trans(
"AgendaUrlOptions3", $user->login, $user->login, $user->login).
'<br>';
238$message .= $langs->trans(
"AgendaUrlOptions4", $user->login, $user->login).
'<br>';
239$message .= $langs->trans(
"AgendaUrlOptionsProject", $user->login, $user->login).
'<br>';
240$message .= $langs->trans(
"AgendaUrlOptionsType",
'systemauto|system').
'<br>';
241$message .= $langs->trans(
"AgendaUrlOptionsCode",
'AC_COMPANY_CREATE,AC_PROPAL_VALIDATE,AC_CODE...').
'<br>';
242$message .= $langs->trans(
"AgendaUrlOptionsIncludeHolidays",
'1',
'1').
'<br>';
245$message .= $langs->trans(
"AgendaUrlOptionsLimit",
'1000').
'<br>';
249$constname =
'MAIN_FICHINTER_XCAL_EXPORTKEY';
252include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
global $dolibarr_main_url_root
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).
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.
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.
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)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
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, $morecssdiv='')
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.
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.
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.