Refactoring - renamed a few things.
authoranuko <support@anuko.com>
Tue, 28 Feb 2017 18:24:44 +0000 (18:24 +0000)
committeranuko <support@anuko.com>
Tue, 28 Feb 2017 18:24:44 +0000 (18:24 +0000)
14 files changed:
WEB-INF/lib/form/Checkbox.class.php
WEB-INF/lib/form/Combobox.class.php
WEB-INF/lib/form/DateField.class.php
WEB-INF/lib/form/Form.class.php
WEB-INF/lib/form/FormElement.class.php
WEB-INF/lib/form/Submit.class.php
WEB-INF/lib/form/TextField.class.php
WEB-INF/templates/footer.tpl
cf_custom_fields.php
mobile/time.php
mobile/time_edit.php
reports.php
time.php
time_edit.php

index 3718962..6fe7ca1 100644 (file)
@@ -61,7 +61,7 @@ class Checkbox extends FormElement {
                if ($this->mChecked || (($this->value == $this->mOptions) && ($this->value != null)))
                   $html .= " checked=\"true\"";
                   
-               if (!$this->isEnable())
+               if (!$this->isEnabled())
                   $html .= " disabled=\"disabled\"";
                   
                $html .= " value=\"".htmlspecialchars($this->mOptions)."\"";
index e253e8e..0a8bf89 100644 (file)
@@ -84,7 +84,7 @@ class Combobox extends FormElement {
                if ($this->style!="")
                   $html .= " style=\"$this->style\"";
                 
-                if (!$this->isEnable())
+                if (!$this->isEnabled())
                   $html .= " disabled";
                   
                $html .= ">\n";   
index d233138..49c2354 100644 (file)
@@ -83,7 +83,7 @@ class DateField extends TextField {
 
   function toStringControl() {
 
-    if (!$this->isEnable()) {
+    if (!$this->isEnabled()) {
       $html = htmlspecialchars($this->getValue()).
         "<input type=\"hidden\" name=\"$this->name\" value=\"".htmlspecialchars($this->getValue())."\">\n";
     } else {
index f832b63..2c16f25 100644 (file)
@@ -142,7 +142,7 @@ class Form {
                        $el->setFormName($this->name);
                        if (isset($arguments["id"])) $el->setId($arguments["id"]);
                        if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]);
-                       if (isset($arguments["enable"])) $el->setEnable($arguments["enable"]);
+                       if (isset($arguments["enable"])) $el->setEnabled($arguments["enable"]);
                        
                        if (isset($arguments["style"])) $el->setStyle($arguments["style"]);
                        if (isset($arguments["size"])) $el->setSize($arguments["size"]);
index fde8b40..20fdb07 100644 (file)
@@ -38,9 +38,9 @@ class FormElement {
   var $on_click = '';   // What happens when the control is clicked.
   var $label = '';      // Optional label for control.
   var $style = '';      // Control style.
-
+  var $enabled = true;  // Whether the control is enabled.
+        
   // TODO: refactoring ongoing down from here.
-       var $mEnabled           = true;
        var $cClassName         = "FormElement";
        var $mI18n                      = null;
 
@@ -76,8 +76,8 @@ class FormElement {
        function setStyle($value) { $this->style = $value; }
        function getStyle() { return $this->style; }
 
-       function setEnable($flag)       { $this->mEnabled = $flag;      }
-       function isEnable()     { return $this->mEnabled; }
+       function setEnabled($flag) { $this->enabled = $flag; }
+       function isEnabled() { return $this->enabled; }
        
        function setOnChange($str) { $this->on_change = $str; }
        function setOnClick($str) { $this->on_click = $str; }
index 236fdb4..c6c917e 100644 (file)
@@ -44,7 +44,7 @@ class Submit extends FormElement {
                $html = "\n\t<input";
                $html .= " type=\"submit\" name=\"$this->name\" id=\"$this->id\"";
                
-               if (!$this->isEnable()) {
+               if (!$this->isEnabled()) {
                        $html .= " disabled=\"true\"";
                }
                
index 9107c96..20b7fc6 100644 (file)
@@ -42,7 +42,7 @@ class TextField extends FormElement {
        function getAsPassword()        { return $this->mPassword; }
 
        function toStringControl() {
-               if (!$this->isEnable()) {
+               if (!$this->isEnabled()) {
                        $html = "<input name=\"$this->name\" value=\"".htmlspecialchars($this->getValue())."\" readonly>\n";
                } else {
                        
index ad9a6fd..e5d8001 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.10.38.3606 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.10.38.3607 | Copyright &copy; <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>
index 18de060..44efc79 100644 (file)
@@ -50,7 +50,7 @@ if ($request->isPost()) {
   $fields = CustomFields::getFields();
   // At this time only one custom field is supported. Disable the Add button if we already have one or more custom fields.
   if (count($fields) > 0)
-    $form->getElement('btn_add')->setEnable(false);
+    $form->getElement('btn_add')->setEnabled(false);
 }
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
index b0c5de1..d812864 100644 (file)
@@ -158,8 +158,8 @@ if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type
 }
 if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
   // Make the start and finish fields read-only.
-  $form->getElement('start')->setEnable(false);
-  $form->getElement('finish')->setEnable(false);
+  $form->getElement('start')->setEnabled(false);
+  $form->getElement('finish')->setEnabled(false);
 }
 if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
   $form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
index 9e1fc32..d9ebdd7 100644 (file)
@@ -178,8 +178,8 @@ if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type
 }
 if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
   // Make the start and finish fields read-only.
-  $form->getElement('start')->setEnable(false);
-  $form->getElement('finish')->setEnable(false);
+  $form->getElement('start')->setEnabled(false);
+  $form->getElement('finish')->setEnabled(false);
 }
 if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
   $form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
index add2b43..cc6edcc 100644 (file)
@@ -242,7 +242,7 @@ $form->setValueByElement('fav_report_changed','');
 
 // Disable the Delete button when no favorite report is selected.
 if (!$bean->getAttribute('favorite_report') || ($bean->getAttribute('favorite_report') == -1))
-  $form->getElement('btn_delete')->setEnable(false);
+  $form->getElement('btn_delete')->setEnabled(false);
 
 if ($request->isPost()) {
   if((!$bean->getAttribute('btn_generate') && ($request->getParameter('fav_report_changed')))) {
index d888911..b926e22 100644 (file)
--- a/time.php
+++ b/time.php
@@ -190,8 +190,8 @@ if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type
 }
 if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
   // Make the start and finish fields read-only.
-  $form->getElement('start')->setEnable(false);
-  $form->getElement('finish')->setEnable(false);
+  $form->getElement('start')->setEnabled(false);
+  $form->getElement('finish')->setEnabled(false);
 }
 if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
   $form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
index aa20419..c05b077 100644 (file)
@@ -178,8 +178,8 @@ if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type
 }
 if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
   // Make the start and finish fields read-only.
-  $form->getElement('start')->setEnable(false);
-  $form->getElement('finish')->setEnable(false);
+  $form->getElement('start')->setEnabled(false);
+  $form->getElement('finish')->setEnabled(false);
 }
 if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
   $form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));