Index: openacs-4/packages/cms/www/modules/types/widget-register-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/widget-register-3.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/types/widget-register-3.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/types/widget-register-3.tcl 20 Aug 2002 11:17:30 -0000 1.3
@@ -20,39 +20,12 @@
if { [form is_request widget_preview] } {
- template::query get_outstanding outstanding_params_list onelist "
- select
- distinct param
- from
- cm_form_widget_params f
- where
- is_required = 't'
- and
- widget = :widget
- and
- not exists (
- select 1
- from
- cm_attribute_widget_params
- where
- attribute_id = :attribute_id
- and
- param_id = f.param_id )
- "
+ set outstanding_params_list [db_list get_outstanding ""]
# the number of required widget params that are missing
set outstanding_params [llength $outstanding_params_list]
- template::query get_names attribute_names onerow "
- select
- pretty_name, attribute_name, object_type
- from
- acs_attributes
- where
- attribute_id = :attribute_id
- "
-
- template::util::array_to_vars attribute_names
+ db_1row get_name ""
content::add_attribute_element widget_preview $object_type $attribute_name
}
Index: openacs-4/packages/cms/www/modules/types/widget-register.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/widget-register.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/types/widget-register.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/types/widget-register.tcl 20 Aug 2002 11:17:30 -0000 1.3
@@ -5,16 +5,8 @@
request set_param content_type -datatype keyword
request set_param widget -datatype keyword -optional
+seet module_id [db_string get_module_id ""]
-template::query get_module_id module_id onevalue "
- select
- module_id
- from
- cm_modules
- where
- key = 'types'
-"
-
# permissions check - need cm_write on types module to edit a widget
content::check_access $module_id cm_write -user_id [User::getID]
Index: openacs-4/packages/cms/www/modules/types/widget-unregister.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/widget-unregister.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/types/widget-unregister.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/types/widget-unregister.tcl 20 Aug 2002 11:17:30 -0000 1.3
@@ -4,30 +4,12 @@
# permissions check - must have cm_write on the types module to unregister
# a widget
-template::query get_module_id module_id onevalue "
- select
- module_id
- from
- cm_modules
- where
- key = 'types'
-"
+set module_id [db_string get_module_id ""]
content::check_access $module_id cm_write -user_id [User::getID]
+db_1row get_attr_info ""
-template::query get_attr_info attribute_info onerow "
- select
- attribute_name, object_type as content_type
- from
- acs_attributes
- where
- attribute_id = :attribute_id
-"
-
-template::util::array_to_vars attribute_info
-
-
if { [catch {db_exec_plsql unregister "
begin
cm_form_widget.unregister_attribute_widget (
Index: openacs-4/packages/cms/www/modules/users/create.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/create.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/users/create.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/users/create.tcl 20 Aug 2002 11:17:31 -0000 1.3
@@ -29,6 +29,7 @@
if { [form is_request add_group] } {
# Get the next folder id
+ set group_id [db_string get_group_id ""]
template::query get_group_id group_id onevalue "
select acs_object_id_seq.nextval from dual
"
Index: openacs-4/packages/cms/www/modules/users/delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/delete.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/users/delete.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/users/delete.tcl 20 Aug 2002 11:17:31 -0000 1.3
@@ -6,12 +6,7 @@
request set_param mount_point -datatype keyword -optional -value users
# Determine if the group is empty
-template::query get_status is_empty onevalue "
- select NVL((select 'f' from dual where exists (
- select 1 from acs_rels
- where object_id_one = :id
- and rel_type in ('composition_rel', 'membership_rel'))),
- 't') as is_empty from dual"
+set is_empty [db_string get_status ""]
# If nonempty, show error
if { [string equal $is_empty "f"] } {
Index: openacs-4/packages/cms/www/modules/users/edit-user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/edit-user.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/cms/www/modules/users/edit-user.tcl 8 Jun 2001 01:44:53 -0000 1.4
+++ openacs-4/packages/cms/www/modules/users/edit-user.tcl 20 Aug 2002 11:17:31 -0000 1.5
@@ -50,23 +50,9 @@
if { [form is_request edit_user] } {
# Find basic user params
- template::query get_user_info info onerow "
- select
- p.first_names, p.last_name,
- pp.email, pp.url,
- u.screen_name,
- to_char(u.no_alerts_until, 'YYYY/MM/DD') as no_alerts_until
- from
- persons p, parties pp, users u
- where
- p.person_id = :id
- and
- pp.party_id = :id
- and
- u.user_id = :id
- "
+ db_1row get_user_info "" -column_array info
- form set_values edit_user info
+ form set_values edit_user info
}
if { [form is_valid edit_user] } {
Index: openacs-4/packages/cms/www/modules/users/edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/cms/www/modules/users/edit.tcl 8 Jun 2001 01:44:53 -0000 1.4
+++ openacs-4/packages/cms/www/modules/users/edit.tcl 20 Aug 2002 11:17:31 -0000 1.5
@@ -31,16 +31,7 @@
if { [form is_request edit_group] } {
- template::query get_group_info info onerow "
- select
- g.group_name, p.url, p.email
- from
- groups g, parties p
- where
- g.group_id = :id
- and
- p.party_id = :id
- "
+ db_1row get_group ""
element set_properties edit_group group_name -value $info(group_name)
element set_properties edit_group email -value $info(email)
Index: openacs-4/packages/cms/www/modules/users/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/index.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/cms/www/modules/users/index.tcl 8 Jun 2001 01:44:53 -0000 1.4
+++ openacs-4/packages/cms/www/modules/users/index.tcl 20 Aug 2002 11:17:31 -0000 1.5
@@ -12,23 +12,14 @@
# Determine if the user has admin privileges on the user module
set user_id [User::getID]
set module_id [cm::modules::get_module_id $mount_point]
-template::query check_admin admin_p onevalue "
- select
- cms_permission.permission_p (:module_id, :user_id, 'cm_admin')
- from
- dual" -cache "module_permission $module_id $user_id"
+set admin_p [db_string check_admin ""]
if { [string equal $admin_p t] } {
set admin_url "make-admin?mount_point=$mount_point&parent_id=$parent_id&target_user_id="
}
-template::query check_perm perm_p onevalue "
- select
- cms_permission.permission_p (:module_id, :user_id, 'cm_perm')
- from
- dual" -cache "module_permission $module_id $user_id"
+set perm_p [db_string check_perm ""]
-
# Create all the neccessary URL params for passthrough
set passthrough "mount_point=$mount_point&parent_id=$parent_id"
set root_id [cm::modules::${mount_point}::getRootFolderID]
@@ -39,20 +30,8 @@
set current_id $id
# Get info about the current group
- template::query get_info1 info onerow "
- select
- g.group_id, g.group_name, p.email, p.url,
- NVL((select 'f' from dual where exists (
- select 1 from acs_rels
- where object_id_one = :id
- and rel_type in ('composition_rel', 'membership_rel'))),
- 't') as is_empty
- from
- groups g, parties p
- where
- g.group_id = :id
- and
- p.party_id = :id"
+
+ db_1row get_info1 "" -column_array info
set groups_query [db_map get_groups_1]
set users_query [db_map get_users_1]
@@ -67,34 +46,25 @@
append state_html $the_pipe
- if { [string equal $row(member_state) $value] } {
+ if { [string equal $member_state $value] } {
append state_html "$value"
} else {
- append state_html ""
append state_html "$value"
}
set the_pipe " | "
}
- set row(state_html) $state_html
}
} else {
set current_id $module_id
# the everyone party
- template::query get_info2 info onerow "
- select
- party_id group_id, 'All Users' as group_name,
- email, url, 'f' as is_empty
- from
- parties
- where
- party_id = -1
- "
+ db_1row get_info2 "" -column_array info
#clipboard::get_bookmark_icon $clip $mount_point $info(group_id) info
@@ -105,7 +75,7 @@
}
# Select subgroups, users
-template::query get_subgroups subgroups multirow $groups_query
-template::query get_users users multirow $users_query -eval $users_eval
+db_multirow subgroups get_subgroups $groups_query
+db_multrow users get_users $user_query $users_eval
set return_url [ns_conn url]
Index: openacs-4/packages/cms/www/modules/users/one-user.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/one-user.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/users/one-user.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/users/one-user.tcl 20 Aug 2002 11:17:31 -0000 1.3
@@ -6,32 +6,7 @@
set passthrough "mount_point=$mount_point&parent_id=$parent_id"
# Find basic user params
-template::query get_info info onerow "
- select
- p.first_names, p.last_name,
- pp.email, pp.url,
- u.screen_name,
- to_char(u.last_visit, 'YYYY/MM/DD HH24:MI') as last_visit,
- to_char(u.no_alerts_until, 'YYYY/MM/DD') as no_alerts_until
- from
- persons p, parties pp, users u
- where
- p.person_id = :id
- and
- pp.party_id = :id
- and
- u.user_id = :id
-"
+db_1row get_info "" -column_array info
# Find the groups to which this user belongs
-template::query get_groups groups multirow "
- select
- g.group_name, g.group_id
- from
- groups g, group_member_map m
- where
- m.group_id = g.group_id
- and
- m.member_id = :id
-"
-
+db_multirow groups get_groups ""
Index: openacs-4/packages/cms/www/modules/users/user-search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/user-search.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/cms/www/modules/users/user-search.tcl 8 Jun 2001 01:44:53 -0000 1.3
+++ openacs-4/packages/cms/www/modules/users/user-search.tcl 20 Aug 2002 11:17:31 -0000 1.4
@@ -37,10 +37,10 @@
if { [util::is_nil form_title] } {
if { ![util::is_nil group_id] } {
- template::query get_who who onevalue "select acs_object.name(:group_id) from dual"
- set form_title "Search members of $who"
+ set who [db_string get_who ""]
+ set form_title "Search members of $who"
} else {
- set form_title "Search All Users"
+ set form_title "Search All Users"
}
element set_properties user_search form_title -value $form_title
}
@@ -81,21 +81,8 @@
}
set clauses [join $clauses " or "]
-
- template::query get_results results multirow "
- select
- distinct u.user_id, u.screen_name,
- p.first_names || ' ' || p.last_name as name,
- pp.email
- from
- users u, persons p, parties pp $extra_table
- where
- ($clauses)
- and
- p.person_id = u.user_id
- and
- pp.party_id = u.user_id
- $where_clause"
+
+ db_multirow results get_results ""
template::set_file "[file dir $__adp_stub]/search-results"
}
Index: openacs-4/packages/cms/www/modules/workflow/case-status.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-status.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/cms/www/modules/workflow/case-status.tcl 24 May 2001 23:57:17 -0000 1.2
+++ openacs-4/packages/cms/www/modules/workflow/case-status.tcl 20 Aug 2002 11:17:31 -0000 1.3
@@ -23,8 +23,7 @@
#set query "select case_id, initcap(toplevel_state) state
# from wf_cases where object_id = :item_id"
-template::query get_caseinfo caseinfo onerow "select case_id, initcap(state) state
- from wf_cases where object_id = :item_id"
+db_0or1row get_caseinfo "" -column_array caseinfo
# Look up the enabled or started transition for this workflow, if any: