Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.16.2.9 -r1.16.2.10 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 5 Mar 2003 14:40:42 -0000 1.16.2.9 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 14 Mar 2003 22:26:59 -0000 1.16.2.10 @@ -169,28 +169,36 @@
+
-
@@ -331,11 +339,11 @@
- start_date:date,to_sql(sql_date),to_html(sql_date),optional + start_date:date,to_sql(sql_date),from_html(sql_date),optionalDefine the optional element "start_date" of type "date", get the sql_date property before executing - any new_data, edit_data or on_submit block, set the sql_date property after performing any + any new_date, edit_date or on_submit block, set the sql_date property after performing any select_query.
@@ -361,7 +369,7 @@ } set valid_args { form method action mode html name select_query select_query_name new_data on_refresh - edit_data validate on_submit after_submit confirm_template new_request edit_request + edit_data validate on_submit after_submit confirm_template on_request new_request edit_request export cancel_url cancel_label has_edit actions }; ad_arg_parser $valid_args $args @@ -668,7 +676,6 @@ section - before_html - after_html - - result_datatype - search_query - search_query_name { if { [llength $extra_arg] > 2 || [llength $extra_arg] == 1 } { @@ -729,15 +736,24 @@ upvar #$level $key_name $key_name upvar #$level __ad_form_values__ values + if { [info exists on_request] } { + ad_page_contract_eval uplevel #$level $on_request + foreach element_name $af_element_names($form_name) { + if { [llength $element_name] == 1 } { + if { [uplevel \#$level [list info exists $element_name]] } { + set values($element_name) [uplevel \#$level [list set $element_name]] + } + } + } + } + # Check to see if we're editing an existing database value if { [info exists $key_name] } { if { [info exists edit_request] } { if { [info exists select_query] || [info exists select_query_name] } { return -code error "Edit request block conflicts with select query" } ad_page_contract_eval uplevel #$level $edit_request - - # set form vars from edit_request block foreach element_name $af_element_names($form_name) { if { [llength $element_name] == 1 } { if { [uplevel \#$level [list info exists $element_name]] } { @@ -789,21 +805,13 @@ set sequence_name "acs_object_id_seq" } - if { ![db_0or1row get_key "" -column_array values] } { - return -code error "Couldn't get the next value from sequence \"$af_sequence_name($form_name)\"" + if { [catch {set values($key_name) [db_nextval $sequence_name]} errmsg]} { + return -code error "Couldn't get the next value from sequence: $errmsg\"" } set values(__new_p) 1 if { [info exists new_request] } { ad_page_contract_eval uplevel #$level $new_request - # LARS: Set form values based on local vars in the new_request block - foreach element_name $af_element_names($form_name) { - if { [llength $element_name] == 1 } { - if { [uplevel \#$level [list info exists $element_name]] } { - set values($element_name) [uplevel \#$level [list set $element_name]] - } - } - } } } Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/form-processing-procs.xql'. Fisheye: No comparison available. Pass `N' to diff?