mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-10181, adding subtracting mechanism for bulk user opertaions, and add some help
This commit is contained in:
parent
07aa205712
commit
dc155ceb57
5 changed files with 49 additions and 10 deletions
|
@ -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(' ', '<br />'), 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(' ', '<br />'), 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);
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?php //$Id$
|
||||
$string['usersinlist'] = 'Users in list';
|
||||
$string['addall'] = 'Add all to selection';
|
||||
$string['addsel'] = 'Add to selection';
|
||||
$string['removeall'] = 'Clear selection';
|
||||
$string['removesel'] = 'Remove from selection';
|
||||
$string['addall'] = 'Add all available users';
|
||||
$string['addsel'] = 'Add selected available users';
|
||||
$string['removeall'] = 'Remove all available users';
|
||||
$string['removesel'] = 'Remove selected available users';
|
||||
$string['deleteall'] = 'Clear all users';
|
||||
$string['deletesel'] = 'Clear selected users';
|
||||
$string['available'] = 'Available';
|
||||
$string['selected'] = 'Selected';
|
||||
$string['selectedlist'] = 'Selected user list...';
|
||||
$string['usersfound'] = '$a user(s) found.';
|
||||
$string['usersselected'] = '$a user(s) selected.';
|
6
lang/en_utf8/help/bulkusers/lists.html
Normal file
6
lang/en_utf8/help/bulkusers/lists.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h2>User lists</h2>
|
||||
|
||||
<p>The <strong>Available</strong> 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.</p>
|
||||
|
||||
<p>The <strong>Selected</strong> list contains the users who have been added to this list by you, using the buttons from the <em>Selected user list...</em> section. When the <em>Go</em> button from the <em>With selected users...</em> is pressed, the operation selected in this section will be performed on the users from this list.</p>
|
||||
|
11
lang/en_utf8/help/bulkusers/selectedlist.html
Normal file
11
lang/en_utf8/help/bulkusers/selectedlist.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<h2>Selected user list...</h2>
|
||||
|
||||
<ul>
|
||||
<li>Add selected available users - adds selected users from the Available list (on the left) to the Selected list (on the right).</li>
|
||||
<li>Add all available users - adds all users from the Available list (on the left) to the Selected list (on the right).</li>
|
||||
<li>Remove selected available users - removes selected users from the Available list (on the left) from the Selected list (on the right).</li>
|
||||
<li>Remove all available users - removes all users from the Available list (on the left) from the Selected list (on the right).</li>
|
||||
<li>Clear selected users - removes selected users from the Selected list (on the right).</li>
|
||||
<li>Clear all users - removes all users from the Selected list (on the right).</li>
|
||||
|
||||
</ul>
|
6
lang/en_utf8/help/filters/date.html
Normal file
6
lang/en_utf8/help/filters/date.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<h1>Date filter</h1>
|
||||
<p>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.</p>
|
||||
<h1>Date filter</h1>
|
||||
<p>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.</p>
|
Loading…
Add table
Add a link
Reference in a new issue