X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FAction.pm;h=1916e40a14322f604f7eaac94f9b3d23f6df3b60;hb=05da91c115be0adae38533c4d16156250f6d2080;hp=bdb9df603754670367d229ca7e8a6c13cdc27aad;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/FS/FS/part_event/Action.pm b/FS/FS/part_event/Action.pm index bdb9df603..1916e40a1 100644 --- a/FS/FS/part_event/Action.pm +++ b/FS/FS/part_event/Action.pm @@ -51,9 +51,23 @@ sub eventtable_hashref { 'cust_bill' => 1, 'cust_pkg' => 1, 'cust_pay_batch' => 1, + 'svc_acct' => 1, }; } +=item event_stage + +Action classes may define an event_stage method to indicate a preference +for being run at a non-standard stage of the billing and collection process. + +This method may currently return "collect" (the default) or "pre-bill". + +=cut + +sub event_stage { + 'collect'; +} + =item option_fields Action classes may define an option_fields method to indicate that they @@ -63,12 +77,16 @@ This method should return a list of option names and option descriptions. Each option description can be a scalar description, for simple options, or a hashref with the following values: +=over 4 + =item label - Description =item type - Currently text, money, checkbox, checkbox-multiple, select, select-agent, select-pkg_class, select-part_referral, select-table, fixed, hidden, (others can be implemented as httemplate/elements/tr-TYPE.html mason components). Defaults to text. =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. @@ -176,6 +194,21 @@ sub cust_main { } +=item cust_pkg OBJECT + +Return the package object (L) associated with the provided +object. The object must be either a service (L) 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. @@ -202,6 +235,7 @@ Returns the option fields as an (ordered) hash reference. sub option_fields_hashref { my $self = shift; tie my %hash, 'Tie::IxHash', $self->option_fields; + \%hash; } =item option_fields_listref