JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
made unpaid totals section into a nice table, and added row for sum accross all clients
authorJason Woofenden <jason283@herkamire.com>
Tue, 20 Jan 2009 07:50:37 +0000 (02:50 -0500)
committerJason Woofenden <jason283@herkamire.com>
Tue, 20 Jan 2009 07:50:37 +0000 (02:50 -0500)
index.html
index.php
tasks.css

index 192fccf..48aede9 100644 (file)
 
   <!--~unpaid_totals start~-->
     <h3>Unpaid totals</h3>
-    <p>"queued" includes work-in-progress.
+    <table cellpadding="3" cellspacing="0" border="1" summary="">
+    <tr><th>Client</th><th>Queued<br />&amp; WIP</th><th>Done</th><th>Done &amp;<br />Tested</th><th>Done But<br />Not Tested</th></tr>
     <!--~unpaid_totals_row start~-->
-    <div class="task_link">~client.html~ queued: ~queued_total.money~, tested: ~tested_total.money~, done: ~done_total.money~</div>
+    <tr><td>~client.html~</td><td class="num">~queued_total.money~</td><td class="num">~done_total.money~</td><td class="num">~tested_total.money~</td><td class="num">~not_tested_total.money~</td></tr>
     <!--~end~-->
+    </table>
   <!--~end~-->
 
   <!--~finished_paid start~-->
index 1c17785..afb5de1 100644 (file)
--- a/index.php
+++ b/index.php
@@ -69,6 +69,10 @@ function task_summary($tem_prefix, $where_clause/*, ... */) {
 # status strings: 'finished_untested', 'finished_unpaid', 'queue'
 function totals_summary($arr) {
        if($arr) {
+               $total_finished_untested = 0;
+               $total_finished_unpaid = 0;
+               $total_queue = 0;
+               $total_working = 0;
                foreach($arr as $client_id => $t) {
                        $finished_untested = 0;
                        $finished_unpaid = 0;
@@ -88,11 +92,23 @@ function totals_summary($arr) {
                        }
                        tem_set('tested_total', $finished_unpaid);
                        tem_set('done_total', $finished_unpaid + $finished_untested);
+                       tem_set('not_tested_total', $finished_untested);
                        tem_set('queued_total', $queue + $working);
                        tem_set('client', db_get_value('people', 'username', 'where id=%i', $client_id));
                        tem_show('unpaid_totals_row');
+                       $total_finished_untested += $finished_untested;
+                       $total_finished_unpaid += $finished_unpaid;
+                       $total_queue += $queue;
+                       $total_working += $working;
                }
 
+               tem_set('tested_total', $total_finished_unpaid);
+               tem_set('done_total', $total_finished_unpaid + $total_finished_untested);
+               tem_set('not_tested_total', $total_finished_untested);
+               tem_set('queued_total', $total_queue + $total_working);
+               tem_set('client', 'all');
+               tem_show('unpaid_totals_row');
+
                tem_show('unpaid_totals');
        }
 }
index a9a6de1..24104b2 100644 (file)
--- a/tasks.css
+++ b/tasks.css
@@ -3,6 +3,14 @@
        margin: 15px 0px 5px;
 }
 
+th {
+       text-align: center;
+}
+
+td.num {
+       text-align: right;
+}
+
 .task_link {
        padding-top: 8px;
 }