[Rt-commit] r10040 - in rt/branches/3.6-EXPERIMENTAL-ABERDEEN: .
html/Admin/CustomFields html/REST/1.0/Forms/ticket
html/Search html/Tools lib lib/RT lib/t/regression
audreyt at bestpractical.com
audreyt at bestpractical.com
Sat Dec 22 10:58:11 EST 2007
Author: audreyt
Date: Sat Dec 22 10:58:11 2007
New Revision: 10040
Modified:
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/ (props changed)
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Admin/CustomFields/index.html
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Approvals/index.html
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/REST/1.0/Forms/ticket/default
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Results.html
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Tools/Offline.html
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT.pm.in
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Groups_Overlay.pm
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/I18N.pm
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/06-mime_decoding.t
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/23cfsort.t
Log:
r18219 at T (orig r9922): ruz | 2007-12-13 04:31:15 +0800
backport from 3.7
* add more tests to show that sorting by CF fails mark them as todo
r18220 at T (orig r9923): ruz | 2007-12-13 04:32:51 +0800
* add definitions of new methods we have to share between Groups and Users classes
r18257 at T (orig r9960): jesse | 2007-12-15 15:10:50 +0800
r72958 at pinglin: jesse | 2007-12-10 13:57:04 -0500
* Switch the REST interface to always show ticket times in minutes, rather than lose data
r18258 at T (orig r9961): jesse | 2007-12-15 15:11:14 +0800
r72961 at pinglin: jesse | 2007-12-10 14:58:08 -0500
RT-Ticket: 8710
RT-Status: resolved
RT-Update correspond
* Attached patch fixes a bug in decoding content-type headers that contain encoded file names.
r18259 at T (orig r9962): jesse | 2007-12-15 15:11:20 +0800
r72962 at pinglin: jesse | 2007-12-10 15:05:42 -0500
* Canonicalize a bunch of "Go" buttons to "Go!"
* Switched the approvals button from "Show Approvals" to "Go"
r18260 at T (orig r9963): jesse | 2007-12-15 15:11:28 +0800
r73110 at pinglin: jesse | 2007-12-14 13:54:52 -0500
* Fix for a copy and paste bug when RT's config file was unreadable.
Thanks to Maxime Henrion <mux at freebsd.org>
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Admin/CustomFields/index.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Admin/CustomFields/index.html (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Admin/CustomFields/index.html Sat Dec 22 10:58:11 2007
@@ -79,7 +79,7 @@
% for (@types) {
<option value="<% $_->[1] %>"><% $_->[0] %></option>
% }
-</select> <input type="submit" value="<%loc('Go')%>" />
+</select> <input type="submit" value="<%loc('Go!')%>" />
</form>
<%args>
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Approvals/index.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Approvals/index.html (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Approvals/index.html Sat Dec 22 10:58:11 2007
@@ -51,7 +51,7 @@
<& /Elements/ListActions, actions => \@actions &>
<form method="post">
<& Elements/PendingMyApproval, %ARGS &>
-<& /Elements/Submit, Label => loc('Show Approvals') &>
+<& /Elements/Submit, Label => loc('Go!') &>
</form>
<%init>
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/REST/1.0/Forms/ticket/default
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/REST/1.0/Forms/ticket/default (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/REST/1.0/Forms/ticket/default Sat Dec 22 10:58:11 2007
@@ -207,7 +207,7 @@
foreach $key (qw(TimeEstimated TimeWorked TimeLeft)) {
next unless (!%$fields || (exists $fields->{lc $key}));
$val = $ticket->$key || 0;
- $val = $time->DurationAsString($val*60) if $val;
+ $val = "$val minutes" if $val;
push @data, [ $key => $val ];
}
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Results.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Results.html (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Results.html Sat Dec 22 10:58:11 2007
@@ -89,7 +89,7 @@
%}
<&|/l, $m->scomp('Elements/SelectGroupBy', Name => 'PrimaryGroupBy', Query => $Query) &>grouped by [_1]</&>
<&|/l, $m->scomp('Elements/SelectChartType', Name => 'ChartStyle') &>style: [_1]</&>
-<input type="submit" class="button" value="<%loc('Go')%>" />
+<input type="submit" class="button" value="<%loc('Go!')%>" />
</form>
<& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&>
</div>
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Tools/Offline.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Tools/Offline.html (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Tools/Offline.html Sat Dec 22 10:58:11 2007
@@ -88,7 +88,7 @@
</td>
<td>
<input name="Template" type="file" value="foo" />
-<input type="submit" class="button" name="Parse" value="<&|/l&>Go</&>" />
+<input type="submit" class="button" name="Parse" value="<&|/l&>Go!</&>" />
</td>
</tr>
</table>
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT.pm.in
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT.pm.in (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT.pm.in Sat Dec 22 10:58:11 2007
@@ -161,12 +161,12 @@
}
eval { require $CORE_CONFIG_FILE };
if ($@) {
- my ($fileuid,$filegid) = (stat($SITE_CONFIG_FILE))[4,5];
+ my ($fileuid,$filegid) = (stat($CORE_CONFIG_FILE))[4,5];
my $fileusername = getpwuid($fileuid);
my $filegroup = getgrgid($filegid);
- my $errormessage = sprintf($message, $SITE_CONFIG_FILE,
+ my $errormessage = sprintf($message, $CORE_CONFIG_FILE,
$fileusername, $filegroup, $filegroup);
- die ("$errormessage '$CORE_CONFIG_FILE'\n$@")
+ die ("$errormessage\n$@")
}
# RT::Essentials mistakenly recommends that WebPath be set to '/'.
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Groups_Overlay.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Groups_Overlay.pm (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Groups_Overlay.pm Sat Dec 22 10:58:11 2007
@@ -452,10 +452,12 @@
QUOTEVALUE => 0,
);
}
-sub _JoinACL { return (shift)->RT::Users::_JoinACL( @_ ) }
-sub _GetEquivObjects { return (shift)->RT::Users::_GetEquivObjects( @_ ) }
-sub WithGroupRight { return (shift)->RT::Users::WhoHaveGroupRight( @_ ) }
-sub WithRoleRight { return (shift)->RT::Users::WhoHaveRoleRight( @_ ) }
+sub _JoinACL { return (shift)->RT::Users::_JoinACL( @_ ) }
+sub _RoleClauses { return (shift)->RT::Users::_RoleClauses( @_ ) }
+sub _WhoHaveRoleRightSplitted { return (shift)->RT::Users::_WhoHaveRoleRightSplitted( @_ ) }
+sub _GetEquivObjects { return (shift)->RT::Users::_GetEquivObjects( @_ ) }
+sub WithGroupRight { return (shift)->RT::Users::WhoHaveGroupRight( @_ ) }
+sub WithRoleRight { return (shift)->RT::Users::WhoHaveRoleRight( @_ ) }
# {{{ sub LimitToEnabled
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/I18N.pm (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/I18N.pm Sat Dec 22 10:58:11 2007
@@ -303,7 +303,7 @@
my $str = shift;
my $enc = shift;
- @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gc;
+ @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gcs;
return ($str) unless (@_);
# add everything that hasn't matched to the end of the latest
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/06-mime_decoding.t
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/06-mime_decoding.t (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/06-mime_decoding.t Sat Dec 22 10:58:11 2007
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
use_ok("RT");
@@ -52,3 +52,13 @@
);
}
+diag q{newline and encoded file name} if $ENV{TEST_VERBOSE};
+{
+ my $str = qq{application/vnd.ms-powerpoint;\n\tname="=?ISO-8859-1?Q?Main_presentation.ppt?="};
+ is(
+ RT::I18N::DecodeMIMEWordsToUTF8($str),
+ qq{application/vnd.ms-powerpoint;\tname="Main presentation.ppt"},
+ "right decoding"
+ );
+}
+
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/23cfsort.t
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/23cfsort.t (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/t/regression/23cfsort.t Sat Dec 22 10:58:11 2007
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use Test::More tests => 15;
+use Test::More tests => 21;
use RT;
RT::LoadConfig();
RT::Init();
@@ -19,9 +19,11 @@
# ---- Create a queue to test with.
my $queue = "CFSortQueue-$$";
-my $queue_obj = RT::Queue->new($RT::SystemUser);
-($ret, $msg) = $queue_obj->Create(Name => $queue,
- Description => 'queue for custom field sort testing');
+my $queue_obj = RT::Queue->new( $RT::SystemUser );
+($ret, $msg) = $queue_obj->Create(
+ Name => $queue,
+ Description => 'queue for custom field sort testing'
+);
ok($ret, "$queue test queue creation. $msg");
# ---- Create some custom fields. We're not currently using all of
@@ -34,7 +36,7 @@
($ret, $msg) = $cfO->Create( Name => 'Order',
Queue => 0,
SortOrder => 1,
- Description => q[Something to compare results for, since we can't guarantee ticket ID],
+ Description => q{Something to compare results for, since we can't guarantee ticket ID},
Type=> 'FreeformSingle');
ok($ret, "Custom Field Order created");
@@ -86,7 +88,8 @@
}
my $results = join (" ", at results);
my $order = join(" ", at order);
- is( $results, $order , "Ordered correctly: $order");
+ @_ = ($results, $order , "Ordered correctly: $order");
+ goto \&is;
}
# The real tests start here
@@ -110,9 +113,23 @@
# in Tickets_Overlay.
$tx = new RT::Tickets( $RT::SystemUser );
$tx->FromSQL(qq[queue="$queue"] );
-$tx->OrderBy( FIELD => "CF.{Charlie}", ORDER => 'DES' );
+$tx->OrderBy( FIELD => "CF.{Charlie}", ORDER => 'DESC' );
+diag $tx->BuildSelectQuery;
is($tx->Count,2);
+TODO: {
+ local $TODO = 'order by CF fail';
check_order( $tx, 1, 2);
+}
+
+$tx = new RT::Tickets( $RT::SystemUser );
+$tx->FromSQL(qq[queue="$queue"] );
+$tx->OrderBy( FIELD => "CF.{Charlie}", ORDER => 'ASC' );
+diag $tx->BuildSelectQuery;
+is($tx->Count,2);
+TODO: {
+ local $TODO = 'order by CF fail';
+check_order( $tx, 2, 1);
+}
# Add a new ticket, to test sorting on multiple columns.
my $t3 = RT::Ticket->new($RT::SystemUser);
@@ -126,18 +143,50 @@
$tx = new RT::Tickets( $RT::SystemUser );
$tx->FromSQL(qq[queue="$queue"] );
-$tx->OrderByCols({FIELD => "CF.${queue}.{Charlie}", ORDER => 'ASC'},
- {FIELD => "CF.${queue}.{Alpha}", ORDER => 'DES'}
- );
+$tx->OrderByCols(
+ { FIELD => "CF.${queue}.{Charlie}", ORDER => 'ASC' },
+ { FIELD => "CF.${queue}.{Alpha}", ORDER => 'DES' },
+);
is($tx->Count,3);
+TODO: {
+ local $TODO = 'order by CF fail';
check_order( $tx, 3, 2, 1);
+}
+
+$tx = new RT::Tickets( $RT::SystemUser );
+$tx->FromSQL(qq[queue="$queue"] );
+$tx->OrderByCols(
+ { FIELD => "CF.${queue}.{Charlie}", ORDER => 'DES' },
+ { FIELD => "CF.${queue}.{Alpha}", ORDER => 'ASC' },
+);
+is($tx->Count,3);
+TODO: {
+ local $TODO = 'order by CF fail';
+check_order( $tx, 1, 2, 3);
+}
# Reverse the order of the secondary column, which changes the order
# of the first two tickets.
$tx = new RT::Tickets( $RT::SystemUser );
$tx->FromSQL(qq[queue="$queue"] );
-$tx->OrderByCols({FIELD => "CF.${queue}.{Charlie}", ORDER => 'ASC'},
- {FIELD => "CF.${queue}.{Alpha}", ORDER => 'ASC'}
- );
+$tx->OrderByCols(
+ { FIELD => "CF.${queue}.{Charlie}", ORDER => 'ASC' },
+ { FIELD => "CF.${queue}.{Alpha}", ORDER => 'ASC' },
+);
is($tx->Count,3);
+TODO: {
+ local $TODO = 'order by CF fail';
check_order( $tx, 2, 3, 1);
+}
+
+$tx = new RT::Tickets( $RT::SystemUser );
+$tx->FromSQL(qq[queue="$queue"] );
+$tx->OrderByCols(
+ { FIELD => "CF.${queue}.{Charlie}", ORDER => 'DES' },
+ { FIELD => "CF.${queue}.{Alpha}", ORDER => 'DES' },
+);
+is($tx->Count,3);
+TODO: {
+ local $TODO = 'order by CF fail';
+check_order( $tx, 1, 3, 2);
+}
More information about the Rt-commit
mailing list