Issue Details (XML | Word | Printable)

Key: MDL-19277
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: moodle.com
Reporter: Tatsuya Shirai
Votes: 1
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

A function to add a new active filter to after deleting all active filters

Created: 22/May/09 04:53 PM   Updated: 03/Nov/09 12:18 PM
Return to search
Issue 100 of 575 issue(s)
<< Previous | MDL-19277 | Next >>
Component/s: Administration, Usability
Affects Version/s: 1.9.5
Fix Version/s: None

File Attachments: 1. Zip Archive NewInterface_BrowseListsofUser.zip (13 kB)
2. Zip Archive NewUserInterface_BrowseListsofUser_20090727_Shirai.zip (13 kB)
3. Zip Archive NewUserInterface_BrowseListsofUser_20091102_Shirai.zip (13 kB)

Image Attachments:

1. ManipulatingActiveFilters.jpg
(37 kB)

2. NewInterface20090723.jpg
(88 kB)
Issue Links:
Relates
 

Participants: Anthony Borrow, moodle.com and Tatsuya Shirai
Security Level: None
Difficulty: Easy
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
In 'Site Administration"-[Users]-[Accounts]-[Browse List of Users],
When we search the user newly, at first we must delete old active filters by pushing "Remove all filters".
We had developed a method to omit this troublesome work by adding new check box.
Let you try the new feature!

Patches for Moodle1.9 are as follows;
(adding one statement and one block, commenting out one statement only!)

(a) user/filters/lib.php

class user_filtering, function user_filtering()

        foreach ($fieldnames as $fieldname=>$advanced) {
            if ($field = $this->get_field($fieldname, $advanced)) {
                $this->_fields[$fieldname] = $field;
            }
        }

        // fist the new filter form
        $this->_addform = new user_add_filter_form($baseurl, array('fields'=>$this->_fields, 'extraparams'=>$extraparams));
        if ($adddata = $this->_addform->get_data(false)) {
// (Shirai): add from here
            if (!empty($adddata->removealladd) && ($adddata->removealladd)) $SESSION->user_filtering = array();
// (Shirai): Add to here
            foreach($this->_fields as $fname=>$field) {
                $data = $field->check_data($adddata);
                if ($data === false) {
                    continue; // nothing new
                }
                if (!array_key_exists($fname, $SESSION->user_filtering)) {
                    $SESSION->user_filtering[$fname] = array();
                }
                $SESSION->user_filtering[$fname][] = $data;
            }

(b) user/filters/user_filter_forms.php

class user_add_filter_form, function definition()

    function definition() {
        $mform =& $this->_form;
        $fields = $this->_customdata['fields'];
        $extraparams = $this->_customdata['extraparams'];

        $mform->addElement('header', 'newfilter', get_string('newfilter','filters'));

        foreach($fields as $ft) {
            $ft->setupForm($mform);
        }

        // in case we wasnt to track some page params
        if ($extraparams) {
            foreach ($extraparams as $key=>$value) {
                $mform->addElement('hidden', $key, $value);
            }
        }

        // Add button
// (Shirai): comment out this line
// $mform->addElement('submit', 'addfilter', get_string('addfilter','filters'));
// (Shirai): add from here
        $objs = array();
        $objs[] = &$mform->createElement('submit', 'addfilter', get_string('addfilter', 'filters'));
        $objs[] = &$mform->createElement('checkbox', 'removealladd', null, 'Add filter after removing all');
        $mform->addElement('group', 'addfiltergrp', '', $objs, ' ', false);
        $mform->setDefault('removealladd', '0');
// (Shirai): add from here

        // Don't use last advanced state
        $mform->setShowAdvanced(false);
    }
}



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Anthony Borrow added a comment - 14/Jul/09 01:44 AM
Tatsuya - Thanks for your report, ideas, and patch. I am working with one of the Google Summer of Coders on looking at usability issues. From what I understand, your patch (from the screenshot - not the code which I have not looked at) still requires a mouse click to check the box. I do not see it saving much time for the user as they still have to click. What I would propose is that the default behavior of the filter search is to simply search without saving; however, the default behavior of hitting the add filter is to add the filter. At one point I think there was also a request to add the ability to save filter settings. This would be a user preference but I have not given much thought about how it might actually be implemented. The downside to my approach would be if a user had added a number of filters and then forgot or accidentally just hit enter and lost all of those filters. In any case, this is certainly worth further thought. I've been told that there are a couple of similar issues which I will link together as appropriate. Peace - Anthony

Tatsuya Shirai added a comment - 14/Jul/09 02:14 PM
Hi Anthony.
I think that" the default behavior of hitting the add filter is to add the filter" is nice. I like this.
Especially, on the site has large number of members, the processes to narrow down to a target user from a lot of users is very effective way!

The proposed feature can save the time to wait for reloading the screen after clicking "Remove all filters", not to save the time to click "Remove all filters".

I'm short-tempered^^; then I can not wait for finishing to reload the screen.
I use proposed feature and original add filter feature, the couple of these functions is better for me.


Anthony Borrow added a comment - 14/Jul/09 07:01 PM
Tatsuya - I am impatient too and understand the benefit of the button to save the time of the page refresh. I've been dabbling with usability issues and was thinking in mouse clicks. Do you think you might be able to work on a patch to implement the behavior I suggested? If so, that would be great but if not just let me know and I'll try to give it a crack. Together I am sure we can come up with something to help move this forward. Peace - Anthony

Tatsuya Shirai added a comment - 15/Jul/09 10:37 AM
Okey.
I'll try to upgrade my idea about user interface of active filter based upon your and other person's ideas.
Now I have two plans. The one is a very simple plan, only adding 'search' button. The other one is a more complicated plan.So, we can add filter after searching bulk users and remove all/selected filters before searching without page refresh by using javascript and so on.
Please give me time.I'll try and report it to here.

Tatsuya Shirai added a comment - 23/Jul/09 06:16 PM
Anthony,
I've completed implementation of new user interface.
There are two important points;
(1) New feature 'Latest filter' : buffer of last search condition.
(2) Getting rid of 'Remove all filters' button.

Original user interface is based on function (Add, Remove filter),
proposed user interface is based on what user wants to do (Search only).

I prepare three buttons, [Search] [Refinement] [Newly].
[Search] :
Search user according to search condition (=filter), and then add the condition to Latest filter buffer.
[Refinement]: (=Search refinement)
At first add the Latest filter to active filter and then search (and update Latest filter).
[Newly]: (=Search newly)
At first clear all active filters and Latest filter buffer, and then newly search (and update latest filter).

If you want to clear all active filters (as same as pussing 'Remove all filters'), you push 'Newly' button without setting up search conditions. (But, I think that the operation is meaningless)

If you want to clear Latest filter buffer, you push 'Search' button without setting up search conditions. (meaningless too...)

Screenshots and patches are posted.


Tatsuya Shirai added a comment - 23/Jul/09 06:18 PM
(Modified)

user/filters/lib.php
user/filters/user_filter_forms.php

and

lang/en_utf8/filters.php


Tatsuya Shirai added a comment - 23/Jul/09 06:31 PM
My mother language is japanese.
Then, I can not propose suitable english terms for this user interface.
You can chage the terms (named by me) to the others.

Buttons: [Search], [Refinement], [Newly]
Strings: 'Latest filter:'

All of [Search], [Refinement] and [Newly] perform searching.
Search only, Add to active filter and then Seach, Clear all filtera and then Search.
Please treat them equally.They are brothers.

------

The proposed interface is not the same as your suggestion, sorry!


Tatsuya Shirai added a comment - 27/Jul/09 08:56 AM
Oh! Sorry!
I forgot we can set multiple sets of constraints for searching for target users!
Then, we need to prepare latest_filter as latest_filter's'.
Now I expand it, please wait for updating modified version of the codes.

Tatsuya Shirai added a comment - 27/Jul/09 11:07 AM
This is a new version.
Latest filter can treat multiple sets of conditions for searching for users.

Anthony Borrow added a comment - 27/Jul/09 11:33 AM
Thanks for your work on this. I am currently playing catch up on various tracker issues. I look forward to testing your new version once I get caught up. Peace - Anthony

Tatsuya Shirai added a comment - 02/Nov/09 05:33 PM
This is a new version.
If there is no active filters, [Newly] button becomes disabled.

Anthony Borrow added a comment - 02/Nov/09 10:24 PM
Tatsuya - Thanks for the updated version. I am wondering if perhaps this issue has been resolved in Moodle 2.0. As I was flying back to California I was poking around 2.0 a little and remember there being a few search options. Would you mind installing a test instance of Moodle 2.0 and seeing how it is done. I think whatever we do for 1.9 should be consistent with what is coming in 2.0. Peace - Anthony

Tatsuya Shirai added a comment - 03/Nov/09 12:18 PM
Now I'm checking Moodle2.0 according as your advice, Anthony. ( I forgot to check Moodle2.0, thanks!)
It seems that there is no changes in Moodle2.0 concerning user filter as compared with Moodle1.9.
I'll probably apply this patches for Moodle2.0, then I'll try this. Please wait a moment!