- task_summary('needs_attention', 'where state=' . TASK_DRAFT . ' || state=' . TASK_NEEDS_CLARIFICATION . ' || state=' . TASK_NEEDS_GO_AHEAD . ' || state=' . TASK_NEEDS_TESTING . ' order by id');
- task_summary('queue', 'where state=' . TASK_QUEUED . " && client_id=$client_id order by ord");
- task_summary('jason', 'where state=' . TASK_NEEDS_QUOTE . ' || state=' . TASK_WORKING . ' || state=' . TASK_BUG . ' order by id desc');
- #task_summary('jason_pricing', 'where state=' . TASK_NEEDS_QUOTE . ' order by id desc');
- #task_summary('jason_working', 'where state=' . TASK_WORKING . ' order by id desc');
- task_summary('finished_unpaid', 'where state=' . TASK_FINISHED . ' && paid = 0 order by id desc');
- task_summary('finished_paid', 'where state=' . TASK_FINISHED . ' && paid = 1 order by id desc');
+ 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);
+ }
+ task_summary('queue', 'where client_id=%i && state=%i order by ord desc', $client_id, TASK_QUEUED);
+ task_summary('jason', 'where client_id=%i && (state=%i || state=%i) order by id desc', $client_id, TASK_NEEDS_QUOTE, TASK_BUG);
+ task_summary('jason_working', 'where client_id=%i && state=%i order by id desc', $client_id, TASK_WORKING);
+ task_summary('finished_unpaid', 'where client_id=%i && state=%i && paid=0 order by finished_at desc', $client_id, TASK_FINISHED);
+ task_summary('finished_paid', 'where client_id=%i && state=%i && paid=1 order by finished_at desc', $client_id, TASK_FINISHED);