- task_summary('needs_approval', 'where state=%i order by id desc', TASK_WORKING);
- task_summary('needs_fixing', 'where (state=%i || state=%i) || (client_id=1 && state<%i) order by id desc', TASK_NEEDS_QUOTE, TASK_BUG, TASK_QUEUED);
- task_summary('finished_unpaid', 'where state=%i && paid = 0 order by id desc', TASK_FINISHED);
- task_summary('finished_paid', 'where state=%i && paid = 1 order by id desc', TASK_FINISHED);
- task_summary('queue', 'where state=%i order by client_id, ord', TASK_QUEUED);
+
+ # things with a view link:
+ task_summary('needs_approval', 'where state=%i || (client_id=%i && (state=%i || state=%i || state=%i)) order by id desc', TASK_WORKING, $client_id, TASK_NEEDS_TESTING, TASK_NEEDS_GO_AHEAD, TASK_BUG);
+
+ # things with an edit link:
+ task_summary('needs_fixing', 'where (state=%i || state=%i) || (client_id=%i && (state<%i || state=%i)) order by id desc', TASK_NEEDS_QUOTE, TASK_BUG, $client_id, TASK_DRAFT, TASK_NEEDS_CLARIFICATION);
+ task_summary('finished_unpaid', 'where state=%i && paid = 0 order by finished_at desc', TASK_FINISHED);
+ task_summary('finished_paid', 'where state=%i && paid = 1 order by finished_at desc limit 20', TASK_FINISHED);
+ task_summary('queue', 'where state=%i order by client_id, ord desc', TASK_QUEUED);