MDL-10181, adding subtracting mechanism for bulk user opertaions, and add some help

This commit is contained in:
toyomoyo 2007-08-28 02:23:10 +00:00
parent 07aa205712
commit dc155ceb57
5 changed files with 49 additions and 10 deletions

View file

@ -26,15 +26,20 @@ class user_bulk_form extends moodleform {
$objs[] = &$this->ausers; $objs[] = &$this->ausers;
$objs[] = &$this->susers; $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'); $mform->addElement('static', 'comment');
$objs = array(); $objs = array();
$objs[] =& $mform->createElement('submit', 'addone', get_string('addsel', 'bulkusers')); $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', 'addall', get_string('addall', 'bulkusers'));
$objs[] =& $mform->createElement('submit', 'removesel', get_string('removesel', 'bulkusers'));
$objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', '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 = array();
$objs[] =& $mform->createElement('select', 'action', get_string('withselected'), @$this->_customdata); $objs[] =& $mform->createElement('select', 'action', get_string('withselected'), @$this->_customdata);
@ -87,11 +92,19 @@ class user_bulk_form extends moodleform {
if(!empty($data->ausers)) { if(!empty($data->ausers)) {
$SESSION->bulk_susers = array_merge($SESSION->bulk_susers, array_values($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)) { if(!empty($data->susers)) {
$SESSION->bulk_susers = array_diff($SESSION->bulk_susers, array_values($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();
} }
$SESSION->bulk_susers = array_unique($SESSION->bulk_susers); $SESSION->bulk_susers = array_unique($SESSION->bulk_susers);

View file

@ -1,10 +1,13 @@
<?php //$Id$ <?php //$Id$
$string['usersinlist'] = 'Users in list'; $string['usersinlist'] = 'Users in list';
$string['addall'] = 'Add all to selection'; $string['addall'] = 'Add all available users';
$string['addsel'] = 'Add to selection'; $string['addsel'] = 'Add selected available users';
$string['removeall'] = 'Clear selection'; $string['removeall'] = 'Remove all available users';
$string['removesel'] = 'Remove from selection'; $string['removesel'] = 'Remove selected available users';
$string['deleteall'] = 'Clear all users';
$string['deletesel'] = 'Clear selected users';
$string['available'] = 'Available'; $string['available'] = 'Available';
$string['selected'] = 'Selected'; $string['selected'] = 'Selected';
$string['selectedlist'] = 'Selected user list...';
$string['usersfound'] = '$a user(s) found.'; $string['usersfound'] = '$a user(s) found.';
$string['usersselected'] = '$a user(s) selected.'; $string['usersselected'] = '$a user(s) selected.';

View 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>

View 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>

View 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>