From dc155ceb578bf519dfe888578784cd96ba664293 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 28 Aug 2007 02:23:10 +0000 Subject: [PATCH] MDL-10181, adding subtracting mechanism for bulk user opertaions, and add some help --- admin/user/user_bulk_form.php | 25 ++++++++++++++----- lang/en_utf8/bulkusers.php | 11 +++++--- lang/en_utf8/help/bulkusers/lists.html | 6 +++++ lang/en_utf8/help/bulkusers/selectedlist.html | 11 ++++++++ lang/en_utf8/help/filters/date.html | 6 +++++ 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 lang/en_utf8/help/bulkusers/lists.html create mode 100644 lang/en_utf8/help/bulkusers/selectedlist.html create mode 100644 lang/en_utf8/help/filters/date.html diff --git a/admin/user/user_bulk_form.php b/admin/user/user_bulk_form.php index 1fcae380f1..90c1f236ca 100644 --- a/admin/user/user_bulk_form.php +++ b/admin/user/user_bulk_form.php @@ -26,16 +26,21 @@ class user_bulk_form extends moodleform { $objs[] = &$this->ausers; $objs[] = &$this->susers; - $mform->addElement('group', 'usersgrp', get_string('users'), $objs, ' ', false); + $grp =& $mform->addElement('group', 'usersgrp', get_string('users'), $objs, ' ', false); + $grp->setHelpButton(array('lists','','bulkusers')); + $mform->addElement('static', 'comment'); $objs = array(); $objs[] =& $mform->createElement('submit', 'addone', get_string('addsel', 'bulkusers')); - $objs[] =& $mform->createElement('submit', 'removeone', get_string('removesel', 'bulkusers')); $objs[] =& $mform->createElement('submit', 'addall', get_string('addall', 'bulkusers')); + $objs[] =& $mform->createElement('submit', 'removesel', get_string('removesel', 'bulkusers')); $objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', 'bulkusers')); - $mform->addElement('group', 'buttonsgrp', null, $objs, array(' ', '
'), false); - + $objs[] =& $mform->createElement('submit', 'deletesel', get_string('deletesel', 'bulkusers')); + $objs[] =& $mform->createElement('submit', 'deleteall', get_string('deleteall', 'bulkusers')); + $grp =& $mform->addElement('group', 'buttonsgrp', get_string('selectedlist', 'bulkusers'), $objs, array(' ', '
'), false); + $grp->setHelpButton(array('selectedlist','','bulkusers')); + $objs = array(); $objs[] =& $mform->createElement('select', 'action', get_string('withselected'), @$this->_customdata); $objs[] =& $mform->createElement('submit', 'doaction', get_string('go'));; @@ -87,11 +92,19 @@ class user_bulk_form extends moodleform { if(!empty($data->ausers)) { $SESSION->bulk_susers = array_merge($SESSION->bulk_susers, array_values($data->ausers)); } - } else if(@$data->removeone) { + } else if(@$data->removeall) { + if(!empty($SESSION->bulk_ausers)) { + $SESSION->bulk_susers = array_diff($SESSION->bulk_susers, $SESSION->bulk_ausers); + } + } else if(@$data->removesel) { + if(!empty($data->ausers)) { + $SESSION->bulk_susers = array_diff($SESSION->bulk_susers, array_values($data->ausers)); + } + } else if(@$data->deletesel) { if(!empty($data->susers)) { $SESSION->bulk_susers = array_diff($SESSION->bulk_susers, array_values($data->susers)); } - } else if(@$data->removeall) { + } else if(@$data->deleteall) { $SESSION->bulk_susers = array(); } $SESSION->bulk_susers = array_unique($SESSION->bulk_susers); diff --git a/lang/en_utf8/bulkusers.php b/lang/en_utf8/bulkusers.php index 3f56497cdb..d864a019de 100644 --- a/lang/en_utf8/bulkusers.php +++ b/lang/en_utf8/bulkusers.php @@ -1,10 +1,13 @@ User lists + +

The Available list contains the users who passed the active filters. For example, if the Active filters sections contains only one filter for users which country is Romania, then the Available list contains only users which have set Romania as their country in the profile page.

+ +

The Selected list contains the users who have been added to this list by you, using the buttons from the Selected user list... section. When the Go button from the With selected users... is pressed, the operation selected in this section will be performed on the users from this list.

+ diff --git a/lang/en_utf8/help/bulkusers/selectedlist.html b/lang/en_utf8/help/bulkusers/selectedlist.html new file mode 100644 index 0000000000..d1b540bebd --- /dev/null +++ b/lang/en_utf8/help/bulkusers/selectedlist.html @@ -0,0 +1,11 @@ +

Selected user list...

+ + diff --git a/lang/en_utf8/help/filters/date.html b/lang/en_utf8/help/filters/date.html new file mode 100644 index 0000000000..ede1583bb1 --- /dev/null +++ b/lang/en_utf8/help/filters/date.html @@ -0,0 +1,6 @@ +

Date filter

+

This filter allows you to filter information based on a date value. +Beside the start and end date, depending on the filter settings, you may select the date field used by the filter.

+

Date filter

+

This filter allows you to filter information based on a date value. +Beside the start and end date, depending on the filter settings, you may select the date field used by the filter.

-- 2.39.5