[freeside-commits] freeside/httemplate/edit/process/elements process.html, 1.17, 1.17.4.1
Ivan,,,
ivan at wavetail.420.am
Tue Apr 27 01:52:43 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process/elements
In directory wavetail.420.am:/tmp/cvs-serv648/elements
Modified Files:
Tag: FREESIDE_1_9_BRANCH
process.html
Log Message:
backport o2m_ and colspan from 2.1 process.html
Index: process.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/elements/process.html,v
retrieving revision 1.17
retrieving revision 1.17.4.1
diff -u -w -d -r1.17 -r1.17.4.1
--- process.html 21 Nov 2008 02:55:53 -0000 1.17
+++ process.html 27 Apr 2010 08:52:41 -0000 1.17.4.1
@@ -56,13 +56,17 @@
},
+ 'process_o2m' => { 'table' => table_name',
+ 'num_col' => 'column', #if column name is different in
+ #link_table than source_table
+ },
#checks CGI params and whatever else before much else runs
#return an error string or empty for no error
'precheck_callback' => sub { my( $cgi ) = @_; },
#supplies arguments to insert() and replace()
- # for use with tables that are FS::option_Common
+ # for use with tables that are FS::option_Common (among other things)
'args_callback' => sub { my( $cgi, $object ) = @_; },
'debug' => 1, #turns on debugging output
@@ -186,11 +190,26 @@
}
if ( $opt{'agent_virt'} ) {
+
+ if ( ! $new->agentnum
+ && ( ! $opt{'agent_null_right'}
+ || ! $curuser->access_right($opt{'agent_null_right'})
+ )
+ )
+ {
+
+ $error ||= 'Select an agent';
+
+ } else {
+
die "illegal agentnum"
unless $curuser->agentnums_href->{$new->agentnum}
or $opt{'agent_null_right'}
&& ! $new->agentnum
&& $curuser->access_right($opt{'agent_null_right'});
+
+ }
+
}
$error ||= $new->check;
@@ -255,6 +274,28 @@
}
+if ( !$error && $opt{'process_o2m'} ) {
+
+ my @process_o2m = ref($opt{'process_o2m'}) eq 'ARRAY'
+ ? @{ $opt{'process_o2m'} }
+ : ( $opt{'process_o2m'} );
+
+
+ foreach my $process_o2m (@process_o2m) {
+
+ if ( $opt{'debug'} ) {
+ warn "$me processing o2m:\n". Dumper( %{ $process_o2m },
+ 'params' => scalar($cgi->Vars),
+ );
+ }
+
+ $error = $new->process_o2m( %{ $process_o2m },
+ 'params' => scalar($cgi->Vars),
+ );
+ }
+
+}
+
if ( $error ) {
$cgi->param('error', $error);
More information about the freeside-commits
mailing list