Fix events visibilities when connected as student see BT#11972

- show all student event
- show all events sent to everyone
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent ee8b90887d
commit 50e5f33870
  1. 6
      main/inc/lib/agenda.lib.php

@ -1688,7 +1688,6 @@ class Agenda
} else { } else {
$where_condition = "( ip.to_user_id = $user_id OR ip.to_user_id IS NULL OR (ip.to_group_id IN (0, ".implode(", ", $group_memberships).")) ) "; $where_condition = "( ip.to_user_id = $user_id OR ip.to_user_id IS NULL OR (ip.to_group_id IN (0, ".implode(", ", $group_memberships).")) ) ";
} }
//var_dump($where_condition);
if (empty($session_id)) { if (empty($session_id)) {
$sessionCondition = " $sessionCondition = "
@ -1730,11 +1729,12 @@ class Agenda
if (empty($user_id)) { if (empty($user_id)) {
$where_condition = ''; $where_condition = '';
} else { } else {
$where_condition = " (ip.to_user_id = ".$user_id.") AND ip.to_group_id IS NULL AND "; $where_condition = " (ip.to_user_id = ".$user_id.") AND (ip.to_group_id IS NULL OR ip.to_group_id = 0) AND ";
} }
$visibilityCondition = " (ip.visibility IN ('1', '0')) AND "; $visibilityCondition = " (ip.visibility IN ('1', '0')) AND ";
} else { } else {
$where_condition = " ( (ip.to_user_id = ".api_get_user_id().") AND ip.to_group_id IS NULL) AND "; // Show my items and also items sent to everyone
$where_condition = " ( (ip.to_user_id = ".api_get_user_id()." OR (ip.to_user_id = 0 or ip.to_user_id is NULL)) AND (ip.to_group_id IS NULL OR ip.to_group_id = 0)) AND ";
} }
if (empty($session_id)) { if (empty($session_id)) {

Loading…
Cancel
Save