[Rt-commit] r10795 - in rt/branches/3.999-DANGEROUS: . bin docs etc html/Admin/Elements html/Elements html/Elements/RT__Model__Ticket html/Search/Elements html/Ticket/Elements lib/RT/Condition lib/RT/Model lib/RT/ScripAction lib/RT/Shredder lib/RT/Shredder/Plugin sbin t/api t/mail

jesse at bestpractical.com jesse at bestpractical.com
Sun Feb 10 21:42:03 EST 2008


Author: jesse
Date: Sun Feb 10 21:41:58 2008
New Revision: 10795

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/bin/rt-crontool
   rt/branches/3.999-DANGEROUS/docs/rt3-schema-relationships.dot
   rt/branches/3.999-DANGEROUS/etc/config.yml
   rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrip
   rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrips
   rt/branches/3.999-DANGEROUS/html/Admin/Elements/ListGlobalScrips
   rt/branches/3.999-DANGEROUS/html/Elements/MySupportQueues
   rt/branches/3.999-DANGEROUS/html/Elements/RT__Model__Ticket/ColumnMap
   rt/branches/3.999-DANGEROUS/html/Elements/ShowCustomFields
   rt/branches/3.999-DANGEROUS/html/Search/Elements/PickBasics
   rt/branches/3.999-DANGEROUS/html/Ticket/Elements/PreviewScrips
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Attachment.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldValue.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Link.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomField.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValue.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.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/ScripCondition.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.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/UserDefined.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm
   rt/branches/3.999-DANGEROUS/sbin/rt-dump-database.in
   rt/branches/3.999-DANGEROUS/share/po/cs.po
   rt/branches/3.999-DANGEROUS/share/po/da.po
   rt/branches/3.999-DANGEROUS/share/po/de.po
   rt/branches/3.999-DANGEROUS/share/po/es.po
   rt/branches/3.999-DANGEROUS/share/po/fi.po
   rt/branches/3.999-DANGEROUS/share/po/fr.po
   rt/branches/3.999-DANGEROUS/share/po/he.po
   rt/branches/3.999-DANGEROUS/share/po/hu.po
   rt/branches/3.999-DANGEROUS/share/po/id.po
   rt/branches/3.999-DANGEROUS/share/po/it.po
   rt/branches/3.999-DANGEROUS/share/po/ja.po
   rt/branches/3.999-DANGEROUS/share/po/nl.po
   rt/branches/3.999-DANGEROUS/share/po/no.po
   rt/branches/3.999-DANGEROUS/share/po/pl.po
   rt/branches/3.999-DANGEROUS/share/po/pt_br.po
   rt/branches/3.999-DANGEROUS/share/po/ru.po
   rt/branches/3.999-DANGEROUS/share/po/sv.po
   rt/branches/3.999-DANGEROUS/share/po/tr.po
   rt/branches/3.999-DANGEROUS/share/po/zh_cn.po
   rt/branches/3.999-DANGEROUS/share/po/zh_tw.po
   rt/branches/3.999-DANGEROUS/t/api/action-createtickets.t
   rt/branches/3.999-DANGEROUS/t/api/scrip.t
   rt/branches/3.999-DANGEROUS/t/mail/sendmail.t

Log:
 r27593 at 31b:  jesse | 2008-02-10 21:41:41 -0500
 * Creator -> creator
 * referenceifying much of the schema 
 * minor scrips cleanup


Modified: rt/branches/3.999-DANGEROUS/bin/rt-crontool
==============================================================================
--- rt/branches/3.999-DANGEROUS/bin/rt-crontool	(original)
+++ rt/branches/3.999-DANGEROUS/bin/rt-crontool	Sun Feb 10 21:41:58 2008
@@ -138,7 +138,7 @@
 
     # perform some more advanced check
     if ($condition) {
-        my $condition_obj = $condition->new(
+        my $scrip_condition = $condition->new(
             transaction_obj => $transaction,
             ticket_obj      => $ticket,
             scrip_obj       => $void_scrip,
@@ -149,12 +149,12 @@
 
         # if the condition doesn't apply, get out of here
 
-        next unless ( $condition_obj->is_applicable );
+        next unless ( $scrip_condition->is_applicable );
         print _("Condition matches...") if ($verbose);
     }
 
     #prepare our action
-    my $action_obj = $action->new(
+    my $scrip_action = $action->new(
         ticket_obj      => $ticket,
         transaction_obj => $transaction,
         template_obj    => $template_obj,
@@ -165,11 +165,11 @@
     );
 
     #if our preparation, move onto the next ticket
-    next unless ( $action_obj->prepare );
+    next unless ( $scrip_action->prepare );
     print _("Action prepared...") if ($verbose);
 
     #commit our action.
-    next unless ( $action_obj->commit );
+    next unless ( $scrip_action->commit );
     print _("Action committed.\n") if ($verbose);
 }
 

Modified: rt/branches/3.999-DANGEROUS/docs/rt3-schema-relationships.dot
==============================================================================
--- rt/branches/3.999-DANGEROUS/docs/rt3-schema-relationships.dot	(original)
+++ rt/branches/3.999-DANGEROUS/docs/rt3-schema-relationships.dot	Sun Feb 10 21:41:58 2008
@@ -12,7 +12,7 @@
 ];
 
 "Records" [shape = record, fontsize = 18, label = "(Any RT::Record)" ];
-"Records" -> "Principals" [label = "Creator -> id"];
+"Records" -> "Principals" [label = "creator -> id"];
 "ACL" [shape = record, fontsize = 18, label = "<col0> \N " ];
 "ACL" -> "Principals" [label="principal_id -> id"];
 "ACL" -> "Principals" [label="DelegatedBy -> id"];

Modified: rt/branches/3.999-DANGEROUS/etc/config.yml
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/config.yml	(original)
+++ rt/branches/3.999-DANGEROUS/etc/config.yml	Sun Feb 10 21:41:58 2008
@@ -8,7 +8,7 @@
   Database: 
     CheckSchema: 0
     Database: rt4
-    Driver: SQLite
+    Driver: mysql
     Host: localhost
     password: ''
     RecordBaseClass: Jifty::DBI::Record::Cachable

Modified: rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrip
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrip	(original)
+++ rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrip	Sun Feb 10 21:41:58 2008
@@ -61,13 +61,13 @@
 <tr><td align="right"><&|/l&>Condition</&>:</td><td>
 <& /Admin/Elements/SelectScripCondition,
     name => "Scrip-$id-scrip_condition",
-    Default => $ARGS{"Scrip-$id-scrip_condition"} || $scrip->condition_obj->id,
+    Default => $ARGS{"Scrip-$id-scrip_condition"} || $scrip->scrip_condition->id,
 &></td></tr>
 
 <tr><td align="right"><&|/l&>Action</&>:</td><td>
 <& /Admin/Elements/SelectScripAction,
     name => "Scrip-$id-scrip_action",
-    Default => $ARGS{"Scrip-$id-scrip_action"} || $scrip->action_obj->id,
+    Default => $ARGS{"Scrip-$id-scrip_action"} || $scrip->scrip_action->id,
 &></td></tr>
 
 <tr><td align="right"><&|/l&>Template</&>:</td><td>

Modified: rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrips
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrips	(original)
+++ rt/branches/3.999-DANGEROUS/html/Admin/Elements/EditScrips	Sun Feb 10 21:41:58 2008
@@ -64,7 +64,7 @@
 </td>
 <td>
 <a href="Scrip.html?id=<%$scrip->id%>&queue=<%$id%>"><% $scrip->description || "<i>("._('no value').")</i>" |n %></a><br />
-<small><&|/l, _($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name) &>%1 %2 with template %3</&></small>
+<small><&|/l, _($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name) &>%1 %2 with template %3</&></small>
 </td>
 </tr>
 %   }

Modified: rt/branches/3.999-DANGEROUS/html/Admin/Elements/ListGlobalScrips
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Admin/Elements/ListGlobalScrips	(original)
+++ rt/branches/3.999-DANGEROUS/html/Admin/Elements/ListGlobalScrips	Sun Feb 10 21:41:58 2008
@@ -62,7 +62,7 @@
 <i>(<&|/l, $scrip->id&>Scrip #%1</&>)</i>
 % }
 </a><br />
-<small><&|/l, _($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name) &>%1 %2 with template %3</&></small>
+<small><&|/l, _($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name) &>%1 %2 with template %3</&></small>
 </li>
 %   }
 

Modified: rt/branches/3.999-DANGEROUS/html/Elements/MySupportQueues
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Elements/MySupportQueues	(original)
+++ rt/branches/3.999-DANGEROUS/html/Elements/MySupportQueues	Sun Feb 10 21:41:58 2008
@@ -48,7 +48,7 @@
 <&|/Widgets/TitleBox, title => _("Queues I'm an AdminCc for"), bodyclass => "" &>
 <& /Elements/QueueSummary,
    cache => 'my_support_queues',
-   queue_filter => sub  { $_->is_admin_cc(Jifty->web->current_user->id) },
+   queue_filter => sub  { $_->is_watcher( role => 'admin_cc', principal_id => Jifty->web->current_user->id) },
    conditions => [ {cond => "Status = 'new'",  name => _('new')  },
 		   {cond => "Status = 'open'", name => _('open') }] &>
 </&>

Modified: rt/branches/3.999-DANGEROUS/html/Elements/RT__Model__Ticket/ColumnMap
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Elements/RT__Model__Ticket/ColumnMap	(original)
+++ rt/branches/3.999-DANGEROUS/html/Elements/RT__Model__Ticket/ColumnMap	Sun Feb 10 21:41:58 2008
@@ -293,7 +293,7 @@
             my $values = $_[0]->custom_field_values( $_[-1] );
             my @values = map {
                 (
-                    ($_->custom_field_obj->type eq 'Image')
+                    ($_->custom_field->type eq 'Image')
                         ? \($m->scomp( '/Elements/ShowCustomFieldImage', object => $_ ))
                         : $_->content
                 ),

Modified: rt/branches/3.999-DANGEROUS/html/Elements/ShowCustomFields
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Elements/ShowCustomFields	(original)
+++ rt/branches/3.999-DANGEROUS/html/Elements/ShowCustomFields	Sun Feb 10 21:41:58 2008
@@ -80,6 +80,8 @@
         $m->out('<a href="'. $value->link_value_to .'" target="_new">');
     }
     my $comp = "ShowCustomField". $cf->type;
+Jifty->log->debug("$comp");
+Jifty->log->debug($cf->id);
     $m->callback(
         Callbackname => 'ShowComponentname',
         name         => \$comp,

Modified: rt/branches/3.999-DANGEROUS/html/Search/Elements/PickBasics
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Search/Elements/PickBasics	(original)
+++ rt/branches/3.999-DANGEROUS/html/Search/Elements/PickBasics	Sun Feb 10 21:41:58 2008
@@ -112,7 +112,7 @@
             type    => 'select',
             options => [
                 owner => _('Owner'),
-                creator => _('Creator'),
+                creator => _('creator'),
                 last_updated_by => _('Last updated by'),
             ],
         },

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	Sun Feb 10 21:41:58 2008
@@ -61,12 +61,12 @@
 <i><&|/l&>(Check boxes to disable notifications to the listed recipients)</&></i><br />
 
 % foreach my $scrip (@{$object->scrips->prepared}) {
-% next unless $scrip->action_obj->action->isa('RT::ScripAction::SendEmail');
+% next unless $scrip->scrip_action->action->isa('RT::ScripAction::SendEmail');
 <b><% $scrip->description || _('Scrip #%1',$scrip->id) %></b><br />
-<&|/l, _($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name)&>%1 %2 with template %3</&>
+<&|/l, _($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name)&>%1 %2 with template %3</&>
 <br />
 %foreach my $type qw(to cc bcc) {
-%my @addresses =  $scrip->action_obj->action->$type();
+%my @addresses =  $scrip->scrip_action->action->$type();
 <ul>
 %foreach my $addr (@addresses) {
 <li> <b><%_($type)%></b>: <input type="checkbox" class="checkbox" name="Ticket-<%$ticket_obj->id%>-SquelchMailTo" value="<%$addr->address%>" /> <%$addr->address%>
@@ -75,7 +75,7 @@
 % }
 % if (RT->config->get('PreviewScripMessages')) {
 <textarea cols="80" rows="5">
-<%$scrip->action_obj->template_obj->mime_obj->as_string%>
+<%$scrip->scrip_action->template_obj->mime_obj->as_string%>
 </textarea>
 % }
 % }
@@ -178,7 +178,7 @@
 
 my @recipients;
 foreach my $scrip ( @{ $txn->scrips->prepared } ) {
-    my $action = $scrip->action_obj->action;
+    my $action = $scrip->scrip_action->action;
     next unless $action->isa('RT::ScripAction::SendEmail');
 
     foreach my $type qw(to cc bcc) {
@@ -223,7 +223,7 @@
 
 my @recipients;
 foreach my $scrip ( @{ $txn->scrips->prepared } ) {
-    my $action = $scrip->action_obj->action;
+    my $action = $scrip->scrip_action->action;
     next unless $action->isa('RT::ScripAction::SendEmail');
 
     foreach my $type qw(to cc bcc) {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm	Sun Feb 10 21:41:58 2008
@@ -82,7 +82,6 @@
 
 use base qw/RT::Base/;
 
-# {{{ sub new
 sub new {
     my $proto = shift;
     my $class = ref($proto) || $proto;
@@ -93,9 +92,6 @@
     return $self;
 }
 
-# }}}
-
-# {{{ sub _init
 sub _init {
     my $self = shift;
     my %args = (
@@ -113,13 +109,12 @@
     $self->{'ticket_obj'}           = $args{'ticket_obj'};
     $self->{'transaction_obj'}      = $args{'transaction_obj'};
     $self->{'applicable_trans_types'} = $args{'applicable_trans_types'};
+    Jifty->log->debug( "My trans type is ".$self->{'applicable_trans_types'} );
 }
 
-# }}}
 
 # Access Scripwide data
 
-# {{{ sub argument
 
 =head2 argument
 
@@ -132,10 +127,6 @@
     return ( $self->{'argument'} );
 }
 
-# }}}
-
-# {{{ sub ticket_obj
-
 =head2 ticket_obj
 
 Return the ticket object we're talking about
@@ -147,10 +138,6 @@
     return ( $self->{'ticket_obj'} );
 }
 
-# }}}
-
-# {{{ sub scrip_obj
-
 =head2 scrip_obj
 
 Return the Scrip object we're talking about
@@ -162,9 +149,6 @@
     return ( $self->{'scrip_obj'} );
 }
 
-# }}}
-# {{{ sub transaction_obj
-
 =head2 transaction_obj
 
 Return the transaction object we're talking about
@@ -176,10 +160,6 @@
     return ( $self->{'transaction_obj'} );
 }
 
-# }}}
-
-# {{{ sub Type
-
 =head2 type 
 
 
@@ -191,49 +171,35 @@
     return ( $self->{'applicable_trans_types'} );
 }
 
-# }}}
-
 # Scrip methods
 
 #What does this type of Action does
 
-# {{{ sub Describe
 sub describe {
     my $self = shift;
     return ( _( "No description for %1", ref $self ) );
 }
 
-# }}}
 
 #Parse the templates, get things ready to go.
 
 #If this rule applies to this transaction, return true.
 
-# {{{ sub IsApplicable
 sub is_applicable {
     my $self = shift;
     return (undef);
 }
 
-# }}}
-
-# {{{ sub DESTROY
 sub DESTROY {
     my $self = shift;
 
     # We need to clean up all the references that might maybe get
     # oddly circular
-    $self->{'template_obj'} = undef $self->{'ticket_obj'} = undef;
+    $self->{'template_obj'} = undef;
+    $self->{'ticket_obj'} = undef;
     $self->{'transaction_obj'} = undef;
     $self->{'scrip_obj'}       = undef;
 
 }
 
-# }}}
-
-eval "require RT::Condition::Generic_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Vendor.pm} );
-eval "require RT::Condition::Generic_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Local.pm} );
-
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Condition/UserDefined.pm	Sun Feb 10 21:41:58 2008
@@ -46,13 +46,11 @@
 #
 # END BPS TAGGED BLOCK }}}
 
-package RT::Condition::UserDefined;
-
-use RT::Condition::Generic;
-
 use strict;
-use vars qw/@ISA/;
- at ISA = qw(RT::Condition::Generic);
+use warnings;
+
+package RT::Condition::UserDefined;
+use base qw(RT::Condition::Generic);
 
 =head2 IsApplicable
 
@@ -62,20 +60,15 @@
 
 sub is_applicable {
     my $self   = shift;
+
+
     my $retval = eval $self->scrip_obj->custom_is_applicable_code;
     if ($@) {
-        Jifty->log->error(
-            "Scrip " . $self->scrip_obj->id . " IsApplicable failed: " . $@ );
+        Jifty->log->error( "Scrip " . $self->scrip_obj->id . " is_applicable failed: " . $@ );
         return (undef);
     }
     return ($retval);
 }
 
-eval "require RT::Condition::UserDefined_Vendor";
-die $@
-    if ( $@ && $@ !~ qr{^Can't locate RT/Condition/UserDefined_Vendor.pm} );
-eval "require RT::Condition::UserDefined_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Condition/UserDefined_Local.pm} );
-
 1;
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ACE.pm	Sun Feb 10 21:41:58 2008
@@ -78,16 +78,12 @@
     column
         principal_type => max_length is 25,
         type is 'varchar(25)', default is '';
-    column principal_id => type is 'int', default is '0';
-    column
-        right_name => max_length is 25,
-        type is 'varchar(25)', default is '';
-    column
-        object_type => max_length is 25,
-        type is 'varchar(25)', default is '';
+    column principal_id => references RT::Model::Principal;
+    column right_name => max_length is 25, type is 'varchar(25)', default is '';
+    column object_type => max_length is 25, type is 'varchar(25)', default is '';
     column object_id     => type is 'int', default is '0';
-    column delegated_by   => type is 'int', default is '0';
-    column delegated_from => type is 'int', default is '0';
+    column delegated_by   => references RT::Model::Principal;
+    column delegated_from => references RT::Model::ACE;
 };
 
 use vars qw (

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Attachment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Attachment.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Attachment.pm	Sun Feb 10 21:41:58 2008
@@ -31,27 +31,16 @@
 use base 'RT::Record';
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
-    column
-        transaction_id => max_length is 11,
-        type is 'int', default is '0';
-    column
-        message_id => max_length is 200,
-        type is 'varchar(200)', default is '';
-    column parent => max_length is 11, type is 'int', default is '0';
-    column
-        content_type => max_length is 200,
-        type is 'varchar(200)', default is '';
-    column
-        filename => max_length is 255,
-        type is 'varchar(255)', default is '';
-    column
-        subject => max_length is 255,
-        type is 'varchar(255)', default is '';
-
+    column transaction_id => references RT::Model::Transaction;
+    column message_id => max_length is 200, type is 'varchar(200)', default is '';
+    column parent => references RT::Model::Attachment;
+    column content_type => max_length is 200, type is 'varchar(200)', default is '';
+    column filename => max_length is 255, type is 'varchar(255)', default is '';
+    column subject => max_length is 255, type is 'varchar(255)', default is '';
     column content         => type is 'blob', default is '';
     column content_encoding => type is 'blob', default is '';
     column headers         => type is 'blob', default is '';
-    column creator => max_length is 11, type is 'int', default is '0';
+    column creator => references RT::Model::Principal;
     column created => type is 'timestamp';
 
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm	Sun Feb 10 21:41:58 2008
@@ -61,15 +61,9 @@
 use Jifty::DBI::Record schema {
     column object_id => max_length is 11, type is 'int', default is '0';
     column name => max_length is 200, type is 'varchar(200)', default is '';
-    column
-        object_type => max_length is 200,
-        type is 'varchar(200)', default is '';
-    column
-        description => max_length is 255,
-        type is 'varchar(255)', default is '';
-    column
-        content_type => max_length is 255,
-        type is 'varchar(255)', default is '';
+    column object_type => max_length is 200, type is 'varchar(200)', default is '';
+    column description => max_length is 255, type is 'varchar(255)', default is '';
+    column content_type => max_length is 255, type is 'varchar(255)', default is '';
     column content => type is 'blob', default is '';
 
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm	Sun Feb 10 21:41:58 2008
@@ -9,9 +9,9 @@
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
     column group_id           => references RT::Model::Group;
-    column member_id          => type is 'integer';
-    column via               => type is 'integer';
-    column immediate_parent_id => type is 'integer';
+    column member_id          => references RT::Model::Principal;
+    column via               => references RT::Model::CachedGroupMember;
+    column immediate_parent_id => references RT::Model::CachedGroupMember;
     column disabled          => type is 'integer', default is '0';
 
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomField.pm	Sun Feb 10 21:41:58 2008
@@ -67,18 +67,12 @@
     column max_values => max_length is 11, type is 'int', default is '0';
     column pattern => type is 'text', default is '';
     column repeated => max_length is 6, type is 'smallint', default is '0';
-    column
-        description => max_length is 255,
-        type is 'varchar(255)', default is '';
+    column description => max_length is 255, type is 'varchar(255)', default is '';
     column sort_order => max_length is 11, type is 'int', default is '0';
-    column
-        lookup_type => max_length is 255,
-        type is 'varchar(255)', default is '';
-    column creator => max_length is 11, type is 'int', default is '0';
+    column lookup_type => max_length is 255, type is 'varchar(255)', default is '';
+    column creator => references RT::Model::Principal;
     column created => type is 'timestamp';
-    column
-        last_updated_by => max_length is 11,
-        type is 'int', default is '0';
+    column last_updated_by => references RT::Model::Principal;
     column last_updated => type is 'timestamp';
     column disabled => max_length is 6, type is 'smallint', default is '0';
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldValue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldValue.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CustomFieldValue.pm	Sun Feb 10 21:41:58 2008
@@ -48,28 +48,20 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
-use warnings;
-use strict;
 
 package RT::Model::CustomFieldValue;
-
-no warnings qw/redefine/;
 use base qw/RT::Record/;
 sub table {'CustomFieldValues'}
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
-    column creator => type is 'int', max_length is 11, default is '0';
-    column
-        last_updated_by => type is 'int',
-        max_length is 11, default is '0';
+    column creator => references RT::Model::User;
+    column last_updated_by => references RT::Model::User;
     column sort_order   => type is 'int', max_length is 11, default is '0';
     column custom_field => type is 'int', max_length is 11, default is '0';
     column created     => type is 'timestamp';
     column last_updated => type is 'timestamp';
     column name => type is 'varchar(200)', max_length is 200, default is '';
-    column
-        description => type is 'varchar(255)',
-        max_length is 255, default is '';
+    column description => type is 'varchar(255)', max_length is 255, default is '';
 
 };
 
@@ -91,10 +83,7 @@
         @_,
     );
 
-    my $cf_id
-        = ref $args{'custom_field'}
-        ? $args{'custom_field'}->id
-        : $args{'custom_field'};
+    my $cf_id = ref $args{'custom_field'} ? $args{'custom_field'}->id : $args{'custom_field'};
 
     my $cf = RT::Model::CustomField->new;
     $cf->load($cf_id);

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm	Sun Feb 10 21:41:58 2008
@@ -35,8 +35,8 @@
 
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
-    column group_id  => type is 'integer';
-    column member_id => type is 'integer';
+    column group_id  => references RT::Model::Group;
+    column member_id => references RT::Model::Principal;
 
 };
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Link.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Link.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Link.pm	Sun Feb 10 21:41:58 2008
@@ -73,18 +73,18 @@
 use strict;
 no warnings qw(redefine);
 sub table {'Links'}
+
+
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
     column target => type is 'varchar(240)', max_length is 240, default is '';
     column base   => type is 'varchar(240)', max_length is 240, default is '';
-    column local_target => type is 'int', max_length is 11, default is '0';
-    column creator     => type is 'int', max_length is 11, default is '0';
+    column local_base => type is 'int';#references RT::Model::Ticket;
+    column local_target =>  type is 'int';#references RT::Model::Ticket;
+    column creator     =>  references RT::Model::User;
     column type => type is 'varchar(20)', max_length is 20, default is '';
-    column
-        last_updated_by => type is 'int',
-        max_length is 11, default is '0';
+    column last_updated_by => references RT::Model::User;
     column created => type is 'timestamp';
-    column local_base => type is 'int', max_length is 11, default is '0';
     column last_updated => type is 'timestamp';
 
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomField.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomField.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomField.pm	Sun Feb 10 21:41:58 2008
@@ -50,21 +50,19 @@
 # END BPS TAGGED BLOCK }}}
 
 package RT::Model::ObjectCustomField;
-
-no warnings qw(redefine);
-
 use base qw/RT::Record/;
+
 sub table {'ObjectCustomFields'}
+
+
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
-    column custom_field => type is 'int', max_length is 11, default is '0';
-    column creator     => type is 'int', max_length is 11, default is '0';
+    column custom_field => references RT::Model::CustomField;
     column object_id   => type is 'int', max_length is 11, default is '0';
-    column
-        last_updated_by => type is 'int',
-        max_length is 11, default is '0';
     column sort_order => type is 'int', max_length is 11, default is '0';
+    column creator     => references RT::Model::User;
     column created     => type is 'timestamp';
+    column last_updated_by => references RT::Model::User;
     column last_updated => type is 'timestamp';
 
 };

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValue.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ObjectCustomFieldValue.pm	Sun Feb 10 21:41:58 2008
@@ -57,42 +57,22 @@
 sub table {'ObjectCustomFieldValues'}
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
-    column
-        content_type => type is 'varchar(80)',
-        max_length is 80, default is '';
+    column content_type => type is 'varchar(80)', max_length is 80, default is '';
     column large_content => type is 'blob', default is '';
-    column Creator => type is 'int', max_length is 11, default is '0';
+    column creator => references RT::Model::User;
     column object_id => type is 'int', max_length is 11, default is '0';
-    column
-        last_updated_by => type is 'int',
-        max_length is 11, default is '0';
+    column last_updated_by => references RT::Model::User;
     column disabled => type is 'smallint', max_length is 6, default is '0';
     column sort_order => type is 'int', max_length is 11, default is '0';
     column Created => type is 'timestamp';
-    column custom_field => type is 'int', max_length is 11, default is '0';
-    column
-        content => type is 'varchar(255)',
-        max_length is 255, default is '';
-    column
-        content_encoding => type is 'varchar(80)',
-        max_length is 80, default is '';
+    column custom_field => references RT::Model::CustomField;
+    column content => type is 'varchar(255)', max_length is 255, default is '';
+    column content_encoding => type is 'varchar(80)', max_length is 80, default is '';
     column last_updated => type is 'timestamp';
-    column
-        object_type => type is 'varchar(255)',
-        max_length is 255, default is '';
+    column object_type => type is 'varchar(255)', max_length is 255, default is '';
 
 };
 
-sub custom_field_obj {
-
-    my $self = shift;
-    unless ( $self->{cf} ) {
-        $self->{cf} = RT::Model::CustomField->new;
-        $self->{cf}->load( $self->custom_field );
-    }
-    return $self->{cf};
-}
-
 sub create {
     my $self = shift;
     my %args = (
@@ -271,7 +251,7 @@
 sub link_value_to {
     my $self = shift;
     return $self->_fill_in_template_url(
-        $self->custom_field_obj->link_value_to );
+        $self->custom_field->link_value_to );
 }
 
 =head2 ValueIncludeURL
@@ -285,7 +265,7 @@
 sub include_content_for_value {
     my $self = shift;
     return $self->_fill_in_template_url(
-        $self->custom_field_obj->include_content_for_value );
+        $self->custom_field->include_content_for_value );
 }
 
 1;

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	Sun Feb 10 21:41:58 2008
@@ -47,18 +47,18 @@
 # END BPS TAGGED BLOCK }}}
 #
 
-package RT::Model::Principal;
-
 use strict;
 use warnings;
 
+package RT::Model::Principal;
+use base qw/RT::Record/;
+
+
 use Cache::Simple::TimedExpiry;
 
-use RT;
 use RT::Model::Group;
 use RT::Model::User;
 
-use base qw/RT::Record/;
 
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
@@ -134,7 +134,7 @@
         } else {
             return (undef);
         }
-        $self->{'object'}->load( $self->object_id() );
+        $self->{'object'}->load( $self->id() );
     }
     return ( $self->{'object'} );
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Queue.pm	Sun Feb 10 21:41:58 2008
@@ -66,10 +66,9 @@
 
 =cut
 
-package RT::Model::Queue;
-
+use warnings;
 use strict;
-no warnings qw(redefine);
+package RT::Model::Queue;
 
 use RT::Model::GroupCollection;
 use RT::Model::ACECollection;
@@ -83,29 +82,15 @@
 use Jifty::DBI::Record schema {
 
     column name => max_length is 200, type is 'varchar(200)', default is '';
-    column
-        description => max_length is 255,
-        type is 'varchar(255)', default is '';
-    column
-        correspond_address => max_length is 120,
-        type is 'varchar(120)', default is '';
-    column
-        comment_address => max_length is 120,
-        type is 'varchar(120)', default is '';
-    column
-        initial_priority => max_length is 11,
-        type is 'int', default is '0';
-    column
-        final_priority => max_length is 11,
-        type is 'int', default is '0';
-    column
-        default_due_in => max_length is 11,
-        type is 'int', default is '0';
-    column Creator => max_length is 11, type is 'int', default is '0';
+    column description => max_length is 255, type is 'varchar(255)', default is '';
+    column correspond_address => max_length is 120, type is 'varchar(120)', default is '';
+    column comment_address => max_length is 120, type is 'varchar(120)', default is '';
+    column initial_priority => max_length is 11, type is 'int', default is '0';
+    column final_priority => max_length is 11, type is 'int', default is '0';
+    column default_due_in => max_length is 11, type is 'int', default is '0';
+    column creator => references RT::Model::User;
     column Created => type is 'timestamp';
-    column
-        last_updated_by => max_length is 11,
-        type is 'int', default is '0';
+    column last_updated_by => references RT::Model::User;
     column last_updated => type is 'timestamp';
     column disabled => max_length is 6, type is 'smallint', default is '0';
 };
@@ -1009,7 +994,7 @@
     my $self = shift;
 
     my %args = (
-        type         => 'Cc',
+        type         => 'cc',
         principal_id => undef,
         @_
     );
@@ -1034,46 +1019,6 @@
 
 # }}}
 
-# {{{ sub IsCc
-
-=head2 IsCc PRINCIPAL_ID
-
-Takes an RT::Model::Principal id.
-Returns true if the principal is a requestor of the current queue.
-
-
-=cut
-
-sub is_cc {
-    my $self = shift;
-    my $cc   = shift;
-
-    return ( $self->is_watcher( type => 'Cc', principal_id => $cc ) );
-
-}
-
-# }}}
-
-# {{{ sub is_admin_cc
-
-=head2 is_admin_cc PRINCIPAL_ID
-
-Takes an RT::Model::Principal id.
-Returns true if the principal is a requestor of the current queue.
-
-=cut
-
-sub is_admin_cc {
-    my $self   = shift;
-    my $person = shift;
-
-    return (
-        $self->is_watcher( type => 'admin_cc', principal_id => $person ) );
-
-}
-
-# }}}
-
 # }}}
 
 # }}}

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	Sun Feb 10 21:41:58 2008
@@ -72,10 +72,10 @@
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
 
-    column queue          => type is 'int';
-    column template       => type is 'int';
-    column scrip_action    => type is 'int';
-    column scrip_condition => type is 'int';
+    column queue          => references RT::Model::Queue;
+    column template       => references RT::Model::Template;
+    column scrip_action    => references RT::Model::ScripAction;
+    column scrip_condition =>  references RT::Model::ScripCondition;
     column stage => type is 'varchar(32)', default is 'TransactionCreate';
     column description            => type is 'text';
     column custom_prepare_code      => type is 'text';
@@ -83,7 +83,6 @@
     column custom_is_applicable_code => type is 'text';
 };
 
-# {{{ sub create
 
 =head2 Create
 
@@ -144,9 +143,7 @@
         $args{'queue'} = $queue_obj->id;
     }
 
-    #TODO +++ validate input
 
-    require RT::Model::ScripAction;
     return ( 0, _("Action is mandatory argument") )
         unless $args{'scrip_action'};
     my $action = RT::Model::ScripAction->new;
@@ -189,9 +186,18 @@
     }
 }
 
-# }}}
 
-# {{{ sub delete
+sub scrip_action {
+    my $self = shift;
+    Jifty->log->debug("loading scripaction ".$self->__value('scrip_action'));
+    # jfity returns a new object each time you call the accessor. I'm not sure that's right, but it blows our behaviour
+    unless ($self->{'scrip_action'}) {
+            $self->{'scrip_action'} = RT::Model::ScripAction->new();
+            $self->{'scrip_action'}->load( $self->_value('scrip_action'), $self->_value('template'));
+        }
+    return $self->{'scrip_action'};
+
+}
 
 =head2 Delete
 
@@ -209,9 +215,6 @@
     return ( $self->SUPER::delete(@_) );
 }
 
-# }}}
-
-# {{{ sub queue_obj
 
 =head2 queue_obj
 
@@ -230,54 +233,6 @@
     return ( $self->{'queue_obj'} );
 }
 
-# }}}
-
-# {{{ sub action_obj
-
-=head2 action_obj
-
-Retuns an RT::ScripAction object with this Scrip\'s Action
-
-=cut
-
-sub action_obj {
-    my $self = shift;
-
-    unless ( defined $self->{'scrip_action_obj'} ) {
-        require RT::Model::ScripAction;
-
-        $self->{'scrip_action_obj'} = RT::Model::ScripAction->new;
-
-        #TODO: why are we loading Actions with templates like this.
-        # two separate methods might make more sense
-        $self->{'scrip_action_obj'}
-            ->load( $self->scrip_action, $self->template );
-    }
-    return ( $self->{'scrip_action_obj'} );
-}
-
-# }}}
-
-# {{{ sub condition_obj
-
-=head2 condition_obj
-
-Retuns an L<RT::Model::ScripCondition> object with this Scrip's is_applicable
-
-=cut
-
-sub condition_obj {
-    my $self = shift;
-
-    my $res = RT::Model::ScripCondition->new;
-    $res->load( $self->scrip_condition );
-    return $res;
-}
-
-# }}}
-
-# {{{ sub template_obj
-
 =head2 template_obj
 
 Retuns an L<RT::Model::Template> object with this Scrip\'s template
@@ -290,16 +245,11 @@
     unless ( defined $self->{'template_obj'} ) {
         require RT::Model::Template;
         $self->{'template_obj'} = RT::Model::Template->new;
-        $self->{'template_obj'}->load( $self->template );
+        $self->{'template_obj'}->load( $self->template->id );
     }
     return ( $self->{'template_obj'} );
 }
 
-# }}}
-
-# {{{ Dealing with this instance of a scrip
-
-# {{{ sub Apply
 
 =head2 Apply { ticket_obj => undef, transaction_obj => undef}
 
@@ -325,66 +275,32 @@
         @_
     );
 
-    Jifty->log->debug( "Now applying scrip "
-            . $self->id
-            . " for transaction "
-            . $args{'transaction_obj'}->id );
-
-    my $Applicabletransaction_obj = $self->is_applicable(
-        ticket_obj      => $args{'ticket_obj'},
-        transaction_obj => $args{'transaction_obj'}
-    );
-    unless ($Applicabletransaction_obj) {
+    Jifty->log->debug( "Now applying scrip " . $self->id . " for transaction " . $args{'transaction_obj'}->id ); 
+    my $applicable_trans = $self->is_applicable( ticket_obj      => $args{'ticket_obj'}, transaction_obj => $args{'transaction_obj'});
+    unless ($applicable_trans) {
         return undef;
     }
 
-    if ( $Applicabletransaction_obj->id != $args{'transaction_obj'}->id ) {
-        Jifty->log->debug( "Found an applicable transaction "
-                . $Applicabletransaction_obj->id
-                . " in the same batch with transaction "
-                . $args{'transaction_obj'}->id );
+    if ( $applicable_trans->id != $args{'transaction_obj'}->id ) {
+        Jifty->log->debug( "Found an applicable transaction " . $applicable_trans->id . " in the same batch with txn " . $args{'transaction_obj'}->id );
     }
 
     #If it's applicable, prepare and commit it
-    Jifty->log->debug( "Now preparing scrip "
-            . $self->id
-            . " for transaction "
-            . $Applicabletransaction_obj->id );
-    unless (
-        $self->prepare(
-            ticket_obj      => $args{'ticket_obj'},
-            transaction_obj => $Applicabletransaction_obj
-        )
-        )
-    {
+    Jifty->log->debug( "Now preparing scrip " . $self->id . " for transaction " . $applicable_trans->id );
+    unless ( $self->prepare( ticket_obj      => $args{'ticket_obj'}, transaction_obj => $applicable_trans)) {
         return undef;
     }
 
-    Jifty->log->debug( "Now commiting scrip "
-            . $self->id
-            . " for transaction "
-            . $Applicabletransaction_obj->id );
-    unless (
-        $self->commit(
-            ticket_obj      => $args{'ticket_obj'},
-            transaction_obj => $Applicabletransaction_obj
-        )
-        )
-    {
+    Jifty->log->debug( "Now commiting scrip " . $self->id . " for transaction " . $applicable_trans->id );
+    unless ( $self->commit( ticket_obj      => $args{'ticket_obj'}, transaction_obj => $applicable_trans)) {
         return undef;
     }
 
-    Jifty->log->debug( "We actually finished scrip "
-            . $self->id
-            . " for transaction "
-            . $Applicabletransaction_obj->id );
+    Jifty->log->debug( "We actually finished scrip " . $self->id . " for transaction " . $applicable_trans->id );
     return (1);
 
 }
 
-# }}}
-
-# {{{ sub is_applicable
 
 =head2 is_applicable
 
@@ -413,6 +329,7 @@
     my $return;
     eval {
 
+        Jifty->log->debug("In the eval for stage ". $self->stage);
         my @Transactions;
 
         if ( $self->stage eq 'TransactionCreate' ) {
@@ -427,34 +344,38 @@
             Jifty->log->error( "Unknown Scrip stage:" . $self->stage );
             return (undef);
         }
-        my $ConditionObj = $self->condition_obj;
         foreach my $transaction_obj (@Transactions) {
 
-  # in TxnBatch stage we can select scrips that are not applicable to all txns
-            my $txn_type = $transaction_obj->type;
-            next
-                unless ( $ConditionObj->applicable_trans_types
-                =~ /(?:^|,)(?:Any|\Q$txn_type\E)(?:,|$)/i );
+        Jifty->log->debug("I found the transaction");
+        # in TxnBatch stage we can select scrips that are not applicable to all txns
+        my $txn_type = $transaction_obj->type;
+
+        my $condition = $self->scrip_condition;
+
+            next unless ( $condition->applicable_trans_types =~ /(?:^|,)(?:Any|\Q$txn_type\E)(?:,|$)/i );
 
             # Load the scrip's Condition object
-            $ConditionObj->load_condition(
+            $condition->load_condition(
                 scrip_obj       => $self,
                 ticket_obj      => $args{'ticket_obj'},
                 transaction_obj => $transaction_obj,
             );
-
-            if ( $ConditionObj->is_applicable() ) {
-
+        Jifty->log->debug("I loaded the condition");
+            if ( $condition->is_applicable() ) {
+                Jifty->log->debug("It's applicable");
+    
                 # We found an application Transaction -- return it
                 $return = $transaction_obj;
                 last;
+            } else {
+                Jifty->log->debug("It's not applicable");
+
             }
         }
     };
 
-    if ($@) {
-        Jifty->log->error(
-            "Scrip is_applicable " . $self->id . " died. - " . $@ );
+    if (my $err = $@) {
+        Jifty->log->error( "Scrip is_applicable " . $self->id . " died. - " . $err );
         return (undef);
     }
 
@@ -480,19 +401,19 @@
 
     my $return;
     eval {
-        $self->action_obj->load_action(
+        $self->scrip_action->load_action(
             scrip_obj       => $self,
             ticket_obj      => $args{'ticket_obj'},
             transaction_obj => $args{'transaction_obj'},
         );
-        $return = $self->action_obj->prepare();
+        $return = $self->scrip_action->prepare();
     };
     if ( my $err = $@ ) {
         Jifty->log->error( "Scrip prepare "
                 . $self->id
                 . " died. - "
                 . $err . " "
-                . $self->action_obj->exec_module );
+                . $self->scrip_action->exec_module );
         return (undef);
     }
     return ($return);
@@ -517,7 +438,7 @@
     );
 
     my $return;
-    eval { $return = $self->action_obj->commit(); };
+    eval { $return = $self->scrip_action->commit(); };
 
 #Searchbuilder caching isn't perfectly coherent. got to reload the ticket object, since it
 # may have changed
@@ -534,14 +455,6 @@
     return ($return);
 }
 
-# }}}
-
-# }}}
-
-# {{{ ACL related methods
-
-# {{{ sub _set
-
 # does an acl check and then passes off the call
 sub _set {
     my $self = shift;
@@ -554,9 +467,6 @@
     return $self->__set(@_);
 }
 
-# }}}
-
-# {{{ sub _value
 # does an acl check and then passes off the call
 sub _value {
     my $self = shift;
@@ -571,9 +481,6 @@
     return $self->__value(@_);
 }
 
-# }}}
-
-# {{{ sub current_user_has_right
 
 =head2 current_user_has_right
 
@@ -594,9 +501,6 @@
 
 }
 
-# }}}
-
-# {{{ sub has_right
 
 =head2 has_right
 
@@ -627,9 +531,7 @@
     }
 }
 
-# }}}
 
-# }}}
 
 1;
 

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	Sun Feb 10 21:41:58 2008
@@ -70,11 +70,9 @@
 =cut
 
 package RT::Model::ScripAction;
-
-use strict;
-no warnings qw(redefine);
 use RT::Model::Template;
 use base qw/RT::Record/;
+
 sub table {'ScripActions'}
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
@@ -82,19 +80,13 @@
     column description => type is 'text';
     column exec_module  => type is 'text';
     column argument    => type is 'text';
-    column creator     => max_length is 11, type is 'int', default is '0';
+    column creator     => references RT::Model::User;
     column created => type is 'timestamp';
-    column
-        last_updated_by => max_length is 11,
-        type is 'int', default is '0';
+    column last_updated_by => references RT::Model::User;
     column last_updated => type is 'timestamp';
 
 };
 
-# }}}
-
-# {{{ sub create
-
 =head2 Create
 
 Takes a hash. Creates a new Action entry.  should be better
@@ -102,22 +94,18 @@
 
 =cut
 
-# {{{ sub delete
 sub delete {
     my $self = shift;
 
     return ( 0, "ScripAction->delete not implemented" );
 }
 
-# }}}
-
-# {{{ sub load
 
-=head2 Load IDENTIFIER
+=head2 load IDENTIFIER
 
 Loads an action by its name.
 
-Returns: Id, Error Message
+Returns: id, Error Message
 
 =cut
 
@@ -146,10 +134,6 @@
     return ( $self->id, ( _( '%1 ScripAction loaded', $self->id ) ) );
 }
 
-# }}}
-
-# {{{ sub loadAction
-
 =head2 load_action HASH
 
   Takes a hash consisting of ticket_obj and transaction_obj.  Loads an RT::ScripAction:: module.
@@ -165,15 +149,11 @@
     );
 
     $self->{_ticket_obj} = $args{ticket_obj};
+        my $type = "RT::ScripAction::".$self->exec_module ;
+    Jifty::Util->require($type);
 
-    #TODO: Put this in an eval
-    $self->exec_module =~ /^(\w+)$/;
-    my $module = $1;
-    my $type   = "RT::ScripAction::" . $module;
 
-    eval "require $type" || die "Require of $type failed.\n$@\n";
-
-    $self->{'Action'} = $type->new(
+    $self->{'action'} = $type->new(
         argument        => $self->argument,
         current_user     => $self->current_user,
         scrip_action_obj  => $self,
@@ -184,10 +164,6 @@
     );
 }
 
-# }}}
-
-# {{{ sub template_obj
-
 =head2 template_obj
 
 Return this action's template object
@@ -225,12 +201,9 @@
     return ( $self->{'template_obj'} );
 }
 
-# }}}
 
 # The following methods call the action object
 
-# {{{ sub prepare
-
 sub prepare {
     my $self = shift;
     $self->{_Message_ID} = 0;
@@ -238,25 +211,17 @@
 
 }
 
-# }}}
-
-# {{{ sub commit
 sub commit {
     my $self = shift;
     return ( $self->action->commit() );
 
 }
-
-# }}}
-
-# {{{ sub Describe
 sub describe {
     my $self = shift;
     return ( $self->action->describe() );
 
 }
 
-# }}}
 
 =head2 Action
 
@@ -266,25 +231,16 @@
 
 sub action {
     my $self = shift;
-    return ( $self->{'Action'} );
+    return ( $self->{'action'} );
 }
 
-# {{{ sub DESTROY
 sub DESTROY {
     my $self = shift;
     $self->{'_ticket_obj'}  = undef;
-    $self->{'Action'}       = undef;
+    $self->{'action'}       = undef;
     $self->{'template_obj'} = undef;
 }
 
-# }}}
-
-=head2 TODO
-
-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
 
 1;
 

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	Sun Feb 10 21:41:58 2008
@@ -69,8 +69,6 @@
 package RT::Model::ScripCollection;
 use base qw/RT::SearchBuilder/;
 
-# {{{ sub limit_ToQueue
-
 =head2 limit_ToQueue
 
 Takes a queue id (numerical) as its only argument. Makes sure that 
@@ -91,11 +89,8 @@
 
 }
 
-# }}}
-
-# {{{ sub limit_ToGlobal
 
-=head2 limit_ToGlobal
+=head2 limit_to_global
 
 Makes sure that 
 Scopes it pulls out apply to all queues (or another that you've selected with
@@ -114,8 +109,6 @@
 
 }
 
-# }}}
-
 =head2 next
 
 Returns the next scrip that this user can see.
@@ -145,9 +138,7 @@
 
 }
 
-# }}}
-
-=head2 Apply
+=head2 apply
 
 Run through the relevant scrips.  Scrips will run in order based on 
 description.  (Most common use case is to prepend a number to the description,
@@ -181,14 +172,9 @@
 
 sub commit {
     my $self = shift;
-
     foreach my $scrip ( @{ $self->prepared } ) {
-        Jifty->log->debug( "Committing scrip #"
-                . $scrip->id
-                . " on txn #"
-                . $self->{'transaction_obj'}->id
-                . " of ticket #"
-                . $self->{'ticket_obj'}->id );
+        Jifty->log->debug( "Committing scrip #" . $scrip->id . " on txn #"
+                . $self->{'transaction_obj'}->id . " of ticket #" . $self->{'ticket_obj'}->id );
 
         $scrip->commit(
             ticket_obj      => $self->{'ticket_obj'},
@@ -216,6 +202,7 @@
         @_
     );
 
+    Jifty->log->debug("preparing a scripcollection");
     #We're really going to need a non-acled ticket for the scrips to work
     $self->setup_source_objects(
         ticket_obj      => $args{'ticket_obj'},
@@ -228,26 +215,25 @@
 
     #Iterate through each script and check it's applicability.
     while ( my $scrip = $self->next() ) {
-        next
-            unless (
-            $scrip->is_applicable(
+        Jifty->log->debug("I found a scrip " .$scrip->id);
+            unless ( $scrip->is_applicable(
                 ticket_obj      => $self->{'ticket_obj'},
-                transaction_obj => $self->{'transaction_obj'}
-            )
-            );
+                transaction_obj => $self->{'transaction_obj'})) {
 
-            Jifty->log->debug("And it's applicable");
+                Jifty->log->debug("It's not applicable: ".$@);
+                next;
+            }
+ 
         #If it's applicable, prepare and commit it
-        next
-            unless (
-            $scrip->prepare(
+        
+       if ( $scrip->prepare(
                 ticket_obj      => $self->{'ticket_obj'},
-                transaction_obj => $self->{'transaction_obj'}
-            )
-            );
-            Jifty->log->debug("And it's prepared");
-        push @{ $self->{'prepared_scrips'} }, $scrip;
-
+                transaction_obj => $self->{'transaction_obj'})) {
+                Jifty->log->debug("And it's prepared");
+                push @{ $self->{'prepared_scrips'} }, $scrip;
+        } else {
+           Jifty->log->debug("Prepare failed " . $@); 
+        }
     }
 
     return ( @{ $self->prepared } );
@@ -266,9 +252,7 @@
     return ( $self->{'prepared_scrips'} || [] );
 }
 
-# {{{ sup _setupSourceobjects
-
-=head2  _setupSourceobjects { ticket_obj , Ticket, Transaction, transaction_obj }
+=head2  setup_source_objects { ticket_obj , Ticket, Transaction, transaction_obj }
 
 Setup a ticket and transaction for this Scrip collection to work with as it runs through the 
 relevant scrips.  (Also to figure out which scrips apply)
@@ -293,8 +277,7 @@
     } else {
         $self->{'ticket_obj'} = RT::Model::Ticket->new;
         $self->{'ticket_obj'}->load( $args{'ticket'} )
-            || Jifty->log->err(
-            "$self couldn't load ticket $args{'ticket'}\n");
+            || Jifty->log->err( "$self couldn't load ticket $args{'ticket'}");
     }
 
     if ( ( $self->{'transaction_obj'} = $args{'transaction_obj'} ) ) {
@@ -302,16 +285,11 @@
     } else {
         $self->{'transaction_obj'} = RT::Model::Transaction->new;
         $self->{'transaction_obj'}->load( $args{'transaction'} )
-            || Jifty->log->err(
-            "$self couldn't load transaction $args{'transaction'}\n");
+            || Jifty->log->err( "$self couldn't load transaction $args{'transaction'}");
     }
 }
 
-# }}}
-
-# {{{ sub _FindScrips;
-
-=head2 _FindScrips
+=head2 _find_scrips
 
 Find only the apropriate scrips for whatever we're doing now.  order them 
 by their description.  (Most common use case is to prepend a number to the
@@ -328,8 +306,7 @@
         @_
     );
 
-    $self->limit_to_queue( $self->{'ticket_obj'}->queue_obj->id )
-        ;    #Limit it to  $Ticket->queue_obj->id
+    $self->limit_to_queue( $self->{'ticket_obj'}->queue_obj->id ) ;    #Limit it to  $Ticket->queue_obj->id
     $self->limit_to_global();
 
     # or to "global"
@@ -373,13 +350,8 @@
     # so just do search and get count from results
     $self->_do_search if $self->{'must_redo_search'};
 
-    Jifty->log->debug( "Found "
-            . $self->count
-            . " scrips for $args{'stage'} stage"
+    Jifty->log->debug( "Found " . $self->count . " scrips for $args{'stage'} stage"
             . " with applicable type(s) $args{'type'}" );
 }
 
-# }}}
-
 1;
-

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCondition.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCondition.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCondition.pm	Sun Feb 10 21:41:58 2008
@@ -66,15 +66,11 @@
 
 =cut
 
-package RT::Model::ScripCondition;
-
 use strict;
-no warnings qw(redefine);
-
+use warnings;
+package RT::Model::ScripCondition;
 use base qw/RT::Record/;
 
-# {{{  sub _init
-
 sub table {'ScripConditions'}
 use Jifty::DBI::Schema;
 use Jifty::DBI::Record schema {
@@ -83,34 +79,13 @@
     column exec_module           => type is 'text';
     column argument             => type is 'text';
     column applicable_trans_types => type is 'text';
-    column creator => max_length is 11, type is 'int', default is '0';
+    column creator =>  references RT::Model::User;
     column created => type is 'timestamp';
-    column
-        last_updated_by => max_length is 11,
-        type is 'int', default is '0';
+    column last_updated_by => references RT::Model::User;
     column last_updated => type is 'timestamp';
 
 };
 
-# }}}
-
-# {{{ sub create
-
-=head2 Create
-  
-  Takes a hash. Creates a new Condition entry.
-  should be better documented.
-
-=cut
-
-sub create {
-    my $self = shift;
-    return ( $self->SUPER::create(@_) );
-}
-
-# }}}
-
-# {{{ sub delete
 
 =head2 delete
 
@@ -123,11 +98,7 @@
     return ( 0, _('Unimplemented') );
 }
 
-# }}}
-
-# {{{ sub load
-
-=head2 Load IDENTIFIER
+=head2 load IDENTIFIER
 
 Loads a condition takes a name or ScripCondition id.
 
@@ -148,14 +119,12 @@
     }
 }
 
-# }}}
 
-# {{{ sub loadCondition
 
 =head2 load_condition  HASH
 
 takes a hash which has the following elements:  transaction_obj and ticket_obj.
-Loads the Condition module in question.
+Loads the condition module in question.
 
 =cut
 
@@ -167,15 +136,12 @@
         @_
     );
 
-    #TODO: Put this in an eval
-    $self->exec_module =~ /^(\w+)$/;
-    my $module = $1;
-    my $type   = "RT::Condition::" . $module;
+    my $type   = "RT::Condition::" . $self->exec_module;
 
-    eval "require $type" || die "Require of $type failed.\n$@\n";
+    Jifty::Util->require($type);
 
-    $self->{'Condition'} = $type->new(
-        'scrip_condition_obj'    => $self,
+    $self->{'condition'} = $type->new(
+        'scrip_scrip_condition'    => $self,
         'ticket_obj'           => $args{'ticket_obj'},
         'scrip_obj'            => $args{'scrip_obj'},
         'transaction_obj'      => $args{'transaction_obj'},
@@ -185,13 +151,8 @@
     );
 }
 
-# }}}
 
-# {{{ The following methods call the Condition object
-
-# {{{ sub Describe
-
-=head2 Describe 
+=head2 describe 
 
 Helper method to call the condition module\'s Describe method.
 
@@ -199,13 +160,10 @@
 
 sub describe {
     my $self = shift;
-    return ( $self->{'Condition'}->describe() );
+    return ( $self->{'condition'}->describe() );
 
 }
 
-# }}}
-
-# {{{ sub is_applicable
 
 =head2 is_applicable
 
@@ -215,21 +173,15 @@
 
 sub is_applicable {
     my $self = shift;
-    return ( $self->{'Condition'}->is_applicable() );
+    return ( $self->{'condition'}->is_applicable() );
 
 }
 
-# }}}
-
-# }}}
-
-# {{{ sub DESTROY
 sub DESTROY {
     my $self = shift;
-    $self->{'Condition'} = undef;
+    $self->{'condition'} = undef;
 }
 
-# }}}
 
 sub _value { shift->__value(@_) }
 1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Ticket.pm	Sun Feb 10 21:41:58 2008
@@ -67,11 +67,21 @@
 =cut
 
 package RT::Model::Ticket;
-
-use strict;
-no warnings qw(redefine);
 use base qw/RT::Record/;
 
+use RT::Model::Queue;
+use RT::Model::User;
+use RT::Model::LinkCollection;
+use RT::Date;
+use RT::Model::CustomFieldCollection;
+use RT::Model::TicketCollection;
+use RT::Model::TransactionCollection;
+use RT::Reminders;
+use RT::URI::fsck_com_rt;
+use RT::URI;
+use MIME::Entity;
+
+
 sub table {'Tickets'}
 
 use Jifty::DBI::Schema;
@@ -80,47 +90,29 @@
     column effective_id => max_length is 11, type is 'int', default is '0';
     column queue       => references RT::Model::Queue;
     column type => max_length is 16, type is 'varchar(16)', default is '';
-    column issue_statement => max_length is 11,
-        type is 'int', default is '0';
+    column issue_statement => max_length is 11, type is 'int', default is '0';
     column resolution => max_length is 11, type is 'int', default is '0';
     column owner      => max_length is 11, type is 'int', default is '0';
     column subject => max_length is 200, type is 'varchar(200)', default is '';
     column initial_priority => max_length is 11, type is 'int', default is '0';
     column final_priority => max_length is 11, type is 'int', default is '0';
     column priority => max_length is 11, type is 'int', default is '0';
-    column
-        time_estimated => max_length is 11,
-        type is 'int', default is '0';
+    column time_estimated => max_length is 11, type is 'int', default is '0';
     column time_worked => max_length is 11, type is 'int', default is '0';
-    column status => max_length is 10, type is 'varchar(10)', default is '';
     column time_left => max_length is 11, type is 'int', default is '0';
+    column status => max_length is 10, type is 'varchar(10)', default is '';
     column told     => type is 'timestamp';
     column starts   => type is 'timestamp';
     column started  => type is 'timestamp';
     column due      => type is 'timestamp';
     column resolved => type is 'timestamp';
-    column
-        last_updated_by => max_length is 11,
-        type is 'int', default is '0';
+    column last_updated_by => references RT::Model::User;
     column last_updated => type is 'timestamp';
-    column creator => max_length is 11,   type is 'int', default is '0';
+    column creator => references RT::Model::User;
     column created => type is 'timestamp';
     column disabled => max_length is 6, type is 'smallint', default is '0';
 };
 
-use RT::Model::Queue;
-use RT::Model::User;
-use RT::Record;
-use RT::Model::LinkCollection;
-use RT::Date;
-use RT::Model::CustomFieldCollection;
-use RT::Model::TicketCollection;
-use RT::Model::TransactionCollection;
-use RT::Reminders;
-use RT::URI::fsck_com_rt;
-use RT::URI;
-use MIME::Entity;
-
 # {{{ LINKTYPEMAP
 # A helper table for links mapping to make it easier
 # to build and parse links between tickets
@@ -591,7 +583,7 @@
             _("Ticket could not be created due to an internal error") );
     }
 
-    my $create_groups_ret = $self->_create_ticket_groups();
+    my $create_groups_ret = $self->_create_role_groups();
     unless ($create_groups_ret) {
         Jifty->log->fatal( "Couldn't create ticket groups for ticket "
                 . $self->id
@@ -798,9 +790,9 @@
 
 # {{{ Routines dealing with watchers.
 
-# {{{ _create_ticket_groups
+# {{{ _create_role_groups
 
-=head2 _create_ticket_groups
+=head2 _create_role_groups
 
 Create the ticket groups and links for this ticket. 
 This routine expects to be called from Ticket->create _inside of a transaction_
@@ -812,7 +804,7 @@
 
 =cut
 
-sub _create_ticket_groups {
+sub _create_role_groups {
     my $self = shift;
 
     my @types = qw(requestor owner cc admin_cc);
@@ -1209,10 +1201,10 @@
 
 # }}}
 
-# {{{ is_watcher,is_requestor,is_cc, is_admin_cc
+# {{{ is_watcher,is_requestor
 
 # {{{ sub is_watcher
-# a generic routine to be called by is_requestor, is_cc and is_admin_cc
+# a generic routine to be called by is_requesto
 
 =head2 is_watcher { type => TYPE, principal_id => PRINCIPAL_ID, email => EMAIL }
 
@@ -1288,45 +1280,6 @@
 
 # }}}
 
-# {{{ sub is_cc
-
-=head2 is_cc PRINCIPAL_ID
-
-  Takes an RT::Model::Principal id.
-  Returns true if the principal is a requestor of the current ticket.
-
-
-=cut
-
-sub is_cc {
-    my $self = shift;
-    my $cc   = shift;
-
-    return ( $self->is_watcher( type => 'cc', principal_id => $cc ) );
-
-}
-
-# }}}
-
-# {{{ sub is_admin_cc
-
-=head2 is_admin_cc PRINCIPAL_ID
-
-  Takes an RT::Model::Principal id.
-  Returns true if the principal is a requestor of the current ticket.
-
-=cut
-
-sub is_admin_cc {
-    my $self   = shift;
-    my $person = shift;
-
-    return (
-        $self->is_watcher( type => 'admin_cc', principal_id => $person ) );
-
-}
-
-# }}}
 
 # {{{ sub is_owner
 
@@ -1536,20 +1489,6 @@
 
 # }}}
 
-# {{{ sub due_as_string
-
-=head2 due_as_string
-
-Returns this ticket's due date as a human readable string
-
-=cut
-
-sub due_as_string {
-    my $self = shift;
-    return $self->due_obj->as_string();
-}
-
-# }}}
 
 # {{{ sub resolved_obj
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordComment.pm	Sun Feb 10 21:41:58 2008
@@ -58,11 +58,11 @@
 
 =head1 SYNOPSIS
 
-my $action_obj = RT::ScripAction::RecordComment->new('ticket_obj'   => $ticket_obj,
+my $scrip_action = RT::ScripAction::RecordComment->new('ticket_obj'   => $ticket_obj,
 						'template_obj' => $template_obj,
 						);
-my $result = $action_obj->prepare();
-$action_obj->commit() if $result;
+my $result = $scrip_action->prepare();
+$scrip_action->commit() if $result;
 
 =head1 METHODS
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/RecordCorrespondence.pm	Sun Feb 10 21:41:58 2008
@@ -58,12 +58,12 @@
 
 =head1 SYNOPSIS
 
-my $action_obj = RT::ScripAction::RecordCorrespondence->new(
+my $scrip_action = RT::ScripAction::RecordCorrespondence->new(
 			'ticket_obj'   => $ticket_obj,
 			'template_obj' => $template_obj,
 			);
-my $result = $action_obj->prepare();
-$action_obj->commit() if $result;
+my $result = $scrip_action->prepare();
+$scrip_action->commit() if $result;
 
 =head1 METHODS
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/UserDefined.pm	Sun Feb 10 21:41:58 2008
@@ -46,14 +46,13 @@
 #
 # END BPS TAGGED BLOCK }}}
 
+use strict;
+use warnings;
 package RT::ScripAction::UserDefined;
-use RT::ScripAction::Generic;
 
-use strict;
-use vars qw/@ISA/;
- at ISA = qw(RT::ScripAction::Generic);
+use base qw(RT::ScripAction::Generic);
 
-=head2 Prepare
+=head2 prepare
 
 This happens on every transaction. it's always applicable
 
@@ -61,10 +60,10 @@
 
 sub prepare {
     my $self   = shift;
+        Jifty->log->debug("preparing");
     my $retval = eval $self->scrip_obj->custom_prepare_code;
     if ($@) {
-        Jifty->log->error(
-            "Scrip " . $self->scrip_obj->id . " Prepare failed: " . $@ );
+        Jifty->log->error( "Scrip " . $self->scrip_obj->id . " Prepare failed: " . $@ );
         return (undef);
     }
     return ($retval);
@@ -78,6 +77,7 @@
 
 sub commit {
     my $self   = shift;
+        Jifty->log->debug("committing");
     my $retval = eval $self->scrip_obj->custom_commit_code;
     if ($@) {
         Jifty->log->error(

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm	Sun Feb 10 21:41:58 2008
@@ -138,8 +138,8 @@
     my $self  = shift;
     my %args  = ( object => undef, @_ );
     my $props = $self->_make_hash( $args{'object'} );
-    $props->{'Action'}    = $args{'object'}->action_obj->name;
-    $props->{'Condition'} = $args{'object'}->condition_obj->name;
+    $props->{'Action'}    = $args{'object'}->scrip_action->name;
+    $props->{'Condition'} = $args{'object'}->scrip_condition->name;
     $props->{'template'}  = $args{'object'}->template_obj->name;
     $props->{'queue'}     = $args{'object'}->queue_obj->name || 'global';
 
@@ -149,7 +149,7 @@
 sub _make_hash {
     my ( $self, $obj ) = @_;
     my $hash = $self->__make_hash($obj);
-    foreach ( grep exists $hash->{$_}, qw(Creator last_updated_by) ) {
+    foreach ( grep exists $hash->{$_}, qw(creator last_updated_by) ) {
         my $method = $_ . 'Obj';
         my $u      = $obj->$method();
         $hash->{$_} = $u->email || $u->name || $u->_as_string;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm	Sun Feb 10 21:41:58 2008
@@ -75,7 +75,7 @@
 
 When you delete user there is could be minor links to him in RT DB.
 This option allow you to replace this links with link to other user.
-This links are Creator and last_updated_by, but NOT any watcher roles,
+This links are creator and last_updated_by, but NOT any watcher roles,
 this mean that if user is watcher(Requestor, Owner,
 Cc or AdminCc) of the ticket or queue then link would be deleted.
 
@@ -135,7 +135,7 @@
     # XXX: we want preload only things we need, but later while
     # logging we need all data, TODO envestigate this
     # $objs->columns(qw(id name email lang timezone
-    #                   Creator Created last_updated last_updated_by));
+    #                   creator Created last_updated last_updated_by));
     if ( my $s = $self->{'opt'}{'status'} ) {
         if ( $s eq 'any' ) {
             $objs->{'find_disabled_rows'} = 1;
@@ -188,7 +188,7 @@
         my $resolver = sub {
             my %args = (@_);
             my $t    = $args{'target_object'};
-            foreach my $method (qw(Creator last_updated_by)) {
+            foreach my $method (qw(creator last_updated_by)) {
                 next unless $t->_accessible( $method => 'read' );
                 $t->__set( column => $method, value => $uid );
             }

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm	Sun Feb 10 21:41:58 2008
@@ -184,7 +184,7 @@
     my $deps = $args{'dependencies'};
     my $list = [];
 
-    if ( $self->can('Creator') ) {
+    if ( $self->can('creator') ) {
         my $obj = RT::Model::Principal->new;
         $obj->load( $self->creator );
 
@@ -195,7 +195,7 @@
             $self = $rec->{'object'};
             $rec->{'state'} |= INVALID;
             push @{ $rec->{'description'} },
-                "Have no related User(Creator) #"
+                "Have no related User(creator) #"
                 . $self->creator
                 . " object";
         }

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm	Sun Feb 10 21:41:58 2008
@@ -96,7 +96,7 @@
     }
 
     # Condition
-    $obj = $self->condition_obj;
+    $obj = $self->scrip_condition;
     if ( defined $obj->id ) {
         push( @$list, $obj );
     } else {
@@ -108,7 +108,7 @@
     }
 
     # Action
-    $obj = $self->action_obj;
+    $obj = $self->scrip_action;
     if ( defined $obj->id ) {
         push( @$list, $obj );
     } else {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm	Sun Feb 10 21:41:58 2008
@@ -104,7 +104,7 @@
             = "Have no related queue #" . $self->id . " object";
     }
 
-    # TODO: Users(Creator, last_updated_by)
+    # TODO: Users(creator, last_updated_by)
 
     $deps->_push_dependencies(
         base_object   => $self,

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm	Sun Feb 10 21:41:58 2008
@@ -100,7 +100,7 @@
             = "Have no related Ticket #" . $self->id . " object";
     }
 
-    # TODO: Users(Creator, last_updated_by)
+    # TODO: Users(creator, last_updated_by)
 
     $deps->_push_dependencies(
         base_object   => $self,

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm	Sun Feb 10 21:41:58 2008
@@ -114,12 +114,12 @@
         shredder      => $args{'shredder'}
     );
 
-    # TODO: Almost all objects has Creator, last_updated_by and etc. fields
+    # TODO: Almost all objects has creator, last_updated_by and etc. fields
     # which are references on users(Principal actualy)
     my @var_objs;
     foreach (@OBJECTS) {
         my $class = "RT::Model::$_";
-        foreach my $method (qw(Creator last_updated_by)) {
+        foreach my $method (qw(creator last_updated_by)) {
             my $objs = $class->new;
             next unless $objs->new_item->can($method);
             $objs->limit( column => $method, value => $self->id );

Modified: rt/branches/3.999-DANGEROUS/sbin/rt-dump-database.in
==============================================================================
--- rt/branches/3.999-DANGEROUS/sbin/rt-dump-database.in	(original)
+++ rt/branches/3.999-DANGEROUS/sbin/rt-dump-database.in	Sun Feb 10 21:41:58 2008
@@ -62,7 +62,7 @@
 my %RV;
 my %Ignore = (
     All => [qw(
-	id Created Creator last_updated last_updated_by
+	id Created creator last_updated last_updated_by
     )],
     Templates => [qw(
 	TranslationOf

Modified: rt/branches/3.999-DANGEROUS/share/po/cs.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/cs.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/cs.po	Sun Feb 10 21:41:58 2008
@@ -95,7 +95,7 @@
 msgstr "%1 %2 smazán"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 se vzorem %3"
 
@@ -1600,7 +1600,7 @@
 msgstr "Vytvořené požadavky za období, seskupené dle stavu"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Tvůrce"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/da.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/da.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/da.po	Sun Feb 10 21:41:58 2008
@@ -102,7 +102,7 @@
 msgid "%1 %2 deleted"
 msgstr "%1 %2 slettet"
 
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 #: html/Admin/Elements/EditScrips:65
 #: html/Admin/Elements/ListGlobalScrips:63
 #: html/Ticket/Elements/PreviewScrips:103
@@ -1765,7 +1765,7 @@
 msgstr "Sager oprettet i en periode, fordelt pr. status"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Opretter"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/de.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/de.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/de.po	Sun Feb 10 21:41:58 2008
@@ -92,7 +92,7 @@
 msgstr "%1 %2 gelöscht"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 mit der Vorlage %3"
 
@@ -1367,7 +1367,7 @@
 msgstr "Erstellte Tickets einer Periode, sortiert nach Status"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Ersteller"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/es.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/es.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/es.po	Sun Feb 10 21:41:58 2008
@@ -95,7 +95,7 @@
 msgstr "%1 %2 borrado"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 con la plantilla %3"
 
@@ -1694,7 +1694,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Creador"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/fi.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/fi.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/fi.po	Sun Feb 10 21:41:58 2008
@@ -84,7 +84,7 @@
 msgstr "%1 %2 poistettu"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 pohjalla %3"
 
@@ -1593,7 +1593,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr ""
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/fr.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/fr.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/fr.po	Sun Feb 10 21:41:58 2008
@@ -94,7 +94,7 @@
 msgstr "%1 %2 supprimé"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 avec le modèle %3"
 
@@ -1276,7 +1276,7 @@
 msgstr "Tickets créés dans une période, groupés par l'état"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Créateur"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/he.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/he.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/he.po	Sun Feb 10 21:41:58 2008
@@ -82,7 +82,7 @@
 msgstr ""
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr ""
 
@@ -1307,7 +1307,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr ""
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/hu.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/hu.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/hu.po	Sun Feb 10 21:41:58 2008
@@ -87,7 +87,7 @@
 msgstr "%1 %2 törölve"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 a %3 sablonnal"
 
@@ -1261,7 +1261,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Létrehozó"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/id.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/id.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/id.po	Sun Feb 10 21:41:58 2008
@@ -88,7 +88,7 @@
 msgstr "%1 %2 sudah dihapus"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 gunakan template %3"
 
@@ -1337,7 +1337,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Pencipta"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/it.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/it.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/it.po	Sun Feb 10 21:41:58 2008
@@ -99,7 +99,7 @@
 msgstr "%1 %2 del gruppo %3"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 con il modello %3"
 
@@ -1728,7 +1728,7 @@
 msgstr "TempoDaCreazione"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "CreatoDa"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/ja.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/ja.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/ja.po	Sun Feb 10 21:41:58 2008
@@ -86,7 +86,7 @@
 msgstr ""
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr ""
 
@@ -1513,7 +1513,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr ""
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/nl.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/nl.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/nl.po	Sun Feb 10 21:41:58 2008
@@ -94,7 +94,7 @@
 msgstr "%1 %2 verwijderd"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 met sjabloon %3"
 
@@ -1603,8 +1603,8 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
-msgstr "Creator"
+msgid "creator"
+msgstr "creator"
 
 #: html/Elements/EditLinks:49
 msgid "Current Links"

Modified: rt/branches/3.999-DANGEROUS/share/po/no.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/no.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/no.po	Sun Feb 10 21:41:58 2008
@@ -99,7 +99,7 @@
 msgstr "%1 %2 av gruppen %3"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 med mal %3"
 
@@ -1732,7 +1732,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr ""
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/pl.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/pl.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/pl.po	Sun Feb 10 21:41:58 2008
@@ -96,7 +96,7 @@
 msgstr "%1 %2 z groupy %3"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 wg szablonu %3"
 
@@ -1750,7 +1750,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Zgłaszający"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/pt_br.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/pt_br.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/pt_br.po	Sun Feb 10 21:41:58 2008
@@ -95,7 +95,7 @@
 msgstr "%1 %2 do grupo %3"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 com modelo %3"
 
@@ -1716,7 +1716,7 @@
 msgstr ""
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr ""
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/ru.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/ru.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/ru.po	Sun Feb 10 21:41:58 2008
@@ -92,7 +92,7 @@
 msgstr "%1 %2 удален"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 с шаблоном %3"
 
@@ -1762,7 +1762,7 @@
 msgstr "Создано заявок за период, с группировкой по статусу"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Автор заявки"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/sv.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/sv.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/sv.po	Sun Feb 10 21:41:58 2008
@@ -90,7 +90,7 @@
 msgid "%1 %2 deleted"
 msgstr "%1 %2 raderad"
 
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 #: html/Admin/Elements/EditScrips:65
 #: html/Admin/Elements/ListGlobalScrips:63
 #: html/Ticket/Elements/PreviewScrips:103
@@ -1387,7 +1387,7 @@
 msgstr "Skapade ärenden under period, grupperade efter status"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Skapare"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/tr.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/tr.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/tr.po	Sun Feb 10 21:41:58 2008
@@ -84,7 +84,7 @@
 msgstr "%1 %2 silindi"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "%1 %2 ile şablon %3"
 
@@ -1248,7 +1248,7 @@
 msgstr "Bir devir içinde biletle oluşturuldu ve duruma göre sıralandı"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "Oluşturan"
 
 #: html/Elements/EditLinks:49

Modified: rt/branches/3.999-DANGEROUS/share/po/zh_cn.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/zh_cn.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/zh_cn.po	Sun Feb 10 21:41:58 2008
@@ -110,7 +110,7 @@
 msgstr "%3 群组的 %1 %2"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "条件:%1 | 动作:%2 | 模板:%3"
 
@@ -2083,7 +2083,7 @@
 msgstr "流程 %1 新增成功"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "建立者"
 
 #: NOT FOUND IN SOURCE

Modified: rt/branches/3.999-DANGEROUS/share/po/zh_tw.po
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/po/zh_tw.po	(original)
+++ rt/branches/3.999-DANGEROUS/share/po/zh_tw.po	Sun Feb 10 21:41:58 2008
@@ -110,7 +110,7 @@
 msgstr "%3 群組的 %1 %2"
 
 #: html/Admin/Elements/EditScrips:65 html/Admin/Elements/ListGlobalScrips:63 html/Ticket/Elements/PreviewScrips:103
-#. (_($scrip->condition_obj->name), loc($scrip->action_obj->name), loc($scrip->template_obj->name))
+#. (_($scrip->scrip_condition->name), loc($scrip->scrip_action->name), loc($scrip->template_obj->name))
 msgid "%1 %2 with template %3"
 msgstr "條件:%1 | 動作:%2 | 範本:%3"
 
@@ -2083,7 +2083,7 @@
 msgstr "流程 %1 新增成功"
 
 #: html/Search/Elements/PickBasics:102
-msgid "Creator"
+msgid "creator"
 msgstr "建立者"
 
 #: NOT FOUND IN SOURCE

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	Sun Feb 10 21:41:58 2008
@@ -64,8 +64,8 @@
 ok ($sval, $smsg);
 ok ($scrip->id, "Created the scrip");
 ok ($scrip->template_obj->id, "Created the scrip template");
-ok ($scrip->condition_obj->id, "Created the scrip condition");
-ok ($scrip->action_obj->id, "Created the scrip action");
+ok ($scrip->scrip_condition->id, "Created the scrip condition");
+ok ($scrip->scrip_action->id, "Created the scrip action");
 
 my $t = RT::Model::Ticket->new(current_user => RT->system_user);
 my($tid, $ttrans, $tmsg) = $t->create(subject => "Sample workflow test",

Modified: rt/branches/3.999-DANGEROUS/t/api/scrip.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/scrip.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/api/scrip.t	Sun Feb 10 21:41:58 2008
@@ -18,9 +18,9 @@
 my ($val, $msg) =$s1->create( queue => $q->id,
              scrip_action => 'User Defined',
              scrip_condition => 'User Defined',
-             custom_is_applicable_code => 'if ($self->ticket_obj->subject =~ /fire/) { return (1);} else { return(0)}',
-             custom_prepare_code => 'return 1',
-             custom_commit_code => '$self->ticket_obj->__set(column =>"priority", value => "87");',
+             custom_is_applicable_code => ' if ($self->ticket_obj->subject =~ /fire/) { return (1);} else { return(0)}',
+             custom_prepare_code => ' return 1',
+             custom_commit_code => ' $self->ticket_obj->__set(column =>"priority", value => "87");',
              template => 'Blank'
     );
 ok($val,$msg);
@@ -32,8 +32,6 @@
 ok($tv, $tm);
 
 is ($ticket->priority , '87', "Ticket priority is set right");
-
-
 my $ticket2 = RT::Model::Ticket->new(current_user => RT->system_user);
 my ($t2v,$t2tv,$t2m) = $ticket2->create(queue => $q->id,
                                     subject => "hair in water",

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	Sun Feb 10 21:41:58 2008
@@ -196,7 +196,7 @@
         my $MIME = shift;
 
         my $scrip = $self->scrip_obj->id;
-        ok(1, $self->scrip_obj->condition_obj->name . " ".$self->scrip_obj->action_obj->name);
+        ok(1, $self->scrip_obj->scrip_condition->name . " ".$self->scrip_obj->scrip_action->name);
         main::_fired_scrip($self->scrip_obj);
         $MIME->make_singlepart;
         main::is( ref($MIME) , \'MIME::Entity\',
@@ -223,7 +223,7 @@
         my $MIME = shift;
 
         my $scrip = $self->scrip_obj->id;
-        ok(1, $self->scrip_obj->condition_obj->name . " ".$self->scrip_obj->action_obj->name);
+        ok(1, $self->scrip_obj->scrip_condition->name . " ".$self->scrip_obj->scrip_action->name);
         main::_fired_scrip($self->scrip_obj);
         $MIME->make_singlepart;
         main::is( ref($MIME) , \'MIME::Entity\',
@@ -297,7 +297,7 @@
     eval 'sub RT::ScripAction::SendEmail::send_message { 
                 my $self = shift;
                 my $MIME = shift;
-                return (1) unless ($self->scrip_obj->action_obj->name eq "Notify AdminCcs" );
+                return (1) unless ($self->scrip_obj->scrip_action->name eq "Notify AdminCcs" );
                 is ($MIME->parts, 2, "generated correspondence mime entityis composed of three parts");
                 is ($MIME->head->mime_type , "multipart/mixed", "The first part is a multipart mixed". $MIME->head->mime_type);
                 is ($MIME->parts(0)->head->mime_type , "text/plain", "The second part is a plain");
@@ -334,7 +334,7 @@
                 my $self = shift; 
                 my $MIME = shift; 
                 use Data::Dumper;
-                return (1) unless ($self->scrip_obj->action_obj->name eq "Notify AdminCcs" );
+                return (1) unless ($self->scrip_obj->scrip_action->name eq "Notify AdminCcs" );
                 ok (is $MIME->parts, 2, "generated correspondence mime entityis composed of three parts");
                 is ($MIME->head->mime_type , "multipart/mixed", "The first part is a multipart mixed". $MIME->head->mime_type);
                 is ($MIME->parts(0)->head->mime_type , "text/plain", "The second part is a plain");
@@ -375,7 +375,7 @@
     eval 'sub RT::ScripAction::SendEmail::send_message { 
                 my $self = shift; 
                 my $MIME = shift; 
-                return (1) unless ($self->scrip_obj->action_obj->name eq "Notify AdminCcs" );
+                return (1) unless ($self->scrip_obj->scrip_action->name eq "Notify AdminCcs" );
                 is ($MIME->head->mime_type , "text/plain", "The only part is text/plain ");
                  my $subject  = $MIME->head->get("subject");
                 chomp($subject);
@@ -416,7 +416,7 @@
     eval 'sub RT::ScripAction::SendEmail::send_message { 
                 my $self = shift; 
                 my $MIME = shift; 
-                return (1) unless ($self->scrip_obj->action_obj->name eq "Notify AdminCcs" );
+                return (1) unless ($self->scrip_obj->scrip_action->name eq "Notify AdminCcs" );
                 is ($MIME->head->mime_type , "multipart/mixed", "It is a mixed multipart");
                  my $subject  =  $MIME->head->get("subject");
                  $subject  = MIME::Base64::decode_base64( $subject);


More information about the Rt-commit mailing list