Index: openacs-4/packages/workflow/tcl/case-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/workflow/tcl/case-procs.tcl 29 Jun 2004 10:11:54 -0000 1.34 +++ openacs-4/packages/workflow/tcl/case-procs.tcl 21 Dec 2004 14:30:00 -0000 1.35 @@ -1629,6 +1629,7 @@ # Invoke them foreach impl_name $impl_names { + acs_sc::invoke \ -contract $contract_name \ -operation "DoSideEffect" \ Index: openacs-4/packages/workflow/tcl/deputy-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/deputy-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/workflow/tcl/deputy-procs.tcl 21 Dec 2004 14:30:00 -0000 1.1 @@ -0,0 +1,71 @@ +ad_library { + Procedures in the workflow::deputy namespace. + + @creation-date 2003-06-25 + @author Peter Marklund (peter@collaboraid.biz) + @cvs-id $Id: deputy-procs.tcl,v 1.1 2004/12/21 14:30:00 peterm Exp $ +} + +namespace eval workflow::deputy {} + +ad_proc -public workflow::deputy::new { + {-user_id ""} + {-deputy_id:required} + {-start_day:required} + {-end_day:required} + {-message ""} +} { + Create a new deputizing period for a user during which workflow + tasks will be assigned to a deputee. + + @param user_id The id of the user that is deputizing + @param deputy_id The id of the user to deputize to + @param start_day The start date of the deputizing period. Must be on ANSI format "YYYY-MM-DD" + @param end_day The end date of the deputizing period. Must be on ANSI format "YYYY-MM-DD" + @param message Any message describing the deputizing + + @author Peter Marklund +} { + if { [empty_string_p $user_id] } { + set user_id [ad_conn user_id] + } + + db_dml insert_deputy {} + + # Flush the role assignment info for all cases + # to make sure cache is in sync with db + # Do we also need to flush the workflow level cache here? + workflow::case::flush_cache +} + +ad_proc -public workflow::deputy::edit { + {-user_id:required} + {-deputy_id:required} + {-start_day:required} + {-end_day:required} + {-message:required} +} { + Edit deputy information for a certain user_id and deputy_id. + + @see workflow::deputy::new + + @author Peter Marklund +} { + db_dml update_deputy {} +} + +ad_proc -public workflow::deputy::delete { + {-user_id:required} + {-deputy_id:required} +} { + Delete deputy information for a certain user_id and deputy_id. + + @author Peter Marklund +} { + db_dml delete_deputy {} + + # Flush the role assignment info for all cases + # to make sure cache is in sync with db + # Do we also need to flush the workflow level cache here? + workflow::case::flush_cache +} Index: openacs-4/packages/workflow/tcl/deputy-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/deputy-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/workflow/tcl/deputy-procs.xql 21 Dec 2004 14:30:00 -0000 1.1 @@ -0,0 +1,33 @@ + + + + + + insert into workflow_deputies + (user_id, deputy_user_id, start_date, end_date, message) + values (:user_id, :deputy_id, to_date(:start_day, 'YYYY-MM-DD'), to_date(:end_day, 'YYYY-MM-DD'), :message) + + + + + + update workflow_deputies + set start_date = to_date(:start_day, 'YYYY-MM-DD'), + end_date = to_date(:end_day, 'YYYY-MM-DD'), + message = :message + where user_id = :user_id + and deputy_user_id = :deputy_id + + + + + + delete from workflow_deputies + where user_id = :user_id + and deputy_user_id = :deputy_id + + + + + +