[freeside-commits] freeside/httemplate/edit/process part_event.html, 1.1, 1.2

Mark Wells mark at wavetail.420.am
Sun Nov 21 18:52:32 PST 2010


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv18424

Modified Files:
	part_event.html 
Log Message:
make reasonnum mandatory in event actions, RT#9684

Index: part_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_event.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- part_event.html	1 Aug 2007 22:25:05 -0000	1.1
+++ part_event.html	22 Nov 2010 02:52:30 -0000	1.2
@@ -72,6 +72,17 @@
           @{ $object->option_fields_listref };
 
     },
+    'precheck_callback' => sub {
+      my $cgi = shift;
+      my $action = $cgi->param('action') or return;
+      my %actionfields = map { $_ =~ /^$action\.(.*)/; $1 => $cgi->param($_) }
+                         grep { /^$action\./ } $cgi->param;
+      if ( exists($actionfields{'reasonnum'}) and 
+           length($actionfields{'reasonnum'}) == 0 ) {
+        return 'Reason required';
+      }
+      return '';
+    },
 
     'agent_virt'       => 1,
     'agent_null_right' => 'Edit global billing events',



More information about the freeside-commits mailing list