- if(db_count('tasks', 'where client_id=%i && (state=%i || state=%i || state=%i || state=%i)', $client_id, TASK_DRAFT, TASK_NEEDS_CLARIFICATION, TASK_NEEDS_GO_AHEAD, TASK_NEEDS_TESTING)) {
- tem_show('needs_attention_header');
- task_summary('needs_approval', 'where client_id=%i && (state=%i || state=%i) order by id', $client_id, TASK_NEEDS_GO_AHEAD, TASK_NEEDS_TESTING);
- task_summary('needs_fixing', 'where client_id=%i && (state=%i || state=%i) order by id', $client_id, TASK_DRAFT, TASK_NEEDS_CLARIFICATION);
+ tem_show('not_contractor_links');
+ $num_rows = 0;
+ $num_rows += task_summary('do_approve_price', 'where client_id=%i && state=%i order by id', $client_id, TASK_NEEDS_GO_AHEAD);
+ $num_rows += task_summary('do_clarify', 'where client_id=%i && state=%i order by id', $client_id, TASK_NEEDS_CLARIFICATION);
+ $num_rows += task_summary('do_test', 'where client_id=%i && state=%i order by id', $client_id, TASK_NEEDS_TESTING);
+ $num_rows += task_summary('do_draft', 'where client_id=%i && state=%i order by id', $client_id, TASK_DRAFT);
+ $num_rows += task_summary('do_on_hold', 'where client_id=%i && state=%i order by id', $client_id, TASK_ON_HOLD);
+
+ if($num_rows == 0) {
+ tem_show('nothing_needs_your_attention');
+ } elseif($num_rows == 1) {
+ tem_show('this_needs_your_attention');
+ } else {
+ tem_show('these_need_your_attention');