RT# 76309 Add validation for part_event_option.optionvalue
[freeside.git] / FS / FS / part_event / Action.pm
index 45219a3..1916e40 100644 (file)
@@ -51,6 +51,7 @@ sub eventtable_hashref {
       'cust_bill'      => 1,
       'cust_pkg'       => 1,
       'cust_pay_batch' => 1,
+      'svc_acct'       => 1,
     };
 }
 
@@ -84,6 +85,8 @@ hashref with the following values:
 
 =item size - Size for text fields
 
+=item validation - (optional) Validate optionvalue using the given object method, such as ut_textn, ut_email
+
 =item options - For checkbox-multiple and select, a list reference of available option values.
 
 =item option_labels - For select, a hash reference of availble option values and labels.
@@ -191,6 +194,21 @@ sub cust_main {
 
 }
 
+=item cust_pkg OBJECT
+
+Return the package object (L<FS::cust_pkg>) associated with the provided 
+object.  The object must be either a service (L<FS::svc_Common>) or a 
+package.
+
+=cut
+
+sub cust_pkg {
+  my( $self, $object ) = @_;
+  $object->isa('FS::cust_pkg')      ? $object :
+  $object->isa('FS::svc_Common')    ? $object->cust_svc->cust_pkg :
+  undef;
+}
+
 =item option_label OPTIONNAME
 
 Returns the label for the specified option name.