]> wagnertech.de Git - timetracker.git/commitdiff
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 37189625c2ddc91320a6ba088976cf4072e2fc35..6fe7ca180faa538753f6a7b678f62282143527ed 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 e253e8ec2e62f1ac9b97f80536e06a88a5501152..0a8bf89cd9606df7f46b187c3f0443e912fdce9f 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 d2331387dc5168f238c0e0cfde30a907b91e721e..49c2354425038587097b30fa656133c273c0c7b5 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 f832b632b611a7966af23342c549bfcad4ca81b7..2c16f251072becd87265fce210e580d03b0bc497 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 fde8b40094ab30464cb0e803b2e2b3b0e9791764..20fdb07e9a97b395c7ac787b61798c0c9f0956a4 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 236fdb4bd9f2dc7a0c4eb8489ca8543768b28d6c..c6c917ed0dbaa002e82174f4e65d9f2f2104116f 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 9107c963d73177a063c76a7afc8dbaa7cb27c572..20b7fc6eb9dbcfa39b82001f8e8f77f75c490629 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 ad9a6fd5c6ab051f220568e0eff6d7817e85f485..e5d8001d02512fd1cf43b30003a2157de1c5cf3f 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 18de06059345d330fcefe564e145d510fcc7aa7d..44efc79b65f5532b0dcb3d27812e7a31c00e5f6a 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 b0c5de11a60902bf758386f4bbab1542930d4704..d812864f91b8a94d393bad95c713c982c76e40b6 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 9e1fc324be6c6e9894cbe07108ccabe4d62a7b9a..d9ebdd7673628de9ed122e788349fcec30ace5c0 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 add2b43f326102245776e7fc9fc842e108d49632..cc6edcc287eb11d75c628bea464675e2454f118c 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 d8889110ac444049079da30eda949bb0498bdf3d..b926e2243fb34d244149c334c9313687fd91b2b7 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 aa204198ba8d3037bc3aa89aebe5f9030a1022ec..c05b077419edd8711ac39c31eacb901095189424 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');"));