Merge branch 'MDL-44606-master' of http://github.com/damyon/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 7 May 2014 06:18:13 +0000 (14:18 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 7 May 2014 06:18:13 +0000 (14:18 +0800)
report/eventlist/classes/list_generator.php
report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js
report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js
report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter.js
report/eventlist/yui/src/eventfilter/js/eventfilter.js

index 8db4688..b7483d6 100644 (file)
@@ -274,6 +274,9 @@ class report_eventlist_list_generator {
             }
         }
 
+        // Raw event data to be used to sort the "Event name" column.
+        $eventdata[$eventfullpath]['raweventname'] = $eventfullpath::get_name() . ' ' . $eventdata[$eventfullpath]['eventname'];
+
         // Unset information that is not currently required.
         unset($eventdata[$eventfullpath]['action']);
         unset($eventdata[$eventfullpath]['target']);
index 08010ce..8244277 100644 (file)
Binary files a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js and b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-debug.js differ
index 43f2c3c..6a32c9f 100644 (file)
Binary files a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js and b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter-min.js differ
index 08010ce..8244277 100644 (file)
Binary files a/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter.js and b/report/eventlist/yui/build/moodle-report_eventlist-eventfilter/moodle-report_eventlist-eventfilter.js differ
index 0bdf024..82c2578 100644 (file)
@@ -106,6 +106,22 @@ Y.extend(EventFilter, Y.Base, {
                     label: M.util.get_string('eventname', 'report_eventlist'),
                     allowHTML: true,
                     sortable: true,
+                    /**
+                     * Custom sort of the fulleventname column.
+                     * This will sort via the event name rather than the event path.
+                     *
+                     * @param {object} eventDataListA Event data record module A.
+                     * @param {object} eventDataListB Event data record module B.
+                     * @param {boolean} desc True sorts list in descending order and false sorts in Ascending order.
+                     * @return {number} order for which the column should be sorted.
+                     * @method sortFn
+                     */
+                    sortFn: function (eventDataListA, eventDataListB, desc) {
+                        var rawEventDataA = eventDataListA.getAttrs().raweventname,
+                            rawEventDataB = eventDataListB.getAttrs().raweventname,
+                            order = (rawEventDataA > rawEventDataB ? 1 : -1);
+                        return desc ? -order : order;
+                    },
                     title: M.util.get_string('eventname', 'report_eventlist')
                 }, {
                     key: "component",