X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=index.php;h=03e307755e6895685e8a84a73312af2136fbe9e4;hb=1656ee459ec82ab8f1113ebc71a8c923517b43ad;hp=d8eb41130720eef386128c8e8319fe1cb3d61f74;hpb=cdeb6364310baebb17e2a266d2785e3e90ef1a12;p=contractor-progress.git diff --git a/index.php b/index.php index d8eb411..03e3077 100644 --- a/index.php +++ b/index.php @@ -115,15 +115,22 @@ function totals_summary($arr) { function _index_main() { $client_id = logged_in(); + $ever_was_contractor = ever_was_contractor(); - # make sure they've filled out the tiny user agreement - $tiny_agreement = db_get_value('people', 'tiny_agreement', 'where id=%i', $client_id); - if($tiny_agreement < 30 || $tiny_agreement > 999) { - return './tiny_agreement'; + # make sure the client (not the contractor) has filled out the tiny agreement + if(!$ever_was_contractor) { + $tiny_agreement = db_get_value('people', 'tiny_agreement', 'where id=%i', $client_id); + if($tiny_agreement < 30 || $tiny_agreement > 999) { + return './tiny_agreement'; + } } - if(logged_in_as_contractor()) { + if($ever_was_contractor) { tem_show('su_link'); + } + + if(logged_in_as_contractor()) { + tem_show('contractor_links'); tem_show('needs_attention_header'); $GLOBALS['unpaid_totals'] = array(); @@ -138,10 +145,11 @@ function _index_main() { totals_summary($GLOBALS['unpaid_totals']); task_summary('finished_paid', 'where state=%i && paid = 1 order by finished_at desc limit 20', TASK_FINISHED); } else { - 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('not_contractor_links'); + if(db_count('tasks', 'where client_id=%i && (state=%i || state=%i || state=%i || state=%i || state=%i)', $client_id, TASK_DRAFT, TASK_NEEDS_CLARIFICATION, TASK_ON_HOLD, 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('needs_fixing', 'where client_id=%i && (state=%i || state=%i || state=%i) order by id', $client_id, TASK_ON_HOLD, 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);