its all about control
[freeside.git] / httemplate / browse / part_bill_event.cgi
index 2486c66..682058b 100755 (executable)
@@ -1,16 +1,3 @@
-% 
-%my %search;
-%if ( $cgi->param('showdisabled') ) {
-%  %search = ();
-%} else {
-%  %search = ( 'disabled' => '' );
-%}
-%
-%my @part_bill_event = qsearch('part_bill_event', \%search );
-%my $total = scalar(@part_bill_event);
-%
-
-
 <% include("/elements/header.html",'Invoice Event Listing', menubar( 'Main Menu' => $p) ) %>
 
     Invoice events are actions taken on open invoices.<BR><BR>
@@ -55,6 +42,7 @@
 %         my $delay = duration_exact($part_bill_event->seconds);
 %         ( my $plandata = $part_bill_event->plandata ) =~ s/\n/<BR>/go;
 %         my $freq = $part_bill_event->freq || '1d';
+%         my $reason = $part_bill_event->reasontext ;
 %    
 % if ( $oldfreq ne $freq ) { 
 
@@ -67,6 +55,7 @@
           <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<% $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">After</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
+          <TH CLASS="grid" BGCOLOR="#cccccc">Reason</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Options</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Code</TH>
         </TR>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
           <% $part_bill_event->plan %></TD>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+          <% $reason %></TD>
+        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
           <% $plandata %></TD>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><FONT SIZE="-1">
           <% $part_bill_event->eventcode %></FONT></TD>
 
 </BODY>
 </HTML>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my %search;
+if ( $cgi->param('showdisabled') ) {
+%search = ();
+} else {
+%search = ( 'disabled' => '' );
+}
+
+my @part_bill_event = qsearch('part_bill_event', \%search );
+my $total = scalar(@part_bill_event);
+
+</%init>