[Bps-public-commit] RT-Extension-rt_cpan_org branch, rt4, updated. b75e59fbf49192c2502464f06f31d7a11305fe8d
Thomas Sibley
trs at bestpractical.com
Thu Apr 4 21:48:37 EDT 2013
The branch, rt4 has been updated
via b75e59fbf49192c2502464f06f31d7a11305fe8d (commit)
via 7d56159ea75a05da9ae5392c2630dafaf1c67f28 (commit)
via a3c3694193241aa0c58029b6d60b91b38f5c68cc (commit)
from 4e12eb7feb768358a26e3d32afc4c99c9a0b1c97 (commit)
Summary of changes:
etc/CPAN_Config.pm | 8 ++++
etc/upgrade/4.0/content | 28 +++++++++++++
.../Callbacks/rt_cpan_org/Elements/Tabs/Privileged | 1 +
lib/RT/Condition/Status.pm | 46 ++++++++++++++++++++++
4 files changed, 83 insertions(+)
create mode 100644 lib/RT/Condition/Status.pm
- Log -----------------------------------------------------------------
commit a3c3694193241aa0c58029b6d60b91b38f5c68cc
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 4 18:46:45 2013 -0700
Only auto-open new or stalled tickets on replies from non-requestors
All other transitions to open must be explicit. The general consensus
from authors is that this is preferable and creates less busy work.
diff --git a/etc/upgrade/4.0/content b/etc/upgrade/4.0/content
index 0549112..50c442f 100644
--- a/etc/upgrade/4.0/content
+++ b/etc/upgrade/4.0/content
@@ -9,4 +9,32 @@ our @ACL = (
}
);
+our @ScripConditions = (
+ { Name => 'On Correspond and New or Stalled',
+ Description => 'When a new or stalled ticket receives a correspondence',
+ ApplicableTransTypes => 'Correspond',
+ ExecModule => 'Status',
+ Argument => 'new,stalled', },
+);
+
+our @Scrips = (
+ { Description => 'On Correspond and New or Stalled, then Open Ticket',
+ ScripCondition => 'On Correspond and New or Stalled',
+ ScripAction => 'Open Tickets',
+ Template => 'Blank' },
+);
+
+our @Final = (
+ sub {
+ my $scrip = RT::Scrip->new( RT->SystemUser );
+ $scrip->LoadByCols( Description => "On Correspond Open Tickets" );
+ RT->Logger->error("Unable to find scrip On Correspond Open Tickets"), return
+ unless $scrip->id;
+
+ my ($ok, $msg) = $scrip->SetStage('Disabled');
+ RT->Logger->error("Unable to set scrip stage to Disabled: $msg")
+ unless $ok;
+ },
+);
+
1;
diff --git a/lib/RT/Condition/Status.pm b/lib/RT/Condition/Status.pm
new file mode 100644
index 0000000..c0e705a
--- /dev/null
+++ b/lib/RT/Condition/Status.pm
@@ -0,0 +1,46 @@
+use strict;
+use warnings;
+
+package RT::Condition::Status;
+use base 'RT::Condition';
+
+=head1 NAME
+
+RT::Condition::Status - Scrip condition on a ticket status matching the provided Argument
+
+=head1 DESCRIPTION
+
+The Argument passed to the condition should be a comma-separated list of
+statuses to match on. The special values C<initial>, C<active>, and
+C<inactive> may be used to match any status in those status sets (as defined in
+the applicable Lifecycle).
+
+=cut
+
+sub IsApplicable {
+ my $self = shift;
+ my $status = $self->TicketObj->Status;
+ my @statuses = $self->ProcessArgument($self->Argument);
+ return 1 if grep { lc($status) eq lc($_) } @statuses;
+ return 0;
+}
+
+sub ProcessArgument {
+ my $self = shift;
+ my $arg = shift || "";
+ my $lifecycle = $self->TicketObj->QueueObj->Lifecycle;
+ my @statuses;
+
+ for my $status (split /\s*,\s*/, $arg) {
+ next unless defined $status and length $status;
+
+ if ($status =~ /^(initial|active|inactive)$/i) {
+ push @statuses, $lifecycle->Valid(lc $1);
+ } else {
+ push @statuses, $status;
+ }
+ }
+ return @statuses;
+}
+
+1;
commit 7d56159ea75a05da9ae5392c2630dafaf1c67f28
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 4 18:47:40 2013 -0700
Provide actions for moving from patched to open and resolved
Patched was added but no transitions were defined out.
diff --git a/etc/CPAN_Config.pm b/etc/CPAN_Config.pm
index 522e98f..a9039bb 100644
--- a/etc/CPAN_Config.pm
+++ b/etc/CPAN_Config.pm
@@ -120,6 +120,14 @@ Set( %Lifecycles,
'stalled -> open' => {
label => 'Open It', # loc
},
+ 'patched -> open' => {
+ label => 'Re-open',
+ update => 'Respond',
+ },
+ 'patched -> resolved' => {
+ label => 'Resolve',
+ update => 'Respond',
+ },
'resolved -> open' => {
label => 'Re-open', # loc
update => 'Respond',
commit b75e59fbf49192c2502464f06f31d7a11305fe8d
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Apr 4 18:48:02 2013 -0700
Remove "Extract Article" from the ticket action menu
rt.cpan.org doesn't use articles, and there's no core rights check
guarding this menu action.
diff --git a/html/Callbacks/rt_cpan_org/Elements/Tabs/Privileged b/html/Callbacks/rt_cpan_org/Elements/Tabs/Privileged
index de52502..243085d 100644
--- a/html/Callbacks/rt_cpan_org/Elements/Tabs/Privileged
+++ b/html/Callbacks/rt_cpan_org/Elements/Tabs/Privileged
@@ -3,6 +3,7 @@ use utf8;
if (my $actions = PageMenu->child("actions")) {
$actions->delete("comment");
+ $actions->delete("extract-article");
}
Menu->child("search")->title(loc("Search Tickets"));
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list