summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Transactions.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-07-10 18:15:08 -0700
committerMark Wells <mark@freeside.biz>2015-07-10 18:15:08 -0700
commit88bf5db0cca989c51237c661a13078eef08b3674 (patch)
tree0a84e1b5e7fd239f57fab678bf40c5311b0064a0 /rt/lib/RT/Transactions.pm
parent9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (diff)
parente7eb845db1afab1cbdbc34ff9c387c5ac554659e (diff)
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'rt/lib/RT/Transactions.pm')
-rwxr-xr-xrt/lib/RT/Transactions.pm53
1 files changed, 11 insertions, 42 deletions
diff --git a/rt/lib/RT/Transactions.pm b/rt/lib/RT/Transactions.pm
index 82bd50f12..6794e527f 100755
--- a/rt/lib/RT/Transactions.pm
+++ b/rt/lib/RT/Transactions.pm
@@ -2,7 +2,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -69,11 +69,10 @@ package RT::Transactions;
use strict;
use warnings;
+use base 'RT::SearchBuilder';
use RT::Transaction;
-use base 'RT::SearchBuilder';
-
sub Table { 'Transactions'}
# {{{ sub _Init
@@ -85,9 +84,9 @@ sub _Init {
# By default, order by the date of the transaction, rather than ID.
$self->OrderByCols( { FIELD => 'Created',
- ORDER => 'ASC' },
- { FIELD => 'id',
- ORDER => 'ASC' } );
+ ORDER => 'ASC' },
+ { FIELD => 'id',
+ ORDER => 'ASC' } );
return ( $self->SUPER::_Init(@_));
}
@@ -109,11 +108,10 @@ sub LimitToTicket {
my $tid = shift;
unless ( $self->{'tickets_table'} ) {
- $self->{'tickets_table'} ||= $self->NewAlias('Tickets');
- $self->Join(
+ $self->{'tickets_table'} ||= $self->Join(
ALIAS1 => 'main',
FIELD1 => 'ObjectId',
- ALIAS2 => $self->{'tickets_table'},
+ TABLE2 => 'Tickets',
FIELD2 => 'id'
);
$self->Limit(
@@ -132,43 +130,14 @@ sub LimitToTicket {
}
-sub Next {
+sub AddRecord {
my $self = shift;
-
- my $Transaction = $self->SUPER::Next();
- if ((defined($Transaction)) and (ref($Transaction))) {
- # If the user can see the transaction's type, then they can
- # see the transaction and we should hand it back.
- if ($Transaction->Type) {
- return($Transaction);
- }
-
- #If the user doesn't have the right to show this ticket
- else {
- return($self->Next());
- }
- }
+ my ($record) = @_;
- #if there never was any ticket
- else {
- return(undef);
- }
+ return unless $record->CurrentUserCanSee;
+ return $self->SUPER::AddRecord($record);
}
-
-
-
-
-=head2 NewItem
-
-Returns an empty new RT::Transaction item
-
-=cut
-
-sub NewItem {
- my $self = shift;
- return(RT::Transaction->new($self->CurrentUser));
-}
RT::Base->_ImportOverlays();
1;