class TextField extends FormElement {
+ var $title = null; // Control title (ex: to display a tooltip).
+
function __construct($name)
{
$this->class = 'TextField';
$this->name = $name;
}
+ function setTitle($title) { $this->title = $title; }
+
function getHtml() {
if (empty($this->id)) $this->id = $this->name;
$html = "\n\t<input type=\"text\"";
$html .= " id=\"$this->id\" name=\"$this->name\"";
if (!empty($this->size)) $html .= " size=\"$this->size\"";
if (!empty($this->style)) $html .= " style=\"$this->style\"";
+ if (!empty($this->title)) $html .= " title=\"$this->title\"";
if($this->isEnabled()) {
if (!empty($this->max_length)) $html .= " maxlength=\"$this->max_length\"";
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.13.13.3741 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.13.14.3742 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
}
}
-// Define rendering class for a single cell for time entry in week view table.
-// TODO: Refactor the class name, as we now handle both durations and comments in these cells.
-class TimeCellRenderer extends DefaultCellRenderer {
+// Define rendering class for a single cell for a time or a comment entry in week view table.
+class WeekViewCellRenderer extends DefaultCellRenderer {
function render(&$table, $value, $row, $column, $selected = false) {
$field_name = $table->getValueAt($row,$column)['control_id']; // Our text field names (and ids) are like x_y (row_column).
$field = new TextField($field_name);
$field->setStyle('width: 60px;'); // TODO: need to style everything properly, eventually.
if (0 == $row % 2)
$field->setValue($table->getValueAt($row,$column)['duration']); // Duration for even rows.
- else
+ else {
$field->setValue($table->getValueAt($row,$column)['note']); // Comment for odd rows.
+ $field->setTitle($table->getValueAt($row,$column)['note']); // Tooltip to help view the entire comment.
+ }
// 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.
global $user;
// Add columns to table.
$table->addColumn(new TableColumn('label', '', new LabelCellRenderer(), $dayTotals['label']));
for ($i = 0; $i < 7; $i++) {
- $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new TimeCellRenderer(), $dayTotals[$dayHeaders[$i]]));
+ $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]]));
}
$table->setInteractive(false);
$form->addInputElement($table);