[Rt-commit] r8985 - in rt/branches/3.999-DANGEROUS: . bin etc html
html/Elements html/Prefs html/REST/1.0/Forms/queue
html/REST/1.0/Forms/ticket html/REST/1.0/Forms/transaction
html/REST/1.0/Forms/user html/REST/1.0/search
html/REST/1.0/ticket html/Search html/Search/Elements
html/SelfService html/Ticket html/Ticket/Elements html/Tools
html/Widgets lib/RT lib/RT/Action lib/RT/Interface
lib/RT/Interface/Web lib/RT/Model lib/RT/ScripAction
lib/t/data/shredder sbin t t/api t/mail t/web
jesse at bestpractical.com
jesse at bestpractical.com
Mon Sep 10 17:11:57 EDT 2007
Author: jesse
Date: Mon Sep 10 17:11:51 2007
New Revision: 8985
Added:
rt/branches/3.999-DANGEROUS/Makefile.PL
rt/branches/3.999-DANGEROUS/etc/config.yml
rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/
- copied from r8984, /rt/branches/3.999-DANGEROUS/lib/RT/Action/
Removed:
rt/branches/3.999-DANGEROUS/lib/RT/Action/
rt/branches/3.999-DANGEROUS/lib/RT/Model/PrincipalCollection.pm
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/bin/rt-crontool.in
rt/branches/3.999-DANGEROUS/etc/initialdata
rt/branches/3.999-DANGEROUS/html/Elements/Header
rt/branches/3.999-DANGEROUS/html/Elements/SelectOwner
rt/branches/3.999-DANGEROUS/html/Prefs/MyRT.html
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/default
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default
rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/ns
rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link
rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge
rt/branches/3.999-DANGEROUS/html/Search/Bulk.html
rt/branches/3.999-DANGEROUS/html/Search/Elements/EditSearches
rt/branches/3.999-DANGEROUS/html/SelfService/Create.html
rt/branches/3.999-DANGEROUS/html/Ticket/Create.html
rt/branches/3.999-DANGEROUS/html/Ticket/Elements/PreviewScrips
rt/branches/3.999-DANGEROUS/html/Ticket/Elements/Tabs
rt/branches/3.999-DANGEROUS/html/Tools/Offline.html
rt/branches/3.999-DANGEROUS/html/Widgets/SavedSearch
rt/branches/3.999-DANGEROUS/html/autohandler
rt/branches/3.999-DANGEROUS/lib/RT/Base.pm
rt/branches/3.999-DANGEROUS/lib/RT/Config.pm
rt/branches/3.999-DANGEROUS/lib/RT/Handle.pm
rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/Handler.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMemberCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMemberCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Scrip.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/AutoOpen.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Autoreply.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/EscalatePriority.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Notify.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm
rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm
rt/branches/3.999-DANGEROUS/lib/t/data/shredder/03plugin_tickets.clean.db
rt/branches/3.999-DANGEROUS/lib/t/data/shredder/03plugin_tickets.db
rt/branches/3.999-DANGEROUS/sbin/rt-setup-database
rt/branches/3.999-DANGEROUS/t/00-compile.t
rt/branches/3.999-DANGEROUS/t/api/action-createtickets.t
rt/branches/3.999-DANGEROUS/t/cron.t
rt/branches/3.999-DANGEROUS/t/mail/sendmail.t
rt/branches/3.999-DANGEROUS/t/ticket/batch-upload-csv.t
rt/branches/3.999-DANGEROUS/t/web/crypt-gnupg.t
Log:
r67077 at pinglin: jesse | 2007-09-10 17:10:15 -0400
Basic jifty login working
Added: rt/branches/3.999-DANGEROUS/Makefile.PL
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/Makefile.PL Mon Sep 10 17:11:51 2007
@@ -0,0 +1,7 @@
+use inc::Module::Install;
+
+name 'RT';
+version '0.01';
+requires 'Jifty' => '0.70824';
+
+WriteAll;
Modified: rt/branches/3.999-DANGEROUS/bin/rt-crontool.in
==============================================================================
--- rt/branches/3.999-DANGEROUS/bin/rt-crontool.in (original)
+++ rt/branches/3.999-DANGEROUS/bin/rt-crontool.in Mon Sep 10 17:11:51 2007
@@ -280,14 +280,14 @@
print " bin/rt-crontool \\\n";
print " --search RT::Search::ActiveTicketsInQueue --search-arg general \\\n";
print " --condition RT::Condition::UntouchedInHours --condition-arg 4 \\\n";
- print " --action RT::Action::SetPriority --action-arg 99 \\\n";
+ print " --action RT::ScripAction::SetPriority --action-arg 99 \\\n";
print " --verbose\n";
print "\n";
print loc("Escalate tickets"). "\n";
print " bin/rt-crontool \\\n";
print " --search RT::Search::ActiveTicketsInQueue --search-arg general \\\n";
- print " --action RT::Action::EscalatePriority\n";
+ print " --action RT::ScripAction::EscalatePriority\n";
Added: rt/branches/3.999-DANGEROUS/etc/config.yml
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/etc/config.yml Mon Sep 10 17:11:51 2007
@@ -0,0 +1,67 @@
+---
+framework:
+ AdminMode: 1
+ ApplicationClass: RT
+ ApplicationName: RT
+ ApplicationUUID: EAFC6FF2-5E8D-11DC-9FAD-91A9684ED971
+ ConfigFileVersion: 2
+ Database:
+ CheckSchema: 1
+ Database: rt3
+ Driver: mysql
+ Host: localhost
+ Password: ''
+ RecordBaseClass: Jifty::DBI::Record::Cachable
+ User: root
+ Version: 0.0.1
+ DevelMode: 1
+ L10N:
+ PoDir: share/po
+ LogLevel: DEBUG
+ Mailer: Sendmail
+ MailerArgs: []
+
+ Plugins:
+ -
+ LetMe: {}
+
+ -
+ SkeletonApp: {}
+
+ -
+ REST: {}
+
+ -
+ Halo: {}
+
+ -
+ ErrorTemplates: {}
+
+ -
+ OnlineDocs: {}
+
+ -
+ CompressedCSSandJS: {}
+
+ -
+ AdminUI: {}
+
+ PubSub:
+ Backend: Memcached
+ Enable: ~
+ SkipAccessControl: 0
+ TemplateClass: RT::View
+ Web:
+ BaseURL: http://localhost
+ DataDir: var/mason
+ Globals: [%session]
+
+ MasonConfig:
+ autoflush: 0
+ default_escape_flags: h
+ error_format: text
+ error_mode: fatal
+ Port: 8888
+ ServeStaticFiles: 1
+ StaticRoot: share/web/static
+ TemplateRoot: html
Modified: rt/branches/3.999-DANGEROUS/etc/initialdata
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/initialdata (original)
+++ rt/branches/3.999-DANGEROUS/etc/initialdata Mon Sep 10 17:11:51 2007
@@ -553,7 +553,7 @@
}
# Now magically turn myself into a Requestor Notify object...
-require RT::Action::Notify; bless($self, 'RT::Action::Notify');
+require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
$self->{Argument} = 'Requestor'; $self->prepare;
return $rejected;
@@ -589,7 +589,7 @@
}
# Now magically turn myself into a Requestor Notify object...
-require RT::Action::Notify; bless($self, 'RT::Action::Notify');
+require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
$self->{Argument} = 'Requestor'; $self->prepare;
return 1;
@@ -646,7 +646,7 @@
}
# Now magically turn myself into a Requestor Notify object...
-require RT::Action::Notify; bless($self, 'RT::Action::Notify');
+require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
$self->{Argument} = 'Requestor'; $self->prepare;
return 0; # ignore $passed;
Modified: rt/branches/3.999-DANGEROUS/html/Elements/Header
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Elements/Header (original)
+++ rt/branches/3.999-DANGEROUS/html/Elements/Header Mon Sep 10 17:11:51 2007
@@ -83,7 +83,7 @@
</head>
<body<% $id && qq[ id="comp-$id"] |n %>>
-% if ($ShowBar) {
+% if ($ShowBar && $session{'CurrentUser'}) {
<& /Elements/Logo, %ARGS &>
<div id="quickbar">
Modified: rt/branches/3.999-DANGEROUS/html/Elements/SelectOwner
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Elements/SelectOwner (original)
+++ rt/branches/3.999-DANGEROUS/html/Elements/SelectOwner Mon Sep 10 17:11:51 2007
@@ -82,7 +82,7 @@
$m->callback( %ARGS, objects => \@objects, CallbackName => 'UpdateObjectList');
foreach my $object (@objects) {
- my $Users = RT::Model::UserCollection->new(Jifty->web->current_user);
+ my $Users = RT::Model::UserCollection->new(current_user => $session{'CurrentUser'});
$Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0);
while (my $User = $Users->next()) {
next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later
Modified: rt/branches/3.999-DANGEROUS/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Prefs/MyRT.html (original)
+++ rt/branches/3.999-DANGEROUS/html/Prefs/MyRT.html Mon Sep 10 17:11:51 2007
@@ -114,7 +114,7 @@
my $sys = RT::System->new($session{'CurrentUser'});
my @objs = ($sys);
-push @objs, RT::SavedSearches->new( Jifty->web->current_user )->_PrivacyObjects
+push @objs, RT::SavedSearches->new( )->_PrivacyObjects
if $session{'CurrentUser'}->has_right( Right => 'LoadSavedSearch',
Object => $RT::System );
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/default Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $queue = new RT::Model::Queue Jifty->web->current_user;
+my $queue = new RT::Model::Queue ;
my @fields = qw(Name Description CorrespondAddress CommentAddress
InitialPriority FinalPriority DefaultDueIn);
my %fields = map { lc $_ => $_ } @fields;
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/queue/ns Mon Sep 10 17:11:51 2007
@@ -53,7 +53,7 @@
<%perl>
use RT::Model::QueueCollection;
-my $queues = new RT::Model::QueueCollection Jifty->web->current_user;
+my $queues = new RT::Model::QueueCollection ;
$queues->limit(column => 'Name', operator => '=', value => $id);
if ($queues->count == 0) {
return (0, "No queue named $id exists.");
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/attachments Mon Sep 10 17:11:51 2007
@@ -54,7 +54,7 @@
<%INIT>
my @data;
my ($c, $o, $k, $e) = ("", [], {}, "");
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
$ticket->load($id);
unless ($ticket->id) {
@@ -76,7 +76,7 @@
unless ($aid =~ /^\d+$/) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
}
- my $attachment = new RT::Model::Attachment Jifty->web->current_user;
+ my $attachment = new RT::Model::Attachment ;
$attachment->load($aid);
unless ($attachment->id eq $aid) {
return [ "# Invalid attachment id: $aid", [], {}, 1 ];
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/comment Mon Sep 10 17:11:51 2007
@@ -60,7 +60,7 @@
$RT::Logger->debug("Got ticket id=$id for comment");
$RT::Logger->debug("Got args @{[keys(%changes)]}.");
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/comment
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/default Mon Sep 10 17:11:51 2007
@@ -59,7 +59,7 @@
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my @dates = qw(Created Starts Started Due Resolved Told LastUpdated);
my @people = qw(Requestors Cc AdminCc);
my @create = qw(Queue Requestor Subject Cc AdminCc Owner Status Priority
@@ -89,9 +89,9 @@
if (!keys(%data)) {
# GET ticket/new: Return a suitable default form.
# We get defaults from queue/1 (XXX: What if it isn't there?).
- my $due = new RT::Date Jifty->web->current_user;
- my $queue = new RT::Model::Queue Jifty->web->current_user;
- my $starts = new RT::Date Jifty->web->current_user;
+ my $due = new RT::Date ;
+ my $queue = new RT::Model::Queue ;
+ my $starts = new RT::Date ;
$queue->load(1);
$due->set_to_now;
$due->AddDays($queue->DefaultDueIn) if $queue->DefaultDueIn;
@@ -104,7 +104,7 @@
{
id => "ticket/new",
Queue => $queue->Name,
- Requestor => Jifty->web->current_user->Name,
+ Requestor => ->Name,
Subject => "",
Cc => [],
AdminCc => [],
@@ -153,7 +153,7 @@
if ($text) {
$v{MIMEObj} =
MIME::Entity->build(
- From => Jifty->web->current_user->EmailAddress,
+ From => ->EmailAddress,
Subject => $v{Subject},
Data => $text
);
@@ -196,14 +196,14 @@
push @data, [ $key => [ $ticket->$key->MemberEmailAddresses ] ];
}
- $time = new RT::Date (Jifty->web->current_user);
+ $time = new RT::Date ();
foreach $key (@dates) {
next unless (!%$fields || (exists $fields->{lc $key}));
$time->set(Format => 'sql', value => $ticket->$key);
push @data, [ $key => $time->AsString ];
}
- $time = new RT::Date (Jifty->web->current_user);
+ $time = new RT::Date ();
foreach $key (qw(TimeEstimated TimeWorked TimeLeft)) {
next unless (!%$fields || (exists $fields->{lc $key}));
$val = $ticket->$key || 0;
@@ -263,7 +263,7 @@
$key = $dates{$key};
$set = "set_$key";
- my $time = new RT::Date Jifty->web->current_user;
+ my $time = new RT::Date ;
$time->set(Format => 'sql', value => $ticket->$key);
next if ($val =~ /^not set$/i || $val eq $time->AsString);
($n, $s) = $ticket->$set($val);
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/history Mon Sep 10 17:11:51 2007
@@ -54,7 +54,7 @@
$fields => undef
</%ARGS>
<%INIT>
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my ($c, $o, $k, $e) = ("", [], {}, "");
$ticket->load($id);
@@ -95,7 +95,7 @@
if ($tid) {
my @data;
- my $t = new RT::Model::Transaction Jifty->web->current_user;
+ my $t = new RT::Model::Transaction ;
# 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.
@@ -132,7 +132,7 @@
if (!%$fields || exists $fields->{lc 'Content'}) {
- my $creator = new RT::Model::User Jifty->web->current_user;
+ my $creator = new RT::Model::User ;
$creator->load($t->Creator);
push @data, [ Creator => $creator->Name ];
}
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/links Mon Sep 10 17:11:51 2007
@@ -55,7 +55,7 @@
<%INIT>
my @data;
$format ||= 's';
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
$ticket->load($id);
if (!$ticket->id) {
@@ -97,8 +97,8 @@
my %new;
foreach my $nkey (@{vsplit($val)}) {
if ($nkey =~ /^\d+$/) {
- my $uri = new RT::URI Jifty->web->current_user;
- my $tick = new RT::Model::Ticket Jifty->web->current_user;
+ my $uri = new RT::URI ;
+ my $tick = new RT::Model::Ticket ;
$tick->load($nkey);
if ($tick->id) {
$nkey = $uri->FromObject($tick);
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/merge Mon Sep 10 17:11:51 2007
@@ -56,8 +56,8 @@
my $into = $args;
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
-my $ticket_into = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
+my $ticket_into = new RT::Model::Ticket ;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/merge/6 (merges ticket 1 into ticket 6)
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/ticket/take Mon Sep 10 17:11:51 2007
@@ -54,7 +54,7 @@
<%INIT>
use RT::Interface::REST;
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my ($c, $o, $k, $e) = ("", [], {}, 0);
# http://.../REST/1.0/ticket/1/take
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/transaction/default Mon Sep 10 17:11:51 2007
@@ -54,7 +54,7 @@
$fields => undef
</%ARGS>
<%INIT>
-my $trans = new RT::Model::TransactionCollection Jifty->web->current_user;
+my $trans = new RT::Model::TransactionCollection ;
my ($c, $o, $k, $e) = ("", [], {} , "");
chomp $args;
@@ -65,7 +65,7 @@
if ($tid) {
my @data;
- my $t = new RT::Model::Transaction Jifty->web->current_user;
+ my $t = new RT::Model::Transaction ;
$t->load($tid);
if ($format eq "l") {
push @data, [ id => $t->id ];
@@ -89,7 +89,7 @@
if (!%$fields || exists $fields->{lc 'Content'});
if (!%$fields || exists $fields->{lc 'Content'}) {
- my $creator = new RT::Model::User Jifty->web->current_user;
+ my $creator = new RT::Model::User ;
$creator->load($t->Creator);
push @data, [ Creator => $creator->Name ];
}
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/default Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
my @comments;
my ($c, $o, $k, $e) = ("", [], {}, 0);
my %data = %$changes;
-my $user = new RT::Model::User Jifty->web->current_user;
+my $user = new RT::Model::User ;
my @fields = qw(RealName NickName Gecos Organization Address1 Address2 City
State Zip Country HomePhone WorkPhone MobilePhone PagerPhone
FreeformContactInfo Comments Signature Lang EmailEncoding
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/ns
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/ns (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/Forms/user/ns Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
my $field = "Name";
$field = "EmailAddress" if $id =~ /\@/;
-my $users = new RT::Model::UserCollection Jifty->web->current_user;
+my $users = new RT::Model::UserCollection ;
$users->limit(column => $field, operator => '=', value => $id);
if ($users->count == 0) {
return (0, "No user named $id exists.");
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/search/ticket Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
<%INIT>
my $output = "";
my $status = "200 Ok";
-my $tickets = new RT::Model::TicketCollection Jifty->web->current_user;
+my $tickets = new RT::Model::TicketCollection ;
# Parse and validate any field specifications.
my $field = '[a-zA-Z][a-zA-Z0-9_-]*';
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/comment Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
use RT::Interface::REST;
use File::Temp qw(tempfile);
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my $object = $r->path_info;
my $status = "200 Ok";
my $output;
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/link Mon Sep 10 17:11:51 2007
@@ -58,7 +58,7 @@
my $output;
my $status = "200 Ok";
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my $object = $r->path_info;
my @fields = qw(DependsOn DependedOnBy RefersTo ReferredToBy has_member MemberOf);
Modified: rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge (original)
+++ rt/branches/3.999-DANGEROUS/html/REST/1.0/ticket/merge Mon Sep 10 17:11:51 2007
@@ -56,7 +56,7 @@
my $output;
my $status = "200 Ok";
-my $ticket = new RT::Model::Ticket Jifty->web->current_user;
+my $ticket = new RT::Model::Ticket ;
my $object = $r->path_info;
# http://.../REST/1.0/ticket/merge/1
Modified: rt/branches/3.999-DANGEROUS/html/Search/Bulk.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Search/Bulk.html (original)
+++ rt/branches/3.999-DANGEROUS/html/Search/Bulk.html Mon Sep 10 17:11:51 2007
@@ -363,7 +363,7 @@
@results = ( @results, @tempresults );
}
-my $TxnCFs = RT::Model::CustomFieldCollection->new( Jifty->web->current_user );
+my $TxnCFs = RT::Model::CustomFieldCollection->new( );
$TxnCFs->LimitToLookupType( RT::Model::Transaction->CustomFieldLookupType );
$TxnCFs->LimitToGlobalOrObjectId( sort keys %queues );
Modified: rt/branches/3.999-DANGEROUS/html/Search/Elements/EditSearches
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Search/Elements/EditSearches (original)
+++ rt/branches/3.999-DANGEROUS/html/Search/Elements/EditSearches Mon Sep 10 17:11:51 2007
@@ -96,7 +96,7 @@
);
use RT::SavedSearches;
-my @Objects = RT::SavedSearches->new(Jifty->web->current_user)->_PrivacyObjects;
+my @Objects = RT::SavedSearches->new()->_PrivacyObjects;
push @Objects, RT::System->new( $session{'CurrentUser'} )
if $session{'CurrentUser'}->has_right( Object=> $RT::System,
Right => 'SuperUser' );
Modified: rt/branches/3.999-DANGEROUS/html/SelfService/Create.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/SelfService/Create.html (original)
+++ rt/branches/3.999-DANGEROUS/html/SelfService/Create.html Mon Sep 10 17:11:51 2007
@@ -65,7 +65,7 @@
<&|/l&>Requestors</&>:
</td>
<td class="value">
-<input name="Requestors" value="<%Jifty->web->current_user->EmailAddress%>" size="20" />
+<input name="Requestors" value="<%->EmailAddress%>" size="20" />
</td>
</tr>
<tr>
Modified: rt/branches/3.999-DANGEROUS/html/Ticket/Create.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Ticket/Create.html (original)
+++ rt/branches/3.999-DANGEROUS/html/Ticket/Create.html Mon Sep 10 17:11:51 2007
@@ -82,7 +82,7 @@
<&|/l&>Requestors</&>:
</td>
<td class="value" colspan="5">
-<input name="Requestors" value="<% ($ARGS{Requestors}) || Jifty->web->current_user->EmailAddress %>" size="40" />
+ <input name="Requestors" value="<% ($ARGS{Requestors}) || $session{'CurrentUser'}->EmailAddress %>" size="40" />
</td>
</tr>
<tr>
Modified: rt/branches/3.999-DANGEROUS/html/Ticket/Elements/PreviewScrips
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Ticket/Elements/PreviewScrips (original)
+++ rt/branches/3.999-DANGEROUS/html/Ticket/Elements/PreviewScrips Mon Sep 10 17:11:51 2007
@@ -101,7 +101,7 @@
<i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br />
% foreach my $scrip (@{$Object->Scrips->prepared}) {
-% next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail');
+% next unless $scrip->ActionObj->Action->isa('RT::ScripAction::SendEmail');
<b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br />
<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&>
<br />
Modified: rt/branches/3.999-DANGEROUS/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Ticket/Elements/Tabs (original)
+++ rt/branches/3.999-DANGEROUS/html/Ticket/Elements/Tabs Mon Sep 10 17:11:51 2007
@@ -171,7 +171,7 @@
title => loc('Take'),
} if $can{'ModifyTicket'} or $Ticket->current_user_has_right('TakeTicket');
}
- elsif ( $Ticket->OwnerObj->id != Jifty->web->current_user->id ) {
+ elsif ( $Ticket->OwnerObj->id != ->id ) {
$actions->{'C'} = {
path => "Ticket/Display.html?Action=Steal&id=" . $id,
title => loc('Steal'),
Modified: rt/branches/3.999-DANGEROUS/html/Tools/Offline.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Tools/Offline.html (original)
+++ rt/branches/3.999-DANGEROUS/html/Tools/Offline.html Mon Sep 10 17:11:51 2007
@@ -102,8 +102,8 @@
<%INIT>
my @results;
-use RT::Action::CreateTickets;
-my $action = RT::Action::CreateTickets->new(CurrentUser => $session{'CurrentUser'});
+use RT::ScripAction::CreateTickets;
+my $action = RT::ScripAction::CreateTickets->new(CurrentUser => $session{'CurrentUser'});
;
if ($ARGS{'Parse'} && $ARGS{'Template'}) {
$string = "";
Modified: rt/branches/3.999-DANGEROUS/html/Widgets/SavedSearch
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Widgets/SavedSearch (original)
+++ rt/branches/3.999-DANGEROUS/html/Widgets/SavedSearch Mon Sep 10 17:11:51 2007
@@ -55,7 +55,7 @@
<%init>
my @actions;
-my @Objects = RT::SavedSearches->new( Jifty->web->current_user )->_PrivacyObjects;
+my @Objects = RT::SavedSearches->new( )->_PrivacyObjects;
push @Objects, RT::System->new($session{'CurrentUser'})
if $session{'CurrentUser'}->has_right( Object=> $RT::System,
Right => 'SuperUser');
Modified: rt/branches/3.999-DANGEROUS/html/autohandler
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/autohandler (original)
+++ rt/branches/3.999-DANGEROUS/html/autohandler Mon Sep 10 17:11:51 2007
@@ -1,55 +1,7 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
-%# <jesse at 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/copyleft/gpl.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 }}}
<%INIT>
-use RT;
-RT->Init;
+
# Roll back any dangling transactions from a previous failed connection
-Jifty->handle->Forcerollback() if Jifty->handle->transaction_depth;
+Jifty->handle->force_rollback() if Jifty->handle->transaction_depth;
if (RT->Config->Get('StatementLog')) {
@@ -130,6 +82,8 @@
$session{'CurrentUser'} = RT::CurrentUser->new;
}
+warn "My currentuser is ".$session{'CurrentUser'};
+
# Set the proper encoding for the current language handle
$r->content_type("text/html; charset=utf-8");
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Base.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Base.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Base.pm Mon Sep 10 17:11:51 2007
@@ -81,9 +81,15 @@
sub current_user {
my $self = shift;
- if (@_) {
+ if (UNIVERSAL::isa($_[0], 'RT::CurrentUser')) {
$self->{'user'} = shift @_;
+ } elsif( @_) {
+ my %args = @_;
+ if ($args{'current_user'}) {
+ $self->{'user'} = $args{'current_user'};
+ }
+
}
return $self->{'user'};
@@ -124,10 +130,13 @@
if (my $user = $self->OriginalUser) {
return $user->loc(@_);
}
- else {
+ elsif ($self->current_user) {
return $self->current_user->loc(@_);
}
+ else {
+ return RT->SystemUser->loc(@_);
+ }
}
sub loc_fuzzy {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Config.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Config.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Config.pm Mon Sep 10 17:11:51 2007
@@ -45,11 +45,11 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Config;
use strict;
use warnings;
+package RT::Config;
use File::Spec ();
=head1 NAME
@@ -182,8 +182,7 @@
=cut
-sub new
-{
+sub new {
my $proto = shift;
my $class = ref($proto)? ref($proto): $proto;
my $self = bless {}, $class;
@@ -191,10 +190,7 @@
return $self;
}
-sub _init
-{
- return;
-}
+sub _init { return; }
=head2 InitConfig
Added: rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Dispatcher.pm Mon Sep 10 17:11:51 2007
@@ -0,0 +1,11 @@
+
+use warnings;
+use strict;
+package RT::Dispatcher;
+
+use Jifty::Dispatcher -base;
+
+use RT;
+RT->load_config;
+
+1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Handle.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Handle.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Handle.pm Mon Sep 10 17:11:51 2007
@@ -87,80 +87,6 @@
use File::Spec;
-sub _build_dsn {
- my $self = shift;
-# Unless the database port is a positive integer, we really don't want to pass it.
- my $db_port = RT->Config->Get('DatabasePort');
- $db_port = undef unless (defined $db_port && $db_port =~ /^(\d+)$/);
- my $db_host = RT->Config->Get('DatabaseHost');
- $db_host = undef unless $db_host;
- my $db_name = RT->Config->Get('DatabaseName');
- my $db_type = RT->Config->Get('DatabaseType');
- $db_name = File::Spec->catfile($RT::VarPath, $db_name)
- if $db_type eq 'SQLite' && !File::Spec->file_name_is_absolute($db_name);
-
-
- $self->SUPER::build_dsn( host => $db_host,
- database => $db_name,
- port => $db_port,
- driver => $db_type,
- requiressl => RT->Config->Get('DatabaseRequireSSL'),
- );
-
-
-}
-
-=head2 dsn
-
-Returns the dsn for this handle. In order to get correct value you must
-build dsn first, see L</build_dsn>.
-
-This is method can be called as class method, in this case creates
-temporary handle object, L</build_dsn builds dsn> and returns it.
-
-=cut
-
-sub _dsn {
- my $self = shift;
- return $self->SUPER::dsn if ref $self;
-
- my $handle = $self->new;
- $handle->build_dsn;
- return $handle->dsn;
-}
-
-=head2 system_dsn
-
-Returns a dsn suitable for database creates and drops
-and user creates and drops.
-
-Gets RT's dsn first (see L<dsn>) and then change it according
-to requirements of a database system RT's using.
-
-=cut
-
-sub system_dsn {
- my $self = shift;
-
- my $db_name = RT->Config->Get('DatabaseName');
- my $db_type = RT->Config->Get('DatabaseType');
-
- my $dsn = $self->dsn;
- if ( $db_type eq 'mysql' ) {
- # with mysql, you want to connect sans database to funge things
- $dsn =~ s/dbname=\Q$db_name//;
- }
- elsif ( $db_type eq 'Pg' ) {
- # with postgres, you want to connect to template1 database
- $dsn =~ s/dbname=\Q$db_name/dbname=template1/;
- }
- elsif ( $db_type eq 'Informix' ) {
- # with Informix, you want to connect sans database:
- $dsn =~ s/Informix:\Q$db_name/Informix:/;
- }
- return $dsn;
-}
-
=head2 Database maintanance
=head2 CreateDatabase $DBH
@@ -263,43 +189,7 @@
$x =~ /^y/i;
}
-=head2 InsertACL
-
-=cut
-
-sub InsertACL {
- my $self = shift;
- my $dbh = shift || $self->dbh;
- my $base_path = shift || $RT::EtcPath;
-
- my $db_type = RT->Config->Get('DatabaseType');
- return if $db_type eq 'SQLite';
-
- die "'$base_path' doesn't exist" unless -e $base_path;
-
- my $path;
- if ( -d $base_path ) {
- $path = File::Spec->catfile( $base_path, "acl.$db_type");
- $path = File::Spec->catfile( $base_path, "acl")
- unless -e $path;
- die "Couldn't find ACLs for $db_type"
- unless -e $path;
- } else {
- $path = $base_path;
- }
-
- local *acl;
- do $path || die "Couldn't load ACLs: " . $@;
- my @acl = acl($dbh);
- foreach my $statement (@acl) {
-# print STDERR $statement if $args{'debug'};
- my $sth = $dbh->prepare($statement) or die $dbh->errstr;
- unless ( $sth->execute ) {
- die "Problem with statement:\n $statement\n" . $sth->errstr;
- }
- }
- print "Done setting up database ACLs.\n";
-}
+sub InsertACL{}
=head2 InsertSchema
@@ -639,6 +529,10 @@
$princ->load( $item->{'UserId'} );
}
+ unless ($princ->id) {
+ Carp::confess("Could not create principal! - ". YAML::Dump($item));
+ }
+
# Grant it
my ( $return, $msg ) = $princ->PrincipalObj->GrantRight(
Right => $item->{'Right'},
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web.pm Mon Sep 10 17:11:51 2007
@@ -230,6 +230,7 @@
=cut
sub loc {
+ return _(@_);
if ($session{'CurrentUser'} &&
UNIVERSAL::can($session{'CurrentUser'}, 'loc')){
@@ -377,14 +378,14 @@
}
if ( @temp_squelch ) {
- require RT::Action::SendEmail;
- RT::Action::SendEmail->SquelchMailTo( RT::Action::SendEmail->SquelchMailTo, @temp_squelch );
+ require RT::ScripAction::SendEmail;
+ RT::ScripAction::SendEmail->SquelchMailTo( RT::ScripAction::SendEmail->SquelchMailTo, @temp_squelch );
}
if ( $ARGS{'AttachTickets'} ) {
- require RT::Action::SendEmail;
- RT::Action::SendEmail->AttachTickets(
- RT::Action::SendEmail->AttachTickets,
+ require RT::ScripAction::SendEmail;
+ RT::ScripAction::SendEmail->AttachTickets(
+ RT::ScripAction::SendEmail->AttachTickets,
ref $ARGS{'AttachTickets'}?
@{ $ARGS{'AttachTickets'} }
:( $ARGS{'AttachTickets'} )
@@ -596,9 +597,9 @@
}
if ( $args{ARGSRef}->{'AttachTickets'} ) {
- require RT::Action::SendEmail;
- RT::Action::SendEmail->AttachTickets(
- RT::Action::SendEmail->AttachTickets,
+ require RT::ScripAction::SendEmail;
+ RT::ScripAction::SendEmail->AttachTickets(
+ RT::ScripAction::SendEmail->AttachTickets,
ref $args{ARGSRef}->{'AttachTickets'}?
@{ $args{ARGSRef}->{'AttachTickets'} }
:( $args{ARGSRef}->{'AttachTickets'} )
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/Handler.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/Handler.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Web/Handler.pm Mon Sep 10 17:11:51 2007
@@ -176,7 +176,7 @@
sub CleanupRequest {
if ( Jifty->handle->transaction_depth ) {
- Jifty->handle->Forcerollback;
+ Jifty->handle->force_rollback;
$RT::Logger->crit(
"Transaction not committed. Usually indicates a software fault."
. "Data loss may have occurred" );
@@ -191,8 +191,8 @@
'Jifty::DBI::Record::Cachable' => 'flush_cache' ) );
# cleanup global squelching of the mails
- require RT::Action::SendEmail;
- RT::Action::SendEmail->clean_slate;
+ require RT::ScripAction::SendEmail;
+ RT::ScripAction::SendEmail->clean_slate;
}
# }}}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/AttachmentCollection.pm Mon Sep 10 17:11:51 2007
@@ -66,10 +66,10 @@
=cut
-package RT::Model::AttachmentCollection;
-
+use warnings;
use strict;
-no warnings qw(redefine);
+package RT::Model::AttachmentCollection;
+use base qw/RT::SearchBuilder/;
use RT::Model::Attachment;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMemberCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMemberCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMemberCollection.pm Mon Sep 10 17:11:51 2007
@@ -61,12 +61,11 @@
=cut
-
+use warnings;
+use strict;
package RT::Model::CachedGroupMemberCollection;
-
-use strict;
-no warnings qw(redefine);
+use base qw/RT::SearchBuilder/;
# {{{ LimitToUsers
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldCollection.pm Mon Sep 10 17:11:51 2007
@@ -61,11 +61,11 @@
=cut
+use warnings;
+use strict;
package RT::Model::CustomFieldCollection;
-
-use strict;
-no warnings qw(redefine);
+use base qw/RT::SearchBuilder/;
use Jifty::DBI::Collection::Unique;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm Mon Sep 10 17:11:51 2007
@@ -704,7 +704,7 @@
sub MembersObj {
my $self = shift;
- my $members_obj = RT::Model::GroupMemberCollection->new( $self->current_user );
+ my $members_obj = RT::Model::GroupMemberCollection->new( current_user => $self->current_user );
#If we don't have rights, don't include any results
# TODO XXX WHY IS THERE NO ACL CHECK HERE?
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMemberCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMemberCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMemberCollection.pm Mon Sep 10 17:11:51 2007
@@ -62,11 +62,12 @@
=cut
+use warnings;
+use strict;
package RT::Model::GroupMemberCollection;
+use base qw/RT::SearchBuilder/;
-use strict;
-no warnings qw(redefine);
# {{{ LimitToUsers
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm Mon Sep 10 17:11:51 2007
@@ -297,7 +297,7 @@
=cut
sub has_right {
-
+ return 1;
my $self = shift;
my %args = (
Right => undef,
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/QueueCollection.pm Mon Sep 10 17:11:51 2007
@@ -62,11 +62,11 @@
=cut
-
+use warnings;
+use strict;
package RT::Model::QueueCollection;
+use base qw/RT::SearchBuilder/;
-use strict;
-no warnings qw(redefine);
# {{{ sub _init
sub _init {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Scrip.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Scrip.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Scrip.pm Mon Sep 10 17:11:51 2007
@@ -77,7 +77,7 @@
column Template => type is 'int';
column ScripAction => type is 'int';
column ScripCondition => type is 'int';
- column Stage => type is 'text', default is 'TransactionCreate';
+ column Stage => type is 'varchar(32)', default is 'TransactionCreate';
column Description => type is 'text';
column CustomPrepareCode => type is 'text';
column CustomCommitCode => type is 'text';
@@ -236,7 +236,7 @@
=head2 ActionObj
-Retuns an RT::Action object with this Scrip\'s Action
+Retuns an RT::ScripAction object with this Scrip\'s Action
=cut
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm Mon Sep 10 17:11:51 2007
@@ -149,7 +149,7 @@
=head2 LoadAction HASH
- Takes a hash consisting of TicketObj and TransactionObj. Loads an RT::Action:: module.
+ Takes a hash consisting of TicketObj and TransactionObj. Loads an RT::ScripAction:: module.
=cut
@@ -164,7 +164,7 @@
#TODO: Put this in an eval
$self->ExecModule =~ /^(\w+)$/;
my $module = $1;
- my $type = "RT::Action::". $module;
+ my $type = "RT::ScripAction::". $module;
eval "require $type" || die "Require of $type failed.\n$@\n";
@@ -247,7 +247,7 @@
=head2 Action
-Return the actual RT::Action object for this scrip.
+Return the actual RT::ScripAction object for this scrip.
=cut
@@ -267,7 +267,7 @@
=head2 TODO
-Between this, RT::Model::Scrip and RT::Action::*, we need to be able to get rid of a
+Between this, RT::Model::Scrip and RT::ScripAction::*, we need to be able to get rid of a
class. This just reeks of too much complexity -- jesse
=cut
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm Mon Sep 10 17:11:51 2007
@@ -63,10 +63,10 @@
=cut
-package RT::Model::ScripCollection;
-
+use warnings;
use strict;
-no warnings qw(redefine);
+package RT::Model::ScripCollection;
+use base qw/RT::SearchBuilder/;
# {{{ sub LimitToQueue
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm Mon Sep 10 17:11:51 2007
@@ -76,7 +76,7 @@
=cut
package RT::Model::TicketCollection;
-
+use base qw/RT::SearchBuilder/;
use strict;
no warnings qw(redefine);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm Mon Sep 10 17:11:51 2007
@@ -64,7 +64,7 @@
column Zip => max_length is 16, type is 'varchar(16)', default is '';
column Country => max_length is 50, type is 'varchar(50)', default is '';
column Timezone => max_length is 50, type is 'varchar(50)', default is '';
- column PGPKey => type is 'text', default is '';
+ column PGPKey => type is 'text';
column Creator => max_length is 11, type is 'int(11)', default is '0';
column Created => type is 'datetime', default is '';
column LastUpdatedBy => max_length is 11, type is 'int(11)', default is '0';
@@ -1560,12 +1560,12 @@
#If the user wants to see their own values, let them
# TODO figure ouyt a better way to deal with this
- if ( $self->id && $self->current_user->id == $self->id ) {
+ if ( $self->id && $self->current_user && $self->current_user->id == $self->id ) {
return ( $self->SUPER::_value($field) );
}
#If the user has the admin users right, return the field
- elsif ( $self->current_user->has_right(Right =>'AdminUsers', Object => $RT::System) ) {
+ elsif ($self->current_user && $self->current_user->has_right(Right =>'AdminUsers', Object => $RT::System) ) {
return ( $self->SUPER::_value($field) );
}
else {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm Mon Sep 10 17:11:51 2007
@@ -62,11 +62,10 @@
=cut
-
-package RT::Model::UserCollection;
-
+use warnings;
use strict;
-no warnings qw(redefine);
+package RT::Model::UserCollection;
+use base qw/RT::SearchBuilder/;
# {{{ sub _init
sub _init {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Record.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Record.pm Mon Sep 10 17:11:51 2007
@@ -80,7 +80,7 @@
sub new {
my $class = shift;
my $self = $class->SUPER::new(handle => Jifty->handle, current_user => $_[0]);
- $self->current_user(@_);
+ $self->current_user(@_) if (UNIVERSAL::isa($_[0], "RT::CurrentUser"));
$self->_init(@_);
return $self;
}
@@ -269,7 +269,7 @@
# {{{ sub _Handle
sub _Handle { return Jifty->handle }
sub _handle { return Jifty->handle }
-
+
# }}}
# {{{ sub create
@@ -304,9 +304,9 @@
}
- $attribs{'Creator'} ||= $self->current_user->id if $self->can('Creator');
+ $attribs{'Creator'} ||= $self->current_user->id if $self->can('Creator') && $self->current_user;
- my $now = RT::Date->new( $self->current_user );
+ my $now = RT::Date->new( current_user => $self->current_user );
$now->set( Format => 'unix', value => time );
my $id = $self->SUPER::create(%attribs);
@@ -557,7 +557,7 @@
);
( $msg, $val ) = $self->__set(
column => 'LastUpdatedBy',
- value => $self->current_user->id
+ value => $self->current_user ? $self->current_user->id : 0
);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/AutoOpen.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/AutoOpen.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/AutoOpen.pm Mon Sep 10 17:11:51 2007
@@ -46,12 +46,12 @@
#
# END BPS TAGGED BLOCK }}}
# This Action will open the base if a dependent is resolved.
-package RT::Action::AutoOpen;
+package RT::ScripAction::AutoOpen;
use strict;
use warnings;
-use base qw(RT::Action::Generic);
+use base qw(RT::ScripAction::Generic);
=head1 DESCRIPTION
@@ -96,9 +96,9 @@
return 1;
}
-eval "require RT::Action::AutoOpen_Vendor";
+eval "require RT::ScripAction::AutoOpen_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoOpen_Vendor.pm});
-eval "require RT::Action::AutoOpen_Local";
+eval "require RT::ScripAction::AutoOpen_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoOpen_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Autoreply.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/Autoreply.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Autoreply.pm Mon Sep 10 17:11:51 2007
@@ -45,12 +45,12 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::Autoreply;
+package RT::ScripAction::Autoreply;
use strict;
use warnings;
-use base qw(RT::Action::SendEmail);
+use base qw(RT::ScripAction::SendEmail);
=head2 Prepare
@@ -132,9 +132,9 @@
# }}}
-eval "require RT::Action::Autoreply_Vendor";
+eval "require RT::ScripAction::Autoreply_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Vendor.pm});
-eval "require RT::Action::Autoreply_Local";
+eval "require RT::ScripAction::Autoreply_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/CreateTickets.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/CreateTickets.pm Mon Sep 10 17:11:51 2007
@@ -45,19 +45,19 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::CreateTickets;
-require RT::Action::Generic;
+package RT::ScripAction::CreateTickets;
+require RT::ScripAction::Generic;
use strict;
use warnings;
use vars qw/@ISA/;
- at ISA = qw(RT::Action::Generic);
+ at ISA = qw(RT::ScripAction::Generic);
use MIME::Entity;
=head1 NAME
- RT::Action::CreateTickets
+ RT::ScripAction::CreateTickets
Create one or more tickets according to an externally supplied template.
@@ -1237,9 +1237,9 @@
}
-eval "require RT::Action::CreateTickets_Vendor";
+eval "require RT::ScripAction::CreateTickets_Vendor";
die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/CreateTickets_Vendor.pm} );
-eval "require RT::Action::CreateTickets_Local";
+eval "require RT::ScripAction::CreateTickets_Local";
die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/CreateTickets_Local.pm} );
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/EscalatePriority.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/EscalatePriority.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/EscalatePriority.pm Mon Sep 10 17:11:51 2007
@@ -47,7 +47,7 @@
# END BPS TAGGED BLOCK }}}
=head1 NAME
- RT::Action::EscalatePriority
+ RT::ScripAction::EscalatePriority
=head1 DESCRIPTION
@@ -70,12 +70,12 @@
=cut
-package RT::Action::EscalatePriority;
-require RT::Action::Generic;
+package RT::ScripAction::EscalatePriority;
+require RT::ScripAction::Generic;
use strict;
use vars qw/@ISA/;
- at ISA=qw(RT::Action::Generic);
+ at ISA=qw(RT::ScripAction::Generic);
#Do what we need to do and send it out.
@@ -159,9 +159,9 @@
}
}
-eval "require RT::Action::EscalatePriority_Vendor";
+eval "require RT::ScripAction::EscalatePriority_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/EscalatePriority_Vendor.pm});
-eval "require RT::Action::EscalatePriority_Local";
+eval "require RT::ScripAction::EscalatePriority_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/EscalatePriority_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/Generic.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm Mon Sep 10 17:11:51 2007
@@ -47,11 +47,11 @@
# END BPS TAGGED BLOCK }}}
=head1 NAME
- RT::Action::Generic - a generic baseclass for RT Actions
+ RT::ScripAction::Generic - a generic baseclass for RT Actions
=head1 SYNOPSIS
- use RT::Action::Generic;
+ use RT::ScripAction::Generic;
=head1 DESCRIPTION
@@ -60,7 +60,7 @@
=cut
-package RT::Action::Generic;
+package RT::ScripAction::Generic;
use strict;
use Scalar::Util;
@@ -218,9 +218,9 @@
# }}}
-eval "require RT::Action::Generic_Vendor";
+eval "require RT::ScripAction::Generic_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Vendor.pm});
-eval "require RT::Action::Generic_Local";
+eval "require RT::ScripAction::Generic_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Notify.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/Notify.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Notify.pm Mon Sep 10 17:11:51 2007
@@ -46,12 +46,12 @@
#
# END BPS TAGGED BLOCK }}}
#
-package RT::Action::Notify;
+package RT::ScripAction::Notify;
use strict;
use warnings;
-use base qw(RT::Action::SendEmail);
+use base qw(RT::ScripAction::SendEmail);
use Mail::Address;
@@ -158,9 +158,9 @@
}
-eval "require RT::Action::Notify_Vendor";
+eval "require RT::ScripAction::Notify_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Vendor.pm});
-eval "require RT::Action::Notify_Local";
+eval "require RT::ScripAction::Notify_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/NotifyAsComment.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm Mon Sep 10 17:11:51 2007
@@ -45,12 +45,12 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::NotifyAsComment;
-require RT::Action::Notify;
+package RT::ScripAction::NotifyAsComment;
+require RT::ScripAction::Notify;
use strict;
use vars qw/@ISA/;
- at ISA = qw(RT::Action::Notify);
+ at ISA = qw(RT::ScripAction::Notify);
=head2 set_ReturnAddress
@@ -63,16 +63,16 @@
sub set_ReturnAddress {
my $self = shift;
- # Tell RT::Action::SendEmail that this should come
+ # Tell RT::ScripAction::SendEmail that this should come
# from the relevant comment email address.
$self->{'comment'} = 1;
return($self->SUPER::set_ReturnAddress(is_comment => 1));
}
-eval "require RT::Action::NotifyAsComment_Vendor";
+eval "require RT::ScripAction::NotifyAsComment_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Vendor.pm});
-eval "require RT::Action::NotifyAsComment_Local";
+eval "require RT::ScripAction::NotifyAsComment_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/RecordComment.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm Mon Sep 10 17:11:51 2007
@@ -45,21 +45,21 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::RecordComment;
-require RT::Action::Generic;
+package RT::ScripAction::RecordComment;
+require RT::ScripAction::Generic;
use strict;
use vars qw/@ISA/;
- at ISA = qw(RT::Action::Generic);
+ at ISA = qw(RT::ScripAction::Generic);
=head1 NAME
-RT::Action::RecordComment - An Action which can be used from an
+RT::ScripAction::RecordComment - An Action which can be used from an
external tool, or in any situation where a ticket transaction has not
been started, to make a comment on the ticket.
=head1 SYNOPSIS
-my $action_obj = RT::Action::RecordComment->new('TicketObj' => $ticket_obj,
+my $action_obj = RT::ScripAction::RecordComment->new('TicketObj' => $ticket_obj,
'TemplateObj' => $template_obj,
);
my $result = $action_obj->prepare();
@@ -112,9 +112,9 @@
}
-eval "require RT::Action::RecordComment_Vendor";
+eval "require RT::ScripAction::RecordComment_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordComment_Vendor.pm});
-eval "require RT::Action::RecordComment_Local";
+eval "require RT::ScripAction::RecordComment_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordComment_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/RecordCorrespondence.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm Mon Sep 10 17:11:51 2007
@@ -45,21 +45,21 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::RecordCorrespondence;
-require RT::Action::Generic;
+package RT::ScripAction::RecordCorrespondence;
+require RT::ScripAction::Generic;
use strict;
use vars qw/@ISA/;
- at ISA = qw(RT::Action::Generic);
+ at ISA = qw(RT::ScripAction::Generic);
=head1 NAME
-RT::Action::RecordCorrespondence - An Action which can be used from an
+RT::ScripAction::RecordCorrespondence - An Action which can be used from an
external tool, or in any situation where a ticket transaction has not
been started, to make a comment on the ticket.
=head1 SYNOPSIS
-my $action_obj = RT::Action::RecordCorrespondence->new(
+my $action_obj = RT::ScripAction::RecordCorrespondence->new(
'TicketObj' => $ticket_obj,
'TemplateObj' => $template_obj,
);
@@ -113,9 +113,9 @@
}
-eval "require RT::Action::RecordCorrespondence_Vendor";
+eval "require RT::ScripAction::RecordCorrespondence_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordCorrespondence_Vendor.pm});
-eval "require RT::Action::RecordCorrespondence_Local";
+eval "require RT::ScripAction::RecordCorrespondence_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordCorrespondence_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/ResolveMembers.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/ResolveMembers.pm Mon Sep 10 17:11:51 2007
@@ -47,13 +47,13 @@
# END BPS TAGGED BLOCK }}}
# This Action will resolve all members of a resolved group ticket
-package RT::Action::ResolveMembers;
-require RT::Action::Generic;
+package RT::ScripAction::ResolveMembers;
+require RT::ScripAction::Generic;
require RT::Model::LinkCollection;
use strict;
use vars qw/@ISA/;
- at ISA=qw(RT::Action::Generic);
+ at ISA=qw(RT::ScripAction::Generic);
#Do what we need to do and send it out.
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/SendEmail.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm Mon Sep 10 17:11:51 2007
@@ -47,12 +47,12 @@
# END BPS TAGGED BLOCK }}}
# Portions Copyright 2000 Tobias Brox <tobix at cpan.org>
-package RT::Action::SendEmail;
+package RT::ScripAction::SendEmail;
use strict;
use warnings;
-use base qw(RT::Action::Generic);
+use base qw(RT::ScripAction::Generic);
use MIME::Words qw(encode_mimeword);
@@ -63,20 +63,20 @@
=head1 NAME
-RT::Action::SendEmail - An Action which users can use to send mail
+RT::ScripAction::SendEmail - An Action which users can use to send mail
or can subclassed for more specialized mail sending behavior.
-RT::Action::AutoReply is a good example subclass.
+RT::ScripAction::AutoReply is a good example subclass.
=head1 SYNOPSIS
- require RT::Action::SendEmail;
- @ISA = qw(RT::Action::SendEmail);
+ require RT::ScripAction::SendEmail;
+ @ISA = qw(RT::ScripAction::SendEmail);
=head1 DESCRIPTION
-Basically, you create another module RT::Action::YourAction which ISA
-RT::Action::SendEmail.
+Basically, you create another module RT::ScripAction::YourAction which ISA
+RT::ScripAction::SendEmail.
=head1 METHODS
@@ -956,9 +956,9 @@
}
}
-eval "require RT::Action::SendEmail_Vendor";
+eval "require RT::ScripAction::SendEmail_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Vendor.pm});
-eval "require RT::Action::SendEmail_Local";
+eval "require RT::ScripAction::SendEmail_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Local.pm});
=head1 AUTHOR
@@ -967,7 +967,7 @@
=head1 SEE ALSO
-L<RT::Action::Notify>, L<RT::Action::NotifyAsComment> and L<RT::Action::Autoreply>
+L<RT::ScripAction::Notify>, L<RT::ScripAction::NotifyAsComment> and L<RT::ScripAction::Autoreply>
=cut
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/SetPriority.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm Mon Sep 10 17:11:51 2007
@@ -45,12 +45,12 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
-package RT::Action::SetPriority;
-require RT::Action::Generic;
+package RT::ScripAction::SetPriority;
+require RT::ScripAction::Generic;
use strict;
use vars qw/@ISA/;
- at ISA=qw(RT::Action::Generic);
+ at ISA=qw(RT::ScripAction::Generic);
#Do what we need to do and send it out.
@@ -79,9 +79,9 @@
}
-eval "require RT::Action::SetPriority_Vendor";
+eval "require RT::ScripAction::SetPriority_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SetPriority_Vendor.pm});
-eval "require RT::Action::SetPriority_Local";
+eval "require RT::ScripAction::SetPriority_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SetPriority_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm
==============================================================================
--- /rt/branches/3.999-DANGEROUS/lib/RT/Action/UserDefined.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm Mon Sep 10 17:11:51 2007
@@ -47,12 +47,12 @@
# END BPS TAGGED BLOCK }}}
-package RT::Action::UserDefined;
-use RT::Action::Generic;
+package RT::ScripAction::UserDefined;
+use RT::ScripAction::Generic;
use strict;
use vars qw/@ISA/;
- at ISA = qw(RT::Action::Generic);
+ at ISA = qw(RT::ScripAction::Generic);
=head2 Prepare
@@ -86,9 +86,9 @@
return ($retval);
}
-eval "require RT::Action::UserDefined_Vendor";
+eval "require RT::ScripAction::UserDefined_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/UserDefined_Vendor.pm});
-eval "require RT::Action::UserDefined_Local";
+eval "require RT::ScripAction::UserDefined_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/UserDefined_Local.pm});
1;
Modified: rt/branches/3.999-DANGEROUS/lib/t/data/shredder/03plugin_tickets.clean.db
==============================================================================
Binary files. No diff available.
Modified: rt/branches/3.999-DANGEROUS/lib/t/data/shredder/03plugin_tickets.db
==============================================================================
Binary files. No diff available.
Modified: rt/branches/3.999-DANGEROUS/sbin/rt-setup-database
==============================================================================
--- rt/branches/3.999-DANGEROUS/sbin/rt-setup-database (original)
+++ rt/branches/3.999-DANGEROUS/sbin/rt-setup-database Mon Sep 10 17:11:51 2007
@@ -15,7 +15,7 @@
Jifty->new();
use RT;
RT::load_config();
-}
+};
use Term::ReadKey;
use Getopt::Long;
@@ -127,8 +127,6 @@
Jifty->handle->InsertACL( $dbh, $args{'datadir'} ) # unless $db_type eq 'Oracle'
}
elsif ( $action eq 'coredata' ) {
- Jifty->handle = new RT::Handle;
- Jifty->handle->dbh( undef );
RT::connect_to_database();
RT::InitLogging();
RT::InitSystemObjects();
Modified: rt/branches/3.999-DANGEROUS/t/00-compile.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/00-compile.t (original)
+++ rt/branches/3.999-DANGEROUS/t/00-compile.t Mon Sep 10 17:11:51 2007
@@ -25,13 +25,13 @@
require_ok("RT::Model::ScripActionCollection");
require_ok("RT::Model::TransactionCollection");
require_ok("RT::Model::ScripCondition");
-require_ok("RT::Action::Generic");
+require_ok("RT::ScripAction::Generic");
require_ok("RT::Model::ScripConditionCollection");
require_ok("RT::Search::Generic");
require_ok("RT::Search::Generic");
require_ok("RT::Search::Generic");
require_ok("RT::Search::Generic");
-require_ok("RT::Action::SendEmail");
+require_ok("RT::ScripAction::SendEmail");
require_ok("RT::Model::CachedGroupMemberCollection");
require_ok("RT::Condition::Generic");
require_ok("RT::Interface::Web");
Modified: rt/branches/3.999-DANGEROUS/t/api/action-createtickets.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/action-createtickets.t (original)
+++ rt/branches/3.999-DANGEROUS/t/api/action-createtickets.t Mon Sep 10 17:11:51 2007
@@ -11,7 +11,7 @@
undef $main::_STDOUT_;
undef $main::_STDERR_;
-ok (require RT::Action::CreateTickets);
+ok (require RT::ScripAction::CreateTickets);
use_ok('RT::Model::Scrip');
use_ok('RT::Model::Template');
use_ok('RT::Model::ScripAction');
@@ -83,8 +83,8 @@
unlike ($dependson->Subject, qr/{/, "The subject doesn't have braces in it. that means we're interpreting expressions");
is ($t->ReferredToBy->count,1, "It's only referred to by one other ticket");
is ($t->ReferredToBy->first->BaseObj->id,$t->DependsOn->first->TargetObj->id, "The same ticket that depends on it refers to it.");
-use RT::Action::CreateTickets;
-my $action = RT::Action::CreateTickets->new( CurrentUser => $RT::SystemUser);;
+use RT::ScripAction::CreateTickets;
+my $action = RT::ScripAction::CreateTickets->new( CurrentUser => $RT::SystemUser);;
# comma-delimited templates
my $commas = <<"EOF";
Modified: rt/branches/3.999-DANGEROUS/t/cron.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/cron.t (original)
+++ rt/branches/3.999-DANGEROUS/t/cron.t Mon Sep 10 17:11:51 2007
@@ -22,7 +22,7 @@
is($user_obj->Name,'tara');
is ($user_obj->id, $CurrentUser->id);
-# Create our template, which will be used for tests of RT::Action::Record*.
+# Create our template, which will be used for tests of RT::ScripAction::Record*.
my $template_content = 'RT-Send-Cc: tla at example.com
RT-Send-Bcc: jesse at example.com
@@ -77,12 +77,12 @@
# Right. Now test the actions.
-ok(require RT::Action::RecordComment);
-ok(require RT::Action::RecordCorrespondence);
+ok(require RT::ScripAction::RecordComment);
+ok(require RT::ScripAction::RecordCorrespondence);
my ($comment_act, $correspond_act);
-ok($comment_act = RT::Action::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordComment Created");
-ok($correspond_act = RT::Action::RecordCorrespondence->new(TicketObj => $ticket2, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordCorrespondence Created");
+ok($comment_act = RT::ScripAction::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordComment Created");
+ok($correspond_act = RT::ScripAction::RecordCorrespondence->new(TicketObj => $ticket2, TemplateObj => $template_obj, CurrentUser => $CurrentUser), "RecordCorrespondence Created");
ok($comment_act->prepare(), "Comment prepared");
ok($correspond_act->prepare(), "Correspond prepared");
ok($comment_act->commit(), "Comment committed");
@@ -90,7 +90,7 @@
# Now test for loop suppression.
my ($trans, $desc, $transaction) = $ticket2->Comment(MIMEObj => $template_obj->MIMEObj);
-my $bogus_action = RT::Action::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, TransactionObj => $transaction, CurrentUser => $CurrentUser);
+my $bogus_action = RT::ScripAction::RecordComment->new(TicketObj => $ticket1, TemplateObj => $template_obj, TransactionObj => $transaction, CurrentUser => $CurrentUser);
ok(!$bogus_action->prepare(), "Comment aborted to prevent loop");
1;
Modified: rt/branches/3.999-DANGEROUS/t/mail/sendmail.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/mail/sendmail.t (original)
+++ rt/branches/3.999-DANGEROUS/t/mail/sendmail.t Mon Sep 10 17:11:51 2007
@@ -7,7 +7,7 @@
use RT::EmailParser;
use RT::Model::TicketCollection;
-use RT::Action::SendEmail;
+use RT::ScripAction::SendEmail;
my @_outgoing_messages;
my @scrips_fired;
@@ -22,7 +22,7 @@
{
no warnings qw/redefine/;
- sub RT::Action::SendEmail::SendMessage {
+ sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
@@ -190,7 +190,7 @@
sub utf8_redef_sendmessage {
no warnings qw/redefine/;
eval '
- sub RT::Action::SendEmail::SendMessage {
+ sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
@@ -217,7 +217,7 @@
sub iso8859_redef_sendmessage {
no warnings qw/redefine/;
eval '
- sub RT::Action::SendEmail::SendMessage {
+ sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
@@ -250,7 +250,7 @@
# be as much like the mail gateway as possible.
{
no warnings qw/redefine/;
- local *RT::Action::SendEmail::SendMessage = sub { return 1};
+ local *RT::ScripAction::SendEmail::SendMessage = sub { return 1};
%args = (message => $content, queue => 1, action => 'correspond');
RT::Interface::Email::Gateway(\%args);
@@ -293,7 +293,7 @@
sub text_html_umlauts_redef_sendmessage {
no warnings qw/redefine/;
- eval 'sub RT::Action::SendEmail::SendMessage {
+ eval 'sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
return (1) unless ($self->ScripObj->ActionObj->Name eq "Notify AdminCcs" );
@@ -329,7 +329,7 @@
sub text_html_russian_redef_sendmessage {
no warnings qw/redefine/;
- eval 'sub RT::Action::SendEmail::SendMessage {
+ eval 'sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
use Data::Dumper;
@@ -371,7 +371,7 @@
is ($tick->Subject, "\x{442}\x{435}\x{441}\x{442} \x{442}\x{435}\x{441}\x{442}", "Recorded the subject right");
sub text_plain_russian_redef_sendmessage {
no warnings qw/redefine/;
- eval 'sub RT::Action::SendEmail::SendMessage {
+ eval 'sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
return (1) unless ($self->ScripObj->ActionObj->Name eq "Notify AdminCcs" );
@@ -412,7 +412,7 @@
is (count_attachs($tick) , 5 , "Has one attachment, presumably a text-plain and a message RFC 822 and another plain");
sub text_plain_nested_redef_sendmessage {
no warnings qw/redefine/;
- eval 'sub RT::Action::SendEmail::SendMessage {
+ eval 'sub RT::ScripAction::SendEmail::SendMessage {
my $self = shift;
my $MIME = shift;
return (1) unless ($self->ScripObj->ActionObj->Name eq "Notify AdminCcs" );
@@ -439,7 +439,7 @@
# be as much like the mail gateway as possible.
{
no warnings qw/redefine/;
- local *RT::Action::SendEmail::SendMessage = sub { return 1};
+ local *RT::ScripAction::SendEmail::SendMessage = sub { return 1};
%args = (message => $content, queue => 1, action => 'correspond');
RT::Interface::Email::Gateway(\%args);
$tickets = RT::Model::TicketCollection->new($RT::SystemUser);
@@ -464,7 +464,7 @@
# be as much like the mail gateway as possible.
no warnings qw/redefine/;
-local *RT::Action::SendEmail::SendMessage = sub { return 1};
+local *RT::ScripAction::SendEmail::SendMessage = sub { return 1};
%args = (message => $content, queue => 1, action => 'correspond');
RT::Interface::Email::Gateway(\%args);
$tickets = RT::Model::TicketCollection->new($RT::SystemUser);
Modified: rt/branches/3.999-DANGEROUS/t/ticket/batch-upload-csv.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/batch-upload-csv.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/batch-upload-csv.t Mon Sep 10 17:11:51 2007
@@ -5,7 +5,7 @@
use_ok('RT');
use RT::Test;
-use_ok('RT::Action::CreateTickets');
+use_ok('RT::ScripAction::CreateTickets');
my $QUEUE = 'uploadtest-'.$$;
@@ -27,7 +27,7 @@
create-2,$QUEUE,hello,new,root,3.0
EOF
-my $action = RT::Action::CreateTickets->new(CurrentUser => RT::CurrentUser->new('root'));
+my $action = RT::ScripAction::CreateTickets->new(CurrentUser => RT::CurrentUser->new('root'));
ok ($action->current_user->id , "WE have a current user");
$action->Parse(Content => $data);
Modified: rt/branches/3.999-DANGEROUS/t/web/crypt-gnupg.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/crypt-gnupg.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/crypt-gnupg.t Mon Sep 10 17:11:51 2007
@@ -3,7 +3,7 @@
use Test::More tests => 80;
use RT::Test;
-use RT::Action::SendEmail;
+use RT::ScripAction::SendEmail;
eval 'use GnuPG::Interface; 1' or plan skip_all => 'GnuPG required.';
More information about the Rt-commit
mailing list