diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index f2fce88dc31..b442a6266ec 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -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();
});
});
- ';
+ ';
print '';
}
@@ -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").': id]['transparency']?' checked':'').'">'.$langs->trans("Busy");
+ if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
print '';
// Realised by
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 0e06e1c2fa7..5f8ce1563de 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -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