JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added TASK_BUG state, improved home page so initial states are displayd and lebeled...
authorJason Woofenden <jason283@herkamire.com>
Wed, 12 Nov 2008 23:37:28 +0000 (18:37 -0500)
committerJason Woofenden <jason283@herkamire.com>
Wed, 12 Nov 2008 23:37:28 +0000 (18:37 -0500)
index.html
index.php
tasks.html
tasks.php

index c63f009..6b1ddf4 100644 (file)
   <p><a href="tasks?tasks_new=1">Commission a new feature/update</a> &bull; <a href="tasks?tasks_new_bug=1">Report a problem</a><!-- &bull; <a href="pay">Pay Jason</a>--></p>
 
   <!--~needs_attention start~-->
   <p><a href="tasks?tasks_new=1">Commission a new feature/update</a> &bull; <a href="tasks?tasks_new_bug=1">Report a problem</a><!-- &bull; <a href="pay">Pay Jason</a>--></p>
 
   <!--~needs_attention start~-->
-    <div class="task_list needs_attention">
-    <h3 class="left">Tasks needing your attention:</h3>
+    <h3>Tasks needing your attention:</h3>
     <!--~needs_attention_row start~-->
     <div><a href="tasks?tasks_edit_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_state~)</div>
     <!--~end~-->
   <!--~end~-->
 
   <!--~queue start~-->
     <!--~needs_attention_row start~-->
     <div><a href="tasks?tasks_edit_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_state~)</div>
     <!--~end~-->
   <!--~end~-->
 
   <!--~queue start~-->
-    <div class="task_list queue">
     <h3>Prioritized queue</h3>
     <p>Use the arrows on the left to change the order.</p>
     <!--~queue_row start~-->
     <h3>Prioritized queue</h3>
     <p>Use the arrows on the left to change the order.</p>
     <!--~queue_row start~-->
-    <div><a href="tasks?id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
+    <div><a href="tasks?tasks_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
     <!--~end~-->
   <!--~end~-->
 
   <!--~jason start~-->
     <!--~end~-->
   <!--~end~-->
 
   <!--~jason start~-->
-    <div class="task_list jason_working">
     <h3>Tasks waiting for Jason:</h3>
     <!--~jason_row start~-->
     <h3>Tasks waiting for Jason:</h3>
     <!--~jason_row start~-->
-    <div><a href="tasks?id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_state~)</div>
+    <div><a href="tasks?tasks_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_state~)</div>
     <!--~end~-->
   <!--~end~-->
 
   <!--~jason_working start~-->
     <!--~end~-->
   <!--~end~-->
 
   <!--~jason_working start~-->
-    <div class="task_list jason_working">
     <h3>Jason is currently working on:</h3>
     <!--~jason_working_row start~-->
     <h3>Jason is currently working on:</h3>
     <!--~jason_working_row start~-->
-    <div><a href="tasks?id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
+    <div><a href="tasks?tasks_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
     <!--~end~-->
   <!--~end~-->
 
   <!--~finished_unpaid start~-->
     <!--~end~-->
   <!--~end~-->
 
   <!--~finished_unpaid start~-->
-    <div class="task_list finished_unpaid">
     <h3>Finished tasks (unpaid)</h3>
     <!--~finished_unpaid_row start~-->
     <h3>Finished tasks (unpaid)</h3>
     <!--~finished_unpaid_row start~-->
-    <div><a href="tasks?id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
+    <div><a href="tasks?tasks_id=~task_id~">Task #~task_id~: ~task_title.html~</a> (~task_price.money~)</div>
     <!--~end~-->
     <div>Total: ~task_total.money~</div>
   <!--~end~-->
 
   <!--~finished_paid start~-->
     <!--~end~-->
     <div>Total: ~task_total.money~</div>
   <!--~end~-->
 
   <!--~finished_paid start~-->
-    <div class="task_list finished_paid">
     <h3>Finished and paid for</h3>
     <!--~finished_paid_row start~-->
     <h3>Finished and paid for</h3>
     <!--~finished_paid_row start~-->
-    <div><a href="tasks?id=~task_id~">Task #~task_id~: ~task_title.html~</div>
+    <div><a href="tasks?tasks_id=~task_id~">Task #~task_id~: ~task_title.html~</div>
     <!--~end~-->
     <!--~finished_paid_and_more start~-->
     <div>...</div>
     <!--~end~-->
     <!--~finished_paid_and_more start~-->
     <div>...</div>
index 7f2a922..121f099 100644 (file)
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@ function task_summary($tem_prefix, $where_clause) {
 
 function _index_main() {
        task_summary('needs_attention', 'where state=' . TASK_DRAFT . ' || state=' . TASK_NEEDS_CLARIFICATION . ' || state=' . TASK_NEEDS_GO_AHEAD . ' || state=' . TASK_NEEDS_TESTING . ' order by id');
 
 function _index_main() {
        task_summary('needs_attention', 'where state=' . TASK_DRAFT . ' || state=' . TASK_NEEDS_CLARIFICATION . ' || state=' . TASK_NEEDS_GO_AHEAD . ' || state=' . TASK_NEEDS_TESTING . ' order by id');
-       task_summary('queue', 'where state=' . TASK_QUEUED . ' || state='. TASK_BUG . ' order by ord');
+       task_summary('queue', 'where state=' . TASK_QUEUED . ' order by ord');
        task_summary('jason', 'where state=' . TASK_NEEDS_QUOTE . ' || state=' . TASK_WORKING . ' || state=' . TASK_BUG . ' order by id desc');
        #task_summary('jason_pricing', 'where state=' . TASK_NEEDS_QUOTE . ' order by id desc');
        #task_summary('jason_working', 'where state=' . TASK_WORKING . ' order by id desc');
        task_summary('jason', 'where state=' . TASK_NEEDS_QUOTE . ' || state=' . TASK_WORKING . ' || state=' . TASK_BUG . ' order by id desc');
        #task_summary('jason_pricing', 'where state=' . TASK_NEEDS_QUOTE . ' order by id desc');
        #task_summary('jason_working', 'where state=' . TASK_WORKING . ' order by id desc');
index cce4e0c..829132c 100644 (file)
@@ -10,7 +10,7 @@
   <!--~main_body start~-->
 
 <!--~form start~-->
   <!--~main_body start~-->
 
 <!--~form start~-->
-  <h2><!--~new_msg start~-->Add a new entry<!--~end~--><!--~edit_msg start~-->Edit entry "~client_id.html~"<!--~end~--></h2>
+  <h3><!--~new_msg start~-->Add a new task<!--~end~--><!--~edit_msg start~-->Edit task #~tasks_edit_id~ "~title.html~"<!--~end~--></h3>
 
   <form action="tasks" method="post"><!--~editing start~--><input type="hidden" name="tasks_edit_id" value="~tasks_edit_id.attr~" /><!--~end~-->
     <table cellspacing="0" cellpadding="4" border="0" summary="">
 
   <form action="tasks" method="post"><!--~editing start~--><input type="hidden" name="tasks_edit_id" value="~tasks_edit_id.attr~" /><!--~end~-->
     <table cellspacing="0" cellpadding="4" border="0" summary="">
       <tr><td class="caption">Url: </td><td class="field"><input type="text" name="url" value="~url.attr~" /></td></tr>
 
       <tr><td class="caption">Description: </td><td class="field"><textarea rows="9" cols="22" name="description">~description.html~</textarea></td></tr>
       <tr><td class="caption">Url: </td><td class="field"><input type="text" name="url" value="~url.attr~" /></td></tr>
 
       <tr><td class="caption">Description: </td><td class="field"><textarea rows="9" cols="22" name="description">~description.html~</textarea></td></tr>
-
-      <tr><td class="submit_row" colspan="2"><input type="submit" name="save" value="Save" /></td></tr>
+<!--~normal_submits start~-->
+      <tr><td class="submit_row" colspan="2"><input type="submit" name="save" value="Save and Request Price" /></td></tr>
+      <tr><td class="submit_row" colspan="2"><input type="submit" name="save_draft" value="Save Draft" /></td></tr>
+<!--~end~-->
+<!--~bug_submit start~-->
+      <tr><td class="submit_row" colspan="2"><input type="submit" name="save_bug" value="Send Problem Report" /></td></tr>
+<!--~end~-->
     </table>
   </form>
 <!--~end~-->
     </table>
   </form>
 <!--~end~-->
index 0443889..e923b21 100644 (file)
--- a/tasks.php
+++ b/tasks.php
@@ -46,6 +46,12 @@ function _tasks_main() {
                tem_show('editing');
        }
 
                tem_show('editing');
        }
 
+       if(isset($_REQUEST['tasks_new_bug'])) {
+               tem_show('bug_submit');
+       } else {
+               tem_show('normal_submits');
+       }
+
        $delete_id = format_int($_REQUEST['tasks_delete_id']);
        unset($_REQUEST['tasks_delete_id']);
        if($delete_id) {
        $delete_id = format_int($_REQUEST['tasks_delete_id']);
        unset($_REQUEST['tasks_delete_id']);
        if($delete_id) {
@@ -62,22 +68,25 @@ function _tasks_main() {
        if(isset($_REQUEST['title'])) {
                list($title, $url, $description) = tasks_get_fields();
 
        if(isset($_REQUEST['title'])) {
                list($title, $url, $description) = tasks_get_fields();
 
+               # FIXME
+               if(isset($_REQUEST['save_draft'])) {
+                       $state = TASK_DRAFT;
+               } elseif(isset($_REQUEST['save_bug'])) {
+                       $state = TASK_BUG;
+               } else {
+                       $state = TASK_NEEDS_QUOTE;
+               }
+
                if("you're happy with the POSTed values") {
                        if($edit_id) {
                if("you're happy with the POSTed values") {
                        if($edit_id) {
-                               db_update('tasks', 'title,url,description,state', $title, $url, $description, $state, $paid = 0, 'where id=%i', $edit_id);
+                               db_update('tasks', 'title,url,description,state', $title, $url, $description, $state, 'where id=%i', $edit_id);
                                message('Task updated.');
                        } else {
                                # new task
                                $paid = 0;
                                message('Task updated.');
                        } else {
                                # new task
                                $paid = 0;
-                               if(isset($_REQUEST['save_draft'])) {
-                                       $state = TASK_DRAFT;
-                               } else {
-                                       $state = TASK_NEEDS_QUOTE;
-                               }
                                $client_id = 4; # FIXME
                                db_insert('tasks', 'client_id,title,url,description,state,paid', $client_id, $title, $url, $description, $state, $paid);
                                message('Task saved.');
                                $client_id = 4; # FIXME
                                db_insert('tasks', 'client_id,title,url,description,state,paid', $client_id, $title, $url, $description, $state, $paid);
                                message('Task saved.');
-                               return './';
                        }
                        if($GLOBALS['tasks_form_recipient'] != "fixme@example.com") {
                                $to = $GLOBALS['tasks_form_recipient'];
                        }
                        if($GLOBALS['tasks_form_recipient'] != "fixme@example.com") {
                                $to = $GLOBALS['tasks_form_recipient'];
@@ -99,8 +108,7 @@ function _tasks_main() {
                                }
                        }
                        if($error !== true) {
                                }
                        }
                        if($error !== true) {
-                               tem_show('thankyou');
-                               return;
+                               return './';
                        }
                }
                # otherwise, we display the form again. tasks_get_fields() has
                        }
                }
                # otherwise, we display the form again. tasks_get_fields() has