diff options
author | Ivan Kohler <ivan@freeside.biz> | 2016-09-24 10:28:06 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2016-09-24 10:31:23 -0700 |
commit | 9ce482da3960ee43decee41fba53b78c12c3e52c (patch) | |
tree | f7e77a4a2154a3f259fc41f5c2282a752e4ba200 /rt/lib | |
parent | 6894828ab5a66e53ad6945cc14e6cd9f9c3b67f7 (diff) |
rt 4.2.13 ticket#13852
Diffstat (limited to 'rt/lib')
208 files changed, 514 insertions, 524 deletions
diff --git a/rt/lib/RT.pm b/rt/lib/RT.pm index 7b586859d..069309dc7 100644 --- a/rt/lib/RT.pm +++ b/rt/lib/RT.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ACE.pm b/rt/lib/RT/ACE.pm index c27a82bb7..0a79ecb39 100755 --- a/rt/lib/RT/ACE.pm +++ b/rt/lib/RT/ACE.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ACL.pm b/rt/lib/RT/ACL.pm index 89ca69f2d..fb3f4011d 100755 --- a/rt/lib/RT/ACL.pm +++ b/rt/lib/RT/ACL.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action.pm b/rt/lib/RT/Action.pm index 5c295cb8b..ac4dfe695 100755 --- a/rt/lib/RT/Action.pm +++ b/rt/lib/RT/Action.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/AutoOpen.pm b/rt/lib/RT/Action/AutoOpen.pm index 156c1eea4..9cc324e27 100644 --- a/rt/lib/RT/Action/AutoOpen.pm +++ b/rt/lib/RT/Action/AutoOpen.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/AutoOpenInactive.pm b/rt/lib/RT/Action/AutoOpenInactive.pm index a8a373939..9a48706ca 100644 --- a/rt/lib/RT/Action/AutoOpenInactive.pm +++ b/rt/lib/RT/Action/AutoOpenInactive.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/Autoreply.pm b/rt/lib/RT/Action/Autoreply.pm index 9bf6ab6d3..a7a46277c 100755 --- a/rt/lib/RT/Action/Autoreply.pm +++ b/rt/lib/RT/Action/Autoreply.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/CreateTickets.pm b/rt/lib/RT/Action/CreateTickets.pm index d19f152d0..dd32da70c 100644 --- a/rt/lib/RT/Action/CreateTickets.pm +++ b/rt/lib/RT/Action/CreateTickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/EscalatePriority.pm b/rt/lib/RT/Action/EscalatePriority.pm index 8632d9d5c..1b63d53f4 100644 --- a/rt/lib/RT/Action/EscalatePriority.pm +++ b/rt/lib/RT/Action/EscalatePriority.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/ExtractSubjectTag.pm b/rt/lib/RT/Action/ExtractSubjectTag.pm index b13d2a86d..1dece09b4 100644 --- a/rt/lib/RT/Action/ExtractSubjectTag.pm +++ b/rt/lib/RT/Action/ExtractSubjectTag.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/LinearEscalate.pm b/rt/lib/RT/Action/LinearEscalate.pm index 960703327..23a796cdf 100755 --- a/rt/lib/RT/Action/LinearEscalate.pm +++ b/rt/lib/RT/Action/LinearEscalate.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/Notify.pm b/rt/lib/RT/Action/Notify.pm index 633206ed2..ec98fa3ac 100755 --- a/rt/lib/RT/Action/Notify.pm +++ b/rt/lib/RT/Action/Notify.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/NotifyAsComment.pm b/rt/lib/RT/Action/NotifyAsComment.pm index 50c1a62ec..924419be3 100755 --- a/rt/lib/RT/Action/NotifyAsComment.pm +++ b/rt/lib/RT/Action/NotifyAsComment.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/NotifyGroup.pm b/rt/lib/RT/Action/NotifyGroup.pm index 5646d7e34..e9638b725 100644 --- a/rt/lib/RT/Action/NotifyGroup.pm +++ b/rt/lib/RT/Action/NotifyGroup.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/NotifyGroupAsComment.pm b/rt/lib/RT/Action/NotifyGroupAsComment.pm index dd69fa3de..f6e986d65 100644 --- a/rt/lib/RT/Action/NotifyGroupAsComment.pm +++ b/rt/lib/RT/Action/NotifyGroupAsComment.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/NotifyOwnerOrAdminCc.pm b/rt/lib/RT/Action/NotifyOwnerOrAdminCc.pm index 2d6e423b9..33ca47723 100644 --- a/rt/lib/RT/Action/NotifyOwnerOrAdminCc.pm +++ b/rt/lib/RT/Action/NotifyOwnerOrAdminCc.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/OpenOnStarted.pm b/rt/lib/RT/Action/OpenOnStarted.pm index 0995e9480..c1634519c 100644 --- a/rt/lib/RT/Action/OpenOnStarted.pm +++ b/rt/lib/RT/Action/OpenOnStarted.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/RecordComment.pm b/rt/lib/RT/Action/RecordComment.pm index 575c92edf..8ec0b0edf 100644 --- a/rt/lib/RT/Action/RecordComment.pm +++ b/rt/lib/RT/Action/RecordComment.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/RecordCorrespondence.pm b/rt/lib/RT/Action/RecordCorrespondence.pm index e407b9ff7..73695cd2f 100644 --- a/rt/lib/RT/Action/RecordCorrespondence.pm +++ b/rt/lib/RT/Action/RecordCorrespondence.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/SendEmail.pm b/rt/lib/RT/Action/SendEmail.pm index 80b0054ee..2361ead7f 100755 --- a/rt/lib/RT/Action/SendEmail.pm +++ b/rt/lib/RT/Action/SendEmail.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -317,24 +317,21 @@ sub SendMessage { return (1); } -=head2 AddAttachments +=head2 AttachableFromTransaction -Takes any attachments to this transaction and attaches them to the message -we're building. +Function (not method) that takes an L<RT::Transaction> and returns an +L<RT::Attachments> collection of attachments suitable for attaching to an +email. =cut -sub AddAttachments { - my $self = shift; - - my $MIMEObj = $self->TemplateObj->MIMEObj; - - $MIMEObj->head->delete('RT-Attach-Message'); +sub AttachableFromTransaction { + my $txn = shift; my $attachments = RT::Attachments->new( RT->SystemUser ); $attachments->Limit( FIELD => 'TransactionId', - VALUE => $self->TransactionObj->Id + VALUE => $txn->Id ); # Don't attach anything blank @@ -344,7 +341,7 @@ sub AddAttachments { # We want to make sure that we don't include the attachment that's # being used as the "Content" of this message" unless that attachment's # content type is not like text/... - my $transaction_content_obj = $self->TransactionObj->ContentObj; + my $transaction_content_obj = $txn->ContentObj; if ( $transaction_content_obj && $transaction_content_obj->ContentType =~ m{text/}i ) @@ -368,6 +365,25 @@ sub AddAttachments { } } + return $attachments; +} + +=head2 AddAttachments + +Takes any attachments to this transaction and attaches them to the message +we're building. + +=cut + +sub AddAttachments { + my $self = shift; + + my $MIMEObj = $self->TemplateObj->MIMEObj; + + $MIMEObj->head->delete('RT-Attach-Message'); + + my $attachments = AttachableFromTransaction($self->TransactionObj); + # attach any of this transaction's attachments my $seen_attachment = 0; while ( my $attach = $attachments->Next ) { diff --git a/rt/lib/RT/Action/SendForward.pm b/rt/lib/RT/Action/SendForward.pm index 5fad224b0..3fa6e3b6b 100644 --- a/rt/lib/RT/Action/SendForward.pm +++ b/rt/lib/RT/Action/SendForward.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/SetPriority.pm b/rt/lib/RT/Action/SetPriority.pm index df789e44f..4ebf5e555 100644 --- a/rt/lib/RT/Action/SetPriority.pm +++ b/rt/lib/RT/Action/SetPriority.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/SetStatus.pm b/rt/lib/RT/Action/SetStatus.pm index d763b9b7b..158afe15c 100644 --- a/rt/lib/RT/Action/SetStatus.pm +++ b/rt/lib/RT/Action/SetStatus.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Action/UserDefined.pm b/rt/lib/RT/Action/UserDefined.pm index 2b8d9b794..48bee186d 100644 --- a/rt/lib/RT/Action/UserDefined.pm +++ b/rt/lib/RT/Action/UserDefined.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval.pm b/rt/lib/RT/Approval.pm index afa4286cd..cd6d661cf 100644 --- a/rt/lib/RT/Approval.pm +++ b/rt/lib/RT/Approval.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval/Rule.pm b/rt/lib/RT/Approval/Rule.pm index 0bb98ef45..9bf39f03d 100644 --- a/rt/lib/RT/Approval/Rule.pm +++ b/rt/lib/RT/Approval/Rule.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval/Rule/Created.pm b/rt/lib/RT/Approval/Rule/Created.pm index b5c18822b..fbbf9f5ae 100644 --- a/rt/lib/RT/Approval/Rule/Created.pm +++ b/rt/lib/RT/Approval/Rule/Created.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval/Rule/NewPending.pm b/rt/lib/RT/Approval/Rule/NewPending.pm index 41955651a..238ad63c5 100644 --- a/rt/lib/RT/Approval/Rule/NewPending.pm +++ b/rt/lib/RT/Approval/Rule/NewPending.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval/Rule/Passed.pm b/rt/lib/RT/Approval/Rule/Passed.pm index 53d09a195..cd083d516 100644 --- a/rt/lib/RT/Approval/Rule/Passed.pm +++ b/rt/lib/RT/Approval/Rule/Passed.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Approval/Rule/Rejected.pm b/rt/lib/RT/Approval/Rule/Rejected.pm index 91078d38f..8661bf4ec 100644 --- a/rt/lib/RT/Approval/Rule/Rejected.pm +++ b/rt/lib/RT/Approval/Rule/Rejected.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Article.pm b/rt/lib/RT/Article.pm index b53c3ccef..2c955cc12 100644 --- a/rt/lib/RT/Article.pm +++ b/rt/lib/RT/Article.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Articles.pm b/rt/lib/RT/Articles.pm index 4b85ebab6..726758ac8 100644 --- a/rt/lib/RT/Articles.pm +++ b/rt/lib/RT/Articles.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Attachment.pm b/rt/lib/RT/Attachment.pm index 154d16165..00f790abf 100755 --- a/rt/lib/RT/Attachment.pm +++ b/rt/lib/RT/Attachment.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Attachments.pm b/rt/lib/RT/Attachments.pm index 13cf5cf84..73da9bbfa 100755 --- a/rt/lib/RT/Attachments.pm +++ b/rt/lib/RT/Attachments.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Attribute.pm b/rt/lib/RT/Attribute.pm index 8ee95d23e..9943b5789 100644 --- a/rt/lib/RT/Attribute.pm +++ b/rt/lib/RT/Attribute.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Attributes.pm b/rt/lib/RT/Attributes.pm index f5e84a4d1..e0ede6a06 100644 --- a/rt/lib/RT/Attributes.pm +++ b/rt/lib/RT/Attributes.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Base.pm b/rt/lib/RT/Base.pm index 9254c8f36..77b3736d2 100644 --- a/rt/lib/RT/Base.pm +++ b/rt/lib/RT/Base.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CachedGroupMember.pm b/rt/lib/RT/CachedGroupMember.pm index f5d62c20a..21ea33655 100644 --- a/rt/lib/RT/CachedGroupMember.pm +++ b/rt/lib/RT/CachedGroupMember.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CachedGroupMembers.pm b/rt/lib/RT/CachedGroupMembers.pm index e6bda973c..cb483cb43 100644 --- a/rt/lib/RT/CachedGroupMembers.pm +++ b/rt/lib/RT/CachedGroupMembers.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Class.pm b/rt/lib/RT/Class.pm index 4f746beed..c98564134 100644 --- a/rt/lib/RT/Class.pm +++ b/rt/lib/RT/Class.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Classes.pm b/rt/lib/RT/Classes.pm index bf55d523d..6ff2b574b 100644 --- a/rt/lib/RT/Classes.pm +++ b/rt/lib/RT/Classes.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition.pm b/rt/lib/RT/Condition.pm index 69aaf8664..537aa541b 100755 --- a/rt/lib/RT/Condition.pm +++ b/rt/lib/RT/Condition.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/AnyTransaction.pm b/rt/lib/RT/Condition/AnyTransaction.pm index f63508b03..44a265507 100644 --- a/rt/lib/RT/Condition/AnyTransaction.pm +++ b/rt/lib/RT/Condition/AnyTransaction.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/BeforeDue.pm b/rt/lib/RT/Condition/BeforeDue.pm index 6e1b60272..6302726f8 100644 --- a/rt/lib/RT/Condition/BeforeDue.pm +++ b/rt/lib/RT/Condition/BeforeDue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/CloseTicket.pm b/rt/lib/RT/Condition/CloseTicket.pm index 67f4dd98b..66c810681 100644 --- a/rt/lib/RT/Condition/CloseTicket.pm +++ b/rt/lib/RT/Condition/CloseTicket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/Overdue.pm b/rt/lib/RT/Condition/Overdue.pm index f9c0c498a..e005f696c 100644 --- a/rt/lib/RT/Condition/Overdue.pm +++ b/rt/lib/RT/Condition/Overdue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/OwnerChange.pm b/rt/lib/RT/Condition/OwnerChange.pm index 73689710c..651a4bb2a 100644 --- a/rt/lib/RT/Condition/OwnerChange.pm +++ b/rt/lib/RT/Condition/OwnerChange.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/PriorityChange.pm b/rt/lib/RT/Condition/PriorityChange.pm index 8992e7bd3..a1629e9d0 100644 --- a/rt/lib/RT/Condition/PriorityChange.pm +++ b/rt/lib/RT/Condition/PriorityChange.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/PriorityExceeds.pm b/rt/lib/RT/Condition/PriorityExceeds.pm index 808595bf5..72319eedc 100644 --- a/rt/lib/RT/Condition/PriorityExceeds.pm +++ b/rt/lib/RT/Condition/PriorityExceeds.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/QueueChange.pm b/rt/lib/RT/Condition/QueueChange.pm index d4be9650b..73c1b8424 100644 --- a/rt/lib/RT/Condition/QueueChange.pm +++ b/rt/lib/RT/Condition/QueueChange.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/ReopenTicket.pm b/rt/lib/RT/Condition/ReopenTicket.pm index f082eb8e9..31f014349 100644 --- a/rt/lib/RT/Condition/ReopenTicket.pm +++ b/rt/lib/RT/Condition/ReopenTicket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/StatusChange.pm b/rt/lib/RT/Condition/StatusChange.pm index f665e45e0..97153c675 100644 --- a/rt/lib/RT/Condition/StatusChange.pm +++ b/rt/lib/RT/Condition/StatusChange.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Condition/UserDefined.pm b/rt/lib/RT/Condition/UserDefined.pm index 7d58eb02f..a6e0132a6 100644 --- a/rt/lib/RT/Condition/UserDefined.pm +++ b/rt/lib/RT/Condition/UserDefined.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Config.pm b/rt/lib/RT/Config.pm index 08844f50d..656741ca9 100644 --- a/rt/lib/RT/Config.pm +++ b/rt/lib/RT/Config.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Crypt.pm b/rt/lib/RT/Crypt.pm index cad86d24f..dfc0bf0f9 100644 --- a/rt/lib/RT/Crypt.pm +++ b/rt/lib/RT/Crypt.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -545,7 +545,7 @@ sub VerifyDecrypt { my $modify = $res{status_on}->head->modify; $res{status_on}->head->modify(1); $res{status_on}->head->add( - "X-RT-" . $protected->{'Protocol'} . "-Status" => $res{'status'} + "X-RT-" . $protected->{'Protocol'} . "-Status" => Encode::encode( "UTF-8", $res{'status'} ) ); $res{status_on}->head->modify($modify); diff --git a/rt/lib/RT/Crypt/GnuPG.pm b/rt/lib/RT/Crypt/GnuPG.pm index ddb91e4f5..e986447c8 100644 --- a/rt/lib/RT/Crypt/GnuPG.pm +++ b/rt/lib/RT/Crypt/GnuPG.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -911,10 +911,10 @@ sub _CheckIfProtectedInline { } while ( defined($_ = $io->getline) ) { - if ( /^-----BEGIN PGP (SIGNED )?MESSAGE-----/ ) { + if ( /^-----BEGIN PGP (SIGNED )?MESSAGE-----\s*$/ ) { return $1? 'signed': 'encrypted'; } - elsif ( $check_for_signature && !/^-----BEGIN PGP SIGNATURE-----/ ) { + elsif ( $check_for_signature && !/^-----BEGIN PGP SIGNATURE-----\s*$/ ) { return 'signature'; } } @@ -1092,7 +1092,7 @@ sub DecryptInline { binmode $block_fh, ':raw'; while ( defined(my $str = $io->getline) ) { - if ( $in_block && $str =~ /^-----END PGP (?:MESSAGE|SIGNATURE)-----/ ) { + if ( $in_block && $str =~ /^-----END PGP (?:MESSAGE|SIGNATURE)-----\s*$/ ) { print $block_fh $str; $in_block--; next if $in_block > 0; @@ -1116,7 +1116,7 @@ sub DecryptInline { binmode $block_fh, ':raw'; $in_block = 0; } - elsif ( $str =~ /^-----BEGIN PGP (SIGNED )?MESSAGE-----/ ) { + elsif ( $str =~ /^-----BEGIN PGP (SIGNED )?MESSAGE-----\s*$/ ) { $in_block++; print $block_fh $str; } diff --git a/rt/lib/RT/Crypt/GnuPG/CRLFHandle.pm b/rt/lib/RT/Crypt/GnuPG/CRLFHandle.pm index 74a400986..2dfc45224 100644 --- a/rt/lib/RT/Crypt/GnuPG/CRLFHandle.pm +++ b/rt/lib/RT/Crypt/GnuPG/CRLFHandle.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Crypt/Role.pm b/rt/lib/RT/Crypt/Role.pm index b1e368df7..6a33e5d77 100644 --- a/rt/lib/RT/Crypt/Role.pm +++ b/rt/lib/RT/Crypt/Role.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Crypt/SMIME.pm b/rt/lib/RT/Crypt/SMIME.pm index a676d8bff..743ab2bb8 100644 --- a/rt/lib/RT/Crypt/SMIME.pm +++ b/rt/lib/RT/Crypt/SMIME.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CurrentUser.pm b/rt/lib/RT/CurrentUser.pm index a4b5dc09a..74d44e304 100755 --- a/rt/lib/RT/CurrentUser.pm +++ b/rt/lib/RT/CurrentUser.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CustomField.pm b/rt/lib/RT/CustomField.pm index 6b9d57b4d..3940e83e7 100644 --- a/rt/lib/RT/CustomField.pm +++ b/rt/lib/RT/CustomField.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -1717,7 +1717,7 @@ sub _CanonicalizeValue { my $self = shift; my $args = shift; - my $type = $self->_Value('Type'); + my $type = $self->__Value('Type'); return 1 unless $type; my $method = '_CanonicalizeValue'. $type; @@ -2362,6 +2362,11 @@ sub __DependsOn { # Custom field values push( @$list, $self->Values ); +# Applications of this CF + my $applied = RT::ObjectCustomFields->new( $self->CurrentUser ); + $applied->LimitToCustomField( $self->Id ); + push @$list, $applied; + # Ticket custom field values my $objs = RT::ObjectCustomFieldValues->new( $self->CurrentUser ); $objs->LimitToCustomField( $self->Id ); diff --git a/rt/lib/RT/CustomFieldValue.pm b/rt/lib/RT/CustomFieldValue.pm index ecffa27bc..e4a6a96ef 100644 --- a/rt/lib/RT/CustomFieldValue.pm +++ b/rt/lib/RT/CustomFieldValue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CustomFieldValues.pm b/rt/lib/RT/CustomFieldValues.pm index 718868932..6b5c624cb 100644 --- a/rt/lib/RT/CustomFieldValues.pm +++ b/rt/lib/RT/CustomFieldValues.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CustomFieldValues/External.pm b/rt/lib/RT/CustomFieldValues/External.pm index 66e798aab..100c0353a 100644 --- a/rt/lib/RT/CustomFieldValues/External.pm +++ b/rt/lib/RT/CustomFieldValues/External.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CustomFieldValues/Groups.pm b/rt/lib/RT/CustomFieldValues/Groups.pm index 415046f67..5ec729318 100644 --- a/rt/lib/RT/CustomFieldValues/Groups.pm +++ b/rt/lib/RT/CustomFieldValues/Groups.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/CustomFields.pm b/rt/lib/RT/CustomFields.pm index 90bfa4764..dc15c2fb7 100644 --- a/rt/lib/RT/CustomFields.pm +++ b/rt/lib/RT/CustomFields.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Dashboard.pm b/rt/lib/RT/Dashboard.pm index 6d9eeb6ba..b30f3b2fa 100644 --- a/rt/lib/RT/Dashboard.pm +++ b/rt/lib/RT/Dashboard.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Dashboard/Mailer.pm b/rt/lib/RT/Dashboard/Mailer.pm index f0f14a06f..c88fb67a6 100644 --- a/rt/lib/RT/Dashboard/Mailer.pm +++ b/rt/lib/RT/Dashboard/Mailer.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Dashboards.pm b/rt/lib/RT/Dashboards.pm index e4137a097..a5436c693 100644 --- a/rt/lib/RT/Dashboards.pm +++ b/rt/lib/RT/Dashboards.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Date.pm b/rt/lib/RT/Date.pm index c572b7579..7f4e323e4 100644 --- a/rt/lib/RT/Date.pm +++ b/rt/lib/RT/Date.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/DependencyWalker.pm b/rt/lib/RT/DependencyWalker.pm index 4d1e354be..a1412e53d 100644 --- a/rt/lib/RT/DependencyWalker.pm +++ b/rt/lib/RT/DependencyWalker.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/DependencyWalker/FindDependencies.pm b/rt/lib/RT/DependencyWalker/FindDependencies.pm index 50de01690..396223d61 100644 --- a/rt/lib/RT/DependencyWalker/FindDependencies.pm +++ b/rt/lib/RT/DependencyWalker/FindDependencies.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/EmailParser.pm b/rt/lib/RT/EmailParser.pm index 2954505ff..51d5dae10 100644 --- a/rt/lib/RT/EmailParser.pm +++ b/rt/lib/RT/EmailParser.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Generated.pm.in b/rt/lib/RT/Generated.pm.in index 9dcb80bc3..3634e14ce 100644 --- a/rt/lib/RT/Generated.pm.in +++ b/rt/lib/RT/Generated.pm.in @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Graph/Tickets.pm b/rt/lib/RT/Graph/Tickets.pm index 6fc5310d0..cd1254eb6 100644 --- a/rt/lib/RT/Graph/Tickets.pm +++ b/rt/lib/RT/Graph/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -104,16 +104,19 @@ sub gv_escape($) { return $value; } +sub loc { return HTML::Mason::Commands::loc(@_) }; + our (%fill_cache, @available_colors) = (); our %property_cb = ( - Queue => sub { return $_[0]->QueueObj->Name || $_[0]->Queue }, - CF => sub { + Queue => sub { return $_[0]->QueueObj->Name || $_[0]->Queue }, + Status => sub { return loc($_[0]->Status) }, + CF => sub { my $values = $_[0]->CustomFieldValues( $_[1] ); return join ', ', map $_->Content, @{ $values->ItemsArrayRef }; }, ); -foreach my $field (qw(Subject Status TimeLeft TimeWorked TimeEstimated)) { +foreach my $field (qw(Subject TimeLeft TimeWorked TimeEstimated)) { $property_cb{ $field } = sub { return $_[0]->$field }, } foreach my $field (qw(Creator LastUpdatedBy Owner)) { @@ -163,7 +166,8 @@ sub TicketProperties { next if $seen{ lc $cf->Name }++; next if $cf->Type eq 'Image'; if ( $first ) { - push @res, 'CustomFields', []; + push @res, 'Custom Fields', # loc + []; $first = 0; } push @{ $res[-1] }, 'CF.{'. $cf->Name .'}'; @@ -203,7 +207,8 @@ sub _PropertiesToFields { $RT::Logger->error("Couldn't find property handler for '$key' and '@subkeys' subkeys"); next; } - push @fields, ($subkeys[0] || $key) .': '. $property_cb{ $key }->( $args{'Ticket'}, @subkeys ); + my $label = $key eq 'CF' ? $subkeys[0] : loc($key); + push @fields, $label .': '. $property_cb{ $key }->( $args{'Ticket'}, @subkeys ); } return @fields; diff --git a/rt/lib/RT/Group.pm b/rt/lib/RT/Group.pm index b79f4740c..c412ba690 100755 --- a/rt/lib/RT/Group.pm +++ b/rt/lib/RT/Group.pm @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/GroupMember.pm b/rt/lib/RT/GroupMember.pm index 6fc6002b9..5f35a7fb9 100755 --- a/rt/lib/RT/GroupMember.pm +++ b/rt/lib/RT/GroupMember.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/GroupMembers.pm b/rt/lib/RT/GroupMembers.pm index bf0370630..0396c3772 100755 --- a/rt/lib/RT/GroupMembers.pm +++ b/rt/lib/RT/GroupMembers.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Groups.pm b/rt/lib/RT/Groups.pm index 3099f1bc4..38ba82961 100755 --- a/rt/lib/RT/Groups.pm +++ b/rt/lib/RT/Groups.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm index 735be5574..a990e9d89 100644 --- a/rt/lib/RT/Handle.pm +++ b/rt/lib/RT/Handle.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N.pm b/rt/lib/RT/I18N.pm index bad4eb478..60a66222d 100644 --- a/rt/lib/RT/I18N.pm +++ b/rt/lib/RT/I18N.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N/cs.pm b/rt/lib/RT/I18N/cs.pm index 59057d3ae..a8bda070f 100644 --- a/rt/lib/RT/I18N/cs.pm +++ b/rt/lib/RT/I18N/cs.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N/de.pm b/rt/lib/RT/I18N/de.pm index 65238151d..eb86566de 100644 --- a/rt/lib/RT/I18N/de.pm +++ b/rt/lib/RT/I18N/de.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N/fr.pm b/rt/lib/RT/I18N/fr.pm index cd1273d7a..80ef0574b 100644 --- a/rt/lib/RT/I18N/fr.pm +++ b/rt/lib/RT/I18N/fr.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N/i_default.pm b/rt/lib/RT/I18N/i_default.pm index a8d1acec8..23db4a251 100644 --- a/rt/lib/RT/I18N/i_default.pm +++ b/rt/lib/RT/I18N/i_default.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/I18N/ru.pm b/rt/lib/RT/I18N/ru.pm index c77e864e1..d666d7fda 100755 --- a/rt/lib/RT/I18N/ru.pm +++ b/rt/lib/RT/I18N/ru.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Installer.pm b/rt/lib/RT/Installer.pm index ccf48966a..5b43acee3 100644 --- a/rt/lib/RT/Installer.pm +++ b/rt/lib/RT/Installer.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/CLI.pm b/rt/lib/RT/Interface/CLI.pm index f992f166b..ab9091593 100644 --- a/rt/lib/RT/Interface/CLI.pm +++ b/rt/lib/RT/Interface/CLI.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Email.pm b/rt/lib/RT/Interface/Email.pm index 87e24e700..9bff8f6d1 100755 --- a/rt/lib/RT/Interface/Email.pm +++ b/rt/lib/RT/Interface/Email.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -523,7 +523,7 @@ sub SendEmail { } my $content = $args{Entity}->stringify; $content =~ s/^(>*From )/>$1/mg; - print $fh "From $ENV{USER}\@localhost ".localtime."\n"; + print $fh "From $ENV{USER}\@localhost ".localtime()."\n"; print $fh $content, "\n"; close $fh; } else { diff --git a/rt/lib/RT/Interface/Email/Auth/Crypt.pm b/rt/lib/RT/Interface/Email/Auth/Crypt.pm index 8f8e636dc..c56b6d203 100644 --- a/rt/lib/RT/Interface/Email/Auth/Crypt.pm +++ b/rt/lib/RT/Interface/Email/Auth/Crypt.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Email/Auth/MailFrom.pm b/rt/lib/RT/Interface/Email/Auth/MailFrom.pm index 2d760c28e..96e94cc2d 100644 --- a/rt/lib/RT/Interface/Email/Auth/MailFrom.pm +++ b/rt/lib/RT/Interface/Email/Auth/MailFrom.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/REST.pm b/rt/lib/RT/Interface/REST.pm index b6f9fd35f..24c4bbae1 100644 --- a/rt/lib/RT/Interface/REST.pm +++ b/rt/lib/RT/Interface/REST.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web.pm b/rt/lib/RT/Interface/Web.pm index dad6a8ee4..f26afde35 100644 --- a/rt/lib/RT/Interface/Web.pm +++ b/rt/lib/RT/Interface/Web.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -1313,13 +1313,13 @@ sub ValidateWebConfig { if ( $port != RT->Config->Get('WebPort') and not $ENV{'rt.explicit_port'}) { $RT::Logger->warn("The requested port ($port) does NOT match the configured WebPort ($RT::WebPort). " ."Perhaps you should Set(\$WebPort, $port); in RT_SiteConfig.pm, " - ."otherwise your internal links may be broken."); + ."otherwise your internal hyperlinks may be broken."); } if ( $host ne RT->Config->Get('WebDomain') ) { $RT::Logger->warn("The requested host ($host) does NOT match the configured WebDomain ($RT::WebDomain). " ."Perhaps you should Set(\$WebDomain, '$host'); in RT_SiteConfig.pm, " - ."otherwise your internal links may be broken."); + ."otherwise your internal hyperlinks may be broken."); } return; #next warning flooding our logs, doesn't seem applicable to our use @@ -1333,7 +1333,7 @@ sub ValidateWebConfig { if ($ENV{SCRIPT_NAME} ne RT->Config->Get('WebPath') and not $proxied) { $RT::Logger->warn("The requested path ($ENV{SCRIPT_NAME}) does NOT match the configured WebPath ($RT::WebPath). " ."Perhaps you should Set(\$WebPath, '$ENV{SCRIPT_NAME}'); in RT_SiteConfig.pm, " - ."otherwise your internal links may be broken."); + ."otherwise your internal hyperlinks may be broken."); } } @@ -1364,7 +1364,7 @@ sub StaticRoots { return grep { $_ and -d $_ } @static; } -our %is_whitelisted_component = ( +our %IS_WHITELISTED_COMPONENT = ( # The RSS feed embeds an auth token in the path, but query # information for the search. Because it's a straight-up read, in # addition to embedding its own auth, it's fine. @@ -1386,9 +1386,40 @@ our %is_whitelisted_component = ( '/Ticket/ShowEmailRecord.html' => 1, ); +# Whitelist arguments that do not indicate an effectful request. +our @GLOBAL_WHITELISTED_ARGS = ( + # For example, "id" is acceptable because that is how RT retrieves a + # record. + 'id', + + # If they have a results= from MaybeRedirectForResults, that's also fine. + 'results', + + # The homepage refresh, which uses the Refresh header, doesn't send + # a referer in most browsers; whitelist the one parameter it reloads + # with, HomeRefreshInterval, which is safe + 'HomeRefreshInterval', + + # The NotMobile flag is fine for any page; it's only used to toggle a flag + # in the session related to which interface you get. + 'NotMobile', +); + +our %WHITELISTED_COMPONENT_ARGS = ( + # SavedSearchLoad - This happens when you middle-(or ⌘ )-click "Edit" for a saved search on + # the homepage. It's not going to do any damage + # NewQuery - This is simply to clear the search query + '/Search/Build.html' => ['SavedSearchLoad','NewQuery'], + # Happens if you try and reply to a message in the ticket history or click a number + # of options on a tickets Action menu + '/Ticket/Update.html' => ['QuoteTransaction', 'Action', 'DefaultStatus'], + # Action->Extract Article on a ticket's menu + '/Articles/Article/ExtractIntoClass.html' => ['Ticket'], +); + # Components which are blacklisted from automatic, argument-based whitelisting. # These pages are not idempotent when called with just an id. -our %is_blacklisted_component = ( +our %IS_BLACKLISTED_COMPONENT = ( # Takes only id and toggles bookmark state '/Helpers/Toggle/TicketBookmark' => 1, ); @@ -1397,7 +1428,7 @@ sub IsCompCSRFWhitelisted { my $comp = shift; my $ARGS = shift; - return 1 if $is_whitelisted_component{$comp}; + return 1 if $IS_WHITELISTED_COMPONENT{$comp}; my %args = %{ $ARGS }; @@ -1417,30 +1448,38 @@ sub IsCompCSRFWhitelisted { # Some pages aren't idempotent even with safe args like id; blacklist # them from the automatic whitelisting below. - return 0 if $is_blacklisted_component{$comp}; + return 0 if $IS_BLACKLISTED_COMPONENT{$comp}; - # Eliminate arguments that do not indicate an effectful request. - # For example, "id" is acceptable because that is how RT retrieves a - # record. - delete $args{id}; + if ( my %csrf_config = RT->Config->Get('ReferrerComponents') ) { + my $value = $csrf_config{$comp}; + if ( ref $value eq 'ARRAY' ) { + delete $args{$_} for @$value; + return %args ? 0 : 1; + } + else { + return $value ? 1 : 0; + } + } - # If they have a results= from MaybeRedirectForResults, that's also fine. - delete $args{results}; + return AreCompCSRFParametersWhitelisted($comp, \%args); +} - # The homepage refresh, which uses the Refresh header, doesn't send - # a referer in most browsers; whitelist the one parameter it reloads - # with, HomeRefreshInterval, which is safe - delete $args{HomeRefreshInterval}; +sub AreCompCSRFParametersWhitelisted { + my $sub = shift; + my $ARGS = shift; - # The NotMobile flag is fine for any page; it's only used to toggle a flag - # in the session related to which interface you get. - delete $args{NotMobile}; + my %leftover_args = %{ $ARGS }; + + # Join global whitelist and component-specific whitelist + my @whitelisted_args = (@GLOBAL_WHITELISTED_ARGS, @{ $WHITELISTED_COMPONENT_ARGS{$sub} || [] }); + + for my $arg (@whitelisted_args) { + delete $leftover_args{$arg}; + } # If there are no arguments, then it's likely to be an idempotent # request, which are not susceptible to CSRF - return 1 if !%args; - - return 0; + return !%leftover_args; } sub IsRefererCSRFWhitelisted { @@ -3116,8 +3155,9 @@ sub _ParseObjectCustomFieldArgs { foreach my $arg ( keys %$ARGSRef ) { # format: Object-<object class>-<object id>-CustomField[:<grouping>]-<CF id>-<commands> + # or: Bulk-<Add or Delete>-CustomField[:<grouping>]-<CF id>-<commands> # you can use GetCustomFieldInputName to generate the complement input name - next unless $arg =~ /^Object-([\w:]+)-(\d*)-CustomField(?::(\w+))?-(\d+)-(.*)$/; + next unless $arg =~ /^(?:Bulk-(?:Add|Delete)|Object-([\w:]+)-(\d*))-CustomField(?::(\w+))?-(\d+)-(.*)$/; next if $1 eq 'RT::Transaction';# don't try to update transaction fields diff --git a/rt/lib/RT/Interface/Web/Handler.pm b/rt/lib/RT/Interface/Web/Handler.pm index 8667f014d..ad1068bac 100644 --- a/rt/lib/RT/Interface/Web/Handler.pm +++ b/rt/lib/RT/Interface/Web/Handler.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/Menu.pm b/rt/lib/RT/Interface/Web/Menu.pm index 8670b8acf..3d22a15de 100644 --- a/rt/lib/RT/Interface/Web/Menu.pm +++ b/rt/lib/RT/Interface/Web/Menu.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/Middleware/StaticHeaders.pm b/rt/lib/RT/Interface/Web/Middleware/StaticHeaders.pm index 6d98d9ecd..22047782d 100644 --- a/rt/lib/RT/Interface/Web/Middleware/StaticHeaders.pm +++ b/rt/lib/RT/Interface/Web/Middleware/StaticHeaders.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/QueryBuilder.pm b/rt/lib/RT/Interface/Web/QueryBuilder.pm index b55142434..057835393 100755 --- a/rt/lib/RT/Interface/Web/QueryBuilder.pm +++ b/rt/lib/RT/Interface/Web/QueryBuilder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/QueryBuilder/Tree.pm b/rt/lib/RT/Interface/Web/QueryBuilder/Tree.pm index d7de61ccf..efcc43f15 100755 --- a/rt/lib/RT/Interface/Web/QueryBuilder/Tree.pm +++ b/rt/lib/RT/Interface/Web/QueryBuilder/Tree.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/Request.pm b/rt/lib/RT/Interface/Web/Request.pm index 61cfa70ff..a1520e026 100644 --- a/rt/lib/RT/Interface/Web/Request.pm +++ b/rt/lib/RT/Interface/Web/Request.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Interface/Web/Session.pm b/rt/lib/RT/Interface/Web/Session.pm index c4cc93080..027662a46 100644 --- a/rt/lib/RT/Interface/Web/Session.pm +++ b/rt/lib/RT/Interface/Web/Session.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Lifecycle.pm b/rt/lib/RT/Lifecycle.pm index c2865bcaf..0d6ddb0e0 100644 --- a/rt/lib/RT/Lifecycle.pm +++ b/rt/lib/RT/Lifecycle.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Lifecycle/Ticket.pm b/rt/lib/RT/Lifecycle/Ticket.pm index 3f6dc5e83..ab1c91cb7 100644 --- a/rt/lib/RT/Lifecycle/Ticket.pm +++ b/rt/lib/RT/Lifecycle/Ticket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Link.pm b/rt/lib/RT/Link.pm index f82cf5192..0dadc3be8 100644 --- a/rt/lib/RT/Link.pm +++ b/rt/lib/RT/Link.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Links.pm b/rt/lib/RT/Links.pm index 89e261b09..272b79360 100644 --- a/rt/lib/RT/Links.pm +++ b/rt/lib/RT/Links.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate.pm b/rt/lib/RT/Migrate.pm index c325ce158..ba59c3a32 100644 --- a/rt/lib/RT/Migrate.pm +++ b/rt/lib/RT/Migrate.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Importer.pm b/rt/lib/RT/Migrate/Importer.pm index 58ee632c3..789743493 100644 --- a/rt/lib/RT/Migrate/Importer.pm +++ b/rt/lib/RT/Migrate/Importer.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Importer/File.pm b/rt/lib/RT/Migrate/Importer/File.pm index 176bc2653..cfad9ae9e 100644 --- a/rt/lib/RT/Migrate/Importer/File.pm +++ b/rt/lib/RT/Migrate/Importer/File.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Incremental.pm b/rt/lib/RT/Migrate/Incremental.pm index 61aea6cfb..f4ea8d288 100644 --- a/rt/lib/RT/Migrate/Incremental.pm +++ b/rt/lib/RT/Migrate/Incremental.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Serializer.pm b/rt/lib/RT/Migrate/Serializer.pm index 92be62928..f938bc145 100644 --- a/rt/lib/RT/Migrate/Serializer.pm +++ b/rt/lib/RT/Migrate/Serializer.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Serializer/File.pm b/rt/lib/RT/Migrate/Serializer/File.pm index 283236595..c8642eab0 100644 --- a/rt/lib/RT/Migrate/Serializer/File.pm +++ b/rt/lib/RT/Migrate/Serializer/File.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Serializer/IncrementalRecord.pm b/rt/lib/RT/Migrate/Serializer/IncrementalRecord.pm index d5df8c875..4bbd4e8b6 100644 --- a/rt/lib/RT/Migrate/Serializer/IncrementalRecord.pm +++ b/rt/lib/RT/Migrate/Serializer/IncrementalRecord.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Migrate/Serializer/IncrementalRecords.pm b/rt/lib/RT/Migrate/Serializer/IncrementalRecords.pm index a729caa8d..3bb19c647 100644 --- a/rt/lib/RT/Migrate/Serializer/IncrementalRecords.pm +++ b/rt/lib/RT/Migrate/Serializer/IncrementalRecords.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectClass.pm b/rt/lib/RT/ObjectClass.pm index ba96c594a..c51d9d4c8 100644 --- a/rt/lib/RT/ObjectClass.pm +++ b/rt/lib/RT/ObjectClass.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectClasses.pm b/rt/lib/RT/ObjectClasses.pm index 3370cf645..96442a4b8 100644 --- a/rt/lib/RT/ObjectClasses.pm +++ b/rt/lib/RT/ObjectClasses.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectCustomField.pm b/rt/lib/RT/ObjectCustomField.pm index b21543bfa..b9749aa4e 100644 --- a/rt/lib/RT/ObjectCustomField.pm +++ b/rt/lib/RT/ObjectCustomField.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectCustomFieldValue.pm b/rt/lib/RT/ObjectCustomFieldValue.pm index 2434d6cc5..6a49f3832 100644 --- a/rt/lib/RT/ObjectCustomFieldValue.pm +++ b/rt/lib/RT/ObjectCustomFieldValue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectCustomFieldValues.pm b/rt/lib/RT/ObjectCustomFieldValues.pm index 527ce7ba0..b1cf3caa2 100644 --- a/rt/lib/RT/ObjectCustomFieldValues.pm +++ b/rt/lib/RT/ObjectCustomFieldValues.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectCustomFields.pm b/rt/lib/RT/ObjectCustomFields.pm index 8c31047f3..8dafe4c43 100644 --- a/rt/lib/RT/ObjectCustomFields.pm +++ b/rt/lib/RT/ObjectCustomFields.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectScrip.pm b/rt/lib/RT/ObjectScrip.pm index d2a024a56..839939871 100644 --- a/rt/lib/RT/ObjectScrip.pm +++ b/rt/lib/RT/ObjectScrip.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectScrips.pm b/rt/lib/RT/ObjectScrips.pm index c4952115a..40eca8a09 100644 --- a/rt/lib/RT/ObjectScrips.pm +++ b/rt/lib/RT/ObjectScrips.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectTopic.pm b/rt/lib/RT/ObjectTopic.pm index 33646305c..c9429fd1b 100644 --- a/rt/lib/RT/ObjectTopic.pm +++ b/rt/lib/RT/ObjectTopic.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ObjectTopics.pm b/rt/lib/RT/ObjectTopics.pm index 072a0eb69..dcbda6cc1 100644 --- a/rt/lib/RT/ObjectTopics.pm +++ b/rt/lib/RT/ObjectTopics.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/PlackRunner.pm b/rt/lib/RT/PlackRunner.pm index 0b981487e..e30f4bd2f 100644 --- a/rt/lib/RT/PlackRunner.pm +++ b/rt/lib/RT/PlackRunner.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Plugin.pm b/rt/lib/RT/Plugin.pm index 96a14127e..d10f639b3 100644 --- a/rt/lib/RT/Plugin.pm +++ b/rt/lib/RT/Plugin.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Pod/HTML.pm b/rt/lib/RT/Pod/HTML.pm index 90e20177d..d38a882c8 100644 --- a/rt/lib/RT/Pod/HTML.pm +++ b/rt/lib/RT/Pod/HTML.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Pod/HTMLBatch.pm b/rt/lib/RT/Pod/HTMLBatch.pm index 24c326dc8..ed6f3aac7 100644 --- a/rt/lib/RT/Pod/HTMLBatch.pm +++ b/rt/lib/RT/Pod/HTMLBatch.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Pod/Search.pm b/rt/lib/RT/Pod/Search.pm index eb71601db..d04c67ca0 100644 --- a/rt/lib/RT/Pod/Search.pm +++ b/rt/lib/RT/Pod/Search.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Principal.pm b/rt/lib/RT/Principal.pm index 8cf509df8..341a90c72 100644 --- a/rt/lib/RT/Principal.pm +++ b/rt/lib/RT/Principal.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Principals.pm b/rt/lib/RT/Principals.pm index dcfdfd5b7..b909d2499 100644 --- a/rt/lib/RT/Principals.pm +++ b/rt/lib/RT/Principals.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Queue.pm b/rt/lib/RT/Queue.pm index 6e2bc8d1d..f8c0791a6 100755 --- a/rt/lib/RT/Queue.pm +++ b/rt/lib/RT/Queue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -223,43 +223,6 @@ sub Delete { $self->loc('Deleting this object would break referential integrity') ); } - - -=head2 SetDisabled - -Takes a boolean. -1 will cause this queue to no longer be available for tickets. -0 will re-enable this queue. - -=cut - -sub SetDisabled { - my $self = shift; - my $val = shift; - - $RT::Handle->BeginTransaction(); - my ($ok, $msg) = $self->_Set( Field =>'Disabled', Value => $val); - unless ($ok) { - $RT::Handle->Rollback(); - $RT::Logger->warning("Couldn't ".(($val == 0) ? "enable" : "disable")." queue ".$self->Name.": $msg"); - return ($ok, $msg); - } - $self->_NewTransaction( Type => ($val == 0) ? "Enabled" : "Disabled" ); - - $RT::Handle->Commit(); - - RT->System->QueueCacheNeedsUpdate(1); - - if ( $val == 0 ) { - return (1, $self->loc("Queue enabled")); - } else { - return (1, $self->loc("Queue disabled")); - } - -} - - - =head2 Load Takes either a numerical id or a textual Name and loads the specified queue. @@ -354,8 +317,13 @@ sub SetSign { Content => $value, ); return ($status, $msg) unless $status; - return ($status, $self->loc('Signing enabled')) if $value; - return ($status, $self->loc('Signing disabled')); + + my ( undef, undef, $TransObj ) = $self->_NewTransaction( + Field => 'Signing', #loc + Type => $value ? "Enabled" : "Disabled" + ); + + return ($status, scalar $TransObj->BriefDescription); } sub SignAuto { @@ -380,8 +348,13 @@ sub SetSignAuto { Content => $value, ); return ($status, $msg) unless $status; - return ($status, $self->loc('Signing enabled')) if $value; - return ($status, $self->loc('Signing disabled')); + + my ( undef, undef, $TransObj ) = $self->_NewTransaction( + Field => 'AutoSigning', #loc + Type => $value ? "Enabled" : "Disabled" + ); + + return ($status, scalar $TransObj->BriefDescription); } sub Encrypt { @@ -406,8 +379,13 @@ sub SetEncrypt { Content => $value, ); return ($status, $msg) unless $status; - return ($status, $self->loc('Encrypting enabled')) if $value; - return ($status, $self->loc('Encrypting disabled')); + + my ( undef, undef, $TransObj ) = $self->_NewTransaction( + Field => 'Encrypting', #loc + Type => $value ? "Enabled" : "Disabled" + ); + + return ($status, scalar $TransObj->BriefDescription); } =head2 Templates @@ -793,11 +771,44 @@ sub IsAdminCc { sub _Set { my $self = shift; + my %args = ( + Field => undef, + Value => undef, + TransactionType => 'Set', + RecordTransaction => 1, + @_ + ); + unless ( $self->CurrentUserHasRight('AdminQueue') ) { return ( 0, $self->loc('Permission Denied') ); } + + my $Old = $self->SUPER::_Value("$args{'Field'}"); + + my ($ret, $msg) = $self->SUPER::_Set( + Field => $args{'Field'}, + Value => $args{'Value'}, + ); + + if ( $ret == 0 ) { return ( 0, $msg ); } + RT->System->QueueCacheNeedsUpdate(1); - return ( $self->SUPER::_Set(@_) ); + + if ( $args{'RecordTransaction'} == 1 ) { + if ($args{'Field'} eq 'Disabled') { + $args{'TransactionType'} = ($args{'Value'} == 1) ? "Disabled" : "Enabled"; + delete $args{'Field'}; + } + my ( undef, undef, $TransObj ) = $self->_NewTransaction( + Type => $args{'TransactionType'}, + Field => $args{'Field'}, + NewValue => $args{'Value'}, + OldValue => $Old, + TimeTaken => $args{'TimeTaken'}, + ); + } + + return ( $ret, $msg ); } diff --git a/rt/lib/RT/Queues.pm b/rt/lib/RT/Queues.pm index b9aa3dbd1..e872cfd69 100755 --- a/rt/lib/RT/Queues.pm +++ b/rt/lib/RT/Queues.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record.pm b/rt/lib/RT/Record.pm index d2ffc533d..4722d8660 100755 --- a/rt/lib/RT/Record.pm +++ b/rt/lib/RT/Record.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/AddAndSort.pm b/rt/lib/RT/Record/AddAndSort.pm index 4b5d7ac28..66f7ef5b9 100644 --- a/rt/lib/RT/Record/AddAndSort.pm +++ b/rt/lib/RT/Record/AddAndSort.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role.pm b/rt/lib/RT/Record/Role.pm index 9d95ea152..d3484efef 100644 --- a/rt/lib/RT/Record/Role.pm +++ b/rt/lib/RT/Record/Role.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role/Lifecycle.pm b/rt/lib/RT/Record/Role/Lifecycle.pm index 0474a06e1..3cc92cb92 100644 --- a/rt/lib/RT/Record/Role/Lifecycle.pm +++ b/rt/lib/RT/Record/Role/Lifecycle.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role/Links.pm b/rt/lib/RT/Record/Role/Links.pm index f865090df..5836433cb 100644 --- a/rt/lib/RT/Record/Role/Links.pm +++ b/rt/lib/RT/Record/Role/Links.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role/Rights.pm b/rt/lib/RT/Record/Role/Rights.pm index cd2d60adf..fd3cac26f 100644 --- a/rt/lib/RT/Record/Role/Rights.pm +++ b/rt/lib/RT/Record/Role/Rights.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role/Roles.pm b/rt/lib/RT/Record/Role/Roles.pm index 725c0d76e..5f20a6337 100644 --- a/rt/lib/RT/Record/Role/Roles.pm +++ b/rt/lib/RT/Record/Role/Roles.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Record/Role/Status.pm b/rt/lib/RT/Record/Role/Status.pm index 98f699cd0..0fbce9f3e 100644 --- a/rt/lib/RT/Record/Role/Status.pm +++ b/rt/lib/RT/Record/Role/Status.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Reminders.pm b/rt/lib/RT/Reminders.pm index e3e533a3f..2baab0113 100644 --- a/rt/lib/RT/Reminders.pm +++ b/rt/lib/RT/Reminders.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Report/Tickets.pm b/rt/lib/RT/Report/Tickets.pm index 19bca1852..06b34f716 100644 --- a/rt/lib/RT/Report/Tickets.pm +++ b/rt/lib/RT/Report/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -673,27 +673,24 @@ sub SortEntries { for ( my $i = 0; $i < @groups; $i++ ) { my $group_by = $groups[$i]; my $idx = $i+1; - my $method; - # If this is a CF, traverse the values being used for labels. - # If they all look like numbers or undef, flag for a numeric sort - - my $looks_like_number; - if ( $group_by->{'KEY'} eq 'CF' ){ - $looks_like_number = 1; + my $order = $group_by->{'META'}{Sort} || 'label'; + my $method = $order =~ /label$/ ? 'LabelValue' : 'RawValue'; + unless ($order =~ /^numeric/) { + # Traverse the values being used for labels. + # If they all look like numbers or undef, flag for a numeric sort. + my $looks_like_number = 1; foreach my $item (@data){ - my $cf_label = $item->[0]->RawValue($group_by->{'NAME'}); + my $label = $item->[0]->$method($group_by->{'NAME'}); $looks_like_number = 0 - unless (not defined $cf_label) - or Scalar::Util::looks_like_number( $cf_label ); + unless (not defined $label) + or Scalar::Util::looks_like_number( $label ); } + $order = "numeric $order" if $looks_like_number; } - my $order = $looks_like_number ? 'numeric label' : 'label'; - $order = $group_by->{'META'}{Sort} if exists $group_by->{'META'}{Sort}; - if ( $order eq 'label' ) { push @SORT_OPS, sub { $_[0][$idx] cmp $_[1][$idx] }; $method = 'LabelValue'; diff --git a/rt/lib/RT/Report/Tickets/Entry.pm b/rt/lib/RT/Report/Tickets/Entry.pm index 24cb4f6ec..67017e8e5 100644 --- a/rt/lib/RT/Report/Tickets/Entry.pm +++ b/rt/lib/RT/Report/Tickets/Entry.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Rule.pm b/rt/lib/RT/Rule.pm index bdbbe0b98..dda86fe18 100644 --- a/rt/lib/RT/Rule.pm +++ b/rt/lib/RT/Rule.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Ruleset.pm b/rt/lib/RT/Ruleset.pm index a84ba088b..acf1bf1e0 100644 --- a/rt/lib/RT/Ruleset.pm +++ b/rt/lib/RT/Ruleset.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SQL.pm b/rt/lib/RT/SQL.pm index 9f8dad870..f470a91f1 100644 --- a/rt/lib/RT/SQL.pm +++ b/rt/lib/RT/SQL.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SavedSearch.pm b/rt/lib/RT/SavedSearch.pm index 4dd869bf2..d9bb69203 100644 --- a/rt/lib/RT/SavedSearch.pm +++ b/rt/lib/RT/SavedSearch.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SavedSearches.pm b/rt/lib/RT/SavedSearches.pm index c060701bd..734c946e8 100644 --- a/rt/lib/RT/SavedSearches.pm +++ b/rt/lib/RT/SavedSearches.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Scrip.pm b/rt/lib/RT/Scrip.pm index 5bd86e0d7..48547ccfd 100755 --- a/rt/lib/RT/Scrip.pm +++ b/rt/lib/RT/Scrip.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ScripAction.pm b/rt/lib/RT/ScripAction.pm index 428ad5d35..712b10900 100755 --- a/rt/lib/RT/ScripAction.pm +++ b/rt/lib/RT/ScripAction.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ScripActions.pm b/rt/lib/RT/ScripActions.pm index f663480ce..5735689e7 100755 --- a/rt/lib/RT/ScripActions.pm +++ b/rt/lib/RT/ScripActions.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ScripCondition.pm b/rt/lib/RT/ScripCondition.pm index 46110a9cc..c93b6065d 100755 --- a/rt/lib/RT/ScripCondition.pm +++ b/rt/lib/RT/ScripCondition.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/ScripConditions.pm b/rt/lib/RT/ScripConditions.pm index dc97a1636..51a03a654 100755 --- a/rt/lib/RT/ScripConditions.pm +++ b/rt/lib/RT/ScripConditions.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Scrips.pm b/rt/lib/RT/Scrips.pm index 85f1961f3..193399d8c 100755 --- a/rt/lib/RT/Scrips.pm +++ b/rt/lib/RT/Scrips.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Search.pm b/rt/lib/RT/Search.pm index 404a166fb..022819bae 100755 --- a/rt/lib/RT/Search.pm +++ b/rt/lib/RT/Search.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Search/ActiveTicketsInQueue.pm b/rt/lib/RT/Search/ActiveTicketsInQueue.pm index 7a1f72661..6477632a4 100644 --- a/rt/lib/RT/Search/ActiveTicketsInQueue.pm +++ b/rt/lib/RT/Search/ActiveTicketsInQueue.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Search/FromSQL.pm b/rt/lib/RT/Search/FromSQL.pm index dbcad9099..59679cf8f 100644 --- a/rt/lib/RT/Search/FromSQL.pm +++ b/rt/lib/RT/Search/FromSQL.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Search/Simple.pm b/rt/lib/RT/Search/Simple.pm index 4cb2482db..ac7b226b8 100644 --- a/rt/lib/RT/Search/Simple.pm +++ b/rt/lib/RT/Search/Simple.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SearchBuilder.pm b/rt/lib/RT/SearchBuilder.pm index 44200b561..8b4596795 100644 --- a/rt/lib/RT/SearchBuilder.pm +++ b/rt/lib/RT/SearchBuilder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SearchBuilder/AddAndSort.pm b/rt/lib/RT/SearchBuilder/AddAndSort.pm index abe8aa6d1..90720f6b7 100644 --- a/rt/lib/RT/SearchBuilder/AddAndSort.pm +++ b/rt/lib/RT/SearchBuilder/AddAndSort.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SearchBuilder/Role.pm b/rt/lib/RT/SearchBuilder/Role.pm index ec20de287..cf41522b3 100644 --- a/rt/lib/RT/SearchBuilder/Role.pm +++ b/rt/lib/RT/SearchBuilder/Role.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SearchBuilder/Role/Roles.pm b/rt/lib/RT/SearchBuilder/Role/Roles.pm index 914c74bc9..7e205a0ee 100644 --- a/rt/lib/RT/SearchBuilder/Role/Roles.pm +++ b/rt/lib/RT/SearchBuilder/Role/Roles.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SharedSetting.pm b/rt/lib/RT/SharedSetting.pm index 4a08d0773..6d0e29f30 100644 --- a/rt/lib/RT/SharedSetting.pm +++ b/rt/lib/RT/SharedSetting.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/SharedSettings.pm b/rt/lib/RT/SharedSettings.pm index 962364542..5b1531731 100644 --- a/rt/lib/RT/SharedSettings.pm +++ b/rt/lib/RT/SharedSettings.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder.pm b/rt/lib/RT/Shredder.pm index af675bd45..9590edba4 100644 --- a/rt/lib/RT/Shredder.pm +++ b/rt/lib/RT/Shredder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Constants.pm b/rt/lib/RT/Shredder/Constants.pm index 82445a7f2..11a1731dc 100644 --- a/rt/lib/RT/Shredder/Constants.pm +++ b/rt/lib/RT/Shredder/Constants.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Dependencies.pm b/rt/lib/RT/Shredder/Dependencies.pm index a78fd0cac..b0e620e47 100644 --- a/rt/lib/RT/Shredder/Dependencies.pm +++ b/rt/lib/RT/Shredder/Dependencies.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Dependency.pm b/rt/lib/RT/Shredder/Dependency.pm index ad72f3bac..63ee8ea8c 100644 --- a/rt/lib/RT/Shredder/Dependency.pm +++ b/rt/lib/RT/Shredder/Dependency.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Exceptions.pm b/rt/lib/RT/Shredder/Exceptions.pm index da0464dd1..7d44300cf 100644 --- a/rt/lib/RT/Shredder/Exceptions.pm +++ b/rt/lib/RT/Shredder/Exceptions.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/POD.pm b/rt/lib/RT/Shredder/POD.pm index c6aaeb1eb..26e4aad62 100644 --- a/rt/lib/RT/Shredder/POD.pm +++ b/rt/lib/RT/Shredder/POD.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin.pm b/rt/lib/RT/Shredder/Plugin.pm index 2c7a79009..c9eb86c9d 100644 --- a/rt/lib/RT/Shredder/Plugin.pm +++ b/rt/lib/RT/Shredder/Plugin.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Attachments.pm b/rt/lib/RT/Shredder/Plugin/Attachments.pm index 5a573ad27..42518b5c0 100644 --- a/rt/lib/RT/Shredder/Plugin/Attachments.pm +++ b/rt/lib/RT/Shredder/Plugin/Attachments.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Base.pm b/rt/lib/RT/Shredder/Plugin/Base.pm index 30fa3f320..be36cdc3f 100644 --- a/rt/lib/RT/Shredder/Plugin/Base.pm +++ b/rt/lib/RT/Shredder/Plugin/Base.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Base/Dump.pm b/rt/lib/RT/Shredder/Plugin/Base/Dump.pm index c687c0114..707096ec9 100644 --- a/rt/lib/RT/Shredder/Plugin/Base/Dump.pm +++ b/rt/lib/RT/Shredder/Plugin/Base/Dump.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Base/Search.pm b/rt/lib/RT/Shredder/Plugin/Base/Search.pm index e2ba495d9..26e3d160a 100644 --- a/rt/lib/RT/Shredder/Plugin/Base/Search.pm +++ b/rt/lib/RT/Shredder/Plugin/Base/Search.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Objects.pm b/rt/lib/RT/Shredder/Plugin/Objects.pm index 4da9f8f7f..7e2aa7a60 100644 --- a/rt/lib/RT/Shredder/Plugin/Objects.pm +++ b/rt/lib/RT/Shredder/Plugin/Objects.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/SQLDump.pm b/rt/lib/RT/Shredder/Plugin/SQLDump.pm index 7b59feea9..4e29737f5 100644 --- a/rt/lib/RT/Shredder/Plugin/SQLDump.pm +++ b/rt/lib/RT/Shredder/Plugin/SQLDump.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Summary.pm b/rt/lib/RT/Shredder/Plugin/Summary.pm index 7442c6d15..4dbfb9417 100644 --- a/rt/lib/RT/Shredder/Plugin/Summary.pm +++ b/rt/lib/RT/Shredder/Plugin/Summary.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Tickets.pm b/rt/lib/RT/Shredder/Plugin/Tickets.pm index c6b9b8ede..0e2af36c0 100644 --- a/rt/lib/RT/Shredder/Plugin/Tickets.pm +++ b/rt/lib/RT/Shredder/Plugin/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Shredder/Plugin/Users.pm b/rt/lib/RT/Shredder/Plugin/Users.pm index 7e1c31f77..0073a9e97 100644 --- a/rt/lib/RT/Shredder/Plugin/Users.pm +++ b/rt/lib/RT/Shredder/Plugin/Users.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -108,12 +108,21 @@ Note that found users still B<may have relations> with other objects, for example via Creator or LastUpdatedBy fields, and you most probably want to use C<replace_relations> option. +=head2 no_ticket_transactions - boolean + +If true then plugin looks for users who have created no ticket transactions. +This is especially useful after wiping out tickets. + +Note that found users still B<may have relations> with other objects, +for example via Creator or LastUpdatedBy fields, and you most probably +want to use C<replace_relations> option. + =cut sub SupportArgs { return $_[0]->SUPER::SupportArgs, - qw(status name email member_of not_member_of replace_relations no_tickets); + qw(status name email member_of not_member_of replace_relations no_tickets no_ticket_transactions); } sub TestArgs @@ -209,6 +218,11 @@ sub Run Shredder => $args{'Shredder'}, ); } + if( $self->{'opt'}{'no_ticket_transactions'} ) { + push @filter, $self->FilterWithoutTicketTransactions( + Shredder => $args{'Shredder'}, + ); + } if (@filter) { $self->FetchNext( $objs, 'init' ); @@ -284,11 +298,40 @@ sub _WithoutTickets { my $tickets = RT::Tickets->new( RT->SystemUser ); $tickets->{'allow_deleted_search'} = 1; $tickets->FromSQL( 'Watcher.id = '. $user->id ); - # HACK: we may use Count method which counts all records - # that match condtion, but we really want to know only that - # at least one record exist, so we fetch first row only + + # we could use the Count method which counts all records + # that match, but we really want to know only that + # at least one record exists, so this is faster $tickets->RowsPerPage(1); return !$tickets->First; } +sub FilterWithoutTicketTransactions { + my $self = shift; + my %args = ( + Shredder => undef, + Objects => undef, + @_, + ); + + return sub { + my $user = shift; + $self->_WithoutTicketTransactions( $user ) + }; +} + +sub _WithoutTicketTransactions { + my ($self, $user) = @_; + return unless $user and $user->Id; + my $txns = RT::Transactions->new( RT->SystemUser ); + $txns->Limit(FIELD => 'ObjectType', VALUE => 'RT::Ticket'); + $txns->Limit(FIELD => 'Creator', VALUE => $user->Id); + + # we could use the Count method which counts all records + # that match, but we really want to know only that + # at least one record exists, so this is faster + $txns->RowsPerPage(1); + return !$txns->First; +} + 1; diff --git a/rt/lib/RT/Shredder/Record.pm b/rt/lib/RT/Shredder/Record.pm deleted file mode 100644 index 1e777ba6f..000000000 --- a/rt/lib/RT/Shredder/Record.pm +++ /dev/null @@ -1,174 +0,0 @@ -# BEGIN BPS TAGGED BLOCK {{{ -# -# COPYRIGHT: -# -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC -# <sales@bestpractical.com> -# -# (Except where explicitly superseded by other copyright notices) -# -# -# LICENSE: -# -# This work is made available to you under the terms of Version 2 of -# the GNU General Public License. A copy of that license should have -# been provided with this software, but in any event can be snarfed -# from www.gnu.org. -# -# This work is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 or visit their web page on the internet at -# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -# -# -# CONTRIBUTION SUBMISSION POLICY: -# -# (The following paragraph is not intended to limit the rights granted -# to you to modify and distribute this software under the terms of -# the GNU General Public License and is only of importance to you if -# you choose to contribute your changes and enhancements to the -# community by submitting them to Best Practical Solutions, LLC.) -# -# By intentionally submitting any modifications, corrections or -# derivatives to this work, or any other work intended for use with -# Request Tracker, to Best Practical Solutions, LLC, you confirm that -# you are the copyright holder for those contributions and you grant -# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -# royalty-free, perpetual, license to use, copy, create derivative -# works based on those contributions, and sublicense and distribute -# those contributions and any derivatives thereof. -# -# END BPS TAGGED BLOCK }}} - -package RT::Record; -use RT::Record (); - -use strict; -use warnings; -use warnings FATAL => 'redefine'; - -use RT::Shredder::Constants; -use RT::Shredder::Exceptions; - -=head2 _AsInsertQuery - -Returns INSERT query string that duplicates current record and -can be used to insert record back into DB after delete. - -=cut - -sub _AsInsertQuery -{ - my $self = shift; - - my $dbh = $RT::Handle->dbh; - - my $res = "INSERT INTO ". $dbh->quote_identifier( $self->Table ); - my $values = $self->{'values'}; - $res .= "(". join( ",", map { $dbh->quote_identifier( $_ ) } sort keys %$values ) .")"; - $res .= " VALUES"; - $res .= "(". join( ",", map { $dbh->quote( $values->{$_} ) } sort keys %$values ) .")"; - $res .= ";"; - - return $res; -} - -sub BeforeWipeout { return 1 } - -=head2 Dependencies - -Returns L<RT::Shredder::Dependencies> object. - -=cut - -sub Dependencies -{ - my $self = shift; - my %args = ( - Shredder => undef, - Flags => RT::Shredder::Constants::DEPENDS_ON, - @_, - ); - - unless( $self->id ) { - RT::Shredder::Exception->throw('Object is not loaded'); - } - - my $deps = RT::Shredder::Dependencies->new(); - if( $args{'Flags'} & RT::Shredder::Constants::DEPENDS_ON ) { - $self->__DependsOn( %args, Dependencies => $deps ); - } - return $deps; -} - -sub __DependsOn -{ - my $self = shift; - my %args = ( - Shredder => undef, - Dependencies => undef, - @_, - ); - my $deps = $args{'Dependencies'}; - my $list = []; - -# Object custom field values - my $objs = $self->CustomFieldValues; - $objs->{'find_expired_rows'} = 1; - push( @$list, $objs ); - -# Object attributes - $objs = $self->Attributes; - push( @$list, $objs ); - -# Transactions - $objs = RT::Transactions->new( $self->CurrentUser ); - $objs->Limit( FIELD => 'ObjectType', VALUE => ref $self ); - $objs->Limit( FIELD => 'ObjectId', VALUE => $self->id ); - push( @$list, $objs ); - -# Links - if ( $self->can('Links') ) { - # make sure we don't skip any record - no warnings 'redefine'; - local *RT::Links::IsValidLink = sub { 1 }; - - foreach ( qw(Base Target) ) { - my $objs = $self->Links( $_ ); - $objs->_DoSearch; - push @$list, $objs->ItemsArrayRef; - } - } - -# ACE records - $objs = RT::ACL->new( $self->CurrentUser ); - $objs->LimitToObject( $self ); - push( @$list, $objs ); - - $deps->_PushDependencies( - BaseObject => $self, - Flags => RT::Shredder::Constants::DEPENDS_ON, - TargetObjects => $list, - Shredder => $args{'Shredder'} - ); - return; -} - -# implement proxy method because some RT classes -# override Delete method -sub __Wipeout -{ - my $self = shift; - my $msg = $self->UID ." wiped out"; - $self->SUPER::Delete; - $RT::Logger->info( $msg ); - return; -} - -1; diff --git a/rt/lib/RT/Squish.pm b/rt/lib/RT/Squish.pm index 9ae883de3..f580221af 100644 --- a/rt/lib/RT/Squish.pm +++ b/rt/lib/RT/Squish.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Squish/CSS.pm b/rt/lib/RT/Squish/CSS.pm index ccfbc27ec..d22b03747 100644 --- a/rt/lib/RT/Squish/CSS.pm +++ b/rt/lib/RT/Squish/CSS.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Squish/JS.pm b/rt/lib/RT/Squish/JS.pm index c44f45570..18dd9a770 100644 --- a/rt/lib/RT/Squish/JS.pm +++ b/rt/lib/RT/Squish/JS.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/System.pm b/rt/lib/RT/System.pm index 994825d62..388a1fd6e 100644 --- a/rt/lib/RT/System.pm +++ b/rt/lib/RT/System.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm index 4b5544371..b8aa0aac4 100755 --- a/rt/lib/RT/Template.pm +++ b/rt/lib/RT/Template.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Templates.pm b/rt/lib/RT/Templates.pm index 93ed4fc80..67f4783c6 100755 --- a/rt/lib/RT/Templates.pm +++ b/rt/lib/RT/Templates.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Test.pm b/rt/lib/RT/Test.pm index 6afb31192..257eea5b7 100644 --- a/rt/lib/RT/Test.pm +++ b/rt/lib/RT/Test.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -886,7 +886,7 @@ sub create_ticket { $args{'MIMEObj'} = MIME::Entity->build( From => Encode::encode( "UTF-8", $args{'Requestor'} ), Subject => RT::Interface::Email::EncodeToMIME( String => $args{'Subject'} ), - Type => $args{ContentType} // "text/plain", + Type => (defined $args{ContentType} ? $args{ContentType} : "text/plain"), Charset => "UTF-8", Data => Encode::encode( "UTF-8", $content ), ); @@ -1718,9 +1718,9 @@ sub file_content { } sub find_executable { - my $self = shift; + my ( $self, $exe ) = @_; - return File::Which::which( @_ ); + return File::Which::which( $exe ); } sub diag { diff --git a/rt/lib/RT/Test/Apache.pm b/rt/lib/RT/Test/Apache.pm index 29f5ed1be..e7e3cdd11 100644 --- a/rt/lib/RT/Test/Apache.pm +++ b/rt/lib/RT/Test/Apache.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -55,6 +55,10 @@ my %MODULES = ( "mod_perl" => [qw(authz_host env alias perl)], "fastcgi" => [qw(authz_host env alias mime fastcgi)], }, + '2.4' => { + "mod_perl" => [qw(mpm_worker authz_core authn_core authz_host env alias perl)], + "fastcgi" => [qw(mpm_worker authz_core authn_core authz_host env alias mime fastcgi)], + }, ); my $apache_module_prefix = $ENV{RT_TEST_APACHE_MODULES}; @@ -192,15 +196,12 @@ sub apache_server_info { RT::Test::diag("Using '$bin' apache executable for testing"); - my $info = `$bin -V`; + my $info = `$bin -v`; ($res{'version'}) = ($info =~ m{Server\s+version:\s+Apache/(\d+\.\d+)\.}); Test::More::BAIL_OUT( "Couldn't figure out version of the server" ) unless $res{'version'}; - my %opts = ($info =~ m/^\s*-D\s+([A-Z_]+?)(?:="(.*)")$/mg); - %res = (%res, %opts); - $res{'modules'} = [ map {s/^\s+//; s/\s+$//; $_} grep $_ !~ /Compiled in modules/i, @@ -231,6 +232,20 @@ sub apache_server_info { $res{'load_modules'} .= "LoadModule ${mod}_module $so_file\n"; } + + # Apache 2.4 wants to fully-parse a config file when running -V, + # because the MPM is no longer compiled-in. Provide a trivial one. + require File::Temp; + my $tmp = File::Temp->new; + my ($mpm) = grep {/^mpm_/} @{$MODULES{$res{version}}{$res{variant}}}; + print $tmp "LoadModule ${mpm}_module $apache_module_prefix/mod_${mpm}.so\n" + if $mpm; + print $tmp "ErrorLog /dev/null\n"; + print $tmp "TransferLog /dev/null\n"; + close $tmp; + $info = `$res{executable} -V -f $tmp`; + my %opts = ($info =~ m/^\s*-D\s+([A-Z_]+?)(?:="(.*)")$/mg); + %res = (%res, %opts); return %res; } @@ -249,6 +264,7 @@ sub apache_mpm_type { if ( $out =~ /^\s*(worker|prefork|event|itk)\.c\s*$/m ) { return $1; } + return "worker"; } sub fork_exec { diff --git a/rt/lib/RT/Test/Email.pm b/rt/lib/RT/Test/Email.pm index 77431fdcd..0a44aee3e 100644 --- a/rt/lib/RT/Test/Email.pm +++ b/rt/lib/RT/Test/Email.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Test/GnuPG.pm b/rt/lib/RT/Test/GnuPG.pm index e86484534..e5a08b75a 100644 --- a/rt/lib/RT/Test/GnuPG.pm +++ b/rt/lib/RT/Test/GnuPG.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Test/SMIME.pm b/rt/lib/RT/Test/SMIME.pm index d39c4b44d..36b436202 100644 --- a/rt/lib/RT/Test/SMIME.pm +++ b/rt/lib/RT/Test/SMIME.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Test/Shredder.pm b/rt/lib/RT/Test/Shredder.pm index e6314e7e3..4ee0b3589 100644 --- a/rt/lib/RT/Test/Shredder.pm +++ b/rt/lib/RT/Test/Shredder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Test/Web.pm b/rt/lib/RT/Test/Web.pm index 74da61c18..b03e82227 100644 --- a/rt/lib/RT/Test/Web.pm +++ b/rt/lib/RT/Test/Web.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Ticket.pm b/rt/lib/RT/Ticket.pm index e7478ada4..ff75f450d 100755 --- a/rt/lib/RT/Ticket.pm +++ b/rt/lib/RT/Ticket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -316,6 +316,10 @@ sub Create { unless defined $args{'Priority'}; # Dates + + my $Now = RT::Date->new( $self->CurrentUser ); + $Now->SetToNow(); + #TODO we should see what sort of due date we're getting, rather + # than assuming it's in ISO format. @@ -325,7 +329,7 @@ sub Create { $Due->Set( Format => 'ISO', Value => $args{'Due'} ); } elsif ( my $due_in = $QueueObj->DefaultDueIn ) { - $Due->SetToNow; + $Due->Set( Format => 'ISO', Value => $Now->ISO ); $Due->AddDays( $due_in ); } @@ -346,7 +350,7 @@ sub Create { # If the status is not an initial status, set the started date elsif ( !$cycle->IsInitial($args{'Status'}) ) { - $Started->SetToNow; + $Started->Set( Format => 'ISO', Value => $Now->ISO ); } my $Resolved = RT::Date->new( $self->CurrentUser ); @@ -360,7 +364,7 @@ sub Create { $RT::Logger->debug( "Got a ". $args{'Status'} ."(inactive) ticket with undefined resolved date. Setting to now." ); - $Resolved->SetToNow; + $Resolved->Set( Format => 'ISO', Value => $Now->ISO ); } # Dealing with time fields @@ -390,6 +394,7 @@ sub Create { TimeEstimated => $args{'TimeEstimated'}, TimeLeft => $args{'TimeLeft'}, Type => $args{'Type'}, + Created => $Now->ISO, Starts => $Starts->ISO, Started => $Started->ISO, Resolved => $Resolved->ISO, diff --git a/rt/lib/RT/Tickets.pm b/rt/lib/RT/Tickets.pm index 1c01fee18..7bdbce4ef 100755 --- a/rt/lib/RT/Tickets.pm +++ b/rt/lib/RT/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Topic.pm b/rt/lib/RT/Topic.pm index ff1bb884b..4345b3db2 100644 --- a/rt/lib/RT/Topic.pm +++ b/rt/lib/RT/Topic.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Topics.pm b/rt/lib/RT/Topics.pm index 630a4cb0f..b5082cebd 100644 --- a/rt/lib/RT/Topics.pm +++ b/rt/lib/RT/Topics.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Transaction.pm b/rt/lib/RT/Transaction.pm index 781c9e422..44175d49f 100755 --- a/rt/lib/RT/Transaction.pm +++ b/rt/lib/RT/Transaction.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -314,11 +314,25 @@ sub Message { +=head2 HasContent + +Returns whether this transaction has attached mime objects. + +=cut + +sub HasContent { + my $self = shift; + my $type = $PreferredContentType || ''; + return !!$self->ContentObj( $type ? ( Type => $type) : () ); +} + + + =head2 Content PARAMHASH If this transaction has attached mime objects, returns the body of the first textual part (as defined in RT::I18N::IsTextualContentType). Otherwise, -returns undef. +returns the message "This transaction appears to have no content". Takes a paramhash. If the $args{'Quote'} parameter is set, wraps this message at $args{'Wrap'}. $args{'Wrap'} defaults to $RT::MessageBoxWidth - 2 or 70. @@ -342,8 +356,8 @@ sub Content { ); my $content; - if ( my $content_obj = - $self->ContentObj( $args{Type} ? ( Type => $args{Type} ) : () ) ) + if ( my $content_obj = + $self->ContentObj( $args{Type} ? ( Type => $args{Type}) : () ) ) { $content = $content_obj->Content ||''; @@ -863,11 +877,11 @@ sub _FormatUser { }, Enabled => sub { my $self = shift; - return ( "[_1] enabled", $self->FriendlyObjectType ); #loc() + return ( "[_1] enabled", $self->Field ? $self->loc($self->Field) : $self->FriendlyObjectType ); #loc() }, Disabled => sub { my $self = shift; - return ( "[_1] disabled", $self->FriendlyObjectType ); #loc() + return ( "[_1] disabled", $self->Field ? $self->loc($self->Field) : $self->FriendlyObjectType ); #loc() }, Status => sub { my $self = shift; @@ -1188,11 +1202,11 @@ sub _FormatUser { my $q2 = RT::Queue->new( $self->CurrentUser ); $q2->Load( $self->NewValue ); return ("[_1] changed from [_2] to [_3]", - $self->loc($self->Field) , $q1->Name , $q2->Name); #loc() + $self->loc($self->Field), $q1->Name // '#'.$q1->id, $q2->Name // '#'.$q2->id); #loc() } # Write the date/time change at local time: - elsif ($self->Field =~ /Due|Starts|Started|Told|WillResolve/) { + elsif ($self->Field =~ /^(?:Due|Starts|Started|Told|WillResolve)$/) { my $t1 = RT::Date->new($self->CurrentUser); $t1->Set(Format => 'ISO', Value => $self->NewValue); my $t2 = RT::Date->new($self->CurrentUser); @@ -1262,34 +1276,46 @@ sub _FormatUser { my $self = shift; my $ticket = RT::Ticket->new($self->CurrentUser); $ticket->Load($self->NewValue); - my $subject = [ - \'<a href="', RT->Config->Get('WebPath'), - "/Ticket/Reminders.html?id=", $self->ObjectId, - "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' - ]; - return ("Reminder '[_1]' added", $subject); #loc() + if ( $ticket->CurrentUserHasRight('ShowTicket') ) { + my $subject = [ + \'<a href="', RT->Config->Get('WebPath'), + "/Ticket/Reminders.html?id=", $self->ObjectId, + "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' + ]; + return ("Reminder '[_1]' added", $subject); #loc() + } else { + return ("Reminder added"); #loc() + } }, OpenReminder => sub { my $self = shift; my $ticket = RT::Ticket->new($self->CurrentUser); $ticket->Load($self->NewValue); - my $subject = [ - \'<a href="', RT->Config->Get('WebPath'), - "/Ticket/Reminders.html?id=", $self->ObjectId, - "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' - ]; - return ("Reminder '[_1]' reopened", $subject); #loc() + if ( $ticket->CurrentUserHasRight('ShowTicket') ) { + my $subject = [ + \'<a href="', RT->Config->Get('WebPath'), + "/Ticket/Reminders.html?id=", $self->ObjectId, + "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' + ]; + return ("Reminder '[_1]' reopened", $subject); #loc() + } else { + return ("Reminder reopened"); #loc() + } }, ResolveReminder => sub { my $self = shift; my $ticket = RT::Ticket->new($self->CurrentUser); $ticket->Load($self->NewValue); - my $subject = [ - \'<a href="', RT->Config->Get('WebPath'), - "/Ticket/Reminders.html?id=", $self->ObjectId, - "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' - ]; - return ("Reminder '[_1]' completed", $subject); #loc() + if ( $ticket->CurrentUserHasRight('ShowTicket') ) { + my $subject = [ + \'<a href="', RT->Config->Get('WebPath'), + "/Ticket/Reminders.html?id=", $self->ObjectId, + "#reminder-", $ticket->id, \'">', $ticket->Subject, \'</a>' + ]; + return ("Reminder '[_1]' completed", $subject); #loc() + } else { + return ("Reminder completed"); #loc() + } } ); diff --git a/rt/lib/RT/Transactions.pm b/rt/lib/RT/Transactions.pm index 6794e527f..ffbd1ca3c 100755 --- a/rt/lib/RT/Transactions.pm +++ b/rt/lib/RT/Transactions.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI.pm b/rt/lib/RT/URI.pm index 30a096de1..778469f60 100644 --- a/rt/lib/RT/URI.pm +++ b/rt/lib/RT/URI.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI/a.pm b/rt/lib/RT/URI/a.pm index baab6585e..640490ff1 100644 --- a/rt/lib/RT/URI/a.pm +++ b/rt/lib/RT/URI/a.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI/base.pm b/rt/lib/RT/URI/base.pm index ca652efbf..9bb1887ee 100644 --- a/rt/lib/RT/URI/base.pm +++ b/rt/lib/RT/URI/base.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI/fsck_com_article.pm b/rt/lib/RT/URI/fsck_com_article.pm index 713277080..d83386179 100644 --- a/rt/lib/RT/URI/fsck_com_article.pm +++ b/rt/lib/RT/URI/fsck_com_article.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI/fsck_com_rt.pm b/rt/lib/RT/URI/fsck_com_rt.pm index 053268f9e..a0ecc34f8 100644 --- a/rt/lib/RT/URI/fsck_com_rt.pm +++ b/rt/lib/RT/URI/fsck_com_rt.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/URI/t.pm b/rt/lib/RT/URI/t.pm index a4175c990..cb703d6de 100644 --- a/rt/lib/RT/URI/t.pm +++ b/rt/lib/RT/URI/t.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/User.pm b/rt/lib/RT/User.pm index b8a51f064..3ffc1d27b 100755 --- a/rt/lib/RT/User.pm +++ b/rt/lib/RT/User.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Users.pm b/rt/lib/RT/Users.pm index 4fe145589..4b9abfedf 100755 --- a/rt/lib/RT/Users.pm +++ b/rt/lib/RT/Users.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) diff --git a/rt/lib/RT/Util.pm b/rt/lib/RT/Util.pm index aa02b04d9..70b557bb9 100644 --- a/rt/lib/RT/Util.pm +++ b/rt/lib/RT/Util.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # <sales@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) |