--- /dev/null
+tags: *.php code/*.php code/wfpl/*.php
+ exuberant-ctags *.php code/*.php code/wfpl/*.php
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);
}
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:
<p>This page is for giving Jason Woofenden work and figuring out the details of the associated tasks, costs and priorities.</p>
- <p><a href="tasks?tasks_new=1">Add a task</a> • <!--~not_contractor_links start~--><a href="tasks?tasks_new_bug=1">Report a problem</a><!-- • <a href="pay">Pay Jason</a>--><!--~end~--><!--~contractor_links start~--><a href="people">Manage accounts</a> • <a href="su">Switch login</a><!--~end~--></p>
+ <p><a href="tasks?tasks_new=1">Add a task</a> • <!--~not_contractor_links start~--><a href="tasks?tasks_new_bug=1">Report a problem</a><!-- • <a href="pay">Pay Jason</a>--><!--~end~--><!--~contractor_links start~--><a href="people">Manage accounts</a><!--~end~--><!--~su_link start~--> • <a href="su">Switch login</a><!--~end~--></p>
<!--~needs_attention_header start~-->
<h3>Tasks needing your attention:</h3>
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');
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);
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';
<!--~normal_edit_link start~--><p><a href="tasks?tasks_edit_id=~task_id.attr~">Edit this task</a></p><!--~end~-->
<!--~warning_edit_link start~--><p><a href="tasks?tasks_edit_id=~task_id.attr~" onclick="return confirm('Editing this task will invalidate the price, proceed anyway?')">Edit this task</a></p><!--~end~-->
- <!--~working_link start~--><p><a href="tasks?tasks_working_id=~task_id.attr~">I'm starting on this now</a>.</p><!--~end~-->
+ <!--~working_link start~--><p><a href="tasks?tasks_working_id=~task_id.attr~">I'm starting on this now</a></p><!--~end~-->
- <!--~hold_link start~--><p><a href="tasks?tasks_hold_id=~task_id.attr~">Place this task on hold</a>.</p><!--~end~-->
+ <!--~hold_link start~--><p><a href="tasks?tasks_hold_id=~task_id.attr~">Place this task on hold</a></p><!--~end~-->
- <!--~needs_testing_link start~--><p><a href="tasks?tasks_needs_testing_id=~task_id.attr~">Mark this task as finished (request testing)</a>.</p><!--~end~-->
+ <!--~needs_testing_link start~--><p><a href="tasks?tasks_needs_testing_id=~task_id.attr~">Mark this task as finished (request testing)</a></p><!--~end~-->
<!--~finished_link start~--><p>Please test everything in the narrative! If everything is working, <a href="tasks?tasks_finished_id=~task_id.attr~">Mark this task as finished</a> Otherwise please e-mail or call Jason.</p><!--~end~-->
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:
case TASK_QUEUED:
tem_show('price_row');
tem_show('warning_edit_link');
+ tem_show('hold_link');
break;
case TASK_WORKING:
tem_show('price_row');