X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_bill_event.cgi;h=c7f452dc3d5f32a219d1f7ce0e0bfd911d5748ca;hb=0930d22ffc440f80c1b222b2e750cadbabd9e8f6;hp=8e5dcd1fc11660ee0bbf1df92c4a51d4f4791978;hpb=05686487551e26418c9b2d6b92ea0d89bb100082;p=freeside.git diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 8e5dcd1fc..c7f452dc3 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,49 +1,12 @@ - -% -% -%if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { -% $cgi->param('eventpart', $1); -%} else { -% $cgi->param('eventpart', ''); -%} -% -%my ($creason, $newcreasonT, $newcreason); -%my ($sreason, $newsreasonT, $newsreason); -% -% -%my ($query) = $cgi->keywords; -%my $action = ''; -%my $part_bill_event = ''; -%my $currentreasonclass = ''; -%if ( $cgi->param('error') ) { -% $part_bill_event = new FS::part_bill_event ( { -% map { $_, scalar($cgi->param($_)) } fields('part_bill_event') -% } ); -%} -%if ( $query && $query =~ /^(\d+)$/ ) { -% $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1}); -%} else { -% $part_bill_event ||= new FS::part_bill_event {}; -%} -%$action ||= $part_bill_event->eventpart ? 'Edit' : 'Add'; -%my $hashref = $part_bill_event->hashref; -% -% - - <% include('/elements/header.html', "$action Invoice Event Definition", menubar( - 'Main Menu' => popurl(2), 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', ) ) %> -% if ( $cgi->param('error') ) { - - Error: <% $cgi->param('error') %> -% } +<% include('/elements/error.html') %>
@@ -250,6 +213,12 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> % 'weight' => 50, % }, % +% 'send_email' => { +% 'name' => 'Send invoice (email only)', +% 'code' => '$cust_bill->email();', +% 'weight' => 50, +% }, +% % 'send_alternate' => { % 'name' => 'Send invoice (email/print/fax) with alternate template', % 'code' => '$cust_bill->send(\'%%%templatename%%%\');', @@ -498,7 +467,14 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
-<% include('/elements/tr-select-reason.html', 'creason', 'C', $creason, $newcreasonT, $newcreason) %> +<% include('/elements/tr-select-reason.html', + 'field' => 'creason', + 'reason_class' => 'C', + 'curr_value' => $creason, + 'init_type' => $newcreasonT, + 'init_newreason' => $newcreason + ) +%>
@@ -506,7 +482,14 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
-<% include('/elements/tr-select-reason.html', 'sreason', 'S', $sreason, $newsreasonT, $newsreason) %> +<% include('/elements/tr-select-reason.html', + 'field' => 'sreason', + 'reason_class' => 'S', + 'curr_value' => $sreason, + 'init_type' => $newsreasonT, + 'init_newreason' => $newsreason + ) +%>
@@ -519,7 +502,38 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
- - +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { + $cgi->param('eventpart', $1); +} else { + $cgi->param('eventpart', ''); +} + +my ($creason, $newcreasonT, $newcreason); +my ($sreason, $newsreasonT, $newsreason); + +my ($query) = $cgi->keywords; +my $action = ''; +my $part_bill_event = ''; +my $currentreasonclass = ''; +if ( $cgi->param('error') ) { + $part_bill_event = new FS::part_bill_event ( { + map { $_, scalar($cgi->param($_)) } fields('part_bill_event') + } ); +} +if ( $query && $query =~ /^(\d+)$/ ) { + $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1}); +} else { + $part_bill_event ||= new FS::part_bill_event {}; +} +$action ||= $part_bill_event->eventpart ? 'Edit' : 'Add'; +my $hashref = $part_bill_event->hashref; +