From 27907dbe8cb9df3a2db9be1715cbbdeebf084651 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 26 May 2009 15:06:01 -0400 Subject: [PATCH] really made it so you can put tasks on hold. contractor can switch logins multiple times --- .gitignore | 1 + Makefile | 2 ++ code/config.php | 8 ++++++++ code/tasks.php | 2 ++ index.html | 2 +- index.php | 8 ++++++-- su.php | 4 +++- tasks.html | 6 +++--- tasks.php | 7 ++++++- 9 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index d648379..9184ef1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ images *.tgz style*.css w +tags diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a5a48a3 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +tags: *.php code/*.php code/wfpl/*.php + exuberant-ctags *.php code/*.php code/wfpl/*.php diff --git a/code/config.php b/code/config.php index d863f7d..82fb0cc 100644 --- a/code/config.php +++ b/code/config.php @@ -21,6 +21,14 @@ function logged_in_as_contractor() { return logged_in_as_admin(); } +function ever_was_contractor() { + return logged_in_as_contractor() || session_get('auth_was_contractor') == 'Yes'; +} + +function set_was_contractor() { + session_set('auth_was_contractor', 'Yes'); +} + function enc_money($float) { return format_money($float, $cents = false); } diff --git a/code/tasks.php b/code/tasks.php index a716fa2..a442381 100644 --- a/code/tasks.php +++ b/code/tasks.php @@ -46,6 +46,8 @@ function task_state_pretty($state) { return "to be priced"; case TASK_NEEDS_GO_AHEAD: return "waiting for you to approve the price"; + case TASK_ON_HOLD: + return "on hold"; case TASK_QUEUED: return "queued"; case TASK_WORKING: diff --git a/index.html b/index.html index eb1236d..1310540 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@

This page is for giving Jason Woofenden 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:

diff --git a/index.php b/index.php index ab4ff12..88e5605 100644 --- a/index.php +++ b/index.php @@ -122,6 +122,10 @@ function _index_main() { return './tiny_agreement'; } + if(ever_was_contractor()) { + tem_show('su_link'); + } + if(logged_in_as_contractor()) { tem_show('contractor_links'); tem_show('needs_attention_header'); @@ -139,10 +143,10 @@ 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)', $client_id, TASK_DRAFT, TASK_NEEDS_CLARIFICATION, TASK_NEEDS_GO_AHEAD, TASK_NEEDS_TESTING)) { + 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); diff --git a/su.php b/su.php index 0c45cf1..2ff23ae 100644 --- a/su.php +++ b/su.php @@ -18,7 +18,9 @@ require_once('code/wfpl/format.php'); function su_main() { - if(!logged_in_as_contractor()) { + if(logged_in_as_contractor()) { + set_was_contractor(); + } elseif(!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.html b/tasks.html index 08e7a47..192426b 100644 --- a/tasks.html +++ b/tasks.html @@ -31,11 +31,11 @@

Edit this task

Edit this task

-

I'm starting on this now.

+

I'm starting on this now

-

Place this task on hold.

+

Place this task on hold

-

Mark this task as finished (request testing).

+

Mark this task as finished (request testing)

Please test everything in the narrative! If everything is working, Mark this task as finished Otherwise please e-mail or call Jason.

diff --git a/tasks.php b/tasks.php index 19010f8..8418502 100644 --- a/tasks.php +++ b/tasks.php @@ -141,8 +141,12 @@ function tasks_display_main() { switch($state) { case TASK_DRAFT: case TASK_NEEDS_CLARIFICATION: - case TASK_NEEDS_QUOTE: case TASK_BUG: + case TASK_ON_HOLD: + tem_show('normal_edit_link'); + break; + case TASK_NEEDS_QUOTE: + tem_show('hold_link'); tem_show('normal_edit_link'); break; case TASK_NEEDS_GO_AHEAD: @@ -153,6 +157,7 @@ function tasks_display_main() { case TASK_QUEUED: tem_show('price_row'); tem_show('warning_edit_link'); + tem_show('hold_link'); break; case TASK_WORKING: tem_show('price_row'); -- 1.7.10.4