Commit 15720407 authored by Anthony Geourjon's avatar Anthony Geourjon

Fix bug, student get all the event

parent 2aefbccd
Pipeline #50033 passed with stage
in 4 minutes and 41 seconds
......@@ -739,7 +739,7 @@ class Event
if ($onlyInvited) $sql = "SELECT DISTINCT(e.id),e.projectId,e.label as name, e.eventDate FROM *%%events e, *%%events_element ee WHERE ((ee.parameters='$userId' AND ee.type='INVITE_USER' AND ee.status=1) OR e.ownerId='$userId') AND (e.eventDate BETWEEN '$beginDate' AND '$endDate') ORDER BY e.eventDate ASC";
else if ($isStudent == true) {
$sql = "SELECT DISTINCT(e.id),e.projectId,e.label as name, e.eventDate FROM *%%events e, *%%projects_position po, *%%projects_member m WHERE m.userId='$userId' AND po.projectId=e.projectId /**AND m.positionId=po.id **/ AND (e.eventDate BETWEEN '$beginDate' AND '$endDate') ORDER BY e.eventDate ASC";
$sql = "SELECT DISTINCT(e.id),e.projectId,e.label as name, e.eventDate FROM *%%events e, *%%projects_position po, *%%projects_member m WHERE m.userId='$userId' AND po.projectId=e.projectId AND m.positionId=po.id AND (e.eventDate BETWEEN '$beginDate' AND '$endDate') ORDER BY e.eventDate ASC";
} else {
$sql = "SELECT DISTINCT(e.id),e.projectId,e.label as name, e.eventDate FROM *%%events e, *%%projects_position po, *%%projects_member m WHERE m.userId='$userId' AND po.projectId=e.projectId AND m.positionId=po.id AND (e.eventDate BETWEEN '$beginDate' AND '$endDate') ORDER BY e.eventDate ASC";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment