Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / share / html / Admin / Groups / index.html
index b86571f..58ee1a5 100644 (file)
 <input type="hidden" name="GroupField" value="Name" />
 <input type="hidden" name="GroupOp" value="LIKE" />
 <&|/l&>Go to group</&>
-<input type="text" name="GroupString" value="" id="autocomplete-GroupString" />
+<input type="text" name="GroupString" value="" data-autocomplete="Groups" id="autocomplete-GroupString" />
 <script type="text/javascript">
 jQuery(function(){
-    jQuery("#autocomplete-GroupString").autocomplete({
-        source: <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/Groups",
-        // Auto-submit once a group is chosen
-        select: function( event, ui ) {
-            jQuery(event.target).val(ui.item.value);
-            var form = jQuery(event.target).closest('form');
-            form.find('input[name=GroupOp]').val('=');
-            form.submit();
-        }
+    // Jump directly to the page if a group is chosen
+    jQuery("#autocomplete-GroupString").on("autocompleteselect", function( event, ui ) {
+        document.location = RT.Config.WebPath + "/Admin/Groups/Modify.html?id=" + ui.item.id;
     });
 });
 </script>
@@ -72,7 +66,8 @@ jQuery(function(){
 
 <form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Groups/index.html">
 <&|/l&>Find groups whose</&> <& /Elements/SelectGroups &><br />
-<input type="checkbox" class="checkbox" name="FindDisabledGroups" value="1" <% $FindDisabledGroups? 'checked="checked"': '' |n %> /> <&|/l&>Include disabled groups in listing.</&><br />
+<input type="checkbox" class="checkbox" id="FindDisabledGroups" name="FindDisabledGroups" value="1" <% $FindDisabledGroups? 'checked="checked"': '' |n %> />
+<label for="FindDisabledGroups"><&|/l&>Include disabled groups in listing.</&></label><br />
 <div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div> 
 </form>
 
@@ -106,18 +101,18 @@ if ($FindDisabledGroups) {
 if (length $GroupString) {
     $caption = loc("Groups matching search criteria");
     if ($GroupField =~ /^CustomField-(\d+)/) {
-       $Groups->LimitCustomField(
-           CUSTOMFIELD => $1,
-           OPERATOR => $GroupOp,
-           VALUE => $GroupString,
-       ); 
+        $Groups->LimitCustomField(
+            CUSTOMFIELD => $1,
+            OPERATOR => $GroupOp,
+            VALUE => $GroupString,
+        );
     }
     else {
-       $Groups->Limit(
-           FIELD => $GroupField,
-           OPERATOR => $GroupOp,
-           VALUE => $GroupString,
-       ); 
+        $Groups->Limit(
+            FIELD => $GroupField,
+            OPERATOR => $GroupOp,
+            VALUE => $GroupString,
+        );
     }
     RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."Admin/Groups/Modify.html?id=".$Groups->First->id)
           if $Groups->Count == 1 and $Groups->First;