X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=eg%2Fexport_template.pm;h=2c199db8526edec3715af3a807507b14fd549f5a;hp=1d441bda1f17a48db6424d7e8aecf3a0ee23554d;hb=b0511ff939fe1622503ac8e53333fabb1ad9bd37;hpb=eb7c552dd8290d6b33a4e026c5dc21ebf01105cf diff --git a/eg/export_template.pm b/eg/export_template.pm index 1d441bda1..2c199db85 100644 --- a/eg/export_template.pm +++ b/eg/export_template.pm @@ -1,15 +1,40 @@ package FS::part_export::myexport; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; use FS::part_export; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'regular_option' => { label => 'Option description', default => 'value' }, + 'select_option' => { label => 'Select option description', + type => 'select', options=>[qw(chocolate vanilla)], + default => 'vanilla', + }, + 'textarea_option' => { label => 'Textarea option description', + type => 'textarea', + default => 'Default text.', + }, + 'checkbox_option' => { label => 'Checkbox label', type => 'checkbox' }, +; + +%info = ( + 'svc' => 'svc_acct', + #'svc' => [qw( svc_acct svc_forward )], + 'desc' => + 'Export short description', + 'options' => \%options, + 'nodomain' => 'Y', + 'notes' => <<'END' +HTML notes about this export. +END + sub rebless { shift; } sub _export_insert { my($self, $svc_something) = (shift, shift); - $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, 'insert', + $err_or_queue = $self->myexport_queue( $svc_something->svcnum, 'insert', $svc_something->username, $svc_something->_password ); ref($err_or_queue) ? '' : $err_or_queue; } @@ -26,7 +51,7 @@ sub _export_replace { sub _export_delete { my( $self, $svc_something ) = (shift, shift); - $err_or_queue = $self->myexport_queue( $svc_acct->svcnum, + $err_or_queue = $self->myexport_queue( $svc_something->svcnum, 'delete', $svc_something->username ); ref($err_or_queue) ? '' : $err_or_queue; } @@ -42,9 +67,15 @@ sub myexport_queue { } sub myexport_insert { #subroutine, not method + my( $username, $password ) = @_; + #do things with $username and $password } + sub myexport_replace { #subroutine, not method } + sub myexport_delete { #subroutine, not method + my( $username ) = @_; + #do things with $username }