Cosmetic.
[timetracker.git] / week.php
index d457837..4de08c9 100644 (file)
--- a/week.php
+++ b/week.php
@@ -106,6 +106,7 @@ $cl_project = $request->getParameter('project', ($request->getMethod()=='POST'?
 $_SESSION['project'] = $cl_project;
 $cl_task = $request->getParameter('task', ($request->getMethod()=='POST'? null : @$_SESSION['task']));
 $_SESSION['task'] = $cl_task;
+$cl_note = trim($request->getParameter('note'));
 
 // Get the data we need to display week view.
 // Get column headers, which are day numbers in month.
@@ -125,14 +126,13 @@ class LabelCellRenderer extends DefaultCellRenderer {
       $this->setOptions(array('style'=>'text-align: center; font-weight: bold;'));
     }
     // Special handling for not billable entries.
-    /* // TODO: this does not work and should be coded properly.
     if ($row > 0) {
-      $row_id = $table->getValueAt($row,1+$column)['row_id'];
+      $row_id = $table->getValueAtName($row,'row_id');
       $billable = ttTimeHelper::parseFromWeekViewRow($row_id, 'bl');
       if (!$billable) {
-        $this->setOptions(array('class'=>'not_billable')); // TODO: Should not we add options instead? How does it work exactly?
+        $this->setOptions(array('style'=>'color: red;')); // TODO: style it properly in CSS.
       }
-    }*/
+    }
     $this->setValue(htmlspecialchars($value)); // This escapes HTML for output.
     return $this->toString();
   }
@@ -148,7 +148,7 @@ class TimeCellRenderer extends DefaultCellRenderer {
     if ($lockedDays[$column-1])
       $field->setEnabled(false);
     $field->setFormName($table->getFormName());
-    $field->setSize(2);
+    $field->setStyle('width: 60px;'); // TODO: need to style everything properly, eventually.
     $field->setValue($table->getValueAt($row,$column)['duration']);
     // Disable control when time entry mode is TYPE_START_FINISH and there is no value in control
     // because we can't supply start and finish times in week view - there are no fields for them.
@@ -257,6 +257,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
     'datakeys'=>array('id','name'),
     'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
 }
+$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note));
 
 // Add other controls.
 $form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar
@@ -353,6 +354,7 @@ if ($request->isPost()) {
               $record['task_id'] = $cl_task;
               $record['cf_1_value'] = $cl_cf_1;
               $fields['row_id'] = ttTimeHelper::makeRecordIdentifier($record).'_0';
+              $fields['note'] = $cl_note;
             }
             $fields['day_header'] = $dayHeader;
             $fields['start_date'] = $startDate->toString(DB_DATEFORMAT); // To be able to determine date for the entry using $dayHeader.