openacs-4/.../www/change-assignee.tcl (deleted)
1   ad_page_contract {
2      
3       @author Miguel Marin (miguelmarin@viaro.net)
4       @author Viaro Networks www.viaro.net
5       @creation_date 2005-10-23
6   } {
7       {task_id:multiple,optional ""}
8       {process_task_id:multiple,optional ""}
9       {party_id ""}
10       {return_url ""}
11   }
12  
13   set required_p 0
14  
15   if { ![exists_and_not_null task_id] } {
16       if { ![exists_and_not_null process_task_id] } {
17           set required_p 1
18       }
19   } elseif { ![exists_and_not_null process_task_id] } {
20       if { ![exists_and_not_null task_id] } {
21           set required_p 1
22       }
23   }
24  
25   if { $required_p } {
26       ad_return_complaint 1 "You need to provided either task_id or process_task_id"
27       ad_script_abort
28   }
29  
30   set page_title "[_ tasks.Change_Assignee]"
31   set context [list "$page_title"]
32  
33   if { ![exists_and_not_null return_url] } {
34       set return_url [get_referrer]
35   }
36  
37   if { [exists_and_not_null task_id] } {
38       set tasks_list [join $task_id ", \#"]
39   }
40  
41   if { [exists_and_not_null process_task_id] } {
42       set tasks_list [join $process_task_id ", \#"]
43   }
44  
45   ad_form -name change_assignee -form {
46       {tasks_show:text(inform)
47           {label "[_ tasks.Tasks]:"}
48           {value "\#$tasks_list"}
49       }
50       {task_id:text(hidden) {value $task_id}}
51       {process_task_id:text(hidden) {value $process_task_id}}
52       {party_id:party_search(party_search)
53           {label "[_ tasks.Search_Assignee]:"}
54           {help_text "[_ tasks.Search_Assignee_help]"}
55       }
56       {return_url:text(hidden) {value $return_url}}
57   } -on_submit {
58       if { [exists_and_not_null task_id] } {
59           foreach task $task_id {
60               db_dml update_tasks { }
61           }
62       }
63       if { [exists_and_not_null process_task_id] } {
64           foreach process_task $process_task_id {
65               db_dml update_process_tasks { }
66           }
67       }
68   } -after_submit {
69       ad_returnredirect $return_url
70   }