rt 4.2.14 (#13852)
[freeside.git] / rt / share / html / Admin / Groups / index.html
index ef7395f..42a9bdd 100755 (executable)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 <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>
 
@@ -84,7 +79,7 @@ jQuery(function(){
 <& /Elements/CollectionList,
     OrderBy => 'Name',
     Order => 'ASC',
-    Rows  => 100,
+    Rows  => $Rows,
     %ARGS,
     Format => $Format,
     Collection => $Groups,
@@ -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;
@@ -127,6 +122,7 @@ else {
 }
 
 $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'};
+my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Groups'} || 50;
 
 </%INIT>
 <%ARGS>