Index: openacs-4/packages/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.20.2.6 -r1.20.2.7 --- openacs-4/packages/news/tcl/news-procs.tcl 10 Oct 2005 12:59:35 -0000 1.20.2.6 +++ openacs-4/packages/news/tcl/news-procs.tcl 16 Nov 2005 12:14:56 -0000 1.20.2.7 @@ -25,8 +25,48 @@ return $package_id } +ad_proc news_create_new { + {-item_id "null"} + {-locale "null"} + -publish_date_ansi + {-publish_body "null"} + {-nsl_language "null"} + {-publish_title "null"} + {-mime_type "null"} + -package_id + {-archive_date_ansi "null"} + {-approval_user "null"} + {-approval_date "null"} + {-approval_ip "null"} + {-relation_tag "null"} + -creation_ip + -user_id + {-live_revision_p "null"} + {-publish_lead "null"} +} { + Create a New +} { + if {[info exist package_id] == 0} { + set package_id [dotlrn_community::get_package_id] + } + if {[info exist user_id] == 0} { + set user_id [ad_conn user_id] + } + if {[info exist creation_ip] == 0} { + set creation_ip [ad_conn host] + } + if {[info exist publish_date_ansi] == 0} { + set publish_date_ansi [dt_systime] + } + + set news_id [db_exec_plsql create_news_item {}] + return $news_id +} + + + ad_proc news_items_archive { id_list when } { immediately gives all news items in list id_list Index: openacs-4/packages/news/tcl/news-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.xql,v diff -u -r1.8.2.4 -r1.8.2.5 --- openacs-4/packages/news/tcl/news-procs.xql 10 Oct 2005 12:59:35 -0000 1.8.2.4 +++ openacs-4/packages/news/tcl/news-procs.xql 16 Nov 2005 12:14:56 -0000 1.8.2.5 @@ -36,4 +36,30 @@ + + + + select news__new( + null, -- p_item_id + null, -- p_locale + :publish_date_ansi, -- p_publish_date + :publish_body, -- p_text + null, -- p_nls_language + :publish_title, -- p_title + :mime_type, -- p_mime_type + :package_id, -- p_package_id + :archive_date_ansi, -- p_archive_date + :approval_user, -- p_approval_user + :approval_date, -- p_approval_date + :approval_ip, -- p_approval_ip + null, -- p_relation_tag + :creation_ip, -- p_creation_ip + :user_id, -- p_creation_user + :live_revision_p, -- p_is_live_p + :publish_lead -- p_lead + ); + + + +