Ongoing refactoring - renamed a variable.
authoranuko <support@anuko.com>
Sun, 19 Feb 2017 22:14:28 +0000 (22:14 +0000)
committeranuko <support@anuko.com>
Sun, 19 Feb 2017 22:14:28 +0000 (22:14 +0000)
14 files changed:
WEB-INF/lib/form/Calendar.class.php
WEB-INF/lib/form/Checkbox.class.php
WEB-INF/lib/form/CheckboxGroup.class.php
WEB-INF/lib/form/Combobox.class.php
WEB-INF/lib/form/DateField.class.php
WEB-INF/lib/form/FloatField.class.php
WEB-INF/lib/form/FormElement.class.php
WEB-INF/lib/form/Hidden.class.php
WEB-INF/lib/form/Submit.class.php
WEB-INF/lib/form/Table.class.php
WEB-INF/lib/form/TextArea.class.php
WEB-INF/lib/form/TextField.class.php
WEB-INF/lib/form/UploadFile.class.php
WEB-INF/templates/footer.tpl

index 46fcd6e..a64a035 100644 (file)
@@ -90,7 +90,7 @@ class Calendar extends FormElement {
     function toString($date="") {
       global $i18n;
        
-      $indate = $this->mValue;
+      $indate = $this->value;
       if (!$indate) $indate = strftime(DB_DATEFORMAT);
 
       if (!$this->isRenderable()) return "";
index 8ee4fea..6822adf 100644 (file)
@@ -35,8 +35,8 @@ class Checkbox extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function setChecked($value)     { $this->mChecked = $value; }
@@ -62,7 +62,7 @@ class Checkbox extends FormElement {
                if ($this->mStyle!="")
                   $html .= " style=\"$this->mStyle\"";
 
-               if ($this->mChecked || (($this->mValue == $this->mOptions) && ($this->mValue != null)))
+               if ($this->mChecked || (($this->value == $this->mOptions) && ($this->value != null)))
                   $html .= " checked=\"true\"";
                   
                if (!$this->isEnable())
index 759a076..13f207d 100644 (file)
@@ -41,8 +41,8 @@ class CheckboxGroup extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function setChecked($value)     { $this->mChecked = $value; }
@@ -87,9 +87,9 @@ class CheckboxGroup extends FormElement {
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                $html = "<input type=\"checkbox\" name=\"$this->name[]\" id=\"$this->id"."_".$i."\"";
-                               if (is_array($this->mValue)) {
-                                       foreach ($this->mValue as $value) {
-                                               if (($value == $optkey) && ($value != null))
+                               if (is_array($this->value)) {
+                                       foreach ($this->value as $element) {
+                                               if (($element == $optkey) && ($element != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
@@ -115,9 +115,9 @@ class CheckboxGroup extends FormElement {
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                $html = "<input type=\"checkbox\" name=\"$this->name[]\" id=\"$this->id"."_".$i."\"";
-                               if (is_array($this->mValue)) {
-                                       foreach ($this->mValue as $value) {
-                                               if (($value == $optkey) && ($value != null))
+                               if (is_array($this->value)) {
+                                       foreach ($this->value as $element) {
+                                               if (($element == $optkey) && ($element != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
index 0e8ec06..082765e 100644 (file)
@@ -48,8 +48,8 @@ class Combobox extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function setMultiple($value)    { $this->mMultiple = $value; }
@@ -95,7 +95,7 @@ class Combobox extends FormElement {
                if (is_array($this->mOptionsEmpty) && (count($this->mOptionsEmpty) > 0))
                foreach ($this->mOptionsEmpty as $key=>$value) {
                        $html .= "<option value=\"".$key."\"";
-                       if (($this->mValue == $value) && ($this->mValue != '')) $html .= " selected";
+                       if (($this->value == $value) && ($this->value != '')) $html .= " selected";
                        $html .= ">".$value."</option>\n";
                }
                if (is_array($this->mOptions) && (count($this->mOptions) > 0))
@@ -106,7 +106,7 @@ class Combobox extends FormElement {
                                $value = $value[$this->mDataKeys[1]];
                        }
                        $html .= "<option value=\"".$key."\"";
-                       if (($this->mValue == $key) && ($this->mValue != '')) $html .= " selected";
+                       if (($this->value == $key) && ($this->value != '')) $html .= " selected";
                        $html .= ">".htmlspecialchars($value)."</option>\n";
                }
                
index 24266a3..7075c42 100644 (file)
@@ -68,13 +68,13 @@ class DateField extends TextField {
   function setValueSafe($value)  {
     if (isset($value) && (strlen($value) > 0)) {
       $this->mDateObj->parseVal($value, DB_DATEFORMAT);
-      $this->mValue = $this->mDateObj->toString($this->mDateFormat); //?
+      $this->value = $this->mDateObj->toString($this->mDateFormat); //?
     }
   }
   // get value for storing in session or database
   function getValueSafe() {
-    if (strlen($this->mValue)>0) {
-      $this->mDateObj->parseVal($this->mValue, $this->mDateFormat);  //?
+    if (strlen($this->value)>0) {
+      $this->mDateObj->parseVal($this->value, $this->mDateFormat);  //?
       return $this->mDateObj->toString(DB_DATEFORMAT);
     } else {
       return null;
index 298e09b..b5f8d0d 100644 (file)
@@ -54,19 +54,19 @@ class FloatField extends TextField {
       $value = sprintf('%'.$this->mFFormat.'f', $value);
       $value = str_replace('.', $this->mDelimiter, $value);
     }
-    $this->mValue = $value;
+    $this->value = $value;
   }
 
   function setValueSafe($value)        {
     // '.' to ',' , apply delimiter
     if (strlen($value) > 0)
-      $this->mValue = str_replace('.', $this->mDelimiter, $value);
+      $this->value = str_replace('.', $this->mDelimiter, $value);
   }
 
   function getValueSafe() {
     // ',' to '.'
-    if (strlen($this->mValue) > 0)
-      return str_replace($this->mDelimiter, '.', $this->mValue);
+    if (strlen($this->value) > 0)
+      return str_replace($this->mDelimiter, '.', $this->value);
     return null;
   }
 }
index f46e3bf..209578d 100644 (file)
 
 // FromElement is the base class for controls on forms.
 class FormElement {
-  var $id = "";
+  var $id = '';
   var $name;
-  var $form_name = "";
-       var $mValue                     = "";
+  var $form_name = '';
+  var $value = '';
+  // TODO: refactoring ongoing down from here.
        var $mSize                      = "";
        var $mMaxLength         = "";
        var $mTabindex          = "";
@@ -53,17 +54,17 @@ class FormElement {
 
        function getClass()     { return $this->cClassName; }
        
-       function setName($name) { $this->name = $name;  }
+       function setName($name) { $this->name = $name; }
        function getName()      { return $this->name; }
        
        function setFormName($name) { $this->form_name = $name; }
        function getFormName()  { return $this->form_name; }
        
-       function setValue($value)       { $this->mValue = $value;}
-       function getValue() { return $this->mValue; }
+       function setValue($value) { $this->value = $value;}
+       function getValue() { return $this->value; }
        
-       function setValueSafe($value)   { $this->mValue = $value;}
-       function getValueSafe() { return $this->mValue; }
+       function setValueSafe($value) { $this->value = $value;}
+       function getValueSafe() { return $this->value; }
 
        function setId($id)     { $this->id = $id;      }
        function getId() { return $this->id; }
index 0105de1..cddb223 100644 (file)
 import('form.FormElement');
        
 class Hidden extends FormElement {
-    var $mValue;
     var $cClassName    = "Hidden";
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function toStringControl()      {
index bcfe3be..c4a2c0d 100644 (file)
@@ -33,8 +33,8 @@ class Submit extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function toStringControl()      {
@@ -49,7 +49,7 @@ class Submit extends FormElement {
                        $html .= " disabled=\"true\"";
                }
                
-               $html .= " value=\"$this->mValue\"";
+               $html .= " value=\"$this->value\"";
                
                if ($this->mOnClick) {
                        $html .= " onclick=\"".$this->mOnClick."\"";
index 833bffa..44685d4 100644 (file)
@@ -49,7 +49,7 @@ class Table extends FormElement {
        
   function __construct($name, $value='') {
     $this->name = $name;
-    $this->mValue = $value;
+    $this->value = $value;
   }
   
   function setKeyField($value) {
@@ -160,8 +160,8 @@ class Table extends FormElement {
         if (0 == $col && strtolower(get_class($this->mColumns[$col]->getRenderer())) == 'checkboxcellrenderer') {
           // Checkbox for the row. Determine if selected.
           $selected = false;
-          if (is_array($this->mValue)) {
-            foreach ($this->mValue as $p) {
+          if (is_array($this->value)) {
+            foreach ($this->value as $p) {
               if ($p == $this->mData[$row][$this->mKeyField]) {
                $selected = true;
                break;
index ecc2010..6b3b5ee 100644 (file)
@@ -29,7 +29,6 @@
 import('form.FormElement');
        
 class TextArea extends FormElement {
-    var $mValue;
     var $mPassword     = false;
     var $mColumns      = "";
     var $mRows         = "";
@@ -37,8 +36,8 @@ class TextArea extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
        
        function setColumns($value)     { $this->mColumns = $value;     }
index e1259d6..4766d91 100644 (file)
 import('form.FormElement');
        
 class TextField extends FormElement {
-    var $mValue;
     var $mPassword     = false;
     var $cClassName            = "TextField";
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
        
        function setAsPassword($name)   { $this->mPassword = $name;     }
index 98fbe0a..97a2a8c 100644 (file)
 import('form.FormElement');
        
 class UploadFile extends FormElement {
-    var $mValue;
     var $cClassName            = "UploadFile";
     var $mMaxSize              = 100000;       // 100kb
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
        
        function setMaxSize($value)     { $this->mMaxSize = $value;     }
index 20116c5..fc9eb2b 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.3594 | 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.3595 | 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>