coding guideline and behat fixes
authorDan Marsden <dan@danmarsden.com>
Thu, 19 Nov 2015 22:36:23 +0000 (11:36 +1300)
committerDan Marsden <dan@danmarsden.com>
Thu, 19 Nov 2015 22:36:23 +0000 (11:36 +1300)
locallib.php
renderer.php
sessions.php
tests/behat/extra_features.feature

index 0cda77e..cd6d622 100644 (file)
@@ -1134,9 +1134,8 @@ class attendance {
     public function get_user_taken_sessions_count($userid) {
         if (!array_key_exists($userid, $this->usertakensesscount)) {
             if (!empty($this->pageparams->startdate) && !empty($this->pageparams->enddate)) {
-                $this->usertakensesscount[$userid] =
-                    att_get_user_taken_sessions_count($this->id, $this->course->startdate, $userid,
-                                                      $this->cm, $this->pageparams->startdate, $this->pageparams->enddate);
+                $this->usertakensesscount[$userid] = att_get_user_taken_sessions_count($this->id, $this->course->startdate,
+                    $userid, $this->cm, $this->pageparams->startdate, $this->pageparams->enddate);
             } else {
                 $this->usertakensesscount[$userid] = att_get_user_taken_sessions_count($this->id, $this->course->startdate,
                                                                                        $userid, $this->cm);
index dafa78e..26a3d1a 100644 (file)
@@ -234,8 +234,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
             $dta = $this->construct_date_time_actions($sessdata, $sess);
 
             $table->data[$sess->id][] = $i;
-            $table->data[$sess->id][] = $sess->groupid ? $sessdata->groups[$sess->groupid]->name :
-                                                         get_string('commonsession', 'attendance');
+            $table->data[$sess->id][] = $sess->groupid ? $sessdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance');
             $table->data[$sess->id][] = $dta['date'];
             $table->data[$sess->id][] = $dta['time'];
             $table->data[$sess->id][] = $sess->description;
@@ -770,8 +769,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
 
             $row = new html_table_row();
             $row->cells[] = $i;
-            $row->cells[] = html_writer::tag('nobr', $sess->groupid ? $userdata->groups[$sess->groupid]->name :
-                                                                      get_string('commonsession', 'attendance'));
+            $row->cells[] = html_writer::tag('nobr', $sess->groupid ? $userdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance'));
             $row->cells[] = userdate($sess->sessdate, get_string('strftimedmyw', 'attendance'));
             $row->cells[] = $this->construct_time($sess->sessdate, $sess->duration);
             $row->cells[] = $sess->description;
@@ -1076,7 +1074,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
 
     /**
      * Construct a notice message
-     * 
+     *
      * @param string $text
      * @param string $class
      * @return string
index 817f98b..03d23f3 100644 (file)
@@ -71,8 +71,7 @@ switch ($att->pageparams->action) {
         if ($formdata = $mform->get_data()) {
             $sessions = construct_sessions_data_for_add($formdata);
             $att->add_sessions($sessions);
-            $message = count($sessions) == 1 ? get_string('sessiongenerated', 'attendance') :
-                                               get_string('sessionsgenerated', 'attendance', count($sessions));
+            $message = count($sessions) == 1 ? get_string('sessiongenerated', 'attendance') : get_string('sessionsgenerated', 'attendance', count($sessions));
             mod_attendance_notifyqueue::notify_success($message);
             // Redirect to the sessions tab always showing all sessions.
             $SESSION->attcurrentattview[$cm->course] = ATT_VIEW_ALL;
index e0d31e0..4eb467f 100644 (file)
@@ -171,7 +171,6 @@ Feature: Test the various new features in the attendance module
       | id_sessiondate_hour      | 10                     |
       | id_sessiondate_minute    | 0                      |
     And I click on "submitbutton" "button"
-    And I follow "Sessions"
     And I follow "Add"
     And I set the following fields to these values:
       | Create multiple sessions | 0                    |
@@ -179,7 +178,6 @@ Feature: Test the various new features in the attendance module
       | id_sessiondate_hour      | 11                   |
       | id_sessiondate_minute    | 0                    |
     And I click on "submitbutton" "button"
-    And I follow "Sessions"
 
     When I click on "Take attendance" "link" in the "10:00" "table_row"
     Then "Set status for all users to «Present»" "link" should exist