import rt 3.6.6
[freeside.git] / rt / lib / RT / ScripAction_Overlay.pm
index c0a10ca..4b93c6c 100644 (file)
@@ -1,8 +1,8 @@
-# {{{ BEGIN BPS TAGGED BLOCK
+# BEGIN BPS TAGGED BLOCK {{{
 # 
 # COPYRIGHT:
 #  
-# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
+# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
 #                                          <jesse@bestpractical.com>
 # 
 # (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
 # 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 or visit their web page on the internet at
+# http://www.gnu.org/copyleft/gpl.html.
 # 
 # 
 # CONTRIBUTION SUBMISSION POLICY:
@@ -42,7 +44,7 @@
 # works based on those contributions, and sublicense and distribute
 # those contributions and any derivatives thereof.
 # 
-# }}} END BPS TAGGED BLOCK
+# END BPS TAGGED BLOCK }}}
 =head1 NAME
 
   RT::ScripAction - RT Action object
@@ -68,6 +70,9 @@ ok (require RT::ScripAction);
 
 =cut
 
+
+package RT::ScripAction;
+
 use strict;
 no warnings qw(redefine);
 use RT::Template;
@@ -89,10 +94,12 @@ sub _Accessible  {
 # }}}
 
 # {{{ sub Create 
+
 =head2 Create
-  
- Takes a hash. Creates a new Action entry.
- should be better documented.
+
+Takes a hash. Creates a new Action entry.  should be better
+documented.
+
 =cut
 
 sub Create  {
@@ -111,6 +118,15 @@ sub Delete  {
 # }}}
 
 # {{{ sub Load 
+
+=head2 Load IDENTIFIER
+
+Loads an action by its Name.
+
+Returns: Id, Error Message
+
+=cut
+
 sub Load  {
     my $self = shift;
     my $identifier = shift;
@@ -133,7 +149,7 @@ sub Load  {
        
        $self->{'Template'} = $template;
     }
-    return ($self->loc('[_1] ScripAction loaded', $self->Id));
+    return ($self->Id, ($self->loc('[_1] ScripAction loaded', $self->Id)));
 }
 # }}}
 
@@ -160,13 +176,13 @@ sub LoadAction  {
  
     eval "require $type" || die "Require of $type failed.\n$@\n";
     
-    $self->{'Action'}  = $type->new ( ScripActionObj => $self, 
-                                     TicketObj => $args{'TicketObj'},
-                                     ScripObj => $args{'ScripObj'},
-                                     TransactionObj => $args{'TransactionObj'},
-                                     TemplateObj => $self->TemplateObj,
-                                     Argument => $self->Argument,
-                      CurrentUser => $self->CurrentUser
+    $self->{'Action'}  = $type->new ( Argument => $self->Argument,
+                                      CurrentUser => $self->CurrentUser,
+                                      ScripActionObj => $self, 
+                                      ScripObj => $args{'ScripObj'},
+                                      TemplateObj => $self->TemplateObj,
+                                      TicketObj => $args{'TicketObj'},
+                                      TransactionObj => $args{'TransactionObj'},
                                    );
 }
 # }}}
@@ -214,6 +230,7 @@ sub TemplateObj {
 
 sub Prepare  {
     my $self = shift;
+    $self->{_Message_ID} = 0;
     return ($self->Action->Prepare());
   
 }