[Rt-commit] rt branch, 3.999-trunk, updated. 74fe5492690128b8d07f1acb4717c5de4ede5e5f
sartak at bestpractical.com
sartak at bestpractical.com
Thu Dec 3 01:55:35 EST 2009
The branch, 3.999-trunk has been updated
via 74fe5492690128b8d07f1acb4717c5de4ede5e5f (commit)
from ef714aa07e42dbc2ce9690a16a03c4fe27da2441 (commit)
Summary of changes:
share/html/Admin/Elements/EditCustomField | 2 +-
share/html/Admin/Elements/EditCustomFields | 10 +++++-----
share/html/Admin/Elements/EditTemplates | 4 ++--
share/html/Admin/Elements/ObjectCustomFields | 2 +-
.../Admin/Elements/SelectCustomFieldLookupType | 2 +-
share/html/Admin/Elements/SelectCustomFieldType | 2 +-
share/html/Admin/Elements/SelectNewGroupMembers | 2 +-
share/html/Admin/Elements/SelectRights | 4 ++--
share/html/Approvals/Elements/PendingMyApproval | 4 ++--
share/html/Dashboards/Elements/DashboardsForObject | 2 +-
share/html/Download/CustomFieldValue/dhandler | 2 +-
share/html/Elements/CollectionList | 2 +-
share/html/Elements/Dashboards | 2 +-
share/html/Elements/MessageBox | 2 +-
share/html/Elements/MyReminders | 2 +-
share/html/Elements/QueueSummary | 4 ++--
share/html/Elements/SelectGroups | 2 +-
share/html/Elements/SelectOwner | 6 +++---
share/html/Elements/SelectTicketSortBy | 2 +-
share/html/Elements/SelectUsers | 2 +-
share/html/Elements/ShowMemberships | 4 ++--
share/html/Elements/ShowUser | 2 +-
share/html/Helpers/Autocomplete/CustomFieldValues | 2 +-
share/html/REST/1.0/Forms/attachment/default | 2 +-
share/html/REST/1.0/Forms/group/customfields | 2 +-
share/html/REST/1.0/Forms/group/default | 2 +-
share/html/REST/1.0/Forms/group/ns | 2 +-
share/html/REST/1.0/Forms/queue/customfields | 2 +-
share/html/REST/1.0/Forms/queue/default | 2 +-
share/html/REST/1.0/Forms/queue/ns | 2 +-
share/html/REST/1.0/Forms/queue/ticketcustomfields | 2 +-
share/html/REST/1.0/Forms/ticket/attachments | 4 ++--
share/html/REST/1.0/Forms/ticket/comment | 2 +-
share/html/REST/1.0/Forms/ticket/default | 2 +-
share/html/REST/1.0/Forms/ticket/history | 6 +++---
share/html/REST/1.0/Forms/ticket/links | 4 ++--
share/html/REST/1.0/Forms/ticket/merge | 4 ++--
share/html/REST/1.0/Forms/ticket/take | 2 +-
share/html/REST/1.0/Forms/transaction/default | 6 +++---
share/html/REST/1.0/Forms/user/default | 2 +-
share/html/REST/1.0/search/ticket | 2 +-
share/html/REST/1.0/ticket/comment | 2 +-
share/html/REST/1.0/ticket/link | 2 +-
share/html/REST/1.0/ticket/merge | 2 +-
share/html/Search/Elements/PickCFs | 4 ++--
share/html/Search/Elements/SelectGroup | 2 +-
share/html/Search/Results.rdf | 2 +-
share/html/Search/Results.tsv | 2 +-
share/html/Ticket/Attachment/WithHeaders/dhandler | 2 +-
share/html/Ticket/Attachment/dhandler | 2 +-
share/html/Ticket/Elements/AddWatchers | 4 ++--
share/html/Ticket/Elements/Bookmark | 2 +-
share/html/Ticket/Elements/FindAttachments | 2 +-
share/html/Ticket/Elements/LoadTextAttachments | 2 +-
share/html/Ticket/Elements/PreviewScrips | 2 +-
share/html/Ticket/Elements/ShowHistory | 2 +-
share/html/Ticket/Elements/ShowRequestor | 2 +-
share/html/Ticket/Graphs/Elements/ShowGraph | 2 +-
share/html/Ticket/Graphs/Render | 2 +-
59 files changed, 79 insertions(+), 79 deletions(-)
- Log -----------------------------------------------------------------
commit 74fe5492690128b8d07f1acb4717c5de4ede5e5f
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Dec 3 01:55:17 2009 -0500
Get rid of more current_user => Jifty->web->current_user
diff --git a/share/html/Admin/Elements/EditCustomField b/share/html/Admin/Elements/EditCustomField
index 4395e8a..e4852f4 100755
--- a/share/html/Admin/Elements/EditCustomField
+++ b/share/html/Admin/Elements/EditCustomField
@@ -90,7 +90,7 @@
<%INIT>
-my $CustomFieldObj = RT::Model::CustomField->new( current_user => Jifty->web->current_user );
+my $CustomFieldObj = RT::Model::CustomField->new;
my $enabled_checked = 'checked="checked"';
my (@results);
diff --git a/share/html/Admin/Elements/EditCustomFields b/share/html/Admin/Elements/EditCustomFields
index ad7f202..b467999 100755
--- a/share/html/Admin/Elements/EditCustomFields
+++ b/share/html/Admin/Elements/EditCustomFields
@@ -67,7 +67,7 @@
<%INIT>
-my $CustomFields = RT::Model::CustomFieldCollection->new( current_user => Jifty->web->current_user );
+my $CustomFields = RT::Model::CustomFieldCollection->new;
my @results;
my (@GlobalCFs, @UnassignedCFs);
@@ -85,7 +85,7 @@ $CustomFields->order_by( column => 'name' );
my ($GlobalCFs, $objectCFs);
-$objectCFs = RT::Model::ObjectCustomFieldCollection->new( current_user => Jifty->web->current_user );
+$objectCFs = RT::Model::ObjectCustomFieldCollection->new;
$objectCFs->find_all_rows;
$objectCFs->limit_to_object_id($id);
$objectCFs->limit_to_lookup_type($lookup);
@@ -106,7 +106,7 @@ if (grep $_ > 1, values %sort_orders) {
# {{{ deal with moving sort_order of custom fields
if ($custom_field and $move) {
- my $SourceObj = RT::Model::ObjectCustomField->new( current_user => Jifty->web->current_user );
+ my $SourceObj = RT::Model::ObjectCustomField->new;
$SourceObj->load_by_cols( object_id => $id, custom_field => $custom_field );
my $targetObj;
@@ -145,7 +145,7 @@ if ($custom_field and $move) {
# }}}
if ($id) {
- $GlobalCFs = RT::Model::ObjectCustomFieldCollection->new( current_user => Jifty->web->current_user );
+ $GlobalCFs = RT::Model::ObjectCustomFieldCollection->new;
$GlobalCFs->limit_to_object_id(0);
$GlobalCFs->limit_to_lookup_type($lookup);
}
@@ -186,7 +186,7 @@ while (my $cf = $CustomFields->next) {
}
# redo search...
-$objectCFs = RT::Model::ObjectCustomFieldCollection->new( current_user => Jifty->web->current_user );
+$objectCFs = RT::Model::ObjectCustomFieldCollection->new;
$objectCFs->find_all_rows;
$objectCFs->limit_to_object_id($id);
$objectCFs->limit_to_lookup_type($lookup);
diff --git a/share/html/Admin/Elements/EditTemplates b/share/html/Admin/Elements/EditTemplates
index 95e50a0..8b807a6 100755
--- a/share/html/Admin/Elements/EditTemplates
+++ b/share/html/Admin/Elements/EditTemplates
@@ -79,10 +79,10 @@ $format ||= qq{'<a href="__WebPath__$dir_path/Template.html?queue=$id&template=_
.qq{,'<a href="__WebPath__$dir_path/Template.html?queue=$id&template=__id__">__name__</a>/TITLE:name'}
.qq{,'__description__'};
-my $queue_obj = RT::Model::Queue->new( current_user => Jifty->web->current_user );
+my $queue_obj = RT::Model::Queue->new;
$queue_obj->load( $id ) if $id;
-my $Templates = RT::Model::TemplateCollection->new( current_user => Jifty->web->current_user );
+my $Templates = RT::Model::TemplateCollection->new;
if ( $queue_obj->id ) {
$Templates->limit_to_queue( $id );
}
diff --git a/share/html/Admin/Elements/ObjectCustomFields b/share/html/Admin/Elements/ObjectCustomFields
index 98b3efd..b5571aa 100644
--- a/share/html/Admin/Elements/ObjectCustomFields
+++ b/share/html/Admin/Elements/ObjectCustomFields
@@ -73,7 +73,7 @@ my $object = $object_type->new();
my $QualifiedType;
my $FriendlySubTypes;
if (defined $sub_type && $sub_type =~/^RT::(.*)$/) {
- $FriendlySubTypes = RT::Model::CustomField->new( current_user => Jifty->web->current_user )->friendly_lookup_type($object->custom_field_lookup_type);
+ $FriendlySubTypes = RT::Model::CustomField->new->friendly_lookup_type($object->custom_field_lookup_type);
$QualifiedType = "$Type-$1";
} else {
$QualifiedType = $Type;
diff --git a/share/html/Admin/Elements/SelectCustomFieldLookupType b/share/html/Admin/Elements/SelectCustomFieldLookupType
index 45dd896..4802458 100644
--- a/share/html/Admin/Elements/SelectCustomFieldLookupType
+++ b/share/html/Admin/Elements/SelectCustomFieldLookupType
@@ -51,7 +51,7 @@
%}
</select>
<%INIT>
-my $cf = RT::Model::CustomField->new( current_user => Jifty->web->current_user );
+my $cf = RT::Model::CustomField->new;
</%INIT>
<%ARGS>
diff --git a/share/html/Admin/Elements/SelectCustomFieldType b/share/html/Admin/Elements/SelectCustomFieldType
index ced6615..e3c2dc5 100755
--- a/share/html/Admin/Elements/SelectCustomFieldType
+++ b/share/html/Admin/Elements/SelectCustomFieldType
@@ -51,7 +51,7 @@
%}
</select>
<%INIT>
-my $cf = RT::Model::CustomField->new( current_user => Jifty->web->current_user );
+my $cf = RT::Model::CustomField->new;
</%INIT>
<%ARGS>
diff --git a/share/html/Admin/Elements/SelectNewGroupMembers b/share/html/Admin/Elements/SelectNewGroupMembers
index b213e35..5ba1796 100755
--- a/share/html/Admin/Elements/SelectNewGroupMembers
+++ b/share/html/Admin/Elements/SelectNewGroupMembers
@@ -86,7 +86,7 @@ $users->limit(
);
$users->limit_to_privileged();
-my $groups = RT::Model::GroupCollection->new( current_user => Jifty->web->current_user );
+my $groups = RT::Model::GroupCollection->new;
# self-recursive group membership considered harmful!
$groups->limit(column => 'id', value => $group->id, operator => '!=' );
diff --git a/share/html/Admin/Elements/SelectRights b/share/html/Admin/Elements/SelectRights
index a09079e..7994b2f 100755
--- a/share/html/Admin/Elements/SelectRights
+++ b/share/html/Admin/Elements/SelectRights
@@ -92,8 +92,8 @@ while ( my $ace = $acl_obj->next ) {
$princ->load($principal);
$princ = $princ->acl_equivalence_group;
- my $acl_obj = RT::Model::ACECollection->new( current_user => Jifty->web->current_user );
- my $ACE = RT::Model::ACE->new( current_user => Jifty->web->current_user );
+ my $acl_obj = RT::Model::ACECollection->new;
+ my $ACE = RT::Model::ACE->new;
$acl_obj->limit_to_object( $object);
diff --git a/share/html/Approvals/Elements/PendingMyApproval b/share/html/Approvals/Elements/PendingMyApproval
index c14f4c1..4badb7f 100755
--- a/share/html/Approvals/Elements/PendingMyApproval
+++ b/share/html/Approvals/Elements/PendingMyApproval
@@ -69,11 +69,11 @@
</&>
<%init>
-my $tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $tickets = RT::Model::TicketCollection->new;
$tickets->limit( column => 'owner', value => Jifty->web->current_user->id );
# also consider AdminCcs as potential approvers.
-my $group_tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $group_tickets = RT::Model::TicketCollection->new;
$group_tickets->limit_watcher( value => Jifty->web->current_user->user_object->email, type => 'admin_cc' );
my $created_before = RT::DateTime->new_from_string($ARGS{'created_before'});
diff --git a/share/html/Dashboards/Elements/DashboardsForObject b/share/html/Dashboards/Elements/DashboardsForObject
index e31d328..3e1051c 100644
--- a/share/html/Dashboards/Elements/DashboardsForObject
+++ b/share/html/Dashboards/Elements/DashboardsForObject
@@ -57,7 +57,7 @@ my $privacy = RT::Dashboard->_build_privacy($object);
while (my $attr = $object->attributes->next) {
if ($attr->name =~ /^Dashboard\b/) {
- my $dashboard = RT::Dashboard->new( current_user => Jifty->web->current_user );
+ my $dashboard = RT::Dashboard->new;
my ($ok, $msg) = $dashboard->load($privacy, $attr->id);
if (!$ok) {
diff --git a/share/html/Download/CustomFieldValue/dhandler b/share/html/Download/CustomFieldValue/dhandler
index fe1e775..f741e40 100644
--- a/share/html/Download/CustomFieldValue/dhandler
+++ b/share/html/Download/CustomFieldValue/dhandler
@@ -54,7 +54,7 @@ if ($arg =~ /^(\d+)\//) {
else {
abort("Corrupted customfieldvalue URL.");
}
-my $OCFV = RT::Model::ObjectCustomFieldValue->new( current_user => Jifty->web->current_user );
+my $OCFV = RT::Model::ObjectCustomFieldValue->new;
$OCFV->load($id) || abort("OCFV '$id' could not be loaded");
unless ($OCFV->id) {
diff --git a/share/html/Elements/CollectionList b/share/html/Elements/CollectionList
index 89329b5..729b8e1 100644
--- a/share/html/Elements/CollectionList
+++ b/share/html/Elements/CollectionList
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%INIT>
if (!$collection && $class eq 'RT::Model::TicketCollection') {
- $collection = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+ $collection = RT::Model::TicketCollection->new;
$collection->from_sql($query);
}
my $TotalFound = $collection->count_all();
diff --git a/share/html/Elements/Dashboards b/share/html/Elements/Dashboards
index 1eec76d..086adc1 100644
--- a/share/html/Elements/Dashboards
+++ b/share/html/Elements/Dashboards
@@ -58,7 +58,7 @@
<%INIT>
use RT::Dashboard;
-my @objs = RT::Dashboard->new( current_user => Jifty->web->current_user )->_privacy_objects(ShowSystem => 1);
+my @objs = RT::Dashboard->new->_privacy_objects(ShowSystem => 1);
my $dashboard_map = $m->comp("/Dashboards/Elements/DashboardsForObjects", objects => \@objs);
my @dashboards = (
diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index 0181a84..ca8e6c7 100755
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -53,7 +53,7 @@
my $message = '';
if ( $quote_transaction ) {
- my $transaction = RT::Model::Transaction->new( current_user => Jifty->web->current_user );
+ my $transaction = RT::Model::Transaction->new;
$transaction->load( $quote_transaction );
$message = $transaction->content( Quote => 1 );
}
diff --git a/share/html/Elements/MyReminders b/share/html/Elements/MyReminders
index b29611e..74c846f 100755
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/MyReminders
@@ -67,7 +67,7 @@
<%init>
return unless RT->config->get('enable_reminders');
-my $reminders = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $reminders = RT::Model::TicketCollection->new;
$reminders->from_sql('(Owner = "Nobody" OR Owner = "'.Jifty->web->current_user->name.'")' .
' AND type = "reminder" AND (Status = "new" OR Status = "open")');
$reminders->order_by(column => 'Due', order => 'DESC');
diff --git a/share/html/Elements/QueueSummary b/share/html/Elements/QueueSummary
index 88670a4..262e049 100644
--- a/share/html/Elements/QueueSummary
+++ b/share/html/Elements/QueueSummary
@@ -76,7 +76,7 @@ if ($cache && Jifty->web->session->get($cache)) {
@queues = @{Jifty->web->session->get($cache)};
}
else {
- my $Queues = RT::Model::QueueCollection->new( current_user => Jifty->web->current_user );
+ my $Queues = RT::Model::QueueCollection->new;
$Queues->find_all_rows();
@queues = grep $queue_filter->($_), @{$Queues->items_array_ref};
@@ -92,7 +92,7 @@ else {
}
-my $Tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $Tickets = RT::Model::TicketCollection->new;
</%INIT>
<%ARGS>
$cache => undef
diff --git a/share/html/Elements/SelectGroups b/share/html/Elements/SelectGroups
index 4a86d88..df40926 100755
--- a/share/html/Elements/SelectGroups
+++ b/share/html/Elements/SelectGroups
@@ -57,7 +57,7 @@
<& /Elements/SelectMatch, name => 'group_op', default => $group_op &>
<input size="8" name="group_string" value="<% $group_string %>" />
<%INIT>
-my $CFs = RT::Model::CustomFieldCollection->new( current_user => Jifty->web->current_user );
+my $CFs = RT::Model::CustomFieldCollection->new;
$CFs->limit_to_child_type('RT::Model::Group');
$CFs->order_by( column => 'name' );
</%INIT>
diff --git a/share/html/Elements/SelectOwner b/share/html/Elements/SelectOwner
index 2f281a6..9fb8e8a 100755
--- a/share/html/Elements/SelectOwner
+++ b/share/html/Elements/SelectOwner
@@ -76,7 +76,7 @@ if ($ticket_obj) {
} else {
# Let's check rights on an empty queue object. that will do a search
# for any queue.
- my $queue = RT::Model::Queue->new( current_user => Jifty->web->current_user );
+ my $queue = RT::Model::Queue->new;
push( @objects, $queue );
}
@@ -92,7 +92,7 @@ my $isSU = Jifty->web->current_user
->has_right( right => 'SuperUser', object => RT->system );
foreach my $object (@objects) {
- my $Users = RT::Model::UserCollection->new( current_user => Jifty->web->current_user );
+ my $Users = RT::Model::UserCollection->new;
$Users->who_have_right(
right => 'OwnTicket',
object => $object,
@@ -107,7 +107,7 @@ foreach my $object (@objects) {
}
}
if ($default && $default != RT->nobody->id && !$user_uniq_hash{$default}) {
- $user_uniq_hash{$default} = RT::Model::User->new( current_user => Jifty->web->current_user );
+ $user_uniq_hash{$default} = RT::Model::User->new;
$user_uniq_hash{$default}->load($default);
}
diff --git a/share/html/Elements/SelectTicketSortBy b/share/html/Elements/SelectTicketSortBy
index 9d33c90..fcd088c 100755
--- a/share/html/Elements/SelectTicketSortBy
+++ b/share/html/Elements/SelectTicketSortBy
@@ -52,7 +52,7 @@
</select>
<%INIT>
-my $tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $tickets = RT::Model::TicketCollection->new;
my @sortfields = $tickets->sort_fields();
</%INIT>
diff --git a/share/html/Elements/SelectUsers b/share/html/Elements/SelectUsers
index d805c42..4cd96e0 100755
--- a/share/html/Elements/SelectUsers
+++ b/share/html/Elements/SelectUsers
@@ -57,7 +57,7 @@
<& /Elements/SelectMatch, name => 'user_op', default => $user_op &>
<input size="8" name="user_string" value="<% $user_string %>" />
<%INIT>
-my $CFs = RT::Model::CustomFieldCollection->new( current_user => Jifty->web->current_user );
+my $CFs = RT::Model::CustomFieldCollection->new;
$CFs->limit_to_child_type('RT::Model::User');
$CFs->order_by( column => 'name' );
</%INIT>
diff --git a/share/html/Elements/ShowMemberships b/share/html/Elements/ShowMemberships
index 2c50f28..70a21a6 100644
--- a/share/html/Elements/ShowMemberships
+++ b/share/html/Elements/ShowMemberships
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<ul>
% while ( my $GroupMember = $GroupMembers->next ) {
-% my $Group = RT::Model::Group->new( current_user => Jifty->web->current_user );
+% my $Group = RT::Model::Group->new;
% $Group->load($GroupMember->group_id) or next;
% if ($Group->domain eq 'UserDefined') {
<li><a href="<%RT->config->get('web_path')%>/Admin/Groups/Modify.html?id=<% $Group->id %>"><% $Group->name %></a></li>
@@ -57,7 +57,7 @@
% }
</ul>
<%INIT>
-my $GroupMembers = RT::Model::GroupMemberCollection->new( current_user => Jifty->web->current_user );
+my $GroupMembers = RT::Model::GroupMemberCollection->new;
$GroupMembers->limit( column => 'member_id', value => $user_object->id );
my $alias = $GroupMembers->join(
type => 'left',
diff --git a/share/html/Elements/ShowUser b/share/html/Elements/ShowUser
index b996fce..539413c 100644
--- a/share/html/Elements/ShowUser
+++ b/share/html/Elements/ShowUser
@@ -50,7 +50,7 @@
# $user is an RT::Model::User object
# $address is Email::Address object
if ( !$user && $address ) {
- $user = RT::Model::User->new( current_user => Jifty->web->current_user );
+ $user = RT::Model::User->new;
$user->load_by_email( $address->address );
unless ( $user->id ) {
$m->comp( '/Elements/ShowUserVerbose', address => $address );
diff --git a/share/html/Helpers/Autocomplete/CustomFieldValues b/share/html/Helpers/Autocomplete/CustomFieldValues
index f1612d4..b990b54 100644
--- a/share/html/Helpers/Autocomplete/CustomFieldValues
+++ b/share/html/Helpers/Autocomplete/CustomFieldValues
@@ -61,7 +61,7 @@ while( my($k, $v) = each %ARGS ) {
last;
}
$m->abort unless $CustomField;
-my $CustomFieldObj = RT::Model::CustomField->new( current_user => Jifty->web->current_user );
+my $CustomFieldObj = RT::Model::CustomField->new;
$CustomFieldObj->load( $CustomField );
my $values = $CustomFieldObj->values;
$values->limit(
diff --git a/share/html/REST/1.0/Forms/attachment/default b/share/html/REST/1.0/Forms/attachment/default
index 79c98f1..c62d337 100644
--- a/share/html/REST/1.0/Forms/attachment/default
+++ b/share/html/REST/1.0/Forms/attachment/default
@@ -54,7 +54,7 @@ $args => undef
<%INIT>
my @data;
my ($c, $o, $k, $e) = ("", [], {}, "");
-my $attachment = RT::Model::Attachment->new( current_user => Jifty->web->current_user );
+my $attachment = RT::Model::Attachment->new;
$attachment->load($id);
unless ( $attachment->Id ) {
diff --git a/share/html/REST/1.0/Forms/group/customfields b/share/html/REST/1.0/Forms/group/customfields
index 9bb8be9..35a5271 100644
--- a/share/html/REST/1.0/Forms/group/customfields
+++ b/share/html/REST/1.0/Forms/group/customfields
@@ -55,7 +55,7 @@ $changes => {}
<%perl>
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
-my $group = RT::Model::Group->new( current_user => Jifty->web->current_user );
+my $group = RT::Model::Group->new;
$group->load($id);
if (!$group->Id) {
diff --git a/share/html/REST/1.0/Forms/group/default b/share/html/REST/1.0/Forms/group/default
index f42845a..cdeadc1 100644
--- a/share/html/REST/1.0/Forms/group/default
+++ b/share/html/REST/1.0/Forms/group/default
@@ -57,7 +57,7 @@ $changes => {}
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $group = RT::Model::Group->new( current_user => Jifty->web->current_user );
+my $group = RT::Model::Group->new;
my @fields = qw(Name Description);
my %fields = map { lc $_ => $_ } @fields;
diff --git a/share/html/REST/1.0/Forms/group/ns b/share/html/REST/1.0/Forms/group/ns
index 63f54ef..6c53166 100644
--- a/share/html/REST/1.0/Forms/group/ns
+++ b/share/html/REST/1.0/Forms/group/ns
@@ -53,7 +53,7 @@ $id
<%perl>
use RT::Model::Groups;
-my $groups = RT::Model::Groups->new( current_user => Jifty->web->current_user );
+my $groups = RT::Model::Groups->new;
$groups->limit(column => 'name', operator => '=', value => $id);
if ($groups->count == 0) {
return (0, "No group named $id exists.");
diff --git a/share/html/REST/1.0/Forms/queue/customfields b/share/html/REST/1.0/Forms/queue/customfields
index d40c2b0..77857c9 100644
--- a/share/html/REST/1.0/Forms/queue/customfields
+++ b/share/html/REST/1.0/Forms/queue/customfields
@@ -55,7 +55,7 @@ $changes => {}
<%perl>
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
-my $queue = RT::Model::Queue->new( current_user => Jifty->web->current_user );
+my $queue = RT::Model::Queue->new;
$queue->load($id);
if (!$queue->id) {
diff --git a/share/html/REST/1.0/Forms/queue/default b/share/html/REST/1.0/Forms/queue/default
index 49069fb..dc4201e 100755
--- a/share/html/REST/1.0/Forms/queue/default
+++ b/share/html/REST/1.0/Forms/queue/default
@@ -57,7 +57,7 @@ $changes => {}
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $queue = RT::Model::Queue->new( current_user => Jifty->web->current_user ) ;
+my $queue = RT::Model::Queue->new;
my @fields = qw(name description correspond_address comment_address
initial_priority final_priority default_due_in);
my %fields = map { lc $_ => $_ } @fields;
diff --git a/share/html/REST/1.0/Forms/queue/ns b/share/html/REST/1.0/Forms/queue/ns
index 5d31389..0d1822b 100755
--- a/share/html/REST/1.0/Forms/queue/ns
+++ b/share/html/REST/1.0/Forms/queue/ns
@@ -53,7 +53,7 @@ $id
<%perl>
use RT::Model::QueueCollection;
-my $queues = RT::Model::QueueCollection->new( current_user => Jifty->web->current_user );
+my $queues = RT::Model::QueueCollection->new;
$queues->limit(column => 'name', operator => '=', value => $id);
if ($queues->count == 0) {
return (0, "No queue named $id exists.");
diff --git a/share/html/REST/1.0/Forms/queue/ticketcustomfields b/share/html/REST/1.0/Forms/queue/ticketcustomfields
index 130d400..cfbaa7f 100644
--- a/share/html/REST/1.0/Forms/queue/ticketcustomfields
+++ b/share/html/REST/1.0/Forms/queue/ticketcustomfields
@@ -71,7 +71,7 @@ if (%$changes) {
my @data;
push @data, [ id => "queue/" . $queue->Id ];
-my $qcfs = RT::CustomFields->new(current_user => Jifty->web->current_user);
+my $qcfs = RT::CustomFields->new;
$qcfs->limit_to_global_or_queue($id);
while ( my $qcf = $qcfs->next() ) {
if ( $format eq "l" ) {
diff --git a/share/html/REST/1.0/Forms/ticket/attachments b/share/html/REST/1.0/Forms/ticket/attachments
index 6ef156d..9fe9ad0 100755
--- a/share/html/REST/1.0/Forms/ticket/attachments
+++ b/share/html/REST/1.0/Forms/ticket/attachments
@@ -54,7 +54,7 @@ $args => undef
<%INIT>
my @data;
my ($c, $o, $k, $e) = ("", [], {}, "");
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
$ticket->load($id);
unless ($ticket->id) {
@@ -76,7 +76,7 @@ if ($aid) {
unless ($aid =~ /^\d+$/) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
}
- my $attachment = RT::Model::Attachment->new( current_user => Jifty->web->current_user );
+ my $attachment = RT::Model::Attachment->new;
$attachment->load($aid);
unless ($attachment->id eq $aid) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
diff --git a/share/html/REST/1.0/Forms/ticket/comment b/share/html/REST/1.0/Forms/ticket/comment
index abf309a..94487b9 100755
--- a/share/html/REST/1.0/Forms/ticket/comment
+++ b/share/html/REST/1.0/Forms/ticket/comment
@@ -60,7 +60,7 @@ use File::Temp qw(tempfile);
Jifty->log->debug("Got ticket id=$id for comment");
Jifty->log->debug("Got args @{[keys(%changes)]}.");
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/comment
diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default
index 70fd7cc..8e526fe 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -62,7 +62,7 @@ my $cf_spec = RT::Interface::REST->custom_field_spec(1);
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user ) ;
+my $ticket = RT::Model::Ticket->new;
my @dates = qw(created starts started due resolved told last_updated);
my @people = qw(requestors cc admin_cc);
my @create = qw(queue requestor subject cc admin_cc owner status priority
diff --git a/share/html/REST/1.0/Forms/ticket/history b/share/html/REST/1.0/Forms/ticket/history
index d9e3a8a..a7ea267 100755
--- a/share/html/REST/1.0/Forms/ticket/history
+++ b/share/html/REST/1.0/Forms/ticket/history
@@ -54,7 +54,7 @@ $format => undef
$fields => undef
</%ARGS>
<%INIT>
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my ($c, $o, $k, $e) = ("", [], {}, "");
$ticket->load($id);
@@ -101,7 +101,7 @@ if ($type) {
if ($tid) {
my @data;
- my $t = RT::Model::Transaction->new( current_user => Jifty->web->current_user );
+ my $t = RT::Model::Transaction->new;
# this paragraph limits the transaction ID query to transactions on this ticket.
# Otherwise you can query any transaction from any ticket, which makes no sense.
@@ -138,7 +138,7 @@ if ($tid) {
if (!%$fields || exists $fields->{lc 'content'}) {
- my $creator = RT::Model::User->new( current_user => Jifty->web->current_user );
+ my $creator = RT::Model::User->new;
$creator->load($t->creator);
push @data, [ Creator => $creator->name ];
}
diff --git a/share/html/REST/1.0/Forms/ticket/links b/share/html/REST/1.0/Forms/ticket/links
index fc35bb2..bb1da51 100755
--- a/share/html/REST/1.0/Forms/ticket/links
+++ b/share/html/REST/1.0/Forms/ticket/links
@@ -55,7 +55,7 @@ $changes => undef
<%INIT>
my @data;
$format ||= 's';
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
$ticket->load($id);
if (!$ticket->id) {
return [ "# Ticket $id does not exist.", [], {}, 1 ];
@@ -97,7 +97,7 @@ if ($changes) {
foreach my $nkey (@{vsplit($val)}) {
if ($nkey =~ /^\d+$/) {
my $uri = RT::URI->new();
- my $tick = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+ my $tick = RT::Model::Ticket->new;
$tick->load($nkey);
if ($tick->id) {
$nkey = $uri->from_object($tick);
diff --git a/share/html/REST/1.0/Forms/ticket/merge b/share/html/REST/1.0/Forms/ticket/merge
index 0680585..fb4bba9 100755
--- a/share/html/REST/1.0/Forms/ticket/merge
+++ b/share/html/REST/1.0/Forms/ticket/merge
@@ -56,8 +56,8 @@ use RT::Interface::REST;
my $into = $args;
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
-my $ticket_into = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
+my $ticket_into = RT::Model::Ticket->new;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/merge/6 (merges ticket 1 into ticket 6)
diff --git a/share/html/REST/1.0/Forms/ticket/take b/share/html/REST/1.0/Forms/ticket/take
index c3cef88..e4d3727 100755
--- a/share/html/REST/1.0/Forms/ticket/take
+++ b/share/html/REST/1.0/Forms/ticket/take
@@ -54,7 +54,7 @@ $id
<%INIT>
use RT::Interface::REST;
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/take
diff --git a/share/html/REST/1.0/Forms/transaction/default b/share/html/REST/1.0/Forms/transaction/default
index e12f42d..d88435b 100644
--- a/share/html/REST/1.0/Forms/transaction/default
+++ b/share/html/REST/1.0/Forms/transaction/default
@@ -54,7 +54,7 @@ $format => undef
$fields => undef
</%ARGS>
<%INIT>
-my $trans = RT::Model::TransactionCollection->new( current_user => Jifty->web->current_user );
+my $trans = RT::Model::TransactionCollection->new;
my ($c, $o, $k, $e) = ("", [], {} , "");
chomp $args;
@@ -65,7 +65,7 @@ $trans->limit(column => 'id', operator => '=', value => $tid);
if ($tid) {
my @data;
- my $t = RT::Model::Transaction->new( current_user => Jifty->web->current_user );
+ my $t = RT::Model::Transaction->new;
$t->load($tid);
if ($format eq "l") {
push @data, [ id => $t->id ];
@@ -89,7 +89,7 @@ if ($tid) {
if (!%$fields || exists $fields->{lc 'content'});
if (!%$fields || exists $fields->{lc 'content'}) {
- my $creator = RT::Model::User->new( current_user => Jifty->web->current_user );
+ my $creator = RT::Model::User->new;
$creator->load($t->creator);
push @data, [ Creator => $creator->name ];
}
diff --git a/share/html/REST/1.0/Forms/user/default b/share/html/REST/1.0/Forms/user/default
index aa20af4..72bff3b 100755
--- a/share/html/REST/1.0/Forms/user/default
+++ b/share/html/REST/1.0/Forms/user/default
@@ -56,7 +56,7 @@ $changes => {}
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $user = RT::Model::User->new( current_user => Jifty->web->current_user ) ;
+my $user = RT::Model::User->new ;
my @fields = qw(real_name nickname gecos organization address1 address2 city
state zip country home_phone work_phone mobile_phone pager_phone
freeform_contact_info comments signature lang email_encoding
diff --git a/share/html/REST/1.0/search/ticket b/share/html/REST/1.0/search/ticket
index e210685..5f76470 100755
--- a/share/html/REST/1.0/search/ticket
+++ b/share/html/REST/1.0/search/ticket
@@ -57,7 +57,7 @@ $fields => undef
use RT::Interface::REST;
my $output = "";
my $status = "200 Ok";
-my $tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $tickets = RT::Model::TicketCollection->new;
# Parse and validate any field specifications.
my $field = RT::Interface::REST->field_spec;
diff --git a/share/html/REST/1.0/ticket/comment b/share/html/REST/1.0/ticket/comment
index 1664298..1df336e 100755
--- a/share/html/REST/1.0/ticket/comment
+++ b/share/html/REST/1.0/ticket/comment
@@ -56,7 +56,7 @@ use LWP::MediaTypes;
use RT::Interface::REST;
use File::Temp qw(tempfile);
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my $object = $r->path_info;
my $status = "200 Ok";
my $output;
diff --git a/share/html/REST/1.0/ticket/link b/share/html/REST/1.0/ticket/link
index b3c5853..afff6c1 100755
--- a/share/html/REST/1.0/ticket/link
+++ b/share/html/REST/1.0/ticket/link
@@ -57,7 +57,7 @@ $to
use RT::Interface::REST;
my $output;
my $status = "200 Ok";
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my $object = $r->path_info;
my @fields = qw(DependsOn DependedOnBy RefersTo ReferredToBy HasMember MemberOf);
diff --git a/share/html/REST/1.0/ticket/merge b/share/html/REST/1.0/ticket/merge
index 3aa909e..d33fe4b 100755
--- a/share/html/REST/1.0/ticket/merge
+++ b/share/html/REST/1.0/ticket/merge
@@ -56,7 +56,7 @@ use RT::Interface::REST;
my $output;
my $status = "200 Ok";
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
my $object = $r->path_info;
# http://.../REST/1.0/ticket/merge/1
diff --git a/share/html/Search/Elements/PickCFs b/share/html/Search/Elements/PickCFs
index f08aeee..3015ffe 100644
--- a/share/html/Search/Elements/PickCFs
+++ b/share/html/Search/Elements/PickCFs
@@ -49,10 +49,10 @@
<& ConditionRow, condition => $_ &>
% }
<%INIT>
-my $CustomFields = RT::Model::CustomFieldCollection->new( current_user => Jifty->web->current_user );
+my $CustomFields = RT::Model::CustomFieldCollection->new;
foreach my $id (keys %queues) {
# Gotta load up the $queue object, since queues get stored by name now. my $id
- my $queue = RT::Model::Queue->new( current_user => Jifty->web->current_user );
+ my $queue = RT::Model::Queue->new;
$queue->load($id);
unless ($queue->id) {
# XXX TODO: This ancient code dates from a former developer
diff --git a/share/html/Search/Elements/SelectGroup b/share/html/Search/Elements/SelectGroup
index f730b49..fad4570 100644
--- a/share/html/Search/Elements/SelectGroup
+++ b/share/html/Search/Elements/SelectGroup
@@ -55,7 +55,7 @@
</select>
<%INIT>
-my $groups = RT::Model::GroupCollection->new( current_user => Jifty->web->current_user );
+my $groups = RT::Model::GroupCollection->new;
$groups->limit(column => 'domain', operator => '=', value => $domain);
</%INIT>
diff --git a/share/html/Search/Results.rdf b/share/html/Search/Results.rdf
index 62018ee..6f50658 100644
--- a/share/html/Search/Results.rdf
+++ b/share/html/Search/Results.rdf
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%INIT>
-my $Tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $Tickets = RT::Model::TicketCollection->new;
$Tickets->from_sql($ARGS{'query'});
if ($order_by =~ /\|/) {
# Multiple Sorts
diff --git a/share/html/Search/Results.tsv b/share/html/Search/Results.tsv
index 15050bc..49b2b33 100644
--- a/share/html/Search/Results.tsv
+++ b/share/html/Search/Results.tsv
@@ -51,7 +51,7 @@ $order => 'ASC'
</%ARGS>
<%INIT>
-my $Tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+my $Tickets = RT::Model::TicketCollection->new;
$Tickets->from_sql( $ARGS{'query'} );
if ( $order_by =~ /\|/ ) {
diff --git a/share/html/Ticket/Attachment/WithHeaders/dhandler b/share/html/Ticket/Attachment/WithHeaders/dhandler
index 42ba221..9774ccc 100644
--- a/share/html/Ticket/Attachment/WithHeaders/dhandler
+++ b/share/html/Ticket/Attachment/WithHeaders/dhandler
@@ -53,7 +53,7 @@
abort("Corrupted attachment URL");
}
- my $AttachmentObj = RT::Model::Attachment->new( current_user => Jifty->web->current_user );
+ my $AttachmentObj = RT::Model::Attachment->new;
$AttachmentObj->load( $id );
unless ( $AttachmentObj->id ) {
abort("Couldn't load attachment #$id");
diff --git a/share/html/Ticket/Attachment/dhandler b/share/html/Ticket/Attachment/dhandler
index 6225666..10d2e0d 100755
--- a/share/html/Ticket/Attachment/dhandler
+++ b/share/html/Ticket/Attachment/dhandler
@@ -55,7 +55,7 @@
else {
abort("Corrupted attachment URL.");
}
- my $AttachmentObj = RT::Model::Attachment->new( current_user => Jifty->web->current_user );
+ my $AttachmentObj = RT::Model::Attachment->new;
$AttachmentObj->load($attach) || abort("Attachment '$attach' could not be loaded");
diff --git a/share/html/Ticket/Elements/AddWatchers b/share/html/Ticket/Elements/AddWatchers
index c303303..4b895fd 100755
--- a/share/html/Ticket/Elements/AddWatchers
+++ b/share/html/Ticket/Elements/AddWatchers
@@ -99,13 +99,13 @@
my ($Users, $Groups);
if ($user_string) {
- $Users = RT::Model::UserCollection->new( current_user => Jifty->web->current_user );
+ $Users = RT::Model::UserCollection->new;
$Users->limit(column => $user_field, value => $user_string, operator => $user_op);
$Users->limit_to_privileged if $privileged_only;
}
if ($group_string) {
- $Groups = RT::Model::GroupCollection->new( current_user => Jifty->web->current_user );
+ $Groups = RT::Model::GroupCollection->new;
$Groups->limit(column => 'domain', operator => '=', value => 'UserDefined');
$Groups->limit(column => $group_field, value => $group_string, operator => $group_op);
}
diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index 0acb3db..9e7330b 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -54,7 +54,7 @@ my $bookmarked = $bookmarks->{ $id }; # we still not sure if it's undef
my @ids;
if ( $toggle || !$bookmarked ) {
- my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+ my $ticket = RT::Model::Ticket->new;
$ticket->load( $id );
return unless $id = $ticket->id;
diff --git a/share/html/Ticket/Elements/FindAttachments b/share/html/Ticket/Elements/FindAttachments
index db19ae8..4873348 100644
--- a/share/html/Ticket/Elements/FindAttachments
+++ b/share/html/Ticket/Elements/FindAttachments
@@ -53,7 +53,7 @@ my %documents;
# We force the cache of ticket transactions to get populated up front. otherwise, the
# code that looks at attachments will look at each one in turn.
-my $attachments = RT::Model::AttachmentCollection->new( current_user => Jifty->web->current_user );
+my $attachments = RT::Model::AttachmentCollection->new;
$attachments->query_columns( qw( id filename content_type headers subject parent content_encoding content_type transaction_id created));
diff --git a/share/html/Ticket/Elements/LoadTextAttachments b/share/html/Ticket/Elements/LoadTextAttachments
index 37f0686..c6bb3ad 100644
--- a/share/html/Ticket/Elements/LoadTextAttachments
+++ b/share/html/Ticket/Elements/LoadTextAttachments
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%INIT>
-my $attachments = RT::Model::AttachmentCollection->new( current_user => Jifty->web->current_user );
+my $attachments = RT::Model::AttachmentCollection->new;
$attachments->query_columns( qw(id content content_type transaction_id content_encoding));
diff --git a/share/html/Ticket/Elements/PreviewScrips b/share/html/Ticket/Elements/PreviewScrips
index a7d6c3a..e78e2f8 100755
--- a/share/html/Ticket/Elements/PreviewScrips
+++ b/share/html/Ticket/Elements/PreviewScrips
@@ -210,7 +210,7 @@ my $Message = make_mime_entity(
body => $ARGS{'content'},
);
-my $ticket_obj = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket_obj = RT::Model::Ticket->new;
my ( $id, $txn, $msg ) = $ticket_obj->create(
type => $ARGS{'type'} || 'ticket',
queue => $ARGS{'queue'},
diff --git a/share/html/Ticket/Elements/ShowHistory b/share/html/Ticket/Elements/ShowHistory
index c8cca70..523cf86 100755
--- a/share/html/Ticket/Elements/ShowHistory
+++ b/share/html/Ticket/Elements/ShowHistory
@@ -132,7 +132,7 @@ while ( my $Transaction = $Transactions->next ) {
</div>
% }
<%INIT>
-my $Transactions = RT::Model::TransactionCollection->new( current_user => Jifty->web->current_user );
+my $Transactions = RT::Model::TransactionCollection->new;
if ($tickets) {
while (my $t = $tickets->next) {
$Transactions->limit_to_ticket($t->id);
diff --git a/share/html/Ticket/Elements/ShowRequestor b/share/html/Ticket/Elements/ShowRequestor
index a95a7e3..a481dd3 100755
--- a/share/html/Ticket/Elements/ShowRequestor
+++ b/share/html/Ticket/Elements/ShowRequestor
@@ -53,7 +53,7 @@ while ( my $requestor = $people->next ) {
next if $requestor->privileged;
my $name = $m->scomp('/Elements/ShowUser', user => $requestor);
- my $tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
+ my $tickets = RT::Model::TicketCollection->new;
$tickets->from_sql( "Requestor.id = ". $requestor->id ." AND (Status = 'open' OR Status = 'new')" );
$tickets->rows_per_page( $rows );
$tickets->order_by( column => 'Priority', order => 'DESC' );
diff --git a/share/html/Ticket/Graphs/Elements/ShowGraph b/share/html/Ticket/Graphs/Elements/ShowGraph
index ed631b3..42c11f9 100644
--- a/share/html/Ticket/Graphs/Elements/ShowGraph
+++ b/share/html/Ticket/Graphs/Elements/ShowGraph
@@ -55,7 +55,7 @@ $id => undef
<%INIT>
use RT::Util 'safe_run_child';
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
$ticket->load( $id );
unless ( $ticket->id ) {
Jifty->log->error("Couldn't load ticket $id");
diff --git a/share/html/Ticket/Graphs/Render b/share/html/Ticket/Graphs/Render
index f61d3a7..b8e541d 100644
--- a/share/html/Ticket/Graphs/Render
+++ b/share/html/Ticket/Graphs/Render
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<%INIT>
-my $ticket = RT::Model::Ticket->new( current_user => Jifty->web->current_user );
+my $ticket = RT::Model::Ticket->new;
$ticket->load( $id );
unless ( $ticket->id ) {
Jifty->log->error("Couldn't load ticket #$id");
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list