Index: openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/sample-article-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/sample-article-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/sample-article-create.sql 13 Apr 2001 13:36:02 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/sample-article-create.sql 14 May 2001 23:16:08 -0000 1.5 @@ -186,9 +186,11 @@ v_object_name text; v_transition_name wf_transitions.transition_name%TYPE; v_name varchar(1000); + v_subject text default ''''; + v_body text default ''''; begin select to_char(ta.deadline,''Mon fmDDfm, YYYY HH24:MI:SS''), - acs_object.name(c.object_id), + acs_object__name(c.object_id), tr.transition_name into v_deadline_pretty, v_object_name, @@ -199,10 +201,10 @@ and tr.workflow_key = c.workflow_key and tr.transition_key = ta.transition_key; - notification__subject := ''Assignment: '' || v_transition_name || '' '' || - v_object_name; + v_subject := ''Assignment: '' || v_transition_name || '' '' || + v_object_name; - notification__body := ''Dear '' || acs_object__name(notification__party_to) || '' + v_body := ''Dear '' || acs_object__name(notification__party_to) || '' '' || '' Today, you have been assigned to a task. '' || '' @@ -211,7 +213,7 @@ ''; if v_deadline_pretty != '''' then - notification__ body := notification__body || ''Deadline: '' || v_deadline_pretty || '' + v_body := v_body || ''Deadline: '' || v_deadline_pretty || '' ''; end if; Index: openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/wf-callback-package.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/wf-callback-package.sql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/wf-callback-package.sql 13 Apr 2001 13:36:02 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/wf-callback-package.sql 14 May 2001 23:16:08 -0000 1.4 @@ -54,14 +54,14 @@ -- function time_sysdate_plus_x -create function wf_callback__time_sysdate_plus_x (integer,varchar,varchar) +create function wf_callback__time_sysdate_plus_x (integer,varchar,text) returns timestamp as ' declare time_sysdate_plus_x__case_id alias for $1; time_sysdate_plus_x__transition_key alias for $2; time_sysdate_plus_x__custom_arg alias for $3; begin - return now() + to_integer(time_sysdate_plus_x__custom_arg); + return now() + (time_sysdate_plus_x__custom_arg || '' days'')::interval; end;' language 'plpgsql'; Index: openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-case-package.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-case-package.sql,v diff -u -r1.8 -r1.9 --- openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-case-package.sql 18 Apr 2001 23:27:46 -0000 1.8 +++ openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-case-package.sql 14 May 2001 23:16:08 -0000 1.9 @@ -411,7 +411,7 @@ end if; /* Add an entry to the journal */ - v_journal_id := journal_entry.new( + v_journal_id := journal_entry__new( null, resume__case_id, ''case resume'', @@ -1569,19 +1569,24 @@ ''; end if; - /* We would like to add a URL to go visit, but how do we get that URL? */ - /* The notifications should really be sent from the application server layer, not from the database */ + /* + * We would like to add a URL to go visit, but how do we get that URL? + * + * The notifications should really be sent from the application + * server layer, not from the database + */ -- FIXME: last three args are also out varibles. if notify_assignee__callback != '''' and notify_assignee__callback is not null then execute ''select '' || notify_assignee__callback || ''('' || notify_assignee__task_id || '','' || - quote_literal(notify_assignee__custom_arg) || '','' || + coalesce(quote_literal(notify_assignee__custom_arg),''null'') || + '','' || notify_assignee__user_id || '','' || v_party_from || '','' || - v_subject || '','' || - v_body || '')''; + quote_literal(v_subject) || '','' || + quote_literal(v_body) || '')''; end if; -- FIXME: notifications package not ported yet. Index: openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-package.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-package.sql,v diff -u -r1.6 -r1.7 --- openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-package.sql 18 Apr 2001 23:27:46 -0000 1.6 +++ openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/workflow-package.sql 14 May 2001 23:16:08 -0000 1.7 @@ -473,7 +473,7 @@ returns boolean as ' declare simple_p__workflow_key alias for $1; - v_session_id alias for $2; + v_session_id integer; retval boolean; begin v_session_id := nextval(''workflow_session_id''); @@ -501,7 +501,7 @@ target_place_list_1 varchar; target_place_list_2 varchar; previous_place_list_i varchar; - row_count integer default 0; + v_row_count integer default 0; v_count integer; v_count2 integer; v_place_key wf_places.place_key%TYPE; @@ -566,11 +566,11 @@ loop exit when v_place_key = v_end_place; - -- previous_place_list(row_count) := v_place_key; + -- previous_place_list(v_row_count) := v_place_key; insert into previous_place_list (session_id,rcnt,ky) values - (v_session_id,row_count,v_place_key); + (v_session_id,v_row_count,v_place_key); select distinct transition_key into v_transition_key from wf_arcs @@ -643,7 +643,7 @@ select ky into target_place_list_2 from target_place_list where session_id = v_session_id and rcnt = 2; - for i in 0..row_count LOOP + for i in 0..v_row_count LOOP select ky into previous_place_list_i from previous_place_list where session_id = v_session_id and rcont = i; @@ -663,7 +663,7 @@ end if; end if; - row_count := row_count + 1; + v_row_count := v_row_count + 1; end loop; Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql 14 May 2001 23:16:08 -0000 1.2 @@ -18,6 +18,22 @@ + + + + select p.party_id, + acs_object.name(p.party_id) as name, + case when p.email = '' then '' else '(' || p.email || ')' end as email + from parties p + where 0 < (select count(*) + from users u, + party_approved_member_map m + where m.party_id = p.party_id + and u.user_id = m.member_id) + + + + @@ -32,7 +48,7 @@ - FIX ME DECODE (USE SQL92 CASE) + select p.party_id, acs_object.name(p.party_id) as name, decode(p.email, '', '', '('||p.email||')') as email Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 @@ -18,6 +18,22 @@ + + + + select p.party_id, + acs_object__name(p.party_id) as name, + case when p.email = '' then '' else '(' || p.email || ')' end as email + from parties p + where 0 < (select count(*) + from users u, + party_approved_member_map m + where m.party_id = p.party_id + and u.user_id = m.member_id) + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql 14 May 2001 04:55:12 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql 14 May 2001 23:16:08 -0000 1.5 @@ -67,7 +67,7 @@ - select workflow__simple_p(:workflow_key); end; + select workflow__simple_p(:workflow_key); @@ -121,8 +121,7 @@ wf_cases c, wf_transition_info tr, acs_objects o, - acs_object_types ot, - parties p + acs_object_types ot where t.task_id = :task_id and c.case_id = t.case_id and tr.transition_key = t.transition_key @@ -286,7 +285,6 @@ :ip_address, :msg ); - end; Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 14 May 2001 04:55:12 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 14 May 2001 23:16:08 -0000 1.3 @@ -509,7 +509,7 @@ if { [info exists attributes] } { array set attr $attributes foreach attribute_name [array names attr] { - db_dml set_attribute_value { + db_exec_plsql set_attribute_value { begin workflow_case.set_attribute_value( journal_id => :journal_id, @@ -531,7 +531,7 @@ foreach transition_key [array names asgn] { ns_log Notice "Assigning $transition_key" - db_dml clear_assignments { + db_exec_plsql clear_assignments { begin workflow_case.clear_manual_assignments( case_id => :case_id, @@ -542,7 +542,7 @@ foreach party_id $asgn($transition_key) { ns_log Notice "Adding $party_id to $transition_key" - db_dml add_manual_assignment { + db_exec_plsql add_manual_assignment { begin workflow_case.add_manual_assignment( case_id => :case_id, @@ -555,7 +555,7 @@ } } - db_dml end_task_action { + db_exec_plsql end_task_action { begin workflow_case.end_task_action( journal_id => :journal_id, @@ -582,7 +582,7 @@ @author Lars Pind (lars@pinds.com) @creation-date 10 July, 2000 } { - db_dml transition_fire { + db_exec_plsql transition_fire { begin workflow_case.fire_message_transition( task_id => :task_id @@ -635,7 +635,7 @@ set user_id [ad_get_user_id] set ip_address [ad_conn peeraddr] - db_dml case_suspend { + db_exec_plsql case_suspend { begin workflow_case.suspend( case_id => :case_id, @@ -660,7 +660,7 @@ set user_id [ad_get_user_id] set ip_address [ad_conn peeraddr] - db_dml case_resume { + db_exec_plsql case_resume { begin workflow_case.resume( case_id => :case_id, @@ -685,7 +685,7 @@ set user_id [ad_get_user_id] set ip_address [ad_conn peeraddr] - db_dml case_cancel { + db_exec_plsql case_cancel { begin workflow_case.cancel( case_id => :case_id, Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 @@ -6,7 +6,7 @@ select p.party_id, - acs_object.name(p.party_id) as name, + acs_object__name(p.party_id) as name, p.email from parties p where not exists (select 1 from wf_task_assignments ta where ta.task_id = :task_id and ta.party_id = p.party_id) Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 @@ -17,6 +17,8 @@ :transition_key, :party_id ); + + return null; end; Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-oracle.xql 14 May 2001 23:16:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + oracle8.1.6 + + + + + select c.case_id, + o.object_type, + ot.pretty_name as object_type_pretty, + acs_object.name(c.object_id) as object_name, + c.state, + jeo.creation_date as started_date, + to_char(jeo.creation_date, 'Mon fmDDfm, YYYY HH24:MI:SS') as started_date_pretty, + round(sysdate - jeo.creation_date) as age + from wf_cases c, + acs_objects o, + acs_object_types ot, + journal_entries je, + acs_objects jeo + where c.workflow_key = '[db_quote $workflow_key]' + and o.object_id = c.object_id + and ot.object_type = o.object_type + and je.object_id = c.case_id + and je.action = 'case start' + and jeo.object_id = je.journal_id + [ad_dimensional_sql $dimensional_list where and] + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases-postgresql.xql 14 May 2001 23:16:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + postgresql7.1 + + + + + select c.case_id, + o.object_type, + ot.pretty_name as object_type_pretty, + acs_object__name(c.object_id) as object_name, + c.state, + jeo.creation_date as started_date, + to_char(jeo.creation_date, 'Mon fmDDfm, YYYY HH24:MI:SS') as started_date_pretty, + now() - jeo.creation_date as age + from wf_cases c, + acs_objects o, + acs_object_types ot, + journal_entries je, + acs_objects jeo + where c.workflow_key = '[db_quote $workflow_key]' + and o.object_id = c.object_id + and ot.object_type = o.object_type + and je.object_id = c.case_id + and je.action = 'case start' + and jeo.object_id = je.journal_id + [ad_dimensional_sql $dimensional_list where and] + [ad_order_by_from_sort_spec $orderby $table_def] + + + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl 14 May 2001 23:16:08 -0000 1.2 @@ -105,32 +105,8 @@ { action "" "" "(debug)" } } -set sql " - select c.case_id, - o.object_type, - ot.pretty_name as object_type_pretty, - acs_object.name(c.object_id) as object_name, - c.state, - jeo.creation_date as started_date, - to_char(jeo.creation_date, 'Mon fmDDfm, YYYY HH24:MI:SS') as started_date_pretty, - round(sysdate - jeo.creation_date) as age - from wf_cases c, - acs_objects o, - acs_object_types ot, - journal_entries je, - acs_objects jeo - where c.workflow_key = '[db_quote $workflow_key]' - and o.object_id = c.object_id - and ot.object_type = o.object_type - and je.object_id = c.case_id - and je.action = 'case start' - and jeo.object_id = je.journal_id - [ad_dimensional_sql $dimensional_list where and] - [ad_order_by_from_sort_spec $orderby $table_def] -" +set table_html [ad_table -Torderby $orderby -Tmissing_text $missing_text "cases_table" "" $table_def] -set table_html [ad_table -Torderby $orderby -Tmissing_text $missing_text "cases_table" $sql $table_def] - db_release_unused_handles Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-oracle.xql 14 May 2001 23:16:08 -0000 1.2 @@ -30,5 +30,22 @@ + + + + + select p.party_id as sel_party_id, + acs_object.name(p.party_id) as sel_name, + p.email as sel_email + from parties p + where p.party_id not in + (select ca.party_id + from wf_context_assignments ca + where ca.workflow_key = :workflow_key + and ca.context_key = :context_key + and ca.transition_key = :transition_key) + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments-postgresql.xql 14 May 2001 23:16:08 -0000 1.1 @@ -0,0 +1,53 @@ + + + postgresql7.1 + + + + + select tr.transition_key, + tr.transition_name, + p.party_id, + acs_object__name(p.party_id) as party_name, + p.email as party_email, + '' as user_select_widget + from wf_transition_info tr + left outer join + wf_context_assignments ca + on (tr.context_key = ca.context_key and + tr.transition_key = ca.transition_key and + tr.workflow_key = :workflow_key and + tr.context_key = :context_key and + tr.trigger_type = 'user' and + tr.assignment_callback is null) + left outer join + parties p + using (party_id) + where not exists + (select 1 + from wf_transition_assignment_map + where workflow_key = tr.workflow_key + and assign_transition_key = tr.transition_key) + order by tr.sort_order, tr.transition_key + + + + + + + + select p.party_id as sel_party_id, + acs_object__name(p.party_id) as sel_name, + p.email as sel_email + from parties p + where p.party_id not in + (select ca.party_id + from wf_context_assignments ca + where ca.workflow_key = :workflow_key + and ca.context_key = :context_key + and ca.transition_key = :transition_key) + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignments.xql 14 May 2001 23:16:08 -0000 1.2 @@ -33,51 +33,5 @@ - - - - - select tr.transition_key, - tr.transition_name, - p.party_id, - acs_object.name(p.party_id) as party_name, - p.email as party_email, - '' as user_select_widget - from wf_transition_info tr left outer join - (wf_context_assignments ca left outer join parties p - using (party_id)) using (context_key, transition_key) - where tr.workflow_key = :workflow_key - and tr.context_key = :context_key - and tr.trigger_type = 'user' - and tr.assignment_callback is null - and not exists - (select 1 - from wf_transition_assignment_map - where workflow_key = tr.workflow_key - and assign_transition_key = tr.transition_key) - order by tr.sort_order, tr.transition_key - - - - - - - - - select p.party_id as sel_party_id, - acs_object.name(p.party_id) as sel_name, - p.email as sel_email - from parties p - where p.party_id not in - (select ca.party_id - from wf_context_assignments ca - where ca.workflow_key = :workflow_key - and ca.context_key = :context_key - and ca.transition_key = :transition_key) - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql 14 May 2001 23:16:08 -0000 1.2 @@ -11,7 +11,7 @@ ta.transition_key, tr.transition_name, ta.enabled_date, - to_char(ta.enabled_date, :date_format) enabled_date_pretty, + to_char(ta.enabled_date, :date_format) as enabled_date_pretty, ta.state, ta.deadline, to_char(ta.deadline, :date_format) as deadline_pretty, Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 @@ -11,7 +11,7 @@ ta.transition_key, tr.transition_name, ta.enabled_date, - to_char(ta.enabled_date, :date_format) enabled_date_pretty, + to_char(ta.enabled_date, :date_format) as enabled_date_pretty, ta.state, ta.deadline, to_char(ta.deadline, :date_format) as deadline_pretty,