Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.28 -r1.29 --- openacs-4/packages/xowiki/xowiki.info 15 Sep 2006 16:44:59 -0000 1.28 +++ openacs-4/packages/xowiki/xowiki.info 17 Nov 2006 21:26:23 -0000 1.29 @@ -40,6 +40,7 @@ + Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 17 Aug 2006 01:44:26 -0000 1.1 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 17 Nov 2006 21:26:23 -0000 1.2 @@ -83,6 +83,7 @@ -extra_where_clause "and ci.item_id not in ([my exclude_item_ids]) \ and ci.name != '::$folder_id' and ci.name not like '%weblog%' $date_clause \ and ci.content_type not in ('::xowiki::PageTemplate','::xowiki::Object') \ + and ci.publish_status <> 'production' \ $extra_where_clause" ] set nr_items [db_string count [eval ::xowiki::Page select_query $sql -count true]] Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 6 Nov 2006 18:37:38 -0000 1.15 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 17 Nov 2006 21:26:23 -0000 1.16 @@ -156,11 +156,14 @@ return 1 } - WikiForm instproc handle_enhanced_text_from_form {} { + WikiForm instproc data_from_form {} { my instvar data if {[$data exists_form_parameter text.format]} { $data set mime_type [$data form_parameter text.format] } + if {[[$data set package_id] get_parameter production_mode]} { + $data set content_item.publish_status production + } } WikiForm instproc update_references {} { my instvar data @@ -213,15 +216,15 @@ WikiForm instproc new_data {} { my instvar data - my handle_enhanced_text_from_form + my data_from_form set item_id [next] $data set creation_user [ad_conn user_id] my update_references return $item_id } WikiForm instproc edit_data {} { - my handle_enhanced_text_from_form + my data_from_form set item_id [next] my update_references return $item_id Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 17 Aug 2006 01:44:26 -0000 1.1 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 17 Nov 2006 21:26:23 -0000 1.2 @@ -176,7 +176,8 @@ where c.object_id = i.item_id and i.parent_id = [$package_id folder_id] \ and r.revision_id = i.live_revision \ and p.page_id = r.revision_id $tree_select_clause \ - order by r.publish_date desc limit $max_entries + and i.publish_status <> 'production' \ + order by r.publish_date desc limit $max_entries \ " { if {$title eq ""} {set title $name} set itemobj [Object new] @@ -225,6 +226,7 @@ where i.parent_id = [$package_id folder_id] \ and r.revision_id = i.live_revision \ and p.page_id = r.revision_id \ + and i.publish_status <> 'production' \ order by r.publish_date desc limit $max_entries\ " { t1 add \ @@ -267,7 +269,8 @@ from xowiki_last_visited x, xowiki_page p, cr_items i, cr_revisions r \ where x.page_id = i.item_id and i.live_revision = p.page_id \ and r.revision_id = p.page_id and x.user_id = [::xo::cc user_id] \ - and x.package_id = $package_id order by x.time desc limit $max_entries \ + and x.package_id = $package_id and i.publish_status <> 'production' \ + order by x.time desc limit $max_entries \ " { t1 add \ -title $title \ @@ -303,7 +306,8 @@ "select sum(x.count), x.page_id, r.title,i.name \ from xowiki_last_visited x, xowiki_page p, cr_items i, cr_revisions r \ where x.page_id = i.item_id and i.live_revision = p.page_id and r.revision_id = p.page_id \ - and x.package_id = $package_id group by x.page_id, r.title, i.name \ + and x.package_id = $package_id and i.publish_status <> 'production' \ + group by x.page_id, r.title, i.name \ order by sum desc limit $max_entries " \ { t1 add \ Index: openacs-4/packages/xowiki/www/admin/list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xowiki/www/admin/list.tcl 17 Aug 2006 11:21:20 -0000 1.5 +++ openacs-4/packages/xowiki/www/admin/list.tcl 17 Nov 2006 21:26:24 -0000 1.6 @@ -48,6 +48,7 @@ } set ::individual_permissions [expr {[$package_id set policy] eq "::xowiki::policy3"}] +set ::with_publish_status 1 TableWidget t1 -volatile \ -actions $actions \ @@ -58,6 +59,11 @@ -height 16 -border 0 -title "Manage Individual Permssions for this Item" \ -alt permsissions -label "" -html {style "padding: 2px;"} } + if {$::with_publish_status} { + ImageField publish_status -src "" -width 8 \ + -height 8 -border 0 -title "Toggle Publish Status" \ + -alt "publish status" -label [_ xowiki.publish_status] -html {style "padding: 2px;"} + } AnchorField name -label [_ xowiki.name] -orderby name Field object_type -label [_ xowiki.page_type] -orderby object_type Field size -label "Size" -orderby size -html {align right} @@ -77,7 +83,7 @@ [$object_type instance_select_query \ -folder_id [::$package_id folder_id] \ -with_subtypes $with_subtypes \ - -select_attributes [list content_length creation_user \ + -select_attributes [list revision_id content_length creation_user \ "to_char(last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified"] \ -order_clause $order_clause \ ] { @@ -97,6 +103,20 @@ [lindex [t1 set __children] end] set permissions.href \ [export_vars -base permissions {item_id return_url}] } + if {$::with_publish_status} { + # TODO: this should get some architectural support + if {$publish_status eq "ready"} { + set image active.png + set state "production" + } else { + set image inactive.png + set state "ready" + } + [lindex [t1 set __children] end] set publish_status.src /resources/xowiki/$image + [lindex [t1 set __children] end] set publish_status.href \ + [export_vars -base [$package_id package_url]admin/set-publish-state \ + {state revision_id return_url}] + } } set t1 [t1 asHTML] Index: openacs-4/packages/xowiki/www/admin/set-publish-state.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/set-publish-state.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/admin/set-publish-state.tcl 17 Nov 2006 21:26:24 -0000 1.1 @@ -0,0 +1,18 @@ +::xowiki::Package initialize -ad_doc { + Changes the publication state of a content item + + @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) + @creation-date Nov 16, 2006 + @cvs-id $Id: set-publish-state.tcl,v 1.1 2006/11/17 21:26:24 gustafn Exp $ + + @param object_type + @param query +} -parameter { + {-state:required} + {-revision_id:required} + {-return_url "."} +} + +db_0or1row make_live {select content_item__set_live_revision(:revision_id,:state)} + +ad_returnredirect $return_url Index: openacs-4/packages/xowiki/www/resources/active.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/Attic/active.png,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/inactive.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/Attic/inactive.png,v diff -u Binary files differ