JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added "mark paid" link in mostly the right places
[contractor-progress.git] / tasks.php
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);;