From e7ecc20f1789ce0adda175aa0f70177b0f7fdb22 Mon Sep 17 00:00:00 2001 From: anuko Date: Mon, 8 Jan 2018 19:47:12 +0000 Subject: [PATCH] A bit more refactoring of textarea element. --- WEB-INF/lib/form/Form.class.php | 2 -- WEB-INF/lib/form/TextArea.class.php | 13 +------------ WEB-INF/templates/footer.tpl | 2 +- client_add.php | 2 +- client_edit.php | 2 +- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/WEB-INF/lib/form/Form.class.php b/WEB-INF/lib/form/Form.class.php index a67c0c37..cf7890c6 100644 --- a/WEB-INF/lib/form/Form.class.php +++ b/WEB-INF/lib/form/Form.class.php @@ -77,8 +77,6 @@ class Form { case 'textarea': import('form.TextArea'); $el = new TextArea($params['name']); - if (isset($params['cols'])) $el->setColumns($params['cols']); - if (isset($params['rows'])) $el->setRows($params['rows']); if (isset($params['maxlength'])) $el->setMaxLength($params['maxlength']); break; diff --git a/WEB-INF/lib/form/TextArea.class.php b/WEB-INF/lib/form/TextArea.class.php index c6e8d1ff..be884f0d 100644 --- a/WEB-INF/lib/form/TextArea.class.php +++ b/WEB-INF/lib/form/TextArea.class.php @@ -29,8 +29,6 @@ import('form.FormElement'); class TextArea extends FormElement { - var $mColumns = ""; - var $mRows = ""; var $mOnKeyPress = ""; function __construct($name) @@ -39,9 +37,6 @@ class TextArea extends FormElement { $this->name = $name; } - function setColumns($value) { $this->mColumns = $value; } - function setRows($value) { $this->mRows = $value; } - function getHtml() { if (empty($this->id)) @@ -49,13 +44,7 @@ class TextArea extends FormElement { $html = "\n\tname\" id=\"$this->id\""; - - if ($this->mColumns!="") - $html .= " cols=\"$this->mColumns\""; - - if ($this->mRows!="") - $html .= " rows=\"$this->mRows\""; - + if ($this->max_length!="") { if ($this->mOnKeyPress) $this->mOnKeyPress .= ";"; $this->mOnKeyPress .= "return validateMaxLenght_".$this->name."(this, event);"; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 8db99ce5..3946f41f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.13.11.3734 | Copyright © Anuko | +  Anuko Time Tracker 1.13.11.3735 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/client_add.php b/client_add.php index cc8bd8a7..d3ca5aa9 100644 --- a/client_add.php +++ b/client_add.php @@ -52,7 +52,7 @@ if ($request->isPost()) { $form = new Form('clientForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 350px;','value'=>$cl_name)); -$form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','style'=>'width: 350px;','rows'=>'5','value'=>$cl_address)); +$form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','style'=>'width: 350px; height: 80px;','value'=>$cl_address)); $form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax)); if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) $form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'layout'=>'H','datakeys'=>array('id','name'),'value'=>$cl_projects)); diff --git a/client_edit.php b/client_edit.php index 87116cdf..cf4d1541 100644 --- a/client_edit.php +++ b/client_edit.php @@ -62,7 +62,7 @@ if ($request->isPost()) { $form = new Form('clientForm'); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id)); $form->addInput(array('type'=>'text','name'=>'name','maxlength'=>'100','style'=>'width: 350px;','value'=>$cl_name)); -$form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','style'=>'width: 350px;','rows'=>'5','value'=>$cl_address)); +$form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','style'=>'width: 350px; height: 80px;','value'=>$cl_address)); $form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax)); $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status, 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive')))); -- 2.20.1