Commit 94f5ed3f authored by Frank Bergmann's avatar Frank Bergmann

- Old Task-Board:

  Now showing an empty table if the agile configuration is not correct
parent c954a521
......@@ -62,13 +62,22 @@ if {"" eq $agile_category_type} {
}
# Get the first of these states as the default state for new tasks
set default_agile_status_id [db_string def "select category_id from im_categories where category_type = :agile_category_type order by sort_order limit 1" -default ""]
if {"" eq $default_agile_status_id} {
ad_return_complaint 1 "Could not determine default agile state.<br>
set default_agile_status_id [db_string def "
select category_id
from im_categories
where category_type = :agile_category_type
order by sort_order limit 1
" -default ""]
if {0 && "" eq $default_agile_status_id} {
ad_return_complaint 1 "<b>Task-Board</b>:<br>
Could not determine default agile state.<br>&nbsp;<br>
<b>Details:</b><br>
Project #: $project_id<br>
Project Type: [im_category_from_id $project_type_id]<br>
Agile Category Type: '$category_type'"
Agile Category Type: '$agile_category_type'"
ad_script_abort
}
......@@ -106,9 +115,14 @@ set tasks_below_sprint_without_rel_sql "
p.project_id not in (select task_id from ($tasks_sql) t)
"
db_foreach tasks_below_sprint_without_rel $tasks_below_sprint_without_rel_sql {
set max_sort_order [db_string max_sort_order "select coalesce(max(i.sort_order),0) from im_agile_task_rels i, acs_rels r where i.rel_id = r.rel_id and r.object_id_one = :project_id" -default 0]
db_string add_user "select im_agile_task_rel__new(null, 'im_agile_task_rel', :project_id, :task_without_rel_id, null, :user_id, '[ad_conn peeraddr]', :default_agile_status_id, [expr $max_sort_order + 10])"
set max_sort_order [db_string max_sort_order "
select coalesce(max(i.sort_order),0)
from im_agile_task_rels i, acs_rels r
where i.rel_id = r.rel_id and r.object_id_one = :project_id
" -default 0]
if {"" ne $default_agile_status_id} {
db_string add_user "select im_agile_task_rel__new(null, 'im_agile_task_rel', :project_id, :task_without_rel_id, null, :user_id, '[ad_conn peeraddr]', :default_agile_status_id, [expr $max_sort_order + 10])"
}
}
set default_state_id [db_string default_state "
......
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