Index: openacs-4/packages/lorsm/www/admin/item-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/item-add-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 6 Apr 2007 15:52:23 -0000 1.1 +++ openacs-4/packages/lorsm/www/admin/item-add-edit.tcl 3 Sep 2008 20:19:24 -0000 1.2 @@ -10,17 +10,17 @@ ad_form -name item -export {man_id type} -form { item_id:key - {title:text {label "acs-content-repository.Title"}} - {content:richtext {label "acs-content-repository.Content"}} + {title:text {label "[_ acs-content-repository.Title]"}} + {content:richtext(richtext) {label "[_ acs-content-repository.Content]"} {html {cols 80 style {width: 100%}}}} } -edit_request { set content [template::util::richtext::create \ [cr_write_content -string -item_id $item_id] \ text/html] - set title [db_string get_title "select item_title from ims_cp_items where ims_item_id=(select live_revision from cr_items where item_id=:item_id)"] + set title [db_string get_title ""] } -new_data { set content [template::util::richtext::get_property text $content] - set org_id [db_string get_org_id "select org_id from ims_cp_organizations where man_id=:man_id"] - set item_folder_id [db_string get_folder_id "select parent_id from cr_items where latest_revision=:org_id"] + set org_id [db_string get_org_id ""] + set item_folder_id [db_string get_folder_id ""] # ad_return_complaint 1 "folder_id '${item_folder_id}'" # TODO i bet we can make a generic webcontent # a subset of lors::itemcp::item_add_from_object @@ -34,15 +34,15 @@ -identifier $item_id \ -title $title \ -parent_item $org_id] - db_dml set_sort_order "update ims_cp_items set sort_order = (select max(sort_order)+1 from ims_cp_items where org_id=:org_id) where ims_item_id = :ims_item_id" + db_dml set_sort_order "" set revision_id [content::item::get_live_revision -item_id $item_id] content::revision::update_content \ -revision_id $revision_id \ -item_id $item_id \ -content $content \ -mime_type text/html \ - -storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] + -storage_type [db_string get_storage_type ""] set res_id [lors::imscp::resource_add \ -identifier $revision_id \ @@ -62,8 +62,8 @@ -item_id $item_id \ -content $content \ -mime_type text/html \ - -storage_type [db_string get_storage_type "select storage_type from cr_items where item_id=:item_id"] - db_dml set_title "update ims_cp_items set item_title=:title where ims_item_id=:ims_item_id" + -storage_type [db_string get_storage_type ""] + db_dml set_title "" } -after_submit { if {[info exists type]} { lorsm::set_custom_page \ Index: openacs-4/packages/lorsm/www/admin/item-add-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/admin/item-add-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/admin/item-add-edit.xql 3 Sep 2008 20:19:24 -0000 1.1 @@ -0,0 +1,46 @@ + + + + + + select item_title + from ims_cp_items + where ims_item_id=(select live_revision from cr_items + where item_id=:item_id) + + + + + + select org_id from ims_cp_organizations where man_id=:man_id + + + + + + select parent_id from cr_items where latest_revision=:org_id + + + + + + update ims_cp_items + set sort_order = (select coalesce(max(sort_order),0) +1 + from ims_cp_items where org_id=:org_id) + where ims_item_id = :ims_item_id + + + + + + select storage_type from cr_items where item_id=:item_id + + + + + + update ims_cp_items set item_title=:title where ims_item_id=:ims_item_id + + + +