Index: openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl 19 Aug 2002 03:42:26 -0000 1.7 +++ openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl 22 Aug 2002 03:04:32 -0000 1.8 @@ -86,13 +86,6 @@ # an item cannot be previewed if it has no associated template if { [string equal $has_index_page t] } { set template_id [db_string get_template_id "" -default ""] - template::query get_template_id template_id onevalue " - select - content_item.get_template( - nvl( content_folder.get_index_page( :item_id ), 0), 'public' ) - from - dual - " } if { [string equal $template_id ""] } { Index: openacs-4/packages/cms/www/modules/templates/template-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/template-oracle.xql 19 Aug 2002 04:19:45 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/template-oracle.xql 22 Aug 2002 03:04:32 -0000 1.3 @@ -35,7 +35,7 @@ - + select Index: openacs-4/packages/cms/www/modules/templates/template-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/template-postgresql.xql 19 Aug 2002 04:19:45 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/template-postgresql.xql 22 Aug 2002 03:04:32 -0000 1.3 @@ -35,22 +35,22 @@ - + select t.tree_level, t.context_id, content_item__get_title(t.context_id) as title from ( select - context_id, level as tree_level + context_id, tree_level(tree_sortkey) as tree_level from - acs_objects + acs_objects o1, (select tree_ancestor_keys(select tree_sorkey + from acs_objects + where object_id = :template_id) as tree_sortkey) parents where context_id <> 0 - connect by - prior context_id = object_id - start with - object_id = :template_id + and + o1.tree_sortkey = parents.tree_sortkey ) t, cr_items i where i.item_id = t.context_id Index: openacs-4/packages/cms/www/modules/templates/template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/template.tcl 20 Aug 2002 04:18:00 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/template.tcl 22 Aug 2002 03:04:32 -0000 1.5 @@ -33,27 +33,8 @@ # get the context bar info -# FIXME: postgresql query needs to be fixed -template::query get_context context multirow "select - t.tree_level, t.context_id, content_item.get_title(t.context_id) as title - from ( - select - context_id, level as tree_level - from - acs_objects - where - context_id <> 0 - connect by - prior context_id = object_id - start with - object_id = :template_id - ) t, cr_items i - where - i.item_id = t.context_id - order by - tree_level desc" +db_multirow context get_context "" - # find out which items this template is registered to db_multirow items get_items "" 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.3 -r1.4 --- openacs-4/packages/cms/www/modules/users/create.tcl 20 Aug 2002 11:17:31 -0000 1.3 +++ openacs-4/packages/cms/www/modules/users/create.tcl 22 Aug 2002 03:04:32 -0000 1.4 @@ -28,13 +28,10 @@ if { [form is_request add_group] } { - # Get the next folder id + # 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 - " - element set_properties add_group group_id -value $group_id + element set_properties add_group group_id -value $group_id } # Insert the folder Index: openacs-4/packages/cms/www/modules/workflow/case-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-create.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/cms/www/modules/workflow/case-create.tcl 22 Aug 2002 00:19:06 -0000 1.8 +++ openacs-4/packages/cms/www/modules/workflow/case-create.tcl 22 Aug 2002 03:04:32 -0000 1.9 @@ -27,40 +27,32 @@ set transition_list [list] -template::query::iterate get_name_key " - select - transition_name, transition_key - from - wf_transitions - where - workflow_key = 'publishing_wf' - order by - sort_order" { +db_foreach get_name_key "" { - form section case_create $row(transition_name) + form section case_create $transition_name - element create case_create ${row(transition_key)}_assign \ + element create case_create ${transition_key}_assign \ -datatype integer \ -widget select \ -options $users \ -label "Assignment" # Create an element to hold the old values, for later comparison if { [string equal $is_edit t] } { - element create case_create ${row(transition_key)}_assign_old \ + element create case_create ${transition_key}_assign_old \ -datatype text \ -widget hidden \ -optional } - element create case_create ${row(transition_key)}_deadline \ + element create case_create ${transition_key}_deadline \ -datatype date \ -widget date \ -format "DD/MONTH/YYYY" -year_interval { 2000 2001 1 } \ -label "Deadline" \ -value [util::date today] - lappend transition_list $row(transition_key) + lappend transition_list $transition_key } @@ -84,16 +76,8 @@ # Get existing case assignments set case_id [element get_value case_create case_id] - template::query::iterate get_key_id " - select - transition_key, party_id - from - wf_case_assignments - where - workflow_key = 'publishing_wf' - and - case_id = :case_id" { - lappend case_values($row(transition_key)) $row(party_id) + db_foreach get_key_id "" { + lappend case_values($transition_key) $party_id } foreach {transition_key party_id_list} [array get case_values] { @@ -107,26 +91,14 @@ # Get existing deadlines - template::query::iterate get_key_deadline " - select - transition_key, - to_char(deadline, 'YYYY MM DD HH24 MI SS') as deadline - from - wf_case_deadlines - where - workflow_key = 'publishing_wf' - and - case_id = :case_id" { + db_foreach get_key_deadline "" { element set_properties case_create \ - "${row(transition_key)}_deadline" \ - -value [util::date acquire sql_date $row(deadline)] + "${transition_key}_deadline" \ + -value [util::date acquire sql_date $deadline] } } else { - template::query get_case_id case_id onevalue " - select acs_object_id_seq.nextval from dual - " - + set case_id [db_string get_case_id ""] element set_properties case_create case_id -value $case_id } } Index: openacs-4/packages/cms/www/modules/workflow/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/index.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/index.tcl 22 Aug 2002 03:04:32 -0000 1.3 @@ -7,104 +7,16 @@ # workflow totals -template::query get_stats wf_stats onerow " - select - count( decode(content_workflow.is_finished(c.case_id, transition_key), - 'f',1,null) - ) as total_count, - count( decode(content_workflow.is_overdue(c.case_id, transition_key), - 't',1,null) - ) as overdue_count, - count( decode(content_workflow.is_active(c.case_id, transition_key), - 't',1,null) - ) as active_count, - count( decode(content_workflow.is_checked_out(c.case_id, transition_key), - 't',1,null) - ) as checkout_count - from - wf_cases c, wf_transitions trans - where - c.workflow_key = trans.workflow_key - and - c.workflow_key = 'publishing_wf' - and - c.state = 'active' -" +db_1row get_stats "" - # workflow tasks by transition state: content items, overdue items -template::query get_transitions transitions multirow " - select - trans.transition_key, transition_name, sort_order, - count(transition_name) as transition_count, - count(decode ( - content_workflow.is_overdue(c.case_id, trans.transition_key), - 't',1,null) - ) as overdue_count, - count(decode ( - content_workflow.is_active(c.case_id, trans.transition_key), - 't',1,null) - ) as active_count, - count( decode( - content_workflow.is_checked_out(c.case_id, trans.transition_key), - 't',1,null) - ) as checkout_count - from - wf_cases c, wf_transitions trans - where - trans.workflow_key = c.workflow_key - and - trans.workflow_key = 'publishing_wf' - and - c.state in ('active') - and - -- don't include tasks that have been finished or canceled - content_workflow.is_finished(c.case_id, trans.transition_key) = 'f' - group by - sort_order, transition_name, trans.transition_key -" +db_multirow transitions get_transitions "" # workflow tasks by user: content items, overdue items -template::query get_user_tasks user_tasks multirow " - select - p.person_id, p.first_names, p.last_name, - count(transition_name) as transition_count, - count(decode ( - content_workflow.is_overdue(c.case_id, t.transition_key), - 't',1,null) - ) as overdue_count, - count(decode ( - content_workflow.is_active(c.case_id, t.transition_key), - 't',1,null) - ) as active_count, - count( decode( - content_workflow.is_checked_out(c.case_id, t.transition_key, ca.party_id), - 't',1,null) - ) as checkout_count - from - wf_cases c, wf_case_assignments ca, - wf_transitions t, persons p - where - t.workflow_key = 'publishing_wf' - and - t.workflow_key = c.workflow_key - and - c.state = 'active' - and - c.case_id = ca.case_id - and - ca.transition_key = t.transition_key - and - p.person_id = ca.party_id - and - -- don't include tasks that have been finished or canceled - content_workflow.is_finished(c.case_id, t.transition_key) = 'f' - group by - first_names, last_name, person_id -" +db_multirow user_tasks get_user_tasks "" set page_title "Workflow Statistics" Index: openacs-4/packages/cms/www/modules/workflow/overdue-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/overdue-items.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/overdue-items.tcl 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/overdue-items.tcl 22 Aug 2002 03:04:32 -0000 1.3 @@ -3,11 +3,7 @@ if { ![string equal $transition "all"] } { - template::query get_transitoin_name transition_name onevalue " - select transition_name - from wf_transitions - where transition_key = :transition - and workflow_key = 'publishing_wf'" + set transition_name [db_string get_transition_name ""] set transition_sql "and ca.transition_key = :transition" @@ -19,37 +15,6 @@ set date_format "'Mon. DD, YYYY HH24:MI:SS'" -template::query get_overdue_tasks overdue_tasks multirow " - select - ca.transition_key, transition_name, ca.party_id, - item_id, content_item.get_title(item_id) as title, - nvl(party.name(ca.party_id),person.name(ca.party_id)) as assigned_party, - to_char(dead.deadline,'Mon. DD, YYYY') as deadline_pretty, - content_workflow.get_status(c.case_id, ca.transition_key) as status - from - wf_transitions trans, wf_cases c, wf_case_deadlines dead, - wf_case_assignments ca, cr_items i - where - c.case_id = dead.case_id - and - c.case_id = ca.case_id - and - ca.transition_key = dead.transition_key - and - trans.transition_key = ca.transition_key - and - c.workflow_key = 'publishing_wf' - and - c.workflow_key = trans.workflow_key - and - c.state = 'active' - and - c.object_id = i.item_id - and - content_workflow.is_overdue(c.case_id, ca.transition_key) = 't' - $transition_sql - order by - transition_name, dead.deadline desc, title, assigned_party" +db_multirow overdue_tasks get_overdue_tasks "" - set page_title "Outstanding Workflow Tasks - $transition_name" Index: openacs-4/packages/cms/www/modules/workflow/overdue-items.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/overdue-items.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/overdue-items.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/overdue-items.xql 22 Aug 2002 03:04:32 -0000 1.2 @@ -2,7 +2,7 @@ - + select transition_name Index: openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl 27 May 2001 00:22:34 -0000 1.4 +++ openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl 22 Aug 2002 03:04:32 -0000 1.5 @@ -9,9 +9,7 @@ set user_id [User::getID] # check that the task is still valid -template::query check_valid is_valid_task onevalue " - select content_workflow.can_approve( :task_id, :user_id ) from dual -" +set is_valid_task [db_string check_valid ""] if { [string equal $is_valid_task f] } { template::forward $return_url @@ -20,22 +18,7 @@ # task info -template::query get_task_info task_info onerow " - select - c.object_id, tr.transition_name, - content_item.get_title(c.object_id) title, - tk.holding_user as holding_user, - to_char(tk.hold_timeout,'Mon. DD, YYYY') hold_timeout, - content_workflow.get_holding_user_name(tk.task_id) holding_user_name - from - wf_tasks tk, wf_transitions tr, wf_cases c - where - tk.task_id = :task_id - and - tk.transition_key = tr.transition_key - and - tk.case_id = c.case_id -" +db_1row get_task_info "" set holding_user $task_info(holding_user) @@ -100,9 +83,7 @@ db_transaction { # check that the task is still valid - template::query get_task_status is_valid_task onevalue " - select content_workflow.can_approve( :task_id, :user_id ) from dual - " + set valid_task [db_string get_task_status ""] if { [string equal $is_valid_task f] } { db_abort_transaction Index: openacs-4/packages/cms/www/modules/workflow/task-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-finish.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/cms/www/modules/workflow/task-finish.tcl 27 May 2001 04:39:19 -0000 1.5 +++ openacs-4/packages/cms/www/modules/workflow/task-finish.tcl 22 Aug 2002 03:04:32 -0000 1.6 @@ -11,37 +11,16 @@ set user_id [User::getID] # check that the task is still valid -template::query get_status is_valid_task onevalue " - select content_workflow.can_approve( :task_id, :user_id ) from dual -" +set is_valid_task [db_string get_status ""] if { [string equal $is_valid_task f] } { template::forward $return_url } # Get the name of the item and of the task -template::query get_task_info task_info onerow " - select - c.object_id, content_item.get_title(c.object_id) title, - tr.transition_name - from - wf_tasks tk, wf_cases c, - wf_transitions tr - where - tk.task_id = :task_id - and - tk.transition_key = tr.transition_key - and - tk.workflow_key = tr.workflow_key - and - tk.workflow_key = 'publishing_wf' - and - c.case_id = tk.case_id - and - content_workflow.can_approve( tk.task_id, :user_id ) = 't' -" +db_1row get_task_info "" form create task_finish -elements { @@ -87,8 +66,7 @@ set user_id [User::getID] db_transaction { - template::query get_status is_valid_task onevalue " - select content_workflow.can_approve( :task_id, :user_id ) from dual" + set is_valid_task [db_string get_status ""] if { [string equal $is_valid_task f] } { db_abort_transaction Index: openacs-4/packages/cms/www/modules/workflow/task-reject-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-reject-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/task-reject-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/task-reject-oracle.xql 22 Aug 2002 03:04:32 -0000 1.2 @@ -83,5 +83,13 @@ + + + + select content_workflow.can_reject( :task_id, :user_id ) from dual + + + + Index: openacs-4/packages/cms/www/modules/workflow/task-reject-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-reject-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/task-reject-postgresql.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/task-reject-postgresql.xql 22 Aug 2002 03:04:32 -0000 1.2 @@ -83,5 +83,14 @@ + + + + + select content_workflow__can_reject( :task_id, :user_id ) from dual + + + + Index: openacs-4/packages/cms/www/modules/workflow/task-reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-reject.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/task-reject.tcl 27 May 2001 00:22:34 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/task-reject.tcl 22 Aug 2002 03:04:32 -0000 1.4 @@ -9,9 +9,7 @@ set user_id [User::getID] # check that the task is still valid -template::query get_status is_valid_task onevalue " - select content_workflow.can_reject( :task_id, :user_id ) from dual -" +set is_valid_task [db_string get_status ""] if { [string equal $is_valid_task f] } { forward $return_url @@ -20,53 +18,11 @@ # Get the name of the item and of the task -template::query get_task_info task_info onerow " - select - c.object_id, content_item.get_title(c.object_id) title, - tr.transition_name - from - wf_tasks tk, wf_cases c, - wf_transitions tr - where - tk.task_id = :task_id - and - tk.transition_key = tr.transition_key - and - tk.workflow_key = tr.workflow_key - and - tk.workflow_key = 'publishing_wf' - and - tk.case_id = c.case_id - and - content_workflow.can_reject( tk.task_id, :user_id ) = 't' -" +db_1row get_task_info "" -column_array task_info # get the places I can reject to -template::query get_rejects reject_places multilist " - select - trans.transition_name, trans.transition_key - from - wf_places src, wf_places dest, wf_tasks t, wf_transitions trans - where - src.workflow_key = dest.workflow_key - and - src.workflow_key = 'publishing_wf' - and - src.workflow_key = trans.workflow_key - and - src.place_key = content_workflow.get_this_place( t.transition_key ) - and - -- for the publishing_wf, past transitions have a lower sort order - dest.sort_order < src.sort_order - and - -- get the transition associated with that place - content_workflow.get_this_place( trans.transition_key ) = dest.place_key - and - t.task_id = :task_id - order by - dest.sort_order desc -" +set reject_places [db_list_of_lists get_rejects ""] # Create the form @@ -123,8 +79,7 @@ db_transaction { # check that the task is still valid - template::query is_valid_task onevalue " - select content_workflow.can_reject( :task_id, :user_id ) from dual" + set is_valid_task [db_string is_valid_task ""] if { [string equal $is_valid_task f] } { db_abort_transaction Index: openacs-4/packages/cms/www/modules/workflow/task-start.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-start.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/task-start.tcl 27 May 2001 00:22:34 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/task-start.tcl 22 Aug 2002 03:04:32 -0000 1.4 @@ -8,9 +8,7 @@ set user_id [User::getID] # make sure the task hasn't expired yet -template::query get_status is_valid_task onevalue " - select content_workflow.can_start( :task_id, :user_id ) from dual -" +set is_valid_task [db_string get_status ""] # if the task is no longer valid, go to My Tasks page if { [string equal $is_valid_task f] } { @@ -19,24 +17,7 @@ # task info -template::query get_task_info task_info onerow " - select - c.object_id, tr.transition_name, - content_item.get_title(c.object_id) title, - tk.holding_user as holding_user, - to_char(tk.hold_timeout,'Mon. DD, YYYY') hold_timeout, - content_workflow.get_holding_user_name(tk.task_id) holding_user_name - from - wf_tasks tk, - wf_transitions tr, - wf_cases c - where - tk.task_id = :task_id - and - tk.transition_key = tr.transition_key - and - tk.case_id = c.case_id -" +set task_info [db_1row get_task_info ""] set holding_user $task_info(holding_user) @@ -114,8 +95,7 @@ db_transaction { # check that task has not expired, if it has display error msg - template::query get_status is_valid_task onevalue " - select content_workflow.can_start( :task_id, :user_id ) from dual" + set is_valid_task [db_string get_status ""] if { [string equal $is_valid_task f] } { db_abort_transaction Index: openacs-4/packages/cms/www/modules/workflow/user-tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/user-tasks.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/user-tasks.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/user-tasks.tcl 22 Aug 2002 03:04:32 -0000 1.3 @@ -6,91 +6,12 @@ set date_format "'Mon. DD, YYYY HH24:MI:SS'" -template::query get_party_name party_name onevalue " - select nvl(party.name(:party_id),person.name(:party_id)) from dual -" +set party_name [db_string get_party_name ""] set date_format "'Mon., DD, YYYY HH24:MI:SS'" -template::query get_active active_tasks multirow " - select - trans.transition_key, transition_name, - item_id, content_item.get_title(item_id) as title, - t.state, - to_char(deadline,'Mon. DD, YYYY') as deadline_pretty, - to_char(enabled_date,$date_format) as enabled_date_pretty, - to_char(started_date,$date_format) as started_date_pretty, - to_char(hold_timeout,'Mon. DD, YYYY') as hold_timeout_pretty, - holding_user, person.name(holding_user) as holding_user_name, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue - from - wf_transitions trans, wf_tasks t, cr_items i, - wf_cases c, wf_case_assignments ca - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = trans.workflow_key - and - c.case_id = ca.case_id - and - c.case_id = t.case_id - and - c.object_id = i.item_id - and - t.transition_key = trans.transition_key - and - ca.transition_key = trans.transition_key - and - c.state = 'active' - and - t.state in ('enabled','started') - and - ca.party_id = :party_id - order by - trans.sort_order, title" +db_multirow active_tasks get_active "" +db_multirow awaiting_tasks get_waiting "" - -template::query get_waiting awaiting_tasks multirow " - select - ca.transition_key, transition_name, - item_id, content_item.get_title(item_id) as title, - to_char(deadline,'Mon. DD, YYYY') as deadline_pretty, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue - from - wf_case_assignments ca, wf_case_deadlines dead, wf_cases c, - cr_items i, wf_transitions trans - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = trans.workflow_key - and - c.case_id = ca.case_id - and - c.case_id = dead.case_id - and - ca.transition_key = trans.transition_key - and - dead.transition_key = trans.transition_key - and - c.object_id = i.item_id - and - c.state = 'active' - and - content_workflow.is_finished(c.case_id, ca.transition_key) = 'f' - and - not exists ( select 1 - from - wf_tasks - where - case_id = c.case_id - and - transition_key = ca.transition_key - and - state in ('enabled','started') ) - and - ca.party_id = :party_id - order by - trans.sort_order, title" - set page_title "Workflow Tasks Assigned to $party_name" Index: openacs-4/packages/cms/www/modules/workflow/workflow.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/workflow.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/workflow.tcl 19 Nov 2001 18:43:25 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/workflow.tcl 22 Aug 2002 03:04:32 -0000 1.4 @@ -10,19 +10,9 @@ set transition_sql "" } else { - template::query get_name transition_name onevalue " - select - transition_name - from - wf_transitions - where - transition_key = :transition - and - workflow_key = 'publishing_wf' - " -cache "workflow_transition_name $transition" -persistent \ - -timeout 3600 + set transition_name [db_string get_name "" -default ""] - if { [template::util::is_nil transition_name] } { + if { [string equal $transition_name ""] } { ns_log notice "workflow.tcl - Bad transition - $transition" forward "workflow" } @@ -34,90 +24,8 @@ set date_format "'Mon. DD, YYYY HH24:MI:SS'" +db_multirow active_tasks get_active "" -template::query get_active active_tasks multirow " - select - t.transition_key, transition_name, - item_id, content_item.get_title(item_id) as title, - t.state, ca.party_id, - nvl(party.name(ca.party_id),person.name(ca.party_id)) as assigned_party, - holding_user, - person.name(holding_user) as holding_user_name, - to_char(hold_timeout,'Mon. DD, YYYY') as hold_timeout_pretty, - to_char(deadline,'Mon., DD, YYYY') as deadline_pretty, - to_char(enabled_date,$date_format) as enabled_date_pretty, - to_char(started_date,$date_format) as started_date_pretty, - content_workflow.is_overdue(c.case_id, t.transition_key) as is_overdue - from - wf_tasks t, wf_transitions trans, cr_items i, - wf_cases c, wf_case_assignments ca - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = trans.workflow_key - and - c.case_id = t.case_id - and - c.case_id = ca.case_id - and - c.state = 'active' - and - -- the workflow item is a content item - c.object_id = i.item_id - and - t.transition_key = trans.transition_key - and - ca.transition_key = t.transition_key - and - t.state in ('started','enabled') - $transition_sql - order by - trans.sort_order, title, assigned_party, deadline desc, state -" +db_multirow awaiting_tasks get_waiting "" -template::query get_waiting awaiting_tasks multirow " - select - ca.transition_key, transition_name, ca.party_id, - item_id, content_item.get_title(item_id) as title, - nvl(party.name(ca.party_id),person.name(ca.party_id)) as assigned_party, - to_char(dead.deadline,'Mon.DD, YYYY') as deadline_pretty, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue - from - wf_cases c, wf_case_assignments ca, wf_case_deadlines dead, - wf_transitions trans, cr_items i - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = trans.workflow_key - and - c.object_id = i.item_id - and - c.case_id = ca.case_id - and - c.case_id = dead.case_id - and - ca.transition_key = trans.transition_key - and - dead.transition_key = trans.transition_key - and - c.state = 'active' - and - -- non active task - not exists ( select 1 - from - wf_tasks - where - state in ('enabled','started') - and - case_id = c.case_id - and - transition_key = ca.transition_key ) - and - -- its finished - content_workflow.is_finished(c.case_id, ca.transition_key) = 'f' - -- ca.transition_key = transition - $transition_sql - order by - trans.sort_order, title, assigned_party, dead.deadline desc" - set page_title "Workflow Tasks - $transition_name" Index: openacs-4/packages/cms/www/modules/workspace/assignments.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/assignments.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workspace/assignments.tcl 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workspace/assignments.tcl 22 Aug 2002 03:04:33 -0000 1.3 @@ -6,49 +6,7 @@ set user_id [User::getID] -template::query get_locked_tasks locked_tasks multirow " - select - types.pretty_name, - obj.object_id item_id, - content_item.get_title(obj.object_id) title, - task.task_id, - content_workflow.get_holding_user_name(task.task_id) holding_user_name, - to_char(task.hold_timeout,'Mon. DD, YYYY') hold_timeout, - assign.case_id, - trans.transition_name, trans.transition_key, - to_char(dead.deadline,'Mon. DD, YYYY') deadline - from - acs_object_types types, - acs_objects obj, - wf_case_assignments assign, - wf_transitions trans, - wf_tasks task, - wf_cases case, - wf_case_deadlines dead - where - dead.case_id = case.case_id - and - dead.transition_key = task.transition_key - and - assign.party_id = :user_id - and - assign.case_id = task.case_id - and - assign.transition_key = task.transition_key - and - task.state = 'started' - and - task.transition_key = trans.transition_key - and - assign.case_id = case.case_id - and - case.object_id = obj.object_id - and - types.object_type = content_item.get_content_type(obj.object_id) - and - task.holding_user ^= :user_id - order by - dead.deadline" +db_multirow locked_tasks get_locked_tasks "" set page_title "Task Assignments" Index: openacs-4/packages/cms/www/modules/workspace/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workspace/index.tcl 8 Jun 2001 01:44:53 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workspace/index.tcl 22 Aug 2002 03:04:33 -0000 1.3 @@ -11,53 +11,9 @@ # first part of the where clause gets all assignments for the individual # and for any groups to which the individual belongs. +db_multirow items get_workspace_items "" -template::query get_workspace_items items multirow " - select - types.pretty_name, - obj.object_id item_id, - content_item.get_title(obj.object_id) title, - task.task_id, - task.holding_user, - task.state, - assign.case_id, - trans.transition_name, trans.transition_key, - to_char(dead.deadline,'Mon. DD, YYYY') deadline, - content_workflow.can_reject(task.task_id, :user_id) can_reject, - content_workflow.approve_string(task.task_id, :user_id) approve_string - from - acs_object_types types, - acs_objects obj, - wf_case_assignments assign, - wf_transitions trans, - wf_tasks task, - wf_cases case, - wf_case_deadlines dead - where - dead.case_id = case.case_id - and - dead.transition_key = task.transition_key - and - assign.party_id = :user_id - and - assign.case_id = task.case_id - and - assign.transition_key = task.transition_key - and ( - task.state = 'enabled' - or (task.state = 'started' and task.holding_user = :user_id) - ) and - task.transition_key = trans.transition_key - and - assign.case_id = case.case_id - and - case.object_id = obj.object_id - and - types.object_type = content_item.get_content_type(obj.object_id) - order by - dead.deadline" - # don't cache this page #ns_set put [ns_conn outputheaders] Pragma "No-cache"