JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added "mark paid" link in mostly the right places
authorJason Woofenden <jason283@herkamire.com>
Wed, 3 Dec 2008 04:56:52 +0000 (23:56 -0500)
committerJason Woofenden <jason283@herkamire.com>
Wed, 3 Dec 2008 04:56:52 +0000 (23:56 -0500)
tasks.html
tasks.php

index 448e989..af09c86 100644 (file)
@@ -24,6 +24,8 @@
 
   <!--~price_row start~--><p><strong>Price</strong>: ~price.money~</p><!--~end~-->
 
+  <!--~mark_paid_link start~--><p><a href="tasks?tasks_mark_paid_id=~task_id.attr~">Mark as paid</a></p><!--~end~-->
+
   <!--~approve_price_link start~--><p><a href="tasks?tasks_approve_price_id=~task_id.attr~">Approve price</a></p><!--~end~-->
 
   <!--~normal_edit_link start~--><p><a href="tasks?tasks_edit_id=~task_id.attr~">Edit this task</a></p><!--~end~-->
index 779cb31..561c1d9 100644 (file)
--- a/tasks.php
+++ b/tasks.php
@@ -126,6 +126,7 @@ function tasks_display_main() {
                                case TASK_NEEDS_TESTING:
                                case TASK_FINISHED:
                                        tem_show('price_row');
+                                       tem_show('mark_paid_link'); # FIXME
                                break;
                        }
                } else {
@@ -188,6 +189,17 @@ function tasks_edit_main() {
                $state = TASK_BUG;
        }
 
+       if(isset($_REQUEST['tasks_mark_paid_id'])) {
+               if(!logged_in_as_contractor()) {
+                       message("Error: only Jason can mark tasks as paid.");
+                       return './';
+               }
+               $id = $_REQUEST['tasks_mark_paid_id'];
+               db_update('tasks', 'paid', 1, 'where id=%i', $id);
+               message('Marked as paid.');
+               return './';
+       }
+
        if(isset($_REQUEST['tasks_approve_price_id'])) {
                $id = $_REQUEST['tasks_approve_price_id'];
                $owner = db_get_value('tasks', 'client_id', 'where id=%i', $id);;