Index: openacs-4/contrib/obsolete-packages/library/tcl/km-object-data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/library/tcl/km-object-data-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/library/tcl/km-object-data-procs.tcl 1 Mar 2005 00:01:14 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/library/tcl/km-object-data-procs.tcl 13 Feb 2009 20:40:39 -0000 1.3 @@ -6,7 +6,7 @@ # ********** Procs that get data from an object ********** -proc_doc km_object_exists_p {object_id} "Returns 1 if this object exists in the library" { +ad_proc km_object_exists_p {object_id} "Returns 1 if this object exists in the library" { if [empty_string_p [km_get_object_type $object_id]] { return 0 } else { @@ -378,7 +378,7 @@ return $result } -proc_doc km_get_object_answers { object_id question_id } { +ad_proc km_get_object_answers { object_id question_id } { Returns the option_ids, pretty_names as tuples that answer this question for this object. } { set sql "select a.option_id, a.answer_option @@ -392,7 +392,7 @@ # ********** Saving data ********** -proc_doc km_create_object { object_type_id user_id } { +ad_proc km_create_object { object_type_id user_id } { Creates a new knowledge object as a row in sn_objects. Note that the object is first considered completed when all required questions @@ -418,7 +418,7 @@ } -proc_doc km_save_object_data { object_id user_id key_values } { +ad_proc km_save_object_data { object_id user_id key_values } { Takes object data in as a list of keys value tuples and saves it in the database according to its abstract data type. } { @@ -668,7 +668,7 @@ } } -proc_doc km_map_object_answers { question_id object_id option_ids } { +ad_proc km_map_object_answers { question_id object_id option_ids } { Maps any number of answer_options to a } { db_dml km_map_object_answers_1 "delete from sn_object_option_map where object_id=:object_id @@ -690,7 +690,7 @@ } -proc_doc km_delete_object_data { object_id question_id } { +ad_proc km_delete_object_data { object_id question_id } { Removes the answer for a question. (Used for read-only questions.) } { set abstract_data_type [db_string km_delete_object_data_1 " @@ -718,7 +718,7 @@ # ********** Filters/Validators ********** -proc_doc km_filter_content_questions {question_ids abstract_data_types} { +ad_proc km_filter_content_questions {question_ids abstract_data_types} { Returns a list of question_ids that are actually a row in sn_content. } { set questions [zip $question_ids $abstract_data_types] @@ -733,15 +733,15 @@ return $filtered_questions } -proc_doc integer_p {number} "returns 1 if this is an integer" { +ad_proc integer_p {number} "returns 1 if this is an integer" { if [regexp {[^0-9]} $number] { return 0 } else { return 1 } } -proc_doc filter_integers {char_list} { +ad_proc filter_integers {char_list} { returns a filtered list of characters in the list that are integers } { set result [list] @@ -751,7 +751,7 @@ return $result } -proc_doc date_p {date} "returns 1 if this is a date" { +ad_proc date_p {date} "returns 1 if this is a date" { set result [catch {db_0or1row date_p "select to_date('$date') from dual"}] if {$result} { return 0 @@ -760,7 +760,7 @@ } } -proc_doc km_break_date {date} { +ad_proc km_break_date {date} { Breaks an Oracle date in the form YYYY-MM-DD up into a list YYYY MM DD } { if {![regexp {([0-9]*)-.*} $date match YYYY]} { return ""} @@ -770,7 +770,7 @@ return [list $YYYY $MM $DD] } -proc_doc empty_date_p {date} "returns 1 if this is an empty date in the form xx--" { +ad_proc empty_date_p {date} "returns 1 if this is an empty date in the form xx--" { if [regexp {.+-.+-.+} $date] {return 0} return 1