Index: openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl,v diff -u -N -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 31 May 2005 18:07:34 -0000 1.10.2.1 +++ openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 7 Jun 2005 13:14:10 -0000 1.10.2.2 @@ -18,6 +18,7 @@ {-creation_date ""} {-creation_user ""} {-context_id ""} + {-package_id ""} {-creation_ip ""} {-item_subtype "content_item"} {-content_type "content_revision"} @@ -49,6 +50,7 @@ @param item_subtype @param content_type - content_revision or subtype of content_revision @param context_id - + @param package_id - @param creation_user - @param creation_ip - @param creation_date - defaults to current date and time @@ -73,6 +75,9 @@ if {[empty_string_p $creation_ip]} { set creation_ip [ad_conn peeraddr] } + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } set var_list [list] lappend var_list \ @@ -83,6 +88,7 @@ [list creation_date $creation_date ] \ [list creation_user $creation_user ] \ [list context_id $context_id ] \ + [list package_id $package_id ] \ [list creation_ip $creation_ip ] \ [list item_subtype $item_subtype ] \ [list content_type $content_type ] \ @@ -123,6 +129,7 @@ -mime_type $mime_type \ -content_type $content_type \ -is_live $is_live \ + -package_id $package_id \ -attributes $attributes } Index: openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl,v diff -u -N -r1.9 -r1.9.2.1 --- openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 24 Feb 2005 13:32:59 -0000 1.9 +++ openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 7 Jun 2005 13:14:10 -0000 1.9.2.1 @@ -25,9 +25,10 @@ {-content_type} {-creation_user} {-creation_ip} + {-context_id} + {-package_id} {-attributes} {-is_live "f"} - -context_id } { Adds a new revision of a content item. If content_type is not passed in, we determine it from the content item. This is needed @@ -61,6 +62,8 @@ @param creation_ip + @param package_id + @param is_live @param context_id defaults to item_id if not specified. Use empty string for NULL context_id @@ -89,6 +92,9 @@ if {![info exists context_id]} { set context_id $item_id } + if {![info exists package_id]} { + set package_id [ad_conn package_id] + } set attribute_names "" set attribute_values "" @@ -128,8 +134,8 @@ set table_name "${table_name}i" set query_text "insert into ${table_name} - (revision_id, object_type, creation_user, creation_date, creation_ip, title, description, item_id, mime_type $attribute_names) - values (:revision_id, :content_type, :creation_user, :creation_date, :creation_ip, :title, :description, :item_id, :mime_type $attribute_values)" + (revision_id, object_type, creation_user, creation_date, creation_ip, title, description, item_id, context_id, package_id, mime_type $attribute_names) + values (:revision_id, :content_type, :creation_user, :creation_date, :creation_ip, :title, :description, :item_id, :context_id, :package_id, :mime_type $attribute_values)" db_transaction { if {[string equal "" $revision_id]} { set revision_id [db_nextval "acs_object_id_seq"]