Fix: transparency of event was lost

This commit is contained in:
Laurent Destailleur 2015-08-14 13:01:20 +02:00
parent d19f1722a2
commit 1731b1a11b
2 changed files with 11 additions and 5 deletions

View File

@ -243,6 +243,8 @@ if ($action == 'add')
$object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$transparency=(GETPOST("transparency")=='on'?1:0);
$listofuserid=array();
if (! empty($_SESSION['assignedtouser'])) $listofuserid=json_decode($_SESSION['assignedtouser'], true);
$i=0;
@ -251,10 +253,10 @@ if ($action == 'add')
if ($i == 0) // First entry
{
if ($value['id'] > 0) $object->userownerid=$value['id'];
$object->transparency = (GETPOST("transparency")=='on'?1:0);
$object->transparency = $transparency;
}
$object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>(GETPOST("transparency")=='on'?1:0));
$object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>$transparency);
$i++;
}
@ -436,6 +438,8 @@ if ($action == 'update')
$i++;
}
$object->transparency = $transparency; // We set transparency on event (even if we can also store it on each user, standard says this property is for event)
if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{
if (GETPOST("doneby")) $object->userdoneid=GETPOST("doneby","int");
@ -969,7 +973,7 @@ if ($id > 0)
else if (jQuery("#recurrulefreq").val() == \'WEEKLY\')
{
jQuery(".repeateventBYMONTHDAY").hide();
jQuery(".repeateventBYDAY").show();
jQuery(".repeateventBYDAY").show();
}
else
{
@ -982,7 +986,7 @@ if ($id > 0)
init_repeat();
});
});
</script>';
</script>';
print '</td></tr>';
}
@ -1023,7 +1027,7 @@ if ($id > 0)
}
}
print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'">'.$langs->trans("Busy");
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
print '</td></tr>';
// Realised by

View File

@ -853,6 +853,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
// Scan all event for this date
foreach ($eventarray[$daykey] as $index => $event)
{
//var_dump($event);
$keysofuserassigned=array_keys($event->userassigned);
if (! in_array($username->id,$keysofuserassigned)) continue; // We discard record if event is from another user than user we want to show
//if ($username->id != $event->userownerid) continue; // We discard record if event is from another user than user we want to show