]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10181, adding subtracting mechanism for bulk user opertaions, and add some help
authortoyomoyo <toyomoyo>
Tue, 28 Aug 2007 02:23:10 +0000 (02:23 +0000)
committertoyomoyo <toyomoyo>
Tue, 28 Aug 2007 02:23:10 +0000 (02:23 +0000)
admin/user/user_bulk_form.php
lang/en_utf8/bulkusers.php
lang/en_utf8/help/bulkusers/lists.html [new file with mode: 0644]
lang/en_utf8/help/bulkusers/selectedlist.html [new file with mode: 0644]
lang/en_utf8/help/filters/date.html [new file with mode: 0644]

index 1fcae380f1247f69946ebb57d4d820eba55d01be..90c1f236ca73da66f87c0133e5a09c6206e23daf 100644 (file)
@@ -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);
index 3f56497cdbe3c08a83f230a638e53f96cbe1c17f..d864a019de2128eae314d06e9387055f3d8a4d38 100644 (file)
@@ -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.';
\ No newline at end of file
diff --git a/lang/en_utf8/help/bulkusers/lists.html b/lang/en_utf8/help/bulkusers/lists.html
new file mode 100644 (file)
index 0000000..fe229b5
--- /dev/null
@@ -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>
+
diff --git a/lang/en_utf8/help/bulkusers/selectedlist.html b/lang/en_utf8/help/bulkusers/selectedlist.html
new file mode 100644 (file)
index 0000000..d1b540b
--- /dev/null
@@ -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>
diff --git a/lang/en_utf8/help/filters/date.html b/lang/en_utf8/help/filters/date.html
new file mode 100644 (file)
index 0000000..ede1583
--- /dev/null
@@ -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>