|
@@ -42,7 +42,7 @@ $actiontest=GETPOST('test','alpha');
|
|
|
$actionsave=GETPOST('save','alpha');
|
|
|
|
|
|
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
|
|
-$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
|
|
|
+$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
|
|
|
|
|
// List of available colors
|
|
|
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
|
@@ -50,7 +50,8 @@ $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5')
|
|
|
// Security check
|
|
|
$id = GETPOST('id','int');
|
|
|
$object = new User($db);
|
|
|
-$object->fetch($id);
|
|
|
+$object->fetch($id, '', '', 1);
|
|
|
+$object->getrights();
|
|
|
|
|
|
// Security check
|
|
|
$socid=0;
|
|
@@ -81,12 +82,12 @@ if (empty($reshook)) {
|
|
|
if ($actionsave) {
|
|
|
$db->begin();
|
|
|
|
|
|
- $i = 1;
|
|
|
$errorsaved = 0;
|
|
|
$error = 0;
|
|
|
$tabparam = array();
|
|
|
|
|
|
// Save agendas
|
|
|
+ $i = 1;
|
|
|
while ($i <= $MAXAGENDA) {
|
|
|
$name = trim(GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$i, 'alpha'));
|
|
|
$src = trim(GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$i, 'alpha'));
|
|
@@ -110,7 +111,7 @@ if (empty($reshook)) {
|
|
|
$tabparam['AGENDA_EXT_COLOR_'.$id.'_'.$i]=$color;
|
|
|
$tabparam['AGENDA_EXT_ENABLED_'.$id.'_'.$i]=$enabled;
|
|
|
|
|
|
- $i ++;
|
|
|
+ $i++;
|
|
|
}
|
|
|
|
|
|
if (!$error) {
|
|
@@ -167,7 +168,6 @@ print "<br>\n";
|
|
|
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
|
|
|
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
|
|
|
|
|
|
-$var=true;
|
|
|
print '<div class="div-table-responsive">';
|
|
|
print "<table class=\"noborder\" width=\"100%\">";
|
|
|
|
|
@@ -180,7 +180,6 @@ print '<td align="right">'.$langs->trans("Color").'</td>';
|
|
|
print "</tr>";
|
|
|
|
|
|
$i=1;
|
|
|
-$var=true;
|
|
|
while ($i <= $MAXAGENDA)
|
|
|
{
|
|
|
$key=$i;
|
|
@@ -189,7 +188,7 @@ while ($i <= $MAXAGENDA)
|
|
|
$offsettz='AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key;
|
|
|
$color='AGENDA_EXT_COLOR_'.$id.'_'.$key;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
print '<tr class="oddeven">';
|
|
|
// Nb
|
|
|
print '<td class="maxwidth50onsmartphone">'.$langs->trans("AgendaExtNb",$key)."</td>";
|