From d3b45bbcfa1a91751660a384939938f419f7a045 Mon Sep 17 00:00:00 2001 From: anuko Date: Sat, 6 Jan 2018 14:55:08 +0000 Subject: [PATCH] Work in progress enhancing week view. --- WEB-INF/lib/form/FormElement.class.php | 5 ++++- WEB-INF/lib/form/Table.class.php | 6 +++++- WEB-INF/templates/footer.tpl | 2 +- week.php | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/form/FormElement.class.php b/WEB-INF/lib/form/FormElement.class.php index 799abf7b..ff7b3b28 100644 --- a/WEB-INF/lib/form/FormElement.class.php +++ b/WEB-INF/lib/form/FormElement.class.php @@ -39,13 +39,16 @@ class FormElement { var $label = ''; // Optional label for control. var $style = ''; // Control style. var $enabled = true; // Whether the control is enabled. - var $class = 'FormElement'; // Class name for the element. + var $class = 'FormElement'; // PHP class name for the element. + var $cssClass = null; // CSS class name for the element. function __construct() { } function getName() { return $this->name; } function getClass() { return $this->class; } + function getCssClass() { return $this->cssClass; } + function setCssClass($cssClass) { $this->cssClass = $cssClass; } function setFormName($name) { $this->form_name = $name; } function getFormName() { return $this->form_name; } diff --git a/WEB-INF/lib/form/Table.class.php b/WEB-INF/lib/form/Table.class.php index 1e692c31..7bcd78be 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -47,9 +47,10 @@ class Table extends FormElement { var $mHeaderOptions = array(); var $mProccessed = false; - function __construct($name) { + function __construct($name, $cssClass = null) { $this->class = 'Table'; $this->name = $name; + $this->cssClass = $cssClass; } function setKeyField($value) { @@ -122,6 +123,9 @@ class Table extends FormElement { if ($this->mInteractive) $html .= $this->_addJavaScript(); $html .= "cssClass) { + $html .= " class=\"".$this->cssClass."\""; + } if (count($this->mTableOptions) > 0) { foreach ($this->mTableOptions as $k=>$v) { $html .= " $k=\"$v\""; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ab9fbcc7..8c04b71d 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.13.7.3719 | Copyright © Anuko | +  Anuko Time Tracker 1.13.7.3720 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/week.php b/week.php index 4de08c99..1b014d2b 100644 --- a/week.php +++ b/week.php @@ -179,7 +179,7 @@ if ($user->canManageTeam()) { } // Create week_durations table. -$table = new Table('week_durations'); +$table = new Table('week_durations', 'week_view_table'); // $table->setIAScript('markModified'); // TODO: write a script to mark table or particular cells as modified. $table->setTableOptions(array('width'=>'100%','cellspacing'=>'1','cellpadding'=>'3','border'=>'0')); $table->setRowOptions(array('class'=>'tableHeaderCentered')); -- 2.20.1