Index: openacs-4/packages/cms/www/modules/items/status-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/cms/www/modules/items/status-edit.tcl 16 May 2005 22:59:24 -0000 1.9 +++ openacs-4/packages/cms/www/modules/items/status-edit.tcl 6 Jun 2005 15:55:02 -0000 1.9.2.1 @@ -12,10 +12,8 @@ ## Create the form -set cancel_url [export_vars -base index {item_props_tab item_id mount_point}] +form create publish_status -form create publish_status -cancel_url $cancel_url -cancel_label "Cancel Operation" - element create publish_status item_id \ -datatype integer -widget hidden -value $item_id @@ -25,7 +23,7 @@ if { [form is_request publish_status] } { # Determine whether the item has a live revision - set live_revision [db_string get_live_revision ""] + set live_revision [content::item::get_live_revision -item_id $item_id] if { [template::util::is_nil live_revision] } { element set_value publish_status is_live f @@ -43,17 +41,16 @@ # always show production set options [list [list "Production" production]] -set is_publishable [db_string check_status ""] - +set is_publishable [content::item::is_publishable -item_id $item_id] set is_live [element get_value publish_status is_live] # show "Ready" and "Live" if a live revision exists and the item is # publishable -#if { [string equal $is_live t] && [string equal $is_publishable t] } { +if { [string equal $is_live t] && [string equal $is_publishable t] } { lappend options [list "Ready" ready] [list "Live (publishes the item)" live] -#} +} -set is_published [db_string check_published ""] +set is_published [content::item::is_published -item_id $item_id] # show "Expired" only if the item is currently published if { [string equal $is_published t] } { @@ -107,22 +104,17 @@ form get_values publish_status publish_status start_when end_when item_id db_transaction { + ns_log notice "setting publish status to $publish_status for item $item_id" publish::set_publish_status $item_id $publish_status set start_when [template::util::date get_property sql_date $start_when] set end_when [template::util::date get_property sql_date $end_when] - db_exec_plsql set_release_period "begin - content_item.set_release_period( - item_id => :item_id, - start_when => $start_when, - end_when => $end_when - ); - end;" - + db_exec_plsql set_release_period {} } - template::forward index?item_id=$item_id + set item_props_tab publishing + ad_returnredirect [export_vars -base index { item_id item_props_tab }] } # If the item is in a production state, we may simply be marking