[freeside-commits]
freeside/httemplate/edit/elements edit.html, 1.3, 1.4
Ivan,,,
ivan at wavetail.420.am
Sun Jun 18 05:54:50 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/edit/elements
In directory wavetail:/tmp/cvs-serv30582/httemplate/edit/elements
Modified Files:
edit.html
Log Message:
ACLs: finish group edit (agents + rights) & browse
Index: edit.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/elements/edit.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- edit.html 14 May 2006 16:47:30 -0000 1.3
+++ edit.html 18 Jun 2006 12:54:48 -0000 1.4
@@ -16,6 +16,18 @@
#
# 'menubar' => '', #menubar arrayref
#
+ # #run when re-displaying with an error
+ # 'error_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #run when editing
+ # 'edit_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #run when adding
+ # 'new_callback' => sub { my $cgi, $object = @_; },
+ #
+ # #broken'html_table_bottom' => '', #string or listref of additinal HTML to
+ # #add before </TABLE>
+ #
# 'viewall_dir' => '', #'search' or 'browse', defaults to 'search'
#
# 'html_bottom' => '', #string
@@ -43,16 +55,25 @@
map { $_ => scalar($cgi->param($_)) } fields($table)
});
+ &{$opt{'error_callback'}}($cgi, $object)
+ if $opt{'error_callback'};
+
} elsif ( $cgi->keywords ) { #editing
my( $query ) = $cgi->keywords;
$query =~ /^(\d+)$/;
$object = qsearchs( $table, { $pkey => $1 } );
+ &{$opt{'edit_callback'}}($cgi, $object)
+ if $opt{'edit_callback'};
+
} else { #adding
$object = $class->new( {} );
+ &{$opt{'new_callback'}}($cgi, $object)
+ if $opt{'new_callback'};
+
}
my $action = $object->$pkey() ? 'Edit' : 'Add';
More information about the freeside-commits
mailing list