From: Jason Woofenden Date: Wed, 4 Nov 2009 15:53:41 +0000 (-0500) Subject: reorganized main page, and got my name out of the code X-Git-Url: https://jasonwoof.com/gitweb/?p=contractor-progress.git;a=commitdiff_plain;h=387c118c6b5f7f4c547f27db2ac8aab6612471ee reorganized main page, and got my name out of the code --- diff --git a/code/wfpl b/code/wfpl index dfd0f15..23c5e09 160000 --- a/code/wfpl +++ b/code/wfpl @@ -1 +1 @@ -Subproject commit dfd0f158f89020b3142e41127d21e48c8512aa1e +Subproject commit 23c5e0913ba24aa1c689dc75577de581661858e6 diff --git a/index.html b/index.html index 34d035c..a162800 100644 --- a/index.html +++ b/index.html @@ -9,41 +9,155 @@ -

Progress Manager

+

Progress Manager

-

This page is for giving Jason Woofenden work and figuring out the details of the associated tasks, costs and priorities.

+

This page is for giving ~contractor_full_name html~ work and figuring out the details of the associated tasks, costs and priorities.

-

Add a taskReport a problemManage accountsSwitch login

+

Add a taskReport a problemManage accountsSwitch login

- -

Tasks needing your attention:

- - - +
+
+
+ + + + +
Do these soon!
+
(And don't forget the queue below this section.)
- - + + +
Nothing is waiting for you!
+
There are no tasks in the database that are waiting for your attention.
- -

Tasks waiting for Jason:

- - + +
Tasks waiting for you
+
These tasks are waiting for your attention.
- - -

Jason is currently working on:

- - + +
A task waiting on you
+
This task is waiting for your attention.
+ + + +

Fix

+ + + + + + +

Finish

+ + + + + + +

Price

+ + + + + + + + + +

Approve Prices

+ +
(These tasks are waiting for you to approve their prices.)
+ + +
(This task is waiting for you to approve its price.)
+ + + + + + + +

Clarify

+ +
(These tasks are waiting for you to clarify their descriptions. Please replace all occurences of "FIXME" in their descriptions with details on exactly what you'd like.)
+ + +
(This task is waiting for you to clarify its description. Please replace all occurences of "FIXME" in the description with details on exactly what you'd like.)
+ + + + + + + +

Test

+ +
(These tasks are waiting for you to test them. Please read through each description, and see that every part of it has been finished before clicking "Mark this task as finished".)
+ + +
(This tasks is waiting for you to test it. Please read through the description, and see that every part of it has been finished before clicking "Mark this task as finished".)
+ + + + + + + +

Drafts

+ +
(When you are finished writing these task descriptions, you can click "Save and request price".)
+ + +
(When you are finished writing this task description, you can click "Save and request price".)
+ + + + + + + +

On Hold

+ +
(These tasks are on hold. When/if you are ready for one to be implemented, click on it, then click "Save and request price".)
+ + +
(This task is on hold. When/if you are ready for it to be implemented, click on it, then click "Save and request price".)
+ + + + + + +
+
+
+ + + +

~contractor_name html~'s To-Do list

+ +
(These tasks are waiting for ~contractor_name html~'s attention.)
+ + +
(This task is waiting for ~contractor_name html~'s attention.)
+ + + -

Queued tasks

-
Jason hasn't started on these yet. You can use the arrows to set the priority order. Jason will do the top one first.
+

Queued tasks

+ +
(You can use the arrows to set which tasks ~contractor_name html~ will do next.)
+ + +
(~contractor_name html~ will do the following task next.)
+ - + diff --git a/index.php b/index.php index 03e3077..88b09f6 100644 --- a/index.php +++ b/index.php @@ -34,8 +34,14 @@ function task_summary($tem_prefix, $where_clause/*, ... */) { $args = array_slice($args, 1); array_unshift($args, 'tasks', 'id,price,title,state,client_id,paid'); $rows = call_user_func_array('db_get_rows', $args); - #$rows = db_get_rows('tasks', 'id,price,title,state,client_id', $where_clause); + $num_rows = 0; if($rows) { + $num_rows = count($rows); + if($num_rows > 1) { + tem_show($tem_prefix . '_plural'); + } else { + tem_show($tem_prefix . '_singular'); + } $total = 0.0; foreach($rows as $row) { list($id, $price, $title, $state, $client_id, $paid) = $row; @@ -45,6 +51,12 @@ function task_summary($tem_prefix, $where_clause/*, ... */) { tem_set('task_state', task_state_pretty($state)); if(logged_in_as_contractor()) { tem_set('client', db_get_value('people', 'username', 'where id=%i', $client_id)); + if($tem_prefix == 'queue') { + tem_show('queued_for'); + } + } + if($num_rows > 1 && $tem_prefix == 'queue') { + tem_show('not_the_only_queued'); } tem_show($tem_prefix . '_row'); if(!$paid && isset($GLOBALS['unpaid_totals'])) { @@ -63,6 +75,8 @@ function task_summary($tem_prefix, $where_clause/*, ... */) { tem_show($tem_prefix); } + + return $num_rows; } # pass multi-dimensional hash arr[client_id][status]. @@ -87,8 +101,8 @@ function totals_summary($arr) { if(isset($t['queue'])) { $queue = $t['queue']; } - if(isset($t['needs_approval'])) { # administrator page re-uses this for TASK_WORKING - $working = $t['needs_approval']; + if(isset($t['do_finish'])) { + $working = $t['do_finish']; } tem_set('tested_total', $finished_unpaid); tem_set('done_total', $finished_unpaid + $finished_untested); @@ -117,6 +131,15 @@ function _index_main() { $client_id = logged_in(); $ever_was_contractor = ever_was_contractor(); + $contractor_full_name = db_get_value('people', 'name', 'where id=1'); + if(!$contractor_full_name) { + die('To finish installing this site, make yourself an account in the people table with id=1'); + } + list($contractor_name,) = explode(' ', $contractor_full_name, 2); + tem_set('contractor_name', $contractor_name); + tem_set('contractor_full_name', $contractor_full_name); + + # 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); @@ -131,14 +154,13 @@ function _index_main() { if(logged_in_as_contractor()) { tem_show('contractor_links'); - tem_show('needs_attention_header'); + tem_show('contractor_todo'); $GLOBALS['unpaid_totals'] = array(); - # things with a view link: - task_summary('needs_approval', 'where state=%i order by id desc', TASK_WORKING); # this affects queued_total + task_summary('do_finish', 'where state=%i order by id desc', TASK_WORKING); # this affects queued_total + task_summary('do_fix', 'where state=%i order by client_id desc', TASK_BUG); + task_summary('do_price', 'where state=%i order by client_id desc', TASK_NEEDS_QUOTE); - # things with an edit link: - task_summary('needs_fixing', 'where state=%i || state=%i order by id desc', TASK_NEEDS_QUOTE, TASK_BUG); task_summary('finished_untested', 'where state=%i order by client_id, finished_at desc', TASK_NEEDS_TESTING); task_summary('finished_unpaid', 'where state=%i && paid=0 order by finished_at desc', TASK_FINISHED); task_summary('queue', 'where state=%i order by client_id, ord desc', TASK_QUEUED); @@ -146,14 +168,25 @@ function _index_main() { task_summary('finished_paid', 'where state=%i && paid = 1 order by finished_at desc limit 20', TASK_FINISHED); } else { 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 || state=%i) order by id', $client_id, TASK_ON_HOLD, TASK_DRAFT, TASK_NEEDS_CLARIFICATION); + $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'); } + 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('contractor_will', 'where client_id=%i && (state=%i || state=%i || state=%i) order by id desc', $client_id, TASK_NEEDS_QUOTE, TASK_BUG, 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); } diff --git a/su.php b/su.php index 6f26627..a6acd12 100644 --- a/su.php +++ b/su.php @@ -18,8 +18,7 @@ require_once('code/wfpl/format.php'); function su_main() { - # If you log in to the admin account, you can su to a customer account and still have access to su back to admin. That's why we're checking for admin not "contractor" here. - if(!logged_in_as_admin()) { + if(!ever_was_contractor()) { $GLOBALS['url'] = this_url(); message('You must be logged in as an administrator to access that function'); return 'login'; diff --git a/tasks.css b/tasks.css index 24104b2..7c57459 100644 --- a/tasks.css +++ b/tasks.css @@ -1,6 +1,15 @@ +h2.plate { + margin-top: 40px; + text-align: left; + margin-bottom: 0; +} .index_body h3, .index_body h4 { text-align: left; - margin: 15px 0px 5px; + margin: 25px 0px 0px; +} + +div.task_state_note { + font-size: 80%; } th { diff --git a/template.html b/template.html index 447d351..09aa128 100644 --- a/template.html +++ b/template.html @@ -21,15 +21,17 @@
- -
- - -
- -

~message_text html~

- -
+ + +
+ +

~data html~

+ +
+ + +
+