Index: openacs-4/packages/logger/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/package-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/logger/tcl/package-procs.tcl 5 Apr 2003 10:16:42 -0000 1.1 +++ openacs-4/packages/logger/tcl/package-procs.tcl 22 Apr 2003 09:25:40 -0000 1.2 @@ -49,3 +49,30 @@ } { return [db_list select_projects {}] } + +ad_proc -public logger::package::variables_multirow { + {not_in_project_id ""} +} { + Executes a db_multirow that returns all variables created + in the current package and all variables mapped to projects + in the current package. + + @param not_in_project_id Exclude variables already mapped to the given project_id. + + @author Peter Marklund +} { + set package_id [ad_conn package_id] + + if { ![empty_string_p $not_in_project_id] } { + set extra_where_clause \ + "and not exists (select 1 + from logger_project_var_map + where project_id = $not_in_project_id + and variable_id = lv.variable_id + )" + } else { + set extra_where_clause "" + } + + db_multirow variables select_variables {} +}