Commit 28c44638 authored by Frank Bergmann's avatar Frank Bergmann

- added single-column WF task panels

- upgrading costs(?)
parent 61053454
......@@ -5,53 +5,49 @@
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td bgcolor="#cccccc">
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr bgcolor="#9bbad6">
<th colspan="@panels:rowcount@"><big>Task: @task.task_name@</big></th>
</tr>
<tr valign="middle">
<multiple name="panels">
<th bgcolor="#ffffe4" width="@panel_width@%">@panels.header@</th>
</multiple>
</tr>
<tr>
<multiple name="panels">
<td bgcolor="@panels.bgcolor@" valign="top">
<!-- @panels.template_url@ -->
<include src="@panels.template_url;noquote@" &="task" &="task_attributes_to_set" &="task_assigned_users" &="task_roles_to_assign" &="export_form_vars" &="return_url">
</td>
</multiple>
</tr>
</table>
<table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr bgcolor="#9bbad6">
<th colspan="@panels:rowcount@"><big>Task: @task.task_name@</big></th>
</tr>
<tr valign="middle">
<multiple name="panels">
<th bgcolor="#ffffe4" width="@panel_width@%">@panels.header@</th>
</multiple>
</tr>
<tr>
<multiple name="panels">
<td bgcolor="@panels.bgcolor@" valign="top">
<!-- @panels.template_url@ -->
<include src="@panels.template_url;noquote@" &="task" &="task_attributes_to_set" &="task_assigned_users" &="task_roles_to_assign" &="export_form_vars" &="return_url">
</td>
</multiple>
</tr>
</table>
</td></tr>
</table>
<p>
<if @extreme_p@ eq 1>
<table width="100%">
<tr><td align="center" bgcolor="#dddddd">
<small>
Extreme actions:
<multiple name="extreme_actions">
(<a href="@extreme_actions.url@">@extreme_actions.title@</a>)
</multiple>
</small>
</td></tr>
</table>
<table width="100%">
<tr><td align="center" bgcolor="#dddddd">
<small>
Extreme actions:
<multiple name="extreme_actions">
(<a href="@extreme_actions.url@">@extreme_actions.title@</a>)
</multiple>
</small>
</td></tr>
</table>
</if>
<p>
<include src="journal" case_id="@case_id;noquote@">
</master>
......@@ -23,22 +23,13 @@ ad_page_contract {
extreme_p
}
set user_id [ad_get_user_id]
# Fire all message transitions before:
wf_sweep_message_transition_tcl
# ---------------------------------------------------------
# Defaults & Security
# We don't force the user to authentify, is that right?
set user_id [ad_get_user_id]
####################
#
# Process the form
#
####################
#
# NOTE! We need to add some double-click protection here.
#
# ToDo: NOTE! We need to add some double-click protection here.
set the_action [array names action]
if { [llength $the_action] > 1 } {
......@@ -53,15 +44,15 @@ if { [llength $the_action] > 1 } {
}
# ---------------------------------------------------------
# Fire all message transitions before:
####################
#
# Output the page
#
####################
wf_sweep_message_transition_tcl
# ---------------------------------------------------------
# Get everything about the task
array set task [wf_task_info $task_id]
......@@ -73,30 +64,19 @@ set task(action_url) "task"
set task(return_url) $return_url
set context [list [list "case?case_id=$task(case_id)" "$task(object_name) case"] "$task(task_name)"]
set panel_color "#dddddd"
template::multirow create panels header template_url bgcolor
set show_action_panel_p 1
# ---------------------------------------------------------
# Get "information panel" information - displayed on the left usually
template::multirow create panels header template_url bgcolor
set this_user_is_assigned_p $task(this_user_is_assigned_p)
db_multirow panels panels {
select tp.header,
tp.template_url,
'' as bgcolor
from wf_context_task_panels tp,
wf_cases c,
wf_tasks t
where t.task_id = :task_id
and c.case_id = t.case_id
and tp.context_key = c.context_key
and tp.workflow_key = c.workflow_key
and tp.transition_key = t.transition_key
and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1))
and tp.overrides_action_p = 'f'
order by tp.sort_order
} {
db_multirow panels panels {} {
set bgcolor $panel_color
if {"t" == $overrides_both_panels_p} { set show_action_panel_p 0 }
}
# Only display the default-info-panel when we have nothing better
......@@ -104,50 +84,40 @@ if { ${panels:rowcount} == 0 } {
template::multirow append panels "Case" "task-default-info" $panel_color
}
# ---------------------------------------------------------
# Display instructions, if any
if { [db_string instruction_check "
select count(*)
from wf_transition_info ti, wf_tasks t
where t.task_id = :task_id
and t.transition_key = ti.transition_key
and t.workflow_key = ti.workflow_key
and instructions is not null
"] } {
if { [db_string instruction_check ""] } {
template::multirow append panels "Instructions" "task-instructions" $panel_color
}
# ---------------------------------------------------------
# Now for action panels -- these are always displayed at the far right
set override_action 0
db_foreach action_panels {
select tp.header,
tp.template_url
from wf_context_task_panels tp,
wf_cases c,
wf_tasks t
where t.task_id = :task_id
and c.case_id = t.case_id
and tp.context_key = c.context_key
and tp.workflow_key = c.workflow_key
and tp.transition_key = t.transition_key
and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1))
and tp.overrides_action_p = 't'
order by tp.sort_order
} {
set override_action 1
template::multirow append panels $header $template_url "#ffffff"
}
if {$show_action_panel_p} {
set override_action 0
db_foreach action_panels {} {
set override_action 1
template::multirow append panels $header $template_url "#ffffff"
}
if { $override_action == 0 } {
template::multirow append panels "Action" "task-action" "#ffffff"
if { $override_action == 0 } {
template::multirow append panels "Action" "task-action" "#ffffff"
}
}
set panel_width [expr {100/(${panels:rowcount})}]
set panel_width [expr {100/(${panels:rowcount})}]
set case_id $task(case_id)
set case_state [db_string case_state "select state from wf_cases where case_id = :case_id"]
set case_state [db_string case_state "select state from wf_cases where case_id = :case_id"]
# ---------------------------------------------------------
# "Extreme Actions" - cancel and/or suspend the case
set extreme_p 0
if {[string compare $case_state "active"] == 0} {
......@@ -159,7 +129,9 @@ if {[string compare $case_state "active"] == 0} {
# ---------------------------------------------------------
# Fire all message transitions after the action:
wf_sweep_message_transition_tcl
......
......@@ -6,6 +6,7 @@
select tp.header,
tp.template_url,
tp.overrides_both_panels_p,
'' as bgcolor
from wf_context_task_panels tp,
wf_cases c,
......@@ -32,6 +33,7 @@
and t.transition_key = ti.transition_key
and t.workflow_key = ti.workflow_key
and instructions is not null
and trim(instructions) != ''
</querytext>
</fullquery>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment