26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
38$langs->loadLangs(array(
'agenda',
'admin',
'other'));
41$actiontest =
GETPOST(
'test',
'alpha');
42$actionsave =
GETPOST(
'save',
'alpha');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'useragenda';
45if (empty($conf->global->AGENDA_EXT_NB)) {
46 $conf->global->AGENDA_EXT_NB = 5;
48$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
51$colorlist = array(
'BECEDD',
'DDBECE',
'BFDDBE',
'F598B4',
'F68654',
'CBF654',
'A4A4A5');
56if (!isset($id) || empty($id)) {
60$object =
new User($db);
61$object->fetch($id,
'',
'', 1);
66if ($user->socid > 0) {
67 $socid = $user->socid;
69$feature2 = (($socid && $user->hasRight(
'user',
'self',
'creer')) ?
'' :
'user');
71$result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
74if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
79$hookmanager->initHooks(array(
'usercard',
'useragenda',
'globalcard'));
85$parameters = array(
'id'=>$socid);
86$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
101 while ($i <= $MAXAGENDA) {
102 $name = trim(
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$i,
'alpha'));
103 $src = trim(
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$i,
'alpha'));
104 $offsettz = trim(
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$i,
'alpha'));
105 $color = trim(
GETPOST(
'AGENDA_EXT_COLOR_'.$id.
'_'.$i,
'alpha'));
106 if ($color ==
'-1') {
109 $enabled = trim(
GETPOST(
'AGENDA_EXT_ENABLED_'.$id.
'_'.$i,
'alpha'));
118 $tabparam[
'AGENDA_EXT_NAME_'.$id.
'_'.$i] = $name;
119 $tabparam[
'AGENDA_EXT_SRC_'.$id.
'_'.$i] = $src;
120 $tabparam[
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$i] = $offsettz;
121 $tabparam[
'AGENDA_EXT_COLOR_'.$id.
'_'.$i] = $color;
122 $tabparam[
'AGENDA_EXT_ENABLED_'.$id.
'_'.$i] = $enabled;
129 if (!($result > 0)) {
139 if (empty($errorsaved)) {
150$form =
new Form($db);
155$arrayofcss = array();
157$person_name = !empty($object->firstname) ? $object->lastname.
", ".$object->firstname : $object->lastname;
158$title = $person_name.
" - ".$langs->trans(
'ExtSites');
161llxHeader(
'', $title, $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
164print
'<form name="extsitesconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
165print
'<input type="hidden" name="id" value="'.$id.
'">';
166print
'<input type="hidden" name="token" value="'.newToken().
'">';
174if ($user->rights->user->user->lire || $user->admin) {
175 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
178$morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'&output=file&file='.urlencode(
dol_sanitizeFileName($object->getFullName($langs).
'.vcf')).
'" class="refid" rel="noopener">';
179$morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
180$morehtmlref .=
'</a>';
182$urltovirtualcard =
'/user/virtualcard.php?id='.((int) $object->id);
183$morehtmlref .=
dolButtonToOpenUrlInDialogPopup(
'publicvirtualcard', $langs->trans(
"PublicVirtualCardUrl").
' - '.$object->getFullName($langs),
img_picto($langs->trans(
"PublicVirtualCardUrl"),
'card',
'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard,
'',
'nohover');
185dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin,
'rowid',
'ref', $morehtmlref);
187print
'<div class="fichecenter">';
189print
'<div class="underbanner clearboth"></div>';
190print
'<table class="border tableforfield centpercent">';
193print
'<tr><td id="anchorforperms" class="titlefield">'.$langs->trans(
"Login").
'</td>';
194if (!empty($object->ldap_sid) && $object->statut == 0) {
195 print
'<td class="error">';
196 print $langs->trans(
"LoginAccountDisableInDolibarr");
201 if (property_exists($object,
'admin')) {
202 if (isModEnabled(
'multicompany') && !empty($object->admin) && empty($object->entity)) {
203 $addadmin .=
img_picto($langs->trans(
"SuperAdministratorDesc"),
"redstar",
'class="paddingleft"');
204 } elseif (!empty($object->admin)) {
205 $addadmin .=
img_picto($langs->trans(
"AdministratorDesc"),
"star",
'class="paddingleft"');
221print
'<span class="opacitymedium">'.$langs->trans(
"AgendaExtSitesDesc").
"</span><br>\n";
224$selectedvalue = empty($conf->global->AGENDA_DISABLE_EXT) ? 0 : $conf->global->AGENDA_DISABLE_EXT;
225if ($selectedvalue == 1) {
232print
'<div class="div-table-responsive">';
233print
'<table class="noborder centpercent">';
235print
"<tr class=\"liste_titre\">";
236print
"<td>".$langs->trans(
"Parameter").
"</td>";
237print
"<td>".$langs->trans(
"Name").
"</td>";
238print
"<td>".$langs->trans(
"ExtSiteUrlAgenda").
'<div class="hideonsmartphone opacitymedium">'.
" (".$langs->trans(
"Example").
': https://externalcalendar/agenda/agenda.ics)</div></td>';
239print
"<td>".$form->textwithpicto($langs->trans(
"FixTZ"), $langs->trans(
"FillFixTZOnlyIfRequired"), 1).
'</td>';
240print
'<td class="right">'.$langs->trans(
"Color").
'</td>';
244while ($i <= $MAXAGENDA) {
246 $name =
'AGENDA_EXT_NAME_'.$id.
'_'.$key;
247 $src =
'AGENDA_EXT_SRC_'.$id.
'_'.$key;
248 $offsettz =
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key;
249 $color =
'AGENDA_EXT_COLOR_'.$id.
'_'.$key;
251 print
'<tr class="oddeven">';
253 print
'<td class="maxwidth50onsmartphone">'.$langs->trans(
"AgendaExtNb", $key).
"</td>";
255 $name_value = (
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_NAME_'.$id.
'_'.$key) : (empty($object->
conf->$name) ?
'' : $object->
conf->$name));
256 print
'<td><input type="text" class="flat hideifnotset minwidth100 maxwidth100onsmartphone" name="AGENDA_EXT_NAME_'.$id.
'_'.$key.
'" value="'.$name_value.
'"></td>';
258 $src_value = (
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_SRC_'.$id.
'_'.$key) : (empty($object->
conf->$src) ?
'' : $object->
conf->$src));
259 print
'<td><input type="url" class="flat hideifnotset width300" name="AGENDA_EXT_SRC_'.$id.
'_'.$key.
'" value="'.$src_value.
'"></td>';
261 $offsettz_value = (
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key) ?
GETPOST(
'AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key) : (empty($object->
conf->$offsettz) ?
'' : $object->
conf->$offsettz));
262 print
'<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.
'_'.$key.
'" value="'.$offsettz_value.
'" size="1"></td>';
264 print
'<td class="nowraponall right">';
266 $color_value = (
GETPOST(
"AGENDA_EXT_COLOR_".$id.
'_'.$key) ?
GETPOST(
"AGENDA_EXT_COLOR_".$id.
'_'.$key) : (empty($object->
conf->$color) ?
'ffffff' : $object->
conf->$color));
267 print $formother->selectColor($color_value,
"AGENDA_EXT_COLOR_".$id.
'_'.$key,
'', 1,
'',
'hideifnotset');
276$addition_button = array(
278 'label_key' =>
'Save',
279 'addclass' =>
'hideifnotset',
281print $form->buttonsSaveCancel(
"",
"", $addition_button);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage Dolibarr users.
dol_is_url($url)
Return if path is an URL.
dol_set_user_param($db, $conf, &$user, $tab)
Save personnal parameter.
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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return 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)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
restrictedArea(User $user, $features, $object=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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
user_prepare_head(User $object)
Prepare array with list of tabs.