Index: openacs-4/packages/news/www/admin/item.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/item.adp,v
diff -u -r1.7 -r1.7.8.1
--- openacs-4/packages/news/www/admin/item.adp 24 Feb 2005 18:03:05 -0000 1.7
+++ openacs-4/packages/news/www/admin/item.adp 1 Aug 2008 12:32:35 -0000 1.7.8.1
@@ -2,60 +2,4 @@
@context;noquote@
@title;noquote@
-
-
-
#news.Add_a_new_revision#
-
-
-
-
-
-
-
+
Index: openacs-4/packages/news/www/admin/item.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/item.tcl,v
diff -u -r1.4 -r1.4.14.1
--- openacs-4/packages/news/www/admin/item.tcl 23 Aug 2003 22:25:11 -0000 1.4
+++ openacs-4/packages/news/www/admin/item.tcl 1 Aug 2008 12:32:35 -0000 1.4.14.1
@@ -34,33 +34,69 @@
set title "[_ news.One_Item]"
set context [list $title]
+set return_url [export_vars -base "item" {item_id}]
# get revisions of the item
-db_multirow item item_revs_list {
-select
- item_id,
- revision_id,
- live_revision as item_live_revision_id,
- publish_title,
- log_entry,
- package_id,
- approval_needed_p,
- creation_user,
- item_creator,
- status
-from
- news_item_revisions
-where
- item_id = :item_id
-order by revision_id desc
-}
+set counter 1
+db_multirow -extend {revision revision_url set_active_url active_revision author_url action action_url} item item_revs_list {} {
-ad_return_template
+ set revision $counter
+ set revision_url [export_vars -base "revision" {item_id revision_id}]
+ if { $item_live_revision_id eq $revision_id } {
+ set active_revision [_ news.active]
+ set set_active_url ""
+ } else {
+ set active_revision [_ news.make_active]
+ set set_active_url [export_vars -base "revision-set-active" {item_id {new_rev_id $revision_id}}]
+ }
+ set author_url [export_vars -base "/shared/community-member" {{user_id $creation_user}}]
+ if { $approval_needed_p } {
+ set action_url [export_vars -base "approve" {return_url revision_id {n_items $item_id}}]
+ set action [_ news.approve]
+ } else {
+ set action_url [export_vars -base "revoke" {revision_id item_id}]
+ set action [_ news.revoke]
+ }
+ incr counter
+}
+template::multirow foreach item {
+ set revision [expr { $counter - $revision }]
+}
+template::list::create -name news_items -multirow item -actions [list [_ news.Add_a_new_revision] [export_vars -base "revision-add" {item_id}] [_ news.Add_a_new_revision]] -elements {
+ revision {
+ label "[_ news.Revision]"
+ link_url_col revision_url
+ }
+ active_revision {
+ label "[_ news.Active_Revision]"
+ link_url_col set_active_url
+ }
+ publish_title {
+ label "[_ news.Title]"
+ link_url_col revision_url
+ }
+ item_creator {
+ label "[_ news.Author]"
+ link_url_col author_url
+ }
+ log_entry {
+ label "[_ news.Log_Entry]"
+ }
+ status {
+ label "[_ news.Status]"
+ }
+ action {
+ label "[_ acs-kernel.common_Actions]"
+ link_url_col action_url
+ }
+}
+
+ad_return_template