Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 4 Aug 2003 11:19:46 -0000 1.2 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 27 Aug 2003 17:23:27 -0000 1.3 @@ -20,12 +20,15 @@ {-mime_type "text/plain"} {-description ""} {-content ""} - {-creation_user_id ""} - {-creation_ip ""} + {-creation_user_id} + {-creation_ip} } { Adds a new revision to a content item stored in the cr_revision.content column. Normally you will use your own proc patterned after this proc } { + if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } + if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } + if ![info exists content_type] { set content_type [bcms::item::get_content_type -item_id $item_id] } @@ -124,7 +127,7 @@ } { Get the revision info on a single revision returns an array that contains item_id, name, title, description, - content, content_type, publish_status, live_revision, storage_type + content, content_type, publish_status, latest_revision, live_revision, storage_type } { if {[db_0or1row get_1revision "SQL" -column_array one_revision]} { @@ -201,3 +204,23 @@ } +ad_proc -public bcms::revision::copy_revision { + {-revision_id:required} + {-creation_user_id} + {-creation_ip} +} { + creates another revision based from the revision_id passed. + + @param revision_id id of which the version will be copied from + @param creation_user user performing the copy + @param creation_ip ip address of the user performing the copy + + @returns the version id of the new revision +} { + + if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } + if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } + + return [db_exec_plsql copy_revision "SQL"] + +}