A bit of refactoring with getting rid of some GLOBALS.
authoranuko <support@anuko.com>
Sat, 13 Jan 2018 19:04:47 +0000 (19:04 +0000)
committeranuko <support@anuko.com>
Sat, 13 Jan 2018 19:04:47 +0000 (19:04 +0000)
WEB-INF/lib/DateAndTime.class.php
WEB-INF/templates/footer.tpl
initialize.php

index 4752e99..20f2742 100644 (file)
@@ -321,18 +321,17 @@ class DateAndTime {
    */
   function preprocessFormatString($format) {
     global $i18n;
-    if (isset($GLOBALS['i18n'])) {
-      // replace locale-dependent strings
-      $format = str_replace('%a', mb_substr($i18n->getWeekDayName($this->mDay), 0, 3, 'utf-8'), $format);
-      $format = str_replace('%A', $i18n->getWeekDayName($this->mDay), $format);
-      $abbrev_month = mb_substr($i18n->monthNames[$this->mMonth], 0, 3, 'utf-8');
-      $format = str_replace('%b', $abbrev_month, $format);
-      $format = str_replace('%h', $abbrev_month, $format);
-      $format = str_replace('%z', date('O'), $format);
-      $format = str_replace('%Z', date('O'), $format); // format as 'O' for consistency with JS strftime
-      if (strpos($format, '%c') !== false) {
-        $format = str_replace('%c', $this->preprocessFormatString('%a %d %b %Y %T %Z'), $format);
-      }
+
+    // replace locale-dependent strings
+    $format = str_replace('%a', mb_substr($i18n->getWeekDayName($this->mDay), 0, 3, 'utf-8'), $format);
+    $format = str_replace('%A', $i18n->getWeekDayName($this->mDay), $format);
+    $abbrev_month = mb_substr($i18n->monthNames[$this->mMonth], 0, 3, 'utf-8');
+    $format = str_replace('%b', $abbrev_month, $format);
+    $format = str_replace('%h', $abbrev_month, $format);
+    $format = str_replace('%z', date('O'), $format);
+    $format = str_replace('%Z', date('O'), $format); // format as 'O' for consistency with JS strftime
+    if (strpos($format, '%c') !== false) {
+      $format = str_replace('%c', $this->preprocessFormatString('%a %d %b %Y %T %Z'), $format);
     }
     return $format;
   }
index 3d16e58..d067501 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.13.15.3744 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.13.15.3745 | 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 c9a4245..29425c0 100644 (file)
@@ -199,8 +199,6 @@ if (!$lang) {
 $i18n->load($lang);
 $GLOBALS['I18N'] = &$i18n;
 
-$GLOBALS['USER'] = &$user;
-
 // Assign things for smarty to use in template files.
 $smarty->assign('i18n', $i18n->keys);
 $smarty->assign('err', $err);