fixed the events index page that wasn't showing results

The index was not displaying any of the events because two of the columns
require the Course model but the Events model (the one being used) did not
contain the Course model.

I've added the Course model in the $belongsTo in the Events model.
 Please enter the commit message for your changes. Lines starting
fixed all the functions that uses getMyCourseList()

Before all the functions that uses getMyCourseList() uses the original one in sysContainer.
However we are not using it anymore. Instead we are using the getMyCourseList() in User.

This fixed the groups and surveys index that were not displaying any data.
fixed the filtering for evaluations index

Previously the filtering for Self Evals and Comments were not "fully"
working. They were able filter "Enabled" and "Required" respectively.
However, the filtering for "Disabled" and "Optional" returns "All".

Therefore I increased the value for the options by 1 (eg. from 0 to 1
and 1 to 2). This slight change fixed the filtering. It seems like the
ajax list does not like the value 0.

To ensure no bugs appear, I've also changed the events add view to assign
1 and 2 to the options instead of 0 and 1.
fixed a bug from the previous commit

Firstly, I've commited the evaluation controller instead of the events
controller, which I have added to this commit.

Secondly, I've fixed the bug when we add surveys. The default value added
for comments and self_evals were set to 0, which isn't used anymore. It
has not been corrected to use 1.
fixed the missing Course Home link in Evaluations view

It was using rdAuth to check whether to display the link or not. rdAuth
is not being used anymore. I've changed the if statement to check whether
$data is empty or not before displaying the link.
changed the link on the evaluations page to go to events index

Previously, the link goes to the evaluation index, which doesn't work.
So instead I have now used evaluations index to redirect to events index.

I have also added an extra (optional) parameter, which is the course id of
the current course or current event. Three different situations can happen
with this parameter. Firstly, if a valid id is inputted, the events index
will filter and display only the events for that course. Secondly, if no
course id is inputted, then the events index will display all the events in
the courses the user (not student) has access to. Lastly, if a course id that
is not numeric or not a valid id, "No Result" will be displayed.

I have also commented out the goToClassList function in the events
controller, because I  have placed that bit of code in the index itself.
fixed the problem with surveys not appearing in course home

The problem was the code was still using access which caused the Surveys
options to never appear. I have now changed it to use hasPermission from
User.
fixed syntax error for installation - database

For the installation with sample data, a semicolon was used instead of a
comma between tutor and student.

For the installation without sample data, I've added the tutor role, which
was not added.
changed the role id of student to 5

I've changed the role id for student to 5 (its new id).

Currently there is nothing for tutors = no permissions for anything.
fixed the link to survey results from course home

Previously, the link goes to the viewresult with the course id as the
parameter. However, viewresult has been changed to take the event id
as its parameter. So I made some adjustments.

The link from the course home has been changed to not entering any
parameters. If no event id is entered (eg. in this case) the viewresult
will display surveys from the current course (iPeerSession.courseId). If no
current course id exists, viewresult will go through its list of events to find
the first survey. The course the survey/event belongs to will be chosen to
be displayed.

No parameter - only courses with at least one survey will display any results,
otherwise an error message will be displayed (eg. No surveys found)

event id entered - only if the event with the event id is a survey would it
be displayed, otherwise the same error message will appear.
added permission restrictions to evaltools and simple evaluations

For evaltools, as long as the user has permission for the controller
evaltools, they can access their list of evaluation tools.

For simple evaluations, the user must have the  minimum requirement of
having permission for the controller simpleevaluation. The id entered must
also be numeric and valid (except for add and index).

For edit and delete, the user must also be at least one of the following:
creator, admin, or superadmin. For edit, there must also be no sumissions
in any of the events using the simple evaluation. For delete, no events can
exist using that particular simple evaluation.
added permission restrictions for rubrics, mixevals, and surveys

The permission restrictions are exactly the same as the ones for simple
evaluations.

I've also added the 'good' attribute for the successful messages for surveys.
changed the permission check for edit and delete

Instead of using role ids for part of the permission check for edit and
delete, I have changed it to using hasPermission.

I've added new permissions - functions/evaluation.

Instructors are denied access for edit and delete unless they are the
creator.
added new permissions

I've added permissions for evaluation (edit, delete).

Also, permissions for emails - regarding who the user can send emails
to - has also been added.
added permission restrictions for emailer

index - simply is a check if the user has access to the controller - emailer

write - if the $id entered is invalid (for course, group, or user), the
user will be redirected back to the index. I've also used the new permissions
functions/email/all... for checking if the user has permission to email
the specific class, group, or user with $id.

cancel - checked that the $id is valid and the user has permission to cancel
the schedule - creator, admin, or superadmin

view - same as delete

I've also added the 'good' attribute to the successful messages.
added permission restrictions for email templates

index/add - user must have permission for controller/emailtemplate

edit/delete/view - also checked the id is valid and the user has permission
to access that particular email template
fixed the students list for adding/editing groups + redirect for survey

Previously, the list of the students (in selected group and rest of class)
are not displaying in the form for creating/editing group.

For the students that are already assigned to other groups that needs an
asterix appended to their name - I've "find" them separately from the rest
of the class. Then merge the two lists together.

find('list') is the function we want to use (not find('all')), because it
helps making the edit work properly. If we use find('all') and then filter
it - the edit won't work properly - eg. if we just edit the name, the group
would be changed to having users with id 0 to 2 as members (eg. for 3 students)
In other words the array index was used as the id instead of the actual id.

find('list') wasn't working properly before - it ignores the "Group" and
"Enrolment" arrays we've "contained". To fix this, I've added the parameter
"recursive => 1".

Minor change - after copying a survey, I've redirected it to the index.
fixing the unstable build

I have changed the implementation of getStudentsNotinGroup in group model.
Therefore I had to change the test cases(where 2 of the errors occur). The
test cases now change student_no_with_full_name & asterix.

Previously, if the user has no student no, first name or last name,
student_no_with_full_name would be null (empty). So we have now used
a virtualFields variable that uses CONCAT_WS for full_name and
student_no_with_full_name instead.

One of the erros in the build was that the due date test. It so happened that
the due date was set to June 10, 2012, which just past. So we have now changed
it to June 10, 2022.
fixed the email to individual student link

Previously, the link goes to the email write with no recipients because
the second parameter is not given - the user id became the first parameter.
To fix this, I've added a first parameter, "U".
fixed the links for evaluations view

The links were not working before. I've fixed it by removing the exclamation
marks in the actions array.