Index: openacs-4/packages/edit-this-page/tcl/etp-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs-oracle.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/edit-this-page/tcl/etp-procs-oracle.xql 17 Aug 2002 17:42:45 -0000 1.9 +++ openacs-4/packages/edit-this-page/tcl/etp-procs-oracle.xql 13 Oct 2013 14:31:27 -0000 1.10 @@ -113,7 +113,7 @@ (select * from ( select $columns from cr_items i, cr_revisions r - where i.parent_id = etp.get_folder_id(:package_id) + where i.parent_id = :folder_id and i.name != 'index' and i.live_revision = r.revision_id(+) ) attributes Index: openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql 20 Sep 2005 14:06:05 -0000 1.13 +++ openacs-4/packages/edit-this-page/tcl/etp-procs-postgresql.xql 13 Oct 2013 14:31:27 -0000 1.14 @@ -121,7 +121,7 @@ select * from (select $columns from cr_items i left join cr_revisions r on (i.live_revision = r.revision_id) - where i.parent_id = etp__get_folder_id(:package_id) and i.name != 'index' + where i.parent_id = :folder_id and i.name != 'index' ) attributes where $extra_where_clauses order by $orderby Index: openacs-4/packages/edit-this-page/tcl/etp-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 3 Oct 2013 09:15:25 -0000 1.22 +++ openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 13 Oct 2013 14:31:27 -0000 1.23 @@ -576,7 +576,14 @@ return $revision_id } -ad_proc -public get_content_items { args } { +ad_proc -public get_content_items { + {-orderby ""} + {-limit ""} + {-where ""} + {-package_id ""} + {-result_name "content_items"} + args + } { @author Luke Pond @creation-date 2001-06-10 @param -orderby - what should appear in the ORDER BY clause @@ -610,54 +617,38 @@ and currently is never cached. } { - if {(![info exists package_id] || $package_id eq "")} { - set package_id [ad_conn package_id] - } + set content_type [etp::get_content_type] - set result_name "content_items" - set orderby [db_map gci_orderby] + if {$orderby eq ""} { + set orderby [db_map gci_orderby] + } - set extra_where_clauses [db_map gci_where_clause] - + if {$limit ne ""} { + set limit_clause "limit $limit" + } else { + set limit_clause "" + } + + if {$where ne ""} { + set extra_where_clauses $where + } else { + set extra_where_clauses [db_map gci_where_clause] + } + + if {$package_id eq ""} { + set package_id [ad_conn package_id] + } else { + set app [parameter::get -package_id $package_id -parameter application -default default] + set content_type [etp::get_application_param content_content_type $app] + } + set columns [db_map gci_columns_clause] ns_log debug "get_content_items: columns: $columns" - set limit_clause "" - for {set i 0} {$i < [llength $args]} {incr i} { - set arg [lindex $args $i] + set arg [lindex $args i] - if { $arg eq "-result_name" } { - incr i - set result_name [lindex $args $i] - } - - if { $arg eq "-package_id" } { - incr i - set package_id [lindex $args $i] - set app [parameter::get -package_id $package_id -parameter application -default default] - set content_type [etp::get_application_param content_content_type $app] - } - - if { $arg eq "-orderby" } { - incr i - set orderby [lindex $args $i] - continue - } - - if { $arg eq "-limit" } { - incr i - set limit_clause "limit [lindex $args $i]" - continue - } - - if { $arg eq "-where" } { - incr i - set extra_where_clauses [lindex $args $i] - continue - } - if {$arg in { item_id revision_id content publish_date }} { append columns ",\n r.$arg" } else { @@ -672,6 +663,7 @@ } upvar $result_name $result_name + set folder_id [etp::get_folder_id $package_id] db_multirow $result_name get_content_items "" } Index: openacs-4/packages/edit-this-page/templates/news-index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/templates/news-index.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/edit-this-page/templates/news-index.tcl 7 Sep 2013 12:50:57 -0000 1.3 +++ openacs-4/packages/edit-this-page/templates/news-index.tcl 13 Oct 2013 14:31:27 -0000 1.4 @@ -19,7 +19,7 @@ content_pages:multirow } -if { $archive_p eq "f" } { +if { $archive_p == "f" } { set where [db_map archive_where_clause] } else { set where [db_map no_archive_where_clause] Index: openacs-4/packages/edit-this-page/www/etp-create-extlink.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-create-extlink.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/edit-this-page/www/etp-create-extlink.tcl 9 Sep 2013 17:34:17 -0000 1.4 +++ openacs-4/packages/edit-this-page/www/etp-create-extlink.tcl 13 Oct 2013 14:31:27 -0000 1.5 @@ -15,7 +15,7 @@ form_vars:onevalue } -if { $confirmed eq "t" } { +if { $confirmed == "t" } { if { $subtopic_name eq "" || [regexp {[^a-zA-Z0-9\-_]} $subtopic_name] } { ad_return_complaint 1 "The subtopic name must be a short identifier Index: openacs-4/packages/edit-this-page/www/etp-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-delete.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/edit-this-page/www/etp-delete.tcl 9 Sep 2013 17:34:17 -0000 1.3 +++ openacs-4/packages/edit-this-page/www/etp-delete.tcl 13 Oct 2013 14:31:27 -0000 1.4 @@ -19,7 +19,7 @@ set package_id [ad_conn package_id] -if { $confirmed eq "t" } { +if { $confirmed == "t" } { # TODO: the clear_revisions statement below should be unnecessary. # It's there because content_item__delete was throwing an error # (possibly due to the data-change violation, basically a postgresql bug) Index: openacs-4/packages/edit-this-page/www/etp-extlink.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-extlink.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/edit-this-page/www/etp-extlink.tcl 9 Sep 2013 17:34:17 -0000 1.6 +++ openacs-4/packages/edit-this-page/www/etp-extlink.tcl 13 Oct 2013 14:31:27 -0000 1.7 @@ -21,7 +21,7 @@ set package_id [ad_conn package_id] set user_id [ad_conn user_id] -if { $confirmed eq "t" } { +if { $confirmed == "t" } { if { $url eq "" || $label eq "" } { ad_return_complaint 1 "[_ edit-this-page.You_must_fill_out_all_fields]" } else { Index: openacs-4/packages/edit-this-page/www/etp-revert.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-revert.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/edit-this-page/www/etp-revert.tcl 9 Sep 2013 17:34:17 -0000 1.3 +++ openacs-4/packages/edit-this-page/www/etp-revert.tcl 13 Oct 2013 14:31:27 -0000 1.4 @@ -23,7 +23,7 @@ set package_id [ad_conn package_id] -if { $confirmed eq "t" } { +if { $confirmed == "t" } { db_transaction { db_1row get_item_id "" Index: openacs-4/packages/edit-this-page/www/etp-revision-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-revision-delete.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/edit-this-page/www/etp-revision-delete.tcl 9 Sep 2013 17:34:17 -0000 1.4 +++ openacs-4/packages/edit-this-page/www/etp-revision-delete.tcl 13 Oct 2013 14:31:27 -0000 1.5 @@ -22,7 +22,7 @@ set package_id [ad_conn package_id] -if {$confirmed eq "t"} { +if {$confirmed == "t"} { db_exec_plsql delete_revision {} Index: openacs-4/packages/edit-this-page/www/etp-setup.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-setup.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/edit-this-page/www/etp-setup.tcl 7 Sep 2013 12:50:58 -0000 1.5 +++ openacs-4/packages/edit-this-page/www/etp-setup.tcl 13 Oct 2013 14:31:27 -0000 1.6 @@ -22,7 +22,7 @@ set package_id [ad_conn package_id] -if { $confirmed eq "f" } { +if { $confirmed == "f" } { set app [parameter::get -package_id $package_id -parameter application -default "default"] set subtopic_app [parameter::get -package_id $package_id -parameter subtopic_application -default "default"] Index: openacs-4/packages/edit-this-page/www/etp-subtopic-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-subtopic-create.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/edit-this-page/www/etp-subtopic-create.tcl 9 Sep 2013 17:34:17 -0000 1.5 +++ openacs-4/packages/edit-this-page/www/etp-subtopic-create.tcl 13 Oct 2013 14:31:27 -0000 1.6 @@ -17,7 +17,7 @@ etp::check_write_access -if { $confirmed eq "t" } { +if { $confirmed == "t" } { if { $subtopic_name eq "" || [regexp {[^a-zA-Z0-9\-_]} $subtopic_name] } { ad_return_complaint 1 "[_ edit-this-page.The_subtopic_name_must_be_a_short_identifier]"