Improve stempel status layout
authorJoey Schulze <joey@infodrom.org>
Tue, 28 Jan 2020 21:56:11 +0000 (22:56 +0100)
committerJoey Schulze <joey@infodrom.org>
Tue, 28 Jan 2020 21:56:11 +0000 (22:56 +0100)
src/InfoCon/stempel/status.wml

index 76b9ca3..6adea17 100644 (file)
@@ -26,7 +26,7 @@
   <table class="smallfont border" id="table_%d" width="100%%" cellpadding=0 cellspacing=0>
   <thead>
   <tr class="head">
-    <th width=15%%>Datum</th>
+    <th width=15%% colspan="2">Datum</th>
     <th width=5%%>Dauer</th>
     <th width=5%%>St.</th>
     <th width=75%% align=left>Arbeitsbeschreibung</th>
                  '<input type="hidden" name="fields" value="%d">'.
                  '</form>';
 
-    $table_row = '<tr class="t%d" status="%d"><td>%s</td><td align="center" onclick="toggle_checkbox(%d,this)">%s</td>' .
+    $table_row = '<tr class="t%d" status="%d"><td>%s</td><td>%s</td><td align="center" onclick="toggle_checkbox(%d,this)">%s</td>' .
       '<td align="center" onclick="toggle_checkbox(%d,this)">%s</td><td><span class="edit" route="Stempel/EditTask" item_id="%d">%s</span></td></tr>';
     $table_sum = '</tbody><tfoot><tr class="t%d" onclick="edit_task_finish(this)">' .
-       '<td>&nbsp;</td><td align="center">%s</td><td>&nbsp;</td><td>Summe</td></tr></tfoot>';
+       '<td colspan="2">&nbsp;</td><td align="center">%s</td><td>&nbsp;</td><td>Summe</td></tr></tfoot>';
 
     $query = "SELECT stempel.oid,stempel.id,stempel.status,start,customer,time,task,kurz FROM stempel JOIN stempel_status ON (stempel.status = stempel_status.id) WHERE time IS NOT NULL ";
     if (isset($month) && strlen($month))
@@ -93,7 +93,7 @@
                       $form);
       $dt = new Datetime($d[0]);
       $date = sprintf('<span onclick="toggle_checkbox(%d,this)">%s, %s</span>', $form, $wdays[$dt->format('w')], $d[0]);
-      printf($table_row, $color, $row['status'], $check.$date, $form, min2hour($row['time']), $form, $row['kurz'],
+      printf($table_row, $color, $row['status'], $check$date, $form, min2hour($row['time']), $form, $row['kurz'],
             $row['id'],
             htmlspecialchars($row['task'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1'));
       $color = !$color;
@@ -226,7 +226,7 @@ function add_sum(form, checkbox)
     var hours = $('#time_'+form);
     var rate = $('#rate_'+form);
     var sum = $('#sum_'+form);
-    var time = strtime($(checkbox).parents('tr:first').find('td:nth-child(2)').text());
+    var time = strtime($(checkbox).parents('tr:first').find('td:nth-child(3)').text());
     var newval;
 
     if ($(checkbox).prop('checked')) {