[Bps-public-commit] RT-Extension-rt_cpan_org branch, master, updated. 4594d52b0d3ae64d6e98414813bc862bf9e07642

Thomas Sibley trs at bestpractical.com
Tue May 7 15:33:14 EDT 2013


The branch, master has been updated
       via  4594d52b0d3ae64d6e98414813bc862bf9e07642 (commit)
       via  655161266a3445b5d5baac1d27a127adc671a634 (commit)
       via  605329af05bb73b30eec71d07831c7fce8f39abb (commit)
      from  c86868e76d3f13db90c0aea5e5b681669514380f (commit)

Summary of changes:
 Makefile.PL                                        |   2 +-
 patches/4.0.10-not-in-operator.patch               |  26 -----
 patches/4.0.10-plain-text-attachments.patch        |  75 ------------
 patches/4.0.10-quicksearch-links.patch             | 126 ---------------------
 patches/4.0.10-quicksearch-prefs.patch             |  37 ------
 patches/4.0.11-quicksearch-check-clear-all.patch   |  36 ------
 patches/4.0.14-currentuser-attributes.patch        |  49 ++++++++
 ...-bundling.patch => 4.0.14-joins-bundling.patch} |   0
 patches/4.0.14-link-people-box.patch               |  33 ++++++
 9 files changed, 83 insertions(+), 301 deletions(-)
 delete mode 100644 patches/4.0.10-not-in-operator.patch
 delete mode 100644 patches/4.0.10-plain-text-attachments.patch
 delete mode 100644 patches/4.0.10-quicksearch-links.patch
 delete mode 100644 patches/4.0.10-quicksearch-prefs.patch
 delete mode 100644 patches/4.0.11-quicksearch-check-clear-all.patch
 create mode 100644 patches/4.0.14-currentuser-attributes.patch
 rename patches/{4.0.11-joins-bundling.patch => 4.0.14-joins-bundling.patch} (100%)
 create mode 100644 patches/4.0.14-link-people-box.patch

- Log -----------------------------------------------------------------
commit 605329af05bb73b30eec71d07831c7fce8f39abb
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue May 7 12:30:10 2013 -0700

    Bump RT dep to 4.0.12 and clean up required patches
    
    Join bundling didn't make 4.0.12.

diff --git a/Makefile.PL b/Makefile.PL
index 6d23abd..4a6a2ea 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -4,7 +4,7 @@ RTx('RT-Extension-rt_cpan_org');
 all_from        ('lib/RT/Extension/rt_cpan_org.pm');
 readme_from     ('lib/RT/Extension/rt_cpan_org.pm');
 
-requires_rt('4.0.0');
+requires_rt('4.0.12');
 
 # rt-cpan-export-db
 requires 'DBI';
diff --git a/patches/4.0.10-not-in-operator.patch b/patches/4.0.10-not-in-operator.patch
deleted file mode 100644
index 0616173..0000000
--- a/patches/4.0.10-not-in-operator.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 691c5065623a526aa8af664e10f5aae6778eb019 Mon Sep 17 00:00:00 2001
-From: Thomas Sibley <trs at bestpractical.com>
-Date: Mon, 1 Apr 2013 15:39:23 -0700
-Subject: [PATCH] Allow the NOT IN operator in Limit calls
-
-IN/NOT IN is supported by DBIx::SearchBuilder with the 1.63_01 release.
----
- lib/RT/SearchBuilder.pm | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
-index 1df5ac1..0ace421 100644
---- a/lib/RT/SearchBuilder.pm
-+++ b/lib/RT/SearchBuilder.pm
-@@ -279,7 +279,7 @@ sub Limit {
-                                   |(NOT\s*)?(STARTS|ENDS)WITH
-                                   |(NOT\s*)?MATCHES
-                                   |IS(\s*NOT)?
--                                  |IN
-+                                  |(NOT\s*)?IN
-                                   |\@\@)$/ix) {
-         $RT::Logger->crit("Possible SQL injection attack: $ARGS{FIELD} $ARGS{OPERATOR}");
-         $self->SUPER::Limit(
--- 
-1.7.11.3
-
diff --git a/patches/4.0.10-plain-text-attachments.patch b/patches/4.0.10-plain-text-attachments.patch
deleted file mode 100644
index 6d4cc98..0000000
--- a/patches/4.0.10-plain-text-attachments.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 86f7b03372df6f30fb8e9aad043b9b4721dc4eb8 Mon Sep 17 00:00:00 2001
-From: Thomas Sibley <trs at bestpractical.com>
-Date: Fri, 1 Mar 2013 17:45:30 -0800
-Subject: [PATCH] Respect plain text display preferences for all plain text
- content
-
-Attachments with filenames are never parsed with Text::Quoted, so the
-passed in $Message content was never an array reference.  This caused
-textual attachments to ignore the PlainTextPre and PlainTextMono
-settings, the symptom of which is nigh unreadable text.  Moving those
-preferences out of the conditional corrects the display.  Now every call
-to ShowMessageStanza with a text/plain content type will result in a
-<div class="message-stanza">, which may be white-space preserving and/or
-wrapped in a <pre>.
----
- share/html/Ticket/Elements/ShowMessageStanza | 32 ++++++++++++++--------------
- 1 file changed, 16 insertions(+), 16 deletions(-)
-
-diff --git a/share/html/Ticket/Elements/ShowMessageStanza b/share/html/Ticket/Elements/ShowMessageStanza
-index beca35c..716bdfb 100644
---- a/share/html/Ticket/Elements/ShowMessageStanza
-+++ b/share/html/Ticket/Elements/ShowMessageStanza
-@@ -77,16 +77,16 @@ my $print_content = sub {
-     $m->out($$ref);
- };
- 
--if ( ref $Message ) {
--    $m->out('<pre>')
--        if (    $ContentType eq 'text/plain'
--             && $plain_text_pre
--             && !$Depth
--             && !$plain_text_mono );
--    $m->out(   '<div class="message-stanza'
--             . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
--             . '>' );
-+$m->out('<pre>')
-+    if (    $ContentType eq 'text/plain'
-+         && $plain_text_pre
-+         && !$Depth
-+         && !$plain_text_mono );
-+$m->out(   '<div class="message-stanza'
-+         . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
-+         . '>' );
- 
-+if ( ref $Message ) {
-     my @stack;
-     my $para = '';
-     my $i    = 0;
-@@ -170,16 +170,16 @@ AGAIN: foreach ( ; $i < @$Message; $i++ ) {
-         $m->out('</div>');
-         goto AGAIN;
-     }
--
--    $m->out('</div>');
--    $m->out('</pre>')
--        if (    $ContentType eq 'text/plain'
--             && $plain_text_pre
--             && !$Depth
--             && !$plain_text_mono );
- } else {
-     $print_content->( \$Message );
- }
-+
-+$m->out('</div>');
-+$m->out('</pre>')
-+    if (    $ContentType eq 'text/plain'
-+         && $plain_text_pre
-+         && !$Depth
-+         && !$plain_text_mono );
- </%INIT>
- <%ARGS>
- $Message => undef
--- 
-1.7.11.3
-
diff --git a/patches/4.0.10-quicksearch-links.patch b/patches/4.0.10-quicksearch-links.patch
deleted file mode 100644
index 8c36abe..0000000
--- a/patches/4.0.10-quicksearch-links.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-diff --git a/share/html/Elements/QueueSummaryByLifecycle b/share/html/Elements/QueueSummaryByLifecycle
-index 6e5e0cb..44d6b5a 100644
---- a/share/html/Elements/QueueSummaryByLifecycle
-+++ b/share/html/Elements/QueueSummaryByLifecycle
-@@ -66,20 +66,16 @@ for my $queue (@queues) {
-     next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name;
- 
-     $i++;
--    my $name = $queue->{Name};
--    $name =~ s/(['\\])/\\$1/g;
--    my $queue_cond = "Queue = '$name' AND ";
--    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", @cur_statuses ) . ')';
- </%PERL>
- <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
- 
- <td>
--    <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
-+    <a href="<% $link_all->($queue, \@cur_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
- </td>
- 
- %   for my $status (@cur_statuses) {
- <td align="right">
--    <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a>
-+    <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{$status } || '-' %></a>
- </td>
- %   }
- </tr>
-@@ -87,6 +83,31 @@ for my $queue (@queues) {
- </table>
- % }
- <%INIT>
-+my $build_search_link = sub {
-+    my ($queue_name, $extra_query) = @_;
-+    $queue_name =~ s/(['\\])/\\$1/g; #'
-+
-+    return RT->Config->Get('WebPath')
-+         . "/Search/Results.html?Query="
-+         . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
-+};
-+
-+my $link_all = sub {
-+    my ($queue, $all_statuses) = @_;
-+    return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")");
-+};
-+
-+my $link_status = sub {
-+    my ($queue, $status) = @_;
-+    return $build_search_link->($queue->{Name}, "Status = '$status'");
-+};
-+
-+$m->callback(
-+    CallbackName        => 'LinkBuilders',
-+    build_search_link   => \$build_search_link,
-+    link_all            => \$link_all,
-+    link_status         => \$link_status,
-+);
- 
- my $Queues = RT::Queues->new( $session{'CurrentUser'} );
- $Queues->UnLimit();
-diff --git a/share/html/Elements/QueueSummaryByStatus b/share/html/Elements/QueueSummaryByStatus
-index 082a5dc..2a8dc53 100644
---- a/share/html/Elements/QueueSummaryByStatus
-+++ b/share/html/Elements/QueueSummaryByStatus
-@@ -58,16 +58,13 @@
- my $i = 0;
- for my $queue (@queues) {
-     $i++;
--    my $name = $queue->{Name};
--    $name =~ s/(['\\])/\\$1/g;
--    my $queue_cond = "Queue = '$name' AND ";
-     my $lifecycle = $lifecycle{ lc $queue->{'Lifecycle'} };
--    my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", grep $lifecycle->IsValid($_), @statuses ) . ')';
-+    my @queue_statuses = grep { $lifecycle->IsValid($_) } @statuses;
- </%PERL>
- <tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
- 
- <td>
--    <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $all_q |u,n %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
-+    <a href="<% $link_all->($queue, \@queue_statuses) %>" title="<% $queue->{Description} %>"><% $queue->{Name} %></a>
- </td>
- 
- <%perl>
-@@ -75,7 +72,7 @@ for my $queue (@queues) {
-    if ( $lifecycle->IsValid( $status ) ) {
- </%perl>
- <td align="right">
--    <a href="<% RT->Config->Get('WebPath') %>/Search/Results.html?Query=<% $queue_cond ."Status = '$status'" |u,n %>"><% $data->{$queue->{id}}->{$status } || '-' %></a>
-+    <a href="<% $link_status->($queue, $status) %>"><% $data->{$queue->{id}}->{$status } || '-' %></a>
- </td>
- %   } else {
- <td align="right">-</td>
-@@ -85,6 +82,31 @@ for my $queue (@queues) {
- % }
- </table>
- <%INIT>
-+my $build_search_link = sub {
-+    my ($queue_name, $extra_query) = @_;
-+    $queue_name =~ s/(['\\])/\\$1/g; #'
-+
-+    return RT->Config->Get('WebPath')
-+         . "/Search/Results.html?Query="
-+         . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u');
-+};
-+
-+my $link_all = sub {
-+    my ($queue, $all_statuses) = @_;
-+    return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")");
-+};
-+
-+my $link_status = sub {
-+    my ($queue, $status) = @_;
-+    return $build_search_link->($queue->{Name}, "Status = '$status'");
-+};
-+
-+$m->callback(
-+    CallbackName        => 'LinkBuilders',
-+    build_search_link   => \$build_search_link,
-+    link_all            => \$link_all,
-+    link_status         => \$link_status,
-+);
- 
- my $Queues = RT::Queues->new( $session{'CurrentUser'} );
- $Queues->UnLimit();
--- 
-1.7.11.3
-
diff --git a/patches/4.0.10-quicksearch-prefs.patch b/patches/4.0.10-quicksearch-prefs.patch
deleted file mode 100644
index cec0625..0000000
--- a/patches/4.0.10-quicksearch-prefs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 97ee6ca5811e9b68c5c7a3a52b24677a301bf78b Mon Sep 17 00:00:00 2001
-From: Thomas Sibley <trs at bestpractical.com>
-Date: Wed, 27 Feb 2013 17:19:22 -0800
-Subject: [PATCH] Add a callback for modifying the displayed queues on the
- quicksearch prefs
-
-This also lets the callback skip the ShowTicket rights check or specify
-a different right.
----
- share/html/Prefs/Quicksearch.html | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/share/html/Prefs/Quicksearch.html b/share/html/Prefs/Quicksearch.html
-index 02b88ab..93b026f 100644
---- a/share/html/Prefs/Quicksearch.html
-+++ b/share/html/Prefs/Quicksearch.html
-@@ -71,7 +71,16 @@ my $user = $session{'CurrentUser'}->UserObj;
- my $unwanted = $user->Preferences('QuickSearch', {});
- my $Queues = RT::Queues->new($session{'CurrentUser'});
- $Queues->UnLimit;
--my @queues = grep {$_->CurrentUserHasRight('ShowTicket')} @{$Queues->ItemsArrayRef};
-+
-+my $right = 'ShowTicket';
-+$m->callback(
-+    CallbackName    => 'ModifyQueues',
-+    Queues          => \$Queues,
-+    Right           => \$right,
-+    Unwanted        => $unwanted,
-+);
-+
-+my @queues = grep { $right ? $_->CurrentUserHasRight($right) : 1 } @{$Queues->ItemsArrayRef};
- 
- if ($ARGS{'Save'}) {
-     for my $queue (@queues) {
--- 
-1.7.11.3
-
diff --git a/patches/4.0.11-quicksearch-check-clear-all.patch b/patches/4.0.11-quicksearch-check-clear-all.patch
deleted file mode 100644
index 15e058e..0000000
--- a/patches/4.0.11-quicksearch-check-clear-all.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From c2120ccbecf734475fc3a142554a6636fdcd6e5f Mon Sep 17 00:00:00 2001
-From: Thomas Sibley <trs at bestpractical.com>
-Date: Wed, 3 Apr 2013 12:05:10 -0700
-Subject: [PATCH] Add Check/Clear All and Reset buttons for the Quick Search
- (queue list) preferences
-
-Very helpful when the list of queues is long.
----
- share/html/Prefs/Quicksearch.html | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/share/html/Prefs/Quicksearch.html b/share/html/Prefs/Quicksearch.html
-index 93b026f..cb4292a 100644
---- a/share/html/Prefs/Quicksearch.html
-+++ b/share/html/Prefs/Quicksearch.html
-@@ -60,7 +60,16 @@ checked="checked"
- /><%$queue->Name%><% $queue->Description ? ': '.$queue->Description : '' %></li>
- % }
- </ul>
--<& /Elements/Submit, Caption => loc("Save Changes"), Label => loc('Save'), Name => 'Save'&>
-+
-+<& /Elements/Submit,
-+    Caption             => loc("Save Changes"),
-+    Label               => loc('Save'),
-+    Name                => 'Save',
-+    Reset               => 1,
-+    CheckAll            => 1,
-+    ClearAll            => 1,
-+    CheckboxNameRegex   => '/^Want-/',
-+    &>
- 
- </form>
- 
--- 
-1.7.11.3
-
diff --git a/patches/4.0.11-joins-bundling.patch b/patches/4.0.14-joins-bundling.patch
similarity index 100%
rename from patches/4.0.11-joins-bundling.patch
rename to patches/4.0.14-joins-bundling.patch

commit 655161266a3445b5d5baac1d27a127adc671a634
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue May 7 12:32:03 2013 -0700

    Patch to restore linking of People box title

diff --git a/patches/4.0.14-link-people-box.patch b/patches/4.0.14-link-people-box.patch
new file mode 100644
index 0000000..cd68a07
--- /dev/null
+++ b/patches/4.0.14-link-people-box.patch
@@ -0,0 +1,33 @@
+From db3e18a3c44abc2dabd435c349b4a279b4a8f294 Mon Sep 17 00:00:00 2001
+From: Thomas Sibley <trs at bestpractical.com>
+Date: Mon, 6 May 2013 14:21:50 -0700
+Subject: [PATCH] Link the title of the ticket "People" box when
+ Watch/WatchAsAdminCc are granted
+
+---
+ share/html/Ticket/Elements/ShowSummary | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
+index 48db922..7241268 100644
+--- a/share/html/Ticket/Elements/ShowSummary
++++ b/share/html/Ticket/Elements/ShowSummary
+@@ -60,7 +60,7 @@
+     &><& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &></&>
+ 
+     <&| /Widgets/TitleBox, title => loc('People'),
+-        (($can_modify || $can_modify_owner) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
++        (($can_modify || $can_modify_owner || $can_modify_people) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
+         class => 'ticket-info-people',
+     &><& /Ticket/Elements/ShowPeople, Ticket => $Ticket &></&>
+     <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
+@@ -109,4 +109,6 @@ my $can_modify_cf = $Ticket->CurrentUserHasRight('ModifyCustomField');
+ my $can_modify_owner = $Ticket->CurrentUserHasRight('OwnTicket')
+                     || $Ticket->CurrentUserHasRight('TakeTicket')
+                     || $Ticket->CurrentUserHasRight('StealTicket');
++my $can_modify_people = $Ticket->CurrentUserHasRight('Watch')
++                     || $Ticket->CurrentUserHasRight('WatchAsAdminCc');
+ </%INIT>
+-- 
+1.8.2.2
+

commit 4594d52b0d3ae64d6e98414813bc862bf9e07642
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue May 7 12:32:14 2013 -0700

    Patch to allow merged users to login using the merged username

diff --git a/patches/4.0.14-currentuser-attributes.patch b/patches/4.0.14-currentuser-attributes.patch
new file mode 100644
index 0000000..4693e61
--- /dev/null
+++ b/patches/4.0.14-currentuser-attributes.patch
@@ -0,0 +1,49 @@
+From 27fefc1a018b9a06a144e441bed7095c2ca4b7d1 Mon Sep 17 00:00:00 2001
+From: Thomas Sibley <trs at bestpractical.com>
+Date: Tue, 7 May 2013 12:12:20 -0700
+Subject: [PATCH] RT::CurrentUser objects should access Attributes as an
+ RT::User
+
+Otherwise attributes on the user object aren't found when accessed via
+an equivalent current user object.
+
+A larger, more invasive 4.2 fix for this should be introducing an
+_ObjectType method or similar which is provided by the superclass and
+used instead of ref().
+---
+ lib/RT/Attribute.pm  | 2 +-
+ lib/RT/Attributes.pm | 5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/lib/RT/Attribute.pm b/lib/RT/Attribute.pm
+index a0edb15..4350df0 100644
+--- a/lib/RT/Attribute.pm
++++ b/lib/RT/Attribute.pm
+@@ -148,7 +148,7 @@ sub Create {
+ 		  @_);
+ 
+     if ($args{Object} and UNIVERSAL::can($args{Object}, 'Id')) {
+-	    $args{ObjectType} = ref($args{Object});
++	    $args{ObjectType} = $args{Object}->isa("RT::CurrentUser") ? "RT::User" : ref($args{Object});
+ 	    $args{ObjectId} = $args{Object}->Id;
+     } else {
+         return(0, $self->loc("Required parameter '[_1]' not specified", 'Object'));
+diff --git a/lib/RT/Attributes.pm b/lib/RT/Attributes.pm
+index 9c18c1a..997e376 100644
+--- a/lib/RT/Attributes.pm
++++ b/lib/RT/Attributes.pm
+@@ -210,7 +210,10 @@ sub LimitToObject {
+     unless (eval { $obj->id} ){
+         return undef;
+     }
+-    $self->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => ref($obj), ENTRYAGGREGATOR => 'OR');
++
++    my $type = $obj->isa("RT::CurrentUser") ? "RT::User" : ref($obj);
++
++    $self->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => $type, ENTRYAGGREGATOR => 'OR');
+     $self->Limit(FIELD => 'ObjectId', OPERATOR=> '=', VALUE => $obj->id, ENTRYAGGREGATOR => 'OR', QUOTEVALUE => 0);
+ 
+ }
+-- 
+1.8.2.2
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list