projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rt 4.2.15
[freeside.git]
/
rt
/
lib
/
RT
/
Attributes.pm
diff --git
a/rt/lib/RT/Attributes.pm
b/rt/lib/RT/Attributes.pm
index
fcbd0b1
..
10b9f4b
100644
(file)
--- a/
rt/lib/RT/Attributes.pm
+++ b/
rt/lib/RT/Attributes.pm
@@
-2,7
+2,7
@@
#
# COPYRIGHT:
#
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-201
2
Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-201
8
Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@
-68,11
+68,10
@@
package RT::Attributes;
use strict;
use warnings;
use strict;
use warnings;
+use base 'RT::SearchBuilder';
use RT::Attribute;
use RT::Attribute;
-use base 'RT::SearchBuilder';
-
sub Table { 'Attributes'}
sub Table { 'Attributes'}
@@
-140,23
+139,6
@@
sub Named {
return (@attributes);
}
return (@attributes);
}
-=head2 WithId ID
-
-Returns the RT::Attribute objects with the id ID
-
-XXX TODO XXX THIS NEEDS A BETTER ACL CHECK
-
-=cut
-
-sub WithId {
- my $self = shift;
- my $id = shift;
-
- my $attr = RT::Attribute->new($self->CurrentUser);
- $attr->LoadByCols( id => $id );
- return($attr);
-}
-
=head2 DeleteEntry { Name => Content => , id => }
Deletes attributes with
=head2 DeleteEntry { Name => Content => , id => }
Deletes attributes with
@@
-210,23
+192,14
@@
sub LimitToObject {
unless (eval { $obj->id} ){
return undef;
}
unless (eval { $obj->id} ){
return undef;
}
- $self->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => ref($obj), ENTRYAGGREGATOR => 'OR');
- $self->Limit(FIELD => 'ObjectId', OPERATOR=> '=', VALUE => $obj->id, ENTRYAGGREGATOR => 'OR', QUOTEVALUE => 0);
-
-}
-
-
-=head2 NewItem
+ my $type = $obj->isa("RT::CurrentUser") ? "RT::User" : ref($obj);
-Returns an empty new RT::Attribute item
-
-=cut
+ $self->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => $type, ENTRYAGGREGATOR => 'OR');
+ $self->Limit(FIELD => 'ObjectId', OPERATOR=> '=', VALUE => $obj->id, ENTRYAGGREGATOR => 'OR', QUOTEVALUE => 0);
-sub NewItem {
- my $self = shift;
- return(RT::Attribute->new($self->CurrentUser));
}
}
+
RT::Base->_ImportOverlays();
1;
RT::Base->_ImportOverlays();
1;