Go to the documentation of this file.
25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
37 $langs->loadLangs(array(
'agenda',
'admin',
'other'));
40 $actiontest =
GETPOST(
'test',
'alpha');
41 $actionsave =
GETPOST(
'save',
'alpha');
42 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'useragenda';
44 if (empty($conf->global->AGENDA_EXT_NB)) {
45 $conf->global->AGENDA_EXT_NB = 5;
47 $MAXAGENDA = $conf->global->AGENDA_EXT_NB;
50 $colorlist = array(
'BECEDD',
'DDBECE',
'BFDDBE',
'F598B4',
'F68654',
'CBF654',
'A4A4A5');
54 $object =
new User($db);
55 $object->fetch($id,
'',
'', 1);
60 if ($user->socid > 0) {
61 $socid = $user->socid;
63 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
65 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
68 if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
73 $hookmanager->initHooks(array(
'usercard',
'useragenda',
'globalcard'));
79 $parameters = array(
'id'=>$socid);
80 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
85 if (empty($reshook)) {
95 while ($i <= $MAXAGENDA) {
96 $name = trim(
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$i,
'alpha'));
97 $src = trim(
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$i,
'alpha'));
98 $offsettz = trim(
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$i,
'alpha'));
99 $color = trim(
GETPOST(
'AGENDA_EXT_COLOR_'.$id.
'_'.$i,
'alpha'));
100 if ($color ==
'-1') {
103 $enabled = trim(
GETPOST(
'AGENDA_EXT_ENABLED_'.$id.
'_'.$i,
'alpha'));
112 $tabparam[
'AGENDA_EXT_NAME_'.$id.
'_'.$i] = $name;
113 $tabparam[
'AGENDA_EXT_SRC_'.$id.
'_'.$i] = $src;
114 $tabparam[
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$i] = $offsettz;
115 $tabparam[
'AGENDA_EXT_COLOR_'.$id.
'_'.$i] = $color;
116 $tabparam[
'AGENDA_EXT_ENABLED_'.$id.
'_'.$i] = $enabled;
123 if (!($result > 0)) {
133 if (empty($errorsaved)) {
148 $arrayofjs = array();
149 $arrayofcss = array();
151 llxHeader(
'', $langs->trans(
"UserSetup"),
'',
'', 0, 0, $arrayofjs, $arrayofcss);
154 print
'<form name="extsitesconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
155 print
'<input type="hidden" name="id" value="'.$id.
'">';
156 print
'<input type="hidden" name="token" value="'.newToken().
'">';
164 if ($user->rights->user->user->lire || $user->admin) {
165 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
168 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'" class="refid">';
169 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
170 $morehtmlref .=
'</a>';
172 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin,
'rowid',
'ref', $morehtmlref);
175 print
'<div class="underbanner clearboth"></div>';
178 print
'<span class="opacitymedium">'.$langs->trans(
"AgendaExtSitesDesc").
"</span><br>\n";
181 $selectedvalue = empty($conf->global->AGENDA_DISABLE_EXT) ? 0 : $conf->global->AGENDA_DISABLE_EXT;
182 if ($selectedvalue == 1) {
189 print
'<div class="div-table-responsive">';
190 print
'<table class="noborder centpercent">';
192 print
"<tr class=\"liste_titre\">";
193 print
"<td>".$langs->trans(
"Parameter").
"</td>";
194 print
"<td>".$langs->trans(
"Name").
"</td>";
195 print
"<td>".$langs->trans(
"ExtSiteUrlAgenda").
'<div class="hideonsmartphone opacitymedium">'.
" (".$langs->trans(
"Example").
': https://externalcalendar/agenda/agenda.ics)</div></td>';
196 print
"<td>".$form->textwithpicto($langs->trans(
"FixTZ"), $langs->trans(
"FillFixTZOnlyIfRequired"), 1).
'</td>';
197 print
'<td class="right">'.$langs->trans(
"Color").
'</td>';
201 while ($i <= $MAXAGENDA) {
203 $name =
'AGENDA_EXT_NAME_'.$id.
'_'.$key;
204 $src =
'AGENDA_EXT_SRC_'.$id.
'_'.$key;
205 $offsettz =
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key;
206 $color =
'AGENDA_EXT_COLOR_'.$id.
'_'.$key;
208 print
'<tr class="oddeven">';
210 print
'<td class="maxwidth50onsmartphone">'.$langs->trans(
"AgendaExtNb", $key).
"</td>";
212 $name_value = (
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$key) : (empty($object->
conf->$name) ?
'' : $object->
conf->$name));
213 print
'<td><input type="text" class="flat hideifnotset minwidth100 maxwidth100onsmartphone" name="AGENDA_EXT_NAME_'.$id.
'_'.$key.
'" value="'.$name_value.
'"></td>';
215 $src_value = (
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$key) : (empty($object->
conf->$src) ?
'' : $object->
conf->$src));
216 print
'<td><input type="url" class="flat hideifnotset width300" name="AGENDA_EXT_SRC_'.$id.
'_'.$key.
'" value="'.$src_value.
'"></td>';
218 $offsettz_value = (
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key) : (empty($object->
conf->$offsettz) ?
'' : $object->
conf->$offsettz));
219 print
'<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key.
'" value="'.$offsettz_value.
'" size="1"></td>';
221 print
'<td class="nowraponall right">';
223 $color_value = (
GETPOST(
"AGENDA_EXT_COLOR_".$id.
'_'.$key) ?
GETPOST(
"AGENDA_EXT_COLOR_".$id.
'_'.$key) : (empty($object->
conf->$color) ?
'ffffff' : $object->
conf->$color));
224 print $formother->selectColor($color_value,
"AGENDA_EXT_COLOR_".$id.
'_'.$key,
'extsitesconfig', 1,
'',
'hideifnotset');
233 $addition_button = array(
235 'label_key' =>
'Save',
236 'addclass' =>
'hideifnotset',
238 print
$form->buttonsSaveCancel(
"",
"", $addition_button);
dol_is_url($url)
Return if path is an URL.
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
user_prepare_head(User $object)
Prepare array with list of tabs.
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.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_set_user_param($db, $conf, &$user, $tab)
Save personnal parameter.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
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.
Class to manage Dolibarr users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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 ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.