[Rt-commit] [svn] r812 - in rt/trunk: . bin etc html/Admin/Groups html/Elements lib lib/RT lib/RT/Interface

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Mon May 3 00:39:59 EDT 2004


Author: jesse
Date: Mon May  3 00:39:57 2004
New Revision: 812

Modified:
   rt/trunk/   (props changed)
   rt/trunk/bin/rt.in
   rt/trunk/etc/RT_Config.pm.in
   rt/trunk/html/Admin/Groups/index.html
   rt/trunk/html/Elements/MyRequests
   rt/trunk/lib/RT.pm.in
   rt/trunk/lib/RT/Groups_Overlay.pm
   rt/trunk/lib/RT/Interface/Web.pm
   rt/trunk/lib/RT/Tickets_Overlay.pm
Log:
 ----------------------------------------------------------------------
 r2289 at tinbook:  jesse | 2004-05-03T00:13:57.610636Z
 
 Corrected docs for rt.in per Ticket #4618
 ----------------------------------------------------------------------
 r2290 at tinbook:  jesse | 2004-05-03T00:31:06.379542Z
 
 Applied Syslog configuration patch from 4717
 ----------------------------------------------------------------------
 r2291 at tinbook:  jesse | 2004-05-03T00:39:30.205636Z
 
 #5189: patch to bin/rt for default query and order
 ----------------------------------------------------------------------
 r2292 at tinbook:  jesse | 2004-05-03T00:45:15.670290Z
 
 Adding a patch from Dirk Pape to hide disabled groups by default (#5229)
 ----------------------------------------------------------------------
 r2293 at tinbook:  jesse | 2004-05-03T00:47:02.636897Z
 
 #5238: [rt-users] Patch: Mason Profiing under FastCGI
 ----------------------------------------------------------------------
 r2294 at tinbook:  jesse | 2004-05-03T00:51:31.523941Z
 
 #5278: Making the length of the "MyRequests" list configurable
 ----------------------------------------------------------------------
 r2295 at tinbook:  jesse | 2004-05-03T00:56:19.176341Z
 
 #5303: Adding support for piping reply messages from STDIN
 ----------------------------------------------------------------------
 r2296 at tinbook:  jesse | 2004-05-03T01:45:55.903495Z
 
 A patch to generate better SQL when searching on attachment content. Backported from 3.1
 ----------------------------------------------------------------------


Modified: rt/trunk/bin/rt.in
==============================================================================
--- rt/trunk/bin/rt.in	(original)
+++ rt/trunk/bin/rt.in	Mon May  3 00:39:57 2004
@@ -46,6 +46,8 @@
         user    => eval{(getpwuid($<))[0]} || $ENV{USER} || $ENV{USERNAME},
         passwd  => undef,
         server  => 'http://localhost/rt/',
+        query   => undef,
+        orderby => undef,
     ),
     config_from_file($ENV{RTCONFIG} || ".rtrc"),
     config_from_env()
@@ -167,6 +169,8 @@
 
 sub list {
     my ($q, $type, %data, $orderby);
+    $orderby = $config{orderby};
+    
     my $bad = 0;
 
     while (@ARGV) {
@@ -200,7 +204,12 @@
             $bad = 1; last;
         }
     }
-
+    
+    if (!defined $q)
+    {
+        $q = $config{query} ; 
+    }
+    
     $type ||= "ticket";
     unless ($type && defined $q) {
         my $item = $type ? "query string" : "object type";
@@ -514,7 +523,14 @@
                 my $a = $_ eq "-b" ? \@bcc : \@cc;
                 @$a = split /\s*,\s*/, shift @ARGV;
             }
-            elsif (/-m/) { $msg = shift @ARGV }
+            elsif (/-m/) {
+                $msg = shift @ARGV;
+                if ( $msg =~ /^-$/ ) {
+                    undef $msg;
+                    while (<STDIN>) { $msg .= $_ }
+                }
+            }
+
             elsif (/-w/) { $wtime = shift @ARGV }
         }
         elsif (!$id && m|^(?:ticket/)?($idlist)$|) {
@@ -1061,7 +1077,7 @@
 sub config_from_env {
     my %env;
 
-    foreach my $k ("DEBUG", "USER", "PASSWD", "SERVER") {
+    foreach my $k ("DEBUG", "USER", "PASSWD", "SERVER", "QUERY", "ORDERBY") {
         if (exists $ENV{"RT$k"}) {
             $env{lc $k} = $ENV{"RT$k"};
         }
@@ -1112,7 +1128,7 @@
             chomp;
             next if (/^#/ || /^\s*$/);
 
-            if (/^(user|passwd|server)\s+([^ ]+)$/) {
+            if (/^(user|passwd|server|query|orderby)\s+(.*)\s?$/) {
                 $cfg{$1} = $2;
             }
             else {
@@ -1343,6 +1359,8 @@
         - server <URL>          URL to RT server.
         - user <username>       RT username.
         - passwd <passwd>       RT user's password.
+        - query <RT Query>      Default RT Query for list action
+        - orderby <order>       Default RT order for list action
 
         Blank and #-commented lines are ignored.
 
@@ -1357,6 +1375,8 @@
         - RTDEBUG       Numeric debug level. (Set to 3 for full logs.)
         - RTCONFIG      Specifies a name other than ".rtrc" for the
                         configuration file.
+        - RTQUERY       Default RT Query for rt list
+        - RTORDERBY     Default order for rt list
 
 --
 
@@ -1380,7 +1400,7 @@
     be used to specify more than one object of the same type. Note that
     the list must be a single argument (i.e., no spaces). For example,
     "user/root,1-3,5,7-10,ams" is a list of ten users; the same list
-    can also be written as "user/ams,root,1,2,3,5,7,8-20".
+    can also be written as "user/ams,root,1,2,3,5,7,8-10".
     
     Examples:
 

Modified: rt/trunk/etc/RT_Config.pm.in
==============================================================================
--- rt/trunk/etc/RT_Config.pm.in	(original)
+++ rt/trunk/etc/RT_Config.pm.in	Mon May  3 00:39:57 2004
@@ -247,6 +247,14 @@
 Set($LogDir, '@RT_LOG_PATH@');
 Set($LogToFileNamed , "rt.log");    #log to rt.log
 
+# On Solaris, set to ( socket => 'inet' ).  Options here override any
+# other options RT passes to Log::Dispatch::Syslog.  Other interesting
+# flags include facility and logopt.  (See the Log::Dispatch::Syslog
+# documentation for more information.)  (Maybe ident too, if you have
+# multiple RT installations.)
+
+ at LogToSyslogConf = () unless (@LogToSyslogConf);
+
 # }}}
 
 # {{{ Web interface configuration
@@ -322,12 +330,18 @@
 
 Set($MaxInlineBody, 13456);
 
-# $MyTicketsLength is the length of the table on the front page.
-# For some people, the default of 10 isn't big enough to get a feel for
-# how much work needs to be done before you get some time off.
+# $MyTicketsLength is the length of the owned tickets table on the
+# front page. For some people, the default of 10 isn't big enough
+# to get a feel for how much work needs to be done before you get
+# some time off.
 
 Set($MyTicketsLength, 10);
 
+# $MyRequestsLength is the length of the requested tickets table
+# on the front page.
+
+Set($MyRequestsLength, 10);
+
 # @MasonParameters is the list of parameters for the constructor of
 # HTML::Mason's Apache or CGI Handler.  This is normally only useful
 # for debugging, eg. profiling individual components with

Modified: rt/trunk/html/Admin/Groups/index.html
==============================================================================
--- rt/trunk/html/Admin/Groups/index.html	(original)
+++ rt/trunk/html/Admin/Groups/index.html	Mon May  3 00:39:57 2004
@@ -32,12 +32,24 @@
 <LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><BR>
 %}
 </UL>
+<br><br>
+<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html">
+<input type="checkbox" name="FindDisabledGroups"> <&|/l&>Include disabled groups in listing.</&>
+<BR>
+<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> 
+</FORM>
 
 <%INIT>
 my $Groups = RT::Groups->new($session{'CurrentUser'});
+
+if ($FindDisabledGroups) {
+  $Groups->{'find_disabled_rows'} = 1;
+}
+
 $Groups->LimitToUserDefinedGroups();
 my $title = loc('Select a group');
 
 </%INIT>
 <%ARGS>
+$FindDisabledGroups => 0
 </%ARGS>

Modified: rt/trunk/html/Elements/MyRequests
==============================================================================
--- rt/trunk/html/Elements/MyRequests	(original)
+++ rt/trunk/html/Elements/MyRequests	Mon May  3 00:39:57 2004
@@ -66,7 +66,7 @@
 
 
 <%INIT>
-my $rows = 10;
+my $rows = $RT::MyRequestsLength;
 my $MyTickets;
 $MyTickets = new RT::Tickets ($session{'CurrentUser'});
 $MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress);

Modified: rt/trunk/lib/RT.pm.in
==============================================================================
--- rt/trunk/lib/RT.pm.in	(original)
+++ rt/trunk/lib/RT.pm.in	Mon May  3 00:39:57 2004
@@ -231,7 +231,8 @@
                                 return "$p{message} ($filename:$line)\n"}
 				},
              
-		       stderr => 1
+		       stderr => 1,
+               @RT::LogToSyslogConf
 		     ));
     }
 

Modified: rt/trunk/lib/RT/Groups_Overlay.pm
==============================================================================
--- rt/trunk/lib/RT/Groups_Overlay.pm	(original)
+++ rt/trunk/lib/RT/Groups_Overlay.pm	Mon May  3 00:39:57 2004
@@ -354,5 +354,18 @@
 		);
 }
 # }}}
+
+sub _DoSearch {
+    my $self = shift;
+    
+    #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
+    unless($self->{'find_disabled_rows'}) {
+	$self->LimitToEnabled();
+    }
+    
+    return($self->SUPER::_DoSearch(@_));
+    
+}
+
 1;
 

Modified: rt/trunk/lib/RT/Interface/Web.pm
==============================================================================
--- rt/trunk/lib/RT/Interface/Web.pm	(original)
+++ rt/trunk/lib/RT/Interface/Web.pm	Mon May  3 00:39:57 2004
@@ -101,6 +101,7 @@
         default_escape_flags => 'h',
         allow_globals        => [qw(%session)],
         autoflush => 1,
+        @_
     );
   
 

Modified: rt/trunk/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/trunk/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/trunk/lib/RT/Tickets_Overlay.pm	Mon May  3 00:39:57 2004
@@ -536,13 +536,6 @@
 
   $sb->_OpenParen;
 
-  # Join Transactions To Attachments
-  $sb->Join( ALIAS1 => $sb->{_sql_trattachalias}, FIELD1 => 'TransactionId',
-	     ALIAS2 => $sb->{_sql_transalias}, FIELD2 => 'id');
-
-  # Join Transactions to Tickets
-  $sb->Join( ALIAS1 => 'main', FIELD1 => $sb->{'primary_key'}, # UGH!
-	     ALIAS2 => $sb->{_sql_transalias}, FIELD2 => 'Ticket');
 
   #Search for the right field
   $sb->_SQLLimit(ALIAS => $sb->{_sql_trattachalias},
@@ -553,6 +546,14 @@
 		 @rest
 		);
 
+  # Join Transactions To Attachments
+  $sb->_SQLJoin( ALIAS1 => $sb->{_sql_trattachalias}, FIELD1 => 'TransactionId',
+	     ALIAS2 => $sb->{_sql_transalias}, FIELD2 => 'id');
+
+  # Join Transactions to Tickets
+  $sb->_SQLJoin( ALIAS1 => 'main', FIELD1 => $sb->{'primary_key'}, # UGH!
+	     ALIAS2 => $sb->{_sql_transalias}, FIELD2 => 'Ticket');
+
   $sb->_CloseParen;
 
 }


More information about the Rt-commit mailing list