[Rt-commit] r10535 - in rt/branches/3.999-DANGEROUS: lib/RT/Condition lib/RT/Model lib/RT/ScripAction

ruz at bestpractical.com ruz at bestpractical.com
Mon Jan 28 16:36:00 EST 2008


Author: ruz
Date: Mon Jan 28 16:36:00 2008
New Revision: 10535

Modified:
   rt/branches/3.999-DANGEROUS/etc/initialdata
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/Generic.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Condition/PriorityExceeds.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/Generic.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm

Log:
* more API lowering

Modified: rt/branches/3.999-DANGEROUS/etc/initialdata
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/initialdata	(original)
+++ rt/branches/3.999-DANGEROUS/etc/initialdata	Mon Jan 28 16:36:00 2008
@@ -74,62 +74,62 @@
        Description =>
 'Always sends a message to the requestors independent of message sender' ,                                            # loc
        ExecModule => 'Autoreply',
-       Argument   => 'Requestor' },
+       argument   => 'Requestor' },
     { name        => 'Notify Requestors',                    # loc
       Description => 'Sends a message to the requestors',    # loc
       ExecModule  => 'Notify',
-      Argument    => 'Requestor' },
+      argument    => 'Requestor' },
     { name        => 'Notify Owner as comment',              # loc
       Description => 'Sends mail to the owner',              # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'Owner' },
+      argument    => 'Owner' },
     { name        => 'Notify Owner',                         # loc
       Description => 'Sends mail to the owner',              # loc
       ExecModule  => 'Notify',
-      Argument    => 'Owner' },
+      argument    => 'Owner' },
     { name        => 'Notify Ccs as comment',              # loc
       Description => 'Sends mail to the Ccs as a comment', # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'Cc' },
+      argument    => 'Cc' },
     { name        => 'Notify Ccs',                                   # loc
       Description => 'Sends mail to the Ccs',                        # loc
       ExecModule  => 'Notify',
-      Argument    => 'Cc' },
+      argument    => 'Cc' },
     { name        => 'Notify AdminCcs as comment',                        # loc
       Description => 'Sends mail to the administrative Ccs as a comment', # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'AdminCc' },
+      argument    => 'AdminCc' },
     { name        => 'Notify AdminCcs',                                   # loc
       Description => 'Sends mail to the administrative Ccs',              # loc
       ExecModule  => 'Notify',
-      Argument    => 'AdminCc' },
+      argument    => 'AdminCc' },
 
     { name        => 'Notify Requestors and Ccs as comment',              # loc
       Description => 'Send mail to requestors and Ccs as a comment',      # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'Requestor,Cc' },
+      argument    => 'Requestor,Cc' },
 
     { name        => 'Notify Requestors and Ccs',                         # loc
       Description => 'Send mail to requestors and Ccs',                   # loc
       ExecModule  => 'Notify',
-      Argument    => 'Requestor,Cc' },
+      argument    => 'Requestor,Cc' },
 
     { name        => 'Notify Requestors, Ccs and AdminCcs as comment',    # loc
       Description => 'Send mail to all watchers as a "comment"',          # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'All' },
+      argument    => 'All' },
     { name        => 'Notify Requestors, Ccs and AdminCcs',               # loc
       Description => 'Send mail to all watchers',                         # loc
       ExecModule  => 'Notify',
-      Argument    => 'All' },
+      argument    => 'All' },
     { name        => 'Notify Other Recipients as comment',                # loc
       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc
       ExecModule  => 'NotifyAsComment',
-      Argument    => 'OtherRecipients' },
+      argument    => 'OtherRecipients' },
     { name        => 'Notify Other Recipients',                           # loc
       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc
       ExecModule  => 'Notify',
-      Argument    => 'OtherRecipients' },
+      argument    => 'OtherRecipients' },
     { name        => 'User Defined',                                      # loc
       Description => 'Perform a user-defined action',                     # loc
       ExecModule  => 'UserDefined', },
@@ -145,31 +145,31 @@
 @ScripConditions = (
     { name                 => 'On Create',                                # loc
       Description          => 'When a ticket is Created',                 # loc
-      ApplicableTransTypes => 'Create',
+      applicable_trans_types => 'Create',
       ExecModule           => 'AnyTransaction', },
 
     { name                 => 'On Transaction',                           # loc
       Description          => 'When anything happens',                    # loc
-      ApplicableTransTypes => 'Any',
+      applicable_trans_types => 'Any',
       ExecModule           => 'AnyTransaction', },
     {
 
       name                 => 'On Correspond',                             # loc
       Description          => 'Whenever correspondence comes in',          # loc
-      ApplicableTransTypes => 'Correspond',
+      applicable_trans_types => 'Correspond',
       ExecModule           => 'AnyTransaction', },
 
     {
 
       name                 => 'On comment',                                # loc
       Description          => 'Whenever comments come in',                 # loc
-      ApplicableTransTypes => 'comment',
+      applicable_trans_types => 'comment',
       ExecModule           => 'AnyTransaction' },
     {
 
       name                 => 'On Status Change',                          # loc
       Description          => 'Whenever a ticket\'s status changes',       # loc
-      ApplicableTransTypes => 'Status',
+      applicable_trans_types => 'Status',
       ExecModule           => 'AnyTransaction',
 
     },
@@ -177,14 +177,14 @@
 
       name                 => 'On Priority Change',                       # loc
       Description          => 'Whenever a ticket\'s priority changes',    # loc
-      ApplicableTransTypes => 'Set',
+      applicable_trans_types => 'Set',
       ExecModule           => 'PriorityChange',
     },
     {
 
       name                 => 'On Owner Change',                           # loc
       Description          => 'Whenever a ticket\'s owner changes',        # loc
-      ApplicableTransTypes => 'Any',
+      applicable_trans_types => 'Any',
       ExecModule           => 'OwnerChange',
 
     },
@@ -192,33 +192,33 @@
 
       name                 => 'On Queue Change',                           # loc
       Description          => 'Whenever a ticket\'s queue changes',        # loc
-      ApplicableTransTypes => 'Set',
+      applicable_trans_types => 'Set',
       ExecModule           => 'QueueChange',
 
     },
     {  name                 => 'On Resolve',                               # loc
        Description          => 'Whenever a ticket is resolved',            # loc
-       ApplicableTransTypes => 'Status',
+       applicable_trans_types => 'Status',
        ExecModule           => 'StatusChange',
-       Argument             => 'resolved'
+       argument             => 'resolved'
 
     },
 
     {  name                 => 'User Defined',                             # loc
        Description          => 'Whenever a user-defined condition occurs', # loc
-       ApplicableTransTypes => 'Any',
+       applicable_trans_types => 'Any',
        ExecModule           => 'UserDefined'
 
     },
 
     {  name                 => 'On Close',                                 # loc
        Description          => 'Whenever a ticket is closed(inactivated)', # loc
-       ApplicableTransTypes => 'Status,Set',
+       applicable_trans_types => 'Status,Set',
        ExecModule           => 'CloseTicket',
     },
     {  name                 => 'On Reopen',                                # loc
        Description          => 'Whenever a ticket is reopened(activated)', # loc
-       ApplicableTransTypes => 'Status,Set',
+       applicable_trans_types => 'Status,Set',
        ExecModule           => 'ReopenTicket',
     },
 
@@ -565,7 +565,7 @@
 
 # Now magically turn myself into a Requestor Notify object...
 require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
-$self->{Argument} = 'Requestor'; $self->prepare;
+$self->{argument} = 'Requestor'; $self->prepare;
 
 return $rejected;
 # ------------------------------------------------------------------- #
@@ -601,7 +601,7 @@
 
 # Now magically turn myself into a Requestor Notify object...
 require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
-$self->{Argument} = 'Requestor'; $self->prepare;
+$self->{argument} = 'Requestor'; $self->prepare;
 
 return 1;
 # ------------------------------------------------------------------- #
@@ -658,7 +658,7 @@
 
 # Now magically turn myself into a Requestor Notify object...
 require RT::ScripAction::Notify; bless($self, 'RT::ScripAction::Notify');
-$self->{Argument} = 'Requestor'; $self->prepare;
+$self->{argument} = 'Requestor'; $self->prepare;
 
 return 0; # ignore $passed;
 # ------------------------------------------------------------------- #

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	Mon Jan 28 16:36:00 2008
@@ -57,7 +57,7 @@
 		transaction_obj => $tr, 
 		ticket_obj => $ti, 
 		scrip_obj => $scr, 
-		Argument => $arg, 
+		argument => $arg, 
 		Type => $type);
 
     if ($foo->IsApplicable) {
@@ -103,25 +103,25 @@
         ticket_obj           => undef,
         scrip_obj            => undef,
         template_obj         => undef,
-        Argument             => undef,
-        ApplicableTransTypes => undef,
+        argument             => undef,
+        applicable_trans_types => undef,
         @_
     );
 
-    $self->{'Argument'}             = $args{'Argument'};
+    $self->{'argument'}             = $args{'argument'};
     $self->{'scrip_obj'}            = $args{'scrip_obj'};
     $self->{'ticket_obj'}           = $args{'ticket_obj'};
     $self->{'transaction_obj'}      = $args{'transaction_obj'};
-    $self->{'ApplicableTransTypes'} = $args{'ApplicableTransTypes'};
+    $self->{'applicable_trans_types'} = $args{'applicable_trans_types'};
 }
 
 # }}}
 
 # Access Scripwide data
 
-# {{{ sub Argument
+# {{{ sub argument
 
-=head2 Argument
+=head2 argument
 
 Return the optional argument associated with this ScripCondition
 
@@ -129,7 +129,7 @@
 
 sub argument {
     my $self = shift;
-    return ( $self->{'Argument'} );
+    return ( $self->{'argument'} );
 }
 
 # }}}
@@ -188,7 +188,7 @@
 
 sub applicable_trans_types {
     my $self = shift;
-    return ( $self->{'ApplicableTransTypes'} );
+    return ( $self->{'applicable_trans_types'} );
 }
 
 # }}}

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Condition/PriorityExceeds.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Condition/PriorityExceeds.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Condition/PriorityExceeds.pm	Mon Jan 28 16:36:00 2008
@@ -61,7 +61,7 @@
 
 sub is_applicable {
     my $self = shift;
-    if ( $self->ticket_obj->Priority > $self->Argument ) {
+    if ( $self->ticket_obj->Priority > $self->argument ) {
         return (1);
     } else {
         return (undef);

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripAction.pm	Mon Jan 28 16:36:00 2008
@@ -81,7 +81,7 @@
     column name        => type is 'text';
     column Description => type is 'text';
     column ExecModule  => type is 'text';
-    column Argument    => type is 'text';
+    column argument    => type is 'text';
     column Creator     => max_length is 11, type is 'int(11)', default is '0';
     column Created => type is 'datetime', default is '';
     column
@@ -174,7 +174,7 @@
     eval "require $type" || die "Require of $type failed.\n$@\n";
 
     $self->{'Action'} = $type->new(
-        Argument        => $self->argument,
+        argument        => $self->argument,
         CurrentUser     => $self->current_user,
         ScripActionObj  => $self,
         scrip_obj       => $args{'scrip_obj'},

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ScripCollection.pm	Mon Jan 28 16:36:00 2008
@@ -348,7 +348,7 @@
     foreach ( split /\s*,\s*/, ( $args{'Type'} || '' ) ) {
         $self->limit(
             alias            => $ConditionsAlias,
-            column           => 'ApplicableTransTypes',
+            column           => 'applicable_trans_types',
             operator         => 'LIKE',
             value            => $_,
             entry_aggregator => 'OR',
@@ -358,7 +358,7 @@
     # Or where the scrip applies to any transaction
     $self->limit(
         alias            => $ConditionsAlias,
-        column           => 'ApplicableTransTypes',
+        column           => 'applicable_trans_types',
         operator         => 'LIKE',
         value            => "Any",
         entry_aggregator => 'OR',

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	Mon Jan 28 16:36:00 2008
@@ -81,8 +81,8 @@
     column name                 => type is 'text';
     column Description          => type is 'text';
     column ExecModule           => type is 'text';
-    column Argument             => type is 'text';
-    column ApplicableTransTypes => type is 'text';
+    column argument             => type is 'text';
+    column applicable_trans_types => type is 'text';
     column Creator => max_length is 11, type is 'int(11)', default is '0';
     column Created => type is 'datetime', default is '';
     column
@@ -179,8 +179,8 @@
         'ticket_obj'           => $args{'ticket_obj'},
         'scrip_obj'            => $args{'scrip_obj'},
         'transaction_obj'      => $args{'transaction_obj'},
-        'Argument'             => $self->argument,
-        'ApplicableTransTypes' => $self->applicable_trans_types,
+        'argument'             => $self->argument,
+        'applicable_trans_types' => $self->applicable_trans_types,
         CurrentUser            => $self->current_user
     );
 }

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	Mon Jan 28 16:36:00 2008
@@ -623,11 +623,11 @@
         # we know it's an array ref
         foreach my $watcher ( @{ $args{$type} } ) {
 
-      # Note that we're using AddWatcher, rather than _AddWatcher, as we
+      # Note that we're using add_watcher, rather than _add_watcher, as we
       # actually _want_ that ACL check. Otherwise, random ticket creators
       # could make themselves adminccs and maybe get ticket rights. that would
       # be poor
-            my $method = $type eq 'AdminCc' ? 'AddWatcher' : '_AddWatcher';
+            my $method = $type eq 'AdminCc' ? 'add_watcher' : '_add_watcher';
 
             my ( $val, $msg ) = $self->$method(
                 Type         => $type,

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/Generic.pm	Mon Jan 28 16:36:00 2008
@@ -85,7 +85,7 @@
 sub _init {
     my $self = shift;
     my %args = (
-        Argument        => undef,
+        argument        => undef,
         ScripActionObj  => undef,
         scrip_obj       => undef,
         template_obj    => undef,
@@ -96,7 +96,7 @@
         @_
     );
 
-    $self->{'Argument'}        = $args{'Argument'};
+    $self->{'argument'}        = $args{'argument'};
     $self->{'ScripActionObj'}  = $args{'ScripActionObj'};
     $self->{'scrip_obj'}       = $args{'scrip_obj'};
     $self->{'template_obj'}    = $args{'template_obj'};
@@ -116,10 +116,10 @@
 
 # Access Scripwide data
 
-# {{{ sub Argument
+# {{{ sub argument
 sub argument {
     my $self = shift;
-    return ( $self->{'Argument'} );
+    return ( $self->{'argument'} );
 }
 
 # }}}

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	Mon Jan 28 16:36:00 2008
@@ -150,7 +150,7 @@
     my $self = shift;
 
     my ( $result, $message ) = $self->template_obj->parse(
-        Argument        => $self->argument,
+        argument        => $self->argument,
         ticket_obj      => $self->ticket_obj,
         transaction_obj => $self->transaction_obj
     );

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SetPriority.pm	Mon Jan 28 16:36:00 2008
@@ -79,7 +79,7 @@
 sub commit {
     my $self = shift;
     warn "Committing the setprio";
-    $self->ticket_obj->set_Priority( $self->Argument );
+    $self->ticket_obj->set_Priority( $self->argument );
 
 }
 


More information about the Rt-commit mailing list