hamiltonc
committed
on 22 Jun 05
set default for instructors_filter
openacs-4/.../dotlrn-ecommerce/lib/tree-chunk.tcl (+2 -0)
166 166             set ${name}_where_query "dec.community_id in ( select object_id from category_object_map_tree where tree_id = $tree_id and category_id in $map_tree )"
167 167         }
168 168     }
169 169 }
170 170
171 171 foreach tree $category_trees {
172 172     set tree_name [lindex $tree 1]
173 173     regsub -all { } $tree_name _ f
174 174     set f [string tolower $f]_f
175 175
176 176     lappend filters "$f" \
177 177         [list \
178 178              label "$tree_name" \
179 179              values "[set $tree_name]" \
180 180              where_clause "[set ${tree_name}_where_query]"
181 181         ]
182 182 }
183 183
184 184 set instructor_community_id [parameter::get -package_id [ad_conn package_id] -parameter InstructorCommunityId -default 0 ]
185 185 set _instructors [dotlrn_community::list_users $instructor_community_id]
  186
186 187 set __instructors [list]
187 188 if { [llength $_instructors] == 0 } {
188 189     set _instructors 0
  190     set instructors_filter ""
189 191 } else {
190 192     foreach _instructor $_instructors {
191 193         lappend __instructors [ns_set get $_instructor user_id]
192 194         lappend instructors_filter [list "[ns_set get $_instructor first_names] [ns_set get $_instructor last_name]" [ns_set get $_instructor user_id]]
193 195     }
194 196 }
195 197
196 198 lappend filters instructor \
197 199     [list \
198 200          label "[_ dotlrn-ecommerce.Instructor]" \
199 201          values $instructors_filter \
200 202          where_clause_eval {subst {exists (select 1
201 203      from dotlrn_users u, dotlrn_member_rels_approved r
202 204      where u.user_id = r.user_id
203 205      and r.community_id = dec.community_id
204 206      and r.rel_type = 'dotlrn_admin_rel'
205 207      and r.user_id in ([join $instructor ,]))}}]
206 208 # Section categories
207 209 #foreach section_tree [category_tree::get_mapped_trees $package_id] {
208 210 #    set tree_list [category_tree::get_tree -all $section_tree]