hectorr
committed
on 22 May 18
Prefer literal in adp axpressions
openacs-4/.../dotlrn-catalog/lib/course-chunk.tcl (+7 -3)
24 24
25 25 if { ![info exists asmid] } {
26 26     set asmid "-1"
27 27 }
28 28
29 29 if { ![info exists revision] } {
30 30     set revision "no"
31 31 }
32 32
33 33 set category_p [db_string get_category { } -default -1]
34 34
35 35 set info [ad_html_text_convert -from text/enhanced -to text/plain $info]
36 36
37 37 set cc_package_id [apm_package_id_from_key "dotlrn-catalog"]
38 38 set tree_id [db_string get_tree_id { } -default "-1"]
39 39
40 40 # Get the category name
41 41 set category_name "[category::get_name [category::get_mapped_categories $course_id]]"
42 42
43 43 # Check if user has admin permission over course_id
  44 set admin_p 0
44 45 if { [permission::permission_p -object_id $cc_package_id -privilege "create"] } {
45 46     set item_id [dotlrn_catalog::get_item_id -revision_id $course_id]
46       set admin_p [permission::permission_p -object_id $item_id -privilege "admin"]
  47     if { [permission::permission_p -object_id $course_id -privilege "admin"] } {
  48         set admin_p 1
47 49     } else {
48 50         set admin_p 0
49 51     }
  52 }
50 53
  54
51 55 set obj_n 0
52 56 set dotlrn_class "("
53 57 set dotlrn_com "("
54 58
55 59 # For dotlrn associations
56 60 db_multirow -extend { obj_n admin_p } relations relation { } {
57 61     set obj_n 1
58 62     if { [string equal $type "dotlrn_catalog_class_rel" ]} {
59 63         append dotlrn_class "'$object_id'"
60 64         append dotlrn_class ","
61 65     } else {
62 66         append dotlrn_com "'$object_id'"
63 67         append dotlrn_com ","
64 68     }
65 69 }
66 70 append dotlrn_class "0)"
67 71 append dotlrn_com "0)"
68 72
69 73 db_multirow classes_list get_dotlrn_classes { }
70 74