Merge branch 'w18_MDL-32676_m23_yuibootstrap' of git://github.com/skodak/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 30 Apr 2012 00:26:07 +0000 (12:26 +1200)
committerSam Hemelryk <sam@moodle.com>
Mon, 30 Apr 2012 00:26:07 +0000 (12:26 +1200)
course/category.php
course/rest.php
grade/report/user/lib.php
mod/data/lib.php
mod/feedback/show_entries.php

index 6f4f57c..935b83a 100644 (file)
@@ -131,10 +131,8 @@ if ($editingon && $sesskeyprovided) {
         if ($course) {
             $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
             require_capability('moodle/course:visibility', $coursecontext);
-            // Set the visibility of the course
-            $DB->set_field('course', 'visible', $visible, array('id' => $course->id));
-            // we set the old flag when user manually changes visibility of course
-            $DB->set_field('course', 'visibleold', $visible, array('id' => $course->id));
+            // Set the visibility of the course. we set the old flag when user manually changes visibility of course.
+            $DB->update_record('course', array('id' => $course->id, 'visible' => $visible, 'visibleold' => $visible, 'timemodified' => time()));
         }
     }
 
index 72a2a9e..1fec1fc 100644 (file)
@@ -130,10 +130,6 @@ switch($requestmethod) {
                             $beforemod = NULL;
                         }
 
-                        if (debugging('',DEBUG_DEVELOPER)) {
-                            error_log(serialize($beforemod));
-                        }
-
                         moveto_module($cm, $section, $beforemod);
                         break;
                 }
index b57e8a1..915aefd 100644 (file)
@@ -347,6 +347,17 @@ class grade_report_user extends grade_report {
                     ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$grade_grade->is_hiddenuntil()))) {
                 // return false;
             } else {
+                // The grade object can be marked visible but still be hidden
+                // if "enablegroupmembersonly" is on and its an activity assigned to a grouping the user is not in
+                if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
+                    $instances = $this->gtree->modinfo->get_instances();
+                    if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
+                        $cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
+                        if (!$cm->uservisible) {
+                            return false;
+                        }
+                    }
+                }
                 /// Excluded Item
                 if ($grade_grade->is_excluded()) {
                     $fullname .= ' ['.get_string('excluded', 'grades').']';
index d816cc3..d846ea2 100644 (file)
@@ -1314,7 +1314,7 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
 
         $patterns[]='##approve##';
         if (has_capability('mod/data:approve', $context) && ($data->approval) && (!$record->approved)){
-            $replacement[] = '<span class="approve"><a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;approve='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->pix_url('i/approve') . '" class="icon" alt="'.get_string('approve').'" /></a></span>';
+            $replacement[] = '<span class="approve"><a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&amp;approve='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$OUTPUT->pix_url('i/approve') . '" class="iconsmall" alt="'.get_string('approve').'" /></a></span>';
         } else {
             $replacement[] = '';
         }
@@ -3604,4 +3604,4 @@ function data_get_advanced_search_sql($sort, $data, $recordids, $selectdata, $so
     $sqlselect['sql'] = "$nestselectsql $nestfromsql $sortorder";
     $sqlselect['params'] = $inparam;
     return $sqlselect;
-}
\ No newline at end of file
+}
index fba8c0e..1ee4b80 100644 (file)
@@ -214,9 +214,7 @@ if ($do_show == 'showentries') {
         echo '<div class="clearer"></div>';
         echo $OUTPUT->box_start('mdl-align');
         if (!$students) {
-            if ($courseid != SITEID) {
-                echo $OUTPUT->notification(get_string('noexistingparticipants', 'enrol'));
-            }
+            $table->print_html();
         } else {
             echo print_string('non_anonymous_entries', 'feedback');
             echo ' ('.count($students).')<hr />';