[Rt-commit] r8644 - in rt/branches/3.7-EXPERIMENTAL-RTIR-2.4: . etc html/Elements html/Ticket/Elements lib/RT lib/RT/I18N lib/t/regression sbin

ruz at bestpractical.com ruz at bestpractical.com
Mon Aug 20 10:53:52 EDT 2007


Author: ruz
Date: Mon Aug 20 10:53:51 2007
New Revision: 8644

Modified:
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/etc/RT_Config.pm.in
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Elements/ShowCustomFields
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Search/Chart
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Ticket/Elements/ShowTransaction
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/I18N/ru.po
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Record.pm
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/StyleGuide.pod
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Ticket_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Tickets_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/User_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/t/regression/21query-builder.t
   rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/sbin/rt-setup-database.in

Log:
merge 3.7-EXP-RTIR-2.2 -> 3.7-EXP-RTIR-2.4

 r8347 at cubic-pc (orig r8346):  ruz | 2007-08-01 03:33:43 +0400
  r8346 at cubic-pc (orig r8345):  ruz | 2007-08-01 03:33:10 +0400
   r8345 at cubic-pc (orig r8344):  ruz | 2007-08-01 03:32:21 +0400
   * we don't exit on errors in data, but go to next object
  
 
 r8644 at cubic-pc (orig r8643):  ruz | 2007-08-20 18:41:08 +0400
 merge 3.7-EXP-RTIR-2.0 -> 3.7-EXP-RTIR-2.2
 
  r8643 at cubic-pc (orig r8642):  ruz | 2007-08-20 18:39:55 +0400
  * merge 3.6 -> 3.7-EXP-RTIR-2.0
  
   r8410 at cubic-pc (orig r8409):  jesse | 2007-08-07 01:33:00 +0400
    r65236 at pinglin:  jesse | 2007-08-06 17:17:56 -0400
    * better canonicalization of multiple addresses in the cc/bcc box on correspondence and comment
   
   r8429 at cubic-pc (orig r8428):  ruz | 2007-08-07 23:36:17 +0400
   * fix compatibility of a test with new version of mason
   r8431 at cubic-pc (orig r8430):  ruz | 2007-08-08 00:37:21 +0400
   * add debug info into test
   r8432 at cubic-pc (orig r8431):  ruz | 2007-08-08 00:38:47 +0400
   * call CanonicalizeEmailAddress as class method instead of
     passing undef as first argument
   
   r8433 at cubic-pc (orig r8432):  ruz | 2007-08-08 00:43:05 +0400
   * update doc
   r8434 at cubic-pc (orig r8433):  ruz | 2007-08-08 00:44:52 +0400
   * fix performance regression in searches by watchers joined
     with other conditions using OR
   r8444 at cubic-pc (orig r8443):  falcone | 2007-08-08 17:19:21 +0400
    r23542 at ketch:  falcone | 2007-08-08 09:18:04 -0400
    * remove $aid var that never gets used.
   
   r8446 at cubic-pc (orig r8445):  jesse | 2007-08-08 21:25:30 +0400
    r65296 at pinglin:  jesse | 2007-08-08 13:24:39 -0400
    * 3.6.5rc1
   
   r8452 at cubic-pc (orig r8451):  ruz | 2007-08-09 00:26:30 +0400
   * fix ru.po
   * simplify translators' work by using phrases with the same case
   r8454 at cubic-pc (orig r8453):  ruz | 2007-08-09 01:04:31 +0400
   * add new $ChartFont option to the config which allow admin to
     select a tru type font RT uses in charts
   
   r8455 at cubic-pc (orig r8454):  sartak | 2007-08-09 01:20:43 +0400
   Reword $ChartFont description
   r8472 at cubic-pc (orig r8471):  jesse | 2007-08-09 19:26:00 +0400
    r65323 at pinglin:  jesse | 2007-08-09 11:25:41 -0400
    *( Fix a bug (?) where a 0 was displayed after a value for multiple-values
    custom fields. - Quentin Garnier
    
    
   
   r8541 at cubic-pc (orig r8540):  falcone | 2007-08-14 20:23:38 +0400
    r23772 at ketch:  falcone | 2007-08-14 12:22:58 -0400
    * document how to use the Update command on Records
   
   r8551 at cubic-pc (orig r8550):  falcone | 2007-08-14 21:54:27 +0400
    r23791 at ketch:  falcone | 2007-08-14 13:53:58 -0400
    * we no longer support 5.6.1
   
  
 


Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/etc/RT_Config.pm.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/etc/RT_Config.pm.in	Mon Aug 20 10:53:51 2007
@@ -596,6 +596,13 @@
 
 Set($DontSearchFileAttachments, undef);
 
+# The GD module (which RT uses for graphs) uses a builtin font that doesn't
+# have full Unicode support. You can use a particular TrueType font by setting
+# $ChartFont to the absolute path of that font. Your GD library must have
+# support for TrueType fonts to use this option.
+
+Set($ChartFont, undef);
+
 
 # MakeClicky detects various formats of data in headers and email
 # messages, and extends them with supporting links.  By default, RT

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Elements/ShowCustomFields
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Elements/ShowCustomFields	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Elements/ShowCustomFields	Mon Aug 20 10:53:51 2007
@@ -59,7 +59,9 @@
 % } else {
 <ul>
 % while ( my $Value = $Values->Next ) {
-<li><% $print_value->( $CustomField, $Value ) |n %></li>
+<li>
+% $print_value->( $CustomField, $Value );
+</li>
 % }
 </ul>
 % }

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Search/Chart
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Search/Chart	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Search/Chart	Mon Aug 20 10:53:51 2007
@@ -74,14 +74,25 @@
 my $value_name = $tix->Column( FIELD => $PrimaryGroupBy );
 
 my $chart = $chart_class->new( 600 => 400 );
+
+my $font = $RT::FontForCharts || ['verdana', 'arial', gdMediumBoldFont];
+$chart->set_title_font( $font, 12 ) if $chart->can('set_title_font');
+$chart->set_legend_font( $font, 12 ) if $chart->can('set_legend_font');
+$chart->set_x_label_font( $font, 10 ) if $chart->can('set_x_label_font');
+$chart->set_y_label_font( $font, 10 ) if $chart->can('set_y_label_font');
+$chart->set_label_font( $font, 10 ) if $chart->can('set_label_font');
+$chart->set_x_axis_font( $font, 9 ) if $chart->can('set_x_axis_font');
+$chart->set_y_axis_font( $font, 9 ) if $chart->can('set_y_axis_font');
+$chart->set_values_font( $font, 9 ) if $chart->can('set_values_font');
+$chart->set_value_font( $font, 9 ) if $chart->can('set_value_font');
+
 if ($chart_class eq "GD::Graph::bars") {
     $chart->set(
         x_label => $tix->Label( $PrimaryGroupBy ),
         x_labels_vertical => 1,
-        y_label => 'Tickets',
+        y_label => loc('Tickets'),
         show_values => 1
     );
-    $chart->set_legend_font( ['verdana', 'arial', gdMediumBoldFont], 12);
 }
 
 my %class = (

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/html/Ticket/Elements/ShowTransaction	Mon Aug 20 10:53:51 2007
@@ -159,8 +159,6 @@
 if ( $type =~ /EmailRecord$/ ) {
     @DisplayHeaders = qw(To Cc Bcc);
 
-    my $aid = 
-
     $titlebar_commands .=
         "[<a target=\"_blank\" href=\"$EmailRecordPath?id="
       . $Transaction->Ticket

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/I18N/ru.po
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/I18N/ru.po	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/I18N/ru.po	Mon Aug 20 10:53:51 2007
@@ -5852,7 +5852,7 @@
 
 #: html/Admin/Elements/GlobalCustomFieldTabs:64 html/Admin/Global/CustomFields/index.html:75 html/Elements/Tabs:71 html/Search/Elements/Chart:109 lib/RT/CustomField_Overlay.pm:1206
 msgid "Tickets"
-msgstr "Расширенный поиск"
+msgstr "Заявки"
 
 #: NOT FOUND IN SOURCE
 msgid "Tickets %1 %2"
@@ -5910,10 +5910,6 @@
 msgid "Time worked"
 msgstr "Время в работе"
 
-#: NOT FOUND IN SOURCE
-msgid "TimeLeft"
-msgstr "Осталось времени"
-
 #: lib/RT/Ticket_Overlay.pm:1167
 msgid "TimeWorked"
 msgstr "Время в работе"

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Record.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Record.pm	Mon Aug 20 10:53:51 2007
@@ -859,6 +859,21 @@
 
 );
 
+=head2 Update  ARGSHASH
+
+Updates fields on an object for you using the proper Set methods,
+skipping unchanged values.
+
+ ARGSRef => a hashref of attributes => value for the update
+ AttributesRef => an arrayref of keys in ARGSRef that should be updated
+ AttributePrefix => a prefix that should be added to the attributes in AttributesRef
+                    when looking up values in ARGSRef
+                    Bare attributes are tried before prefixed attributes
+
+Returns a list of localized results of the update
+
+=cut
+
 sub Update {
     my $self = shift;
 

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/StyleGuide.pod
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/StyleGuide.pod	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/StyleGuide.pod	Mon Aug 20 10:53:51 2007
@@ -40,10 +40,8 @@
 
 =head2 Perl Version
 
-We code everything to perl 5.6.1. Some features require advanced unicode
-features in perl 5.8.0. It is acceptable that unicode features work only for 
-US-ASCII on perl 5.6.1. 
-
+We code everything to perl 5.8.3 or higher.  Complete unicode support
+requires bugfixes found in 5.8.3.
 
 =head2 Documentation
 

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Ticket_Overlay.pm	Mon Aug 20 10:53:51 2007
@@ -2445,12 +2445,15 @@
     # The "NotifyOtherRecipients" scripAction will look for RT-Send-Cc: and
     # RT-Send-Bcc: headers
 
-    # XXX: 'CcMessageTo' is EmailAddress line, so most probably here is bug
-    # as CanonicalizeEmailAddress expect only one address at a time
-    foreach my $field (qw(Cc Bcc)) {
-        $args{'MIMEObj'}->head->add(
-            "RT-Send-$field" => RT::User->CanonicalizeEmailAddress( $args{ $field .'MessageTo' } )
-        ) if defined $args{ $field . 'MessageTo' };
+
+    foreach my $type (qw/Cc Bcc/) {
+        if ( defined $args{ $type . 'MessageTo' } ) {
+
+            my $addresses = join ', ', (
+                map { RT::User->CanonicalizeEmailAddress( $_->address ) }
+                    Mail::Address->parse( $args{ $type . 'MessageTo' } ) );
+            $args{'MIMEObj'}->head->add( 'RT-Send-' . $type, $addresses );
+        }
     }
 
     foreach my $argument (qw(Encrypt Sign)) {

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/Tickets_Overlay.pm	Mon Aug 20 10:53:51 2007
@@ -886,6 +886,8 @@
     $self->_OpenParen;
     if ( $op =~ /^IS(?: NOT)?$/ ) {
         my $group_members = $self->_GroupMembersJoin( GroupsAlias => $groups );
+        # to avoid joining the table Users into the query, we just join GM
+        # and make sure we don't match records where group is member of itself
         $self->SUPER::Limit(
             LEFTJOIN   => $group_members,
             FIELD      => 'GroupId',
@@ -986,16 +988,26 @@
             );
         }
 
-        $self->_SQLLimit(
-            ALIAS         => $users,
-            FIELD         => $rest{SUBKEY},
-            VALUE         => $value,
-            OPERATOR      => $op,
-            CASESENSITIVE => 0,
+        # we join users table without adding some join condition between tables,
+        # the only conditions we have are conditions on the table iteslf,
+        # for example Users.EmailAddress = 'x'. We should add this condition to
+        # the top level of the query and bundle it with another similar conditions,
+        # for example "Users.EmailAddress = 'x' OR Users.EmailAddress = 'Y'".
+        # To achive this goal we use own SUBCLAUSE for conditions on the users table.
+        $self->SUPER::Limit(
             %rest,
+            SUBCLAUSE       => '_sql_u_watchers_'. $users,
+            ALIAS           => $users,
+            FIELD           => $rest{'SUBKEY'},
+            VALUE           => $value,
+            OPERATOR        => $op,
+            CASESENSITIVE   => 0,
         );
+        # A condition which ties Users and Groups (role groups) is a left join condition
+        # of CachedGroupMembers table. To get correct results of the query we check
+        # if there are matches in CGM table or not using 'cgm.id IS NOT NULL'.
         $self->_SQLLimit(
-            ENTRYAGGREGATOR => 'AND',
+            %rest,
             ALIAS           => $group_members,
             FIELD           => 'id',
             OPERATOR        => 'IS NOT',
@@ -1924,7 +1936,7 @@
         VALUE       => $args{'VALUE'},
         OPERATOR    => $args{'OPERATOR'},
         DESCRIPTION => join( ' ',
-            $self->loc('Time worked'),
+            $self->loc('Time Worked'),
             $args{'OPERATOR'}, $args{'VALUE'}, ),
     );
 }
@@ -1949,7 +1961,7 @@
         VALUE       => $args{'VALUE'},
         OPERATOR    => $args{'OPERATOR'},
         DESCRIPTION => join( ' ',
-            $self->loc('Time left'),
+            $self->loc('Time Left'),
             $args{'OPERATOR'}, $args{'VALUE'}, ),
     );
 }

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/RT/User_Overlay.pm	Mon Aug 20 10:53:51 2007
@@ -664,8 +664,8 @@
 CanonicalizeEmailAddress converts email addresses into canonical form.
 it takes one email address in and returns the proper canonical
 form. You can dump whatever your proper local config is in here.  Note
-that it may be called as a static method; in this case, $self may be
-undef.
+that it may be called as a static method; in this case the first argument
+is class name not an object.
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/t/regression/21query-builder.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/t/regression/21query-builder.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/lib/t/regression/21query-builder.t	Mon Aug 20 10:53:51 2007
@@ -1,6 +1,8 @@
 #!/usr/bin/perl
 
 use strict;
+use warnings;
+
 use Test::More tests => 39;
 use Test::WWW::Mechanize;
 use HTTP::Request::Common;
@@ -24,7 +26,7 @@
     my $queue = RT::Queue->new( $RT::SystemUser );
     $queue->Load( 'Regression' );
     if ( $queue->id ) {
-        ok(1, "queue 'Regression' exists");
+        ok(1, "queue 'Regression' exists - #". $queue->id );
     } else {
         $queue->Create( Name => 'Regression' );
         ok($queue->id, "created queue 'Regression'");

Modified: rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/sbin/rt-setup-database.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/sbin/rt-setup-database.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL-RTIR-2.4/sbin/rt-setup-database.in	Mon Aug 20 10:53:51 2007
@@ -538,7 +538,7 @@
             my ($return,$msg) = $new_entry->Create(%$item);
             unless ($return) {
                 print "(Error: $msg)\n";
-                exit;
+                next;
             }
             print $return. ".";
         }
@@ -554,7 +554,7 @@
             my ($return,$msg) = $new_entry->Create(%$item);
             unless ($return) {
                 print "(Error: $msg)\n";
-                exit;
+                next;
             }
             print $return. ".";
         }


More information about the Rt-commit mailing list