projects
/
timetracker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75eff17
)
More refactoring.
author
anuko
<support@anuko.com>
Sat, 13 Jan 2018 20:27:38 +0000
(20:27 +0000)
committer
anuko
<support@anuko.com>
Sat, 13 Jan 2018 20:27:38 +0000
(20:27 +0000)
15 files changed:
WEB-INF/lib/form/ActionForm.class.php
patch
|
blob
|
history
WEB-INF/lib/form/Calendar.class.php
patch
|
blob
|
history
WEB-INF/lib/form/CheckboxGroup.class.php
patch
|
blob
|
history
WEB-INF/lib/form/DateField.class.php
patch
|
blob
|
history
WEB-INF/lib/form/FloatField.class.php
patch
|
blob
|
history
WEB-INF/lib/form/Form.class.php
patch
|
blob
|
history
WEB-INF/lib/form/FormElement.class.php
patch
|
blob
|
history
WEB-INF/lib/ttImportHelper.class.php
patch
|
blob
|
history
WEB-INF/lib/ttInvoiceHelper.class.php
patch
|
blob
|
history
WEB-INF/templates/footer.tpl
patch
|
blob
|
history
initialize.php
patch
|
blob
|
history
mobile/user_add.php
patch
|
blob
|
history
mobile/user_edit.php
patch
|
blob
|
history
user_add.php
patch
|
blob
|
history
user_edit.php
patch
|
blob
|
history
diff --git
a/WEB-INF/lib/form/ActionForm.class.php
b/WEB-INF/lib/form/ActionForm.class.php
index
ece7ceb
..
97c9219
100644
(file)
--- a/
WEB-INF/lib/form/ActionForm.class.php
+++ b/
WEB-INF/lib/form/ActionForm.class.php
@@
-176,7
+176,7
@@
class ActionForm {
import('form.'.$ref_el["class"]);
$class_name = $ref_el["class"];
$el = new $class_name($ref_el["name"]);
import('form.'.$ref_el["class"]);
$class_name = $ref_el["class"];
$el = new $class_name($ref_el["name"]);
-
if (isset($GLOBALS["I18N"])) $el->localize($GLOBALS["I18N"]
);
+
$el->localize(
);
$el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
if ($this->mForm && !isset($this->mForm->elements[$ref_el["name"]])) {
$el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
if ($this->mForm && !isset($this->mForm->elements[$ref_el["name"]])) {
diff --git
a/WEB-INF/lib/form/Calendar.class.php
b/WEB-INF/lib/form/Calendar.class.php
index
ab2dcf5
..
1340c98
100644
(file)
--- a/
WEB-INF/lib/form/Calendar.class.php
+++ b/
WEB-INF/lib/form/Calendar.class.php
@@
-57,8
+57,9
@@
class Calendar extends FormElement {
$this->highlight = $highlight;
}
$this->highlight = $highlight;
}
- function localize(
$i18n
) {
+ function localize() {
global $user;
global $user;
+ global $i18n;
$this->mMonthNames = $i18n->monthNames;
$this->mWeekDayShortNames = $i18n->weekdayShortNames;
$this->mMonthNames = $i18n->monthNames;
$this->mWeekDayShortNames = $i18n->weekdayShortNames;
diff --git
a/WEB-INF/lib/form/CheckboxGroup.class.php
b/WEB-INF/lib/form/CheckboxGroup.class.php
index
0bb3ac4
..
810c963
100644
(file)
--- a/
WEB-INF/lib/form/CheckboxGroup.class.php
+++ b/
WEB-INF/lib/form/CheckboxGroup.class.php
@@
-58,9
+58,10
@@
class CheckboxGroup extends FormElement {
function setGroupIn($value) { $this->mGroupIn = $value; if ($this->mGroupIn<1) $this->mGroupIn = 1;}
function getGroupIn() { return $this->mGroupIn; }
function setGroupIn($value) { $this->mGroupIn = $value; if ($this->mGroupIn<1) $this->mGroupIn = 1;}
function getGroupIn() { return $this->mGroupIn; }
- function localize($i18n) {
- $this->lSelAll = $i18n->getKey('label.select_all');
- $this->lSelNone = $i18n->getKey('label.select_none');
+ function localize() {
+ global $i18n;
+ $this->lSelAll = $i18n->getKey('label.select_all');
+ $this->lSelNone = $i18n->getKey('label.select_none');
}
function getHtml() {
}
function getHtml() {
diff --git
a/WEB-INF/lib/form/DateField.class.php
b/WEB-INF/lib/form/DateField.class.php
index
ecfdaf9
..
f8eef8c
100644
(file)
--- a/
WEB-INF/lib/form/DateField.class.php
+++ b/
WEB-INF/lib/form/DateField.class.php
@@
-41,14
+41,12
@@
class DateField extends TextField {
$this->class = 'DateField';
$this->name = $name;
$this->mDateObj = new DateAndTime();
$this->class = 'DateField';
$this->name = $name;
$this->mDateObj = new DateAndTime();
-
- if (isset($GLOBALS["I18N"])) {
- $this->localize($GLOBALS["I18N"]);
- }
+ $this->localize();
}
}
- function localize(
$i18n
) {
+ function localize() {
global $user;
global $user;
+ global $i18n;
$this->mDateObj->setFormat($user->date_format);
$this->mDateObj->setFormat($user->date_format);
@@
-80,6
+78,7
@@
class DateField extends TextField {
}
function getHtml() {
}
function getHtml() {
+ global $user;
if (!$this->isEnabled()) {
$html = htmlspecialchars($this->getValue()).
if (!$this->isEnabled()) {
$html = htmlspecialchars($this->getValue()).
@@
-296,9
+295,7
@@
class DateField extends TextField {
function getDateString(dateVal) {\n";
function getDateString(dateVal) {\n";
- if (isset($GLOBALS['i18n'])) {
- $html .= "dateVal.locale = \"".$GLOBALS['i18n']->lang."\";\n";
- }
+ $html .= "dateVal.locale = \"".$user->lang."\";\n";
$html .= "return dateVal.strftime(dateFormat);
}
$html .= "return dateVal.strftime(dateFormat);
}
diff --git
a/WEB-INF/lib/form/FloatField.class.php
b/WEB-INF/lib/form/FloatField.class.php
index
b11f4a1
..
cb035c7
100644
(file)
--- a/
WEB-INF/lib/form/FloatField.class.php
+++ b/
WEB-INF/lib/form/FloatField.class.php
@@
-33,11
+33,14
@@
class FloatField extends TextField {
var $mFFormat;
function __construct($name) {
var $mFFormat;
function __construct($name) {
+ global $user;
+
$this->class = 'FloatField';
$this->name = $name;
$this->class = 'FloatField';
$this->name = $name;
+ $this->mDelimiter = $user->decimal_mark;
}
}
- function localize(
$i18n
) {
+ function localize() {
global $user;
$this->mDelimiter = $user->decimal_mark;
}
global $user;
$this->mDelimiter = $user->decimal_mark;
}
diff --git
a/WEB-INF/lib/form/Form.class.php
b/WEB-INF/lib/form/Form.class.php
index
cf7890c
..
5a4baa9
100644
(file)
--- a/
WEB-INF/lib/form/Form.class.php
+++ b/
WEB-INF/lib/form/Form.class.php
@@
-135,7
+135,7
@@
class Form {
if ($el!=null) {
$el->setFormName($this->name);
if (isset($params["id"])) $el->setId($params["id"]);
if ($el!=null) {
$el->setFormName($this->name);
if (isset($params["id"])) $el->setId($params["id"]);
-
if (isset($GLOBALS["I18N"])) $el->localize($GLOBALS["I18N"]
);
+
$el->localize(
);
if (isset($params["enable"])) $el->setEnabled($params["enable"]);
if (isset($params["style"])) $el->setStyle($params["style"]);
if (isset($params["enable"])) $el->setEnabled($params["enable"]);
if (isset($params["style"])) $el->setStyle($params["style"]);
@@
-153,7
+153,7
@@
class Form {
function addInputElement(&$el) {
if ($el && is_object($el)) {
function addInputElement(&$el) {
if ($el && is_object($el)) {
-
if (isset($GLOBALS["I18N"])) $el->localize($GLOBALS["I18N"]
);
+
$el->localize(
);
$el->setFormName($this->name);
$this->elements[$el->name] = &$el;
$el->setFormName($this->name);
$this->elements[$el->name] = &$el;
diff --git
a/WEB-INF/lib/form/FormElement.class.php
b/WEB-INF/lib/form/FormElement.class.php
index
ff7b3b2
..
0443e6c
100644
(file)
--- a/
WEB-INF/lib/form/FormElement.class.php
+++ b/
WEB-INF/lib/form/FormElement.class.php
@@
-84,8
+84,8
@@
class FormElement {
function setOnChange($str) { $this->on_change = $str; }
function setOnClick($str) { $this->on_click = $str; }
function setOnChange($str) { $this->on_change = $str; }
function setOnClick($str) { $this->on_click = $str; }
- function localize(
$i18n
) {} // Localization occurs in derived classes and is dependent on control type.
-
// For example, in calendar control we need to localize day and month names.
+ function localize() {} // Localization occurs in derived classes and is dependent on control type.
+ // For example, in calendar control we need to localize day and month names.
// getHtml returns HTML for the element.
function getHtml() { return ''; }
// getHtml returns HTML for the element.
function getHtml() { return ''; }
diff --git
a/WEB-INF/lib/ttImportHelper.class.php
b/WEB-INF/lib/ttImportHelper.class.php
index
f7be431
..
5e2d40a
100644
(file)
--- a/
WEB-INF/lib/ttImportHelper.class.php
+++ b/
WEB-INF/lib/ttImportHelper.class.php
@@
-329,6
+329,8
@@
class ttImportHelper {
// startElement, endElement, and dataElement functions are called as many times as necessary.
// Actual import occurs in the endElement handler.
function importXml() {
// startElement, endElement, and dataElement functions are called as many times as necessary.
// Actual import occurs in the endElement handler.
function importXml() {
+ global $i18n;
+
// Do we have a compressed file?
$compressed = false;
$file_ext = substr($_FILES['xmlfile']['name'], strrpos($_FILES['xmlfile']['name'], '.') + 1);
// Do we have a compressed file?
$compressed = false;
$file_ext = substr($_FILES['xmlfile']['name'], strrpos($_FILES['xmlfile']['name'], '.') + 1);
@@
-343,13
+345,13
@@
class ttImportHelper {
// If the file is compressed - uncompress it.
if ($compressed) {
if (!$this->uncompress($_FILES['xmlfile']['tmp_name'], $filename)) {
// If the file is compressed - uncompress it.
if ($compressed) {
if (!$this->uncompress($_FILES['xmlfile']['tmp_name'], $filename)) {
- $this->errors->add($
GLOBALS['I18N']
->getKey('error.sys'));
+ $this->errors->add($
i18n
->getKey('error.sys'));
return;
}
unlink($_FILES['xmlfile']['tmp_name']);
} else {
if (!move_uploaded_file($_FILES['xmlfile']['tmp_name'], $filename)) {
return;
}
unlink($_FILES['xmlfile']['tmp_name']);
} else {
if (!move_uploaded_file($_FILES['xmlfile']['tmp_name'], $filename)) {
- $this->errors->add($
GLOBALS['I18N']
->getKey('error.upload'));
+ $this->errors->add($
i18n
->getKey('error.upload'));
return;
}
}
return;
}
}
@@
-369,7
+371,7
@@
class ttImportHelper {
xml_get_current_line_number($parser)));
}
if (!$this->canImport) {
xml_get_current_line_number($parser)));
}
if (!$this->canImport) {
- $this->errors->add($
GLOBALS['I18N']
->getKey('error.user_exists'));
+ $this->errors->add($
i18n
->getKey('error.user_exists'));
break;
}
}
break;
}
}
diff --git
a/WEB-INF/lib/ttInvoiceHelper.class.php
b/WEB-INF/lib/ttInvoiceHelper.class.php
index
b7d2cc2
..
2784a7b
100644
(file)
--- a/
WEB-INF/lib/ttInvoiceHelper.class.php
+++ b/
WEB-INF/lib/ttInvoiceHelper.class.php
@@
-99,7
+99,6
@@
class ttInvoiceHelper {
// The getInvoiceItems retrieves tt_log items associated with the invoice.
static function getInvoiceItems($invoice_id) {
global $user;
// The getInvoiceItems retrieves tt_log items associated with the invoice.
static function getInvoiceItems($invoice_id) {
global $user;
- global $i18n;
$mdb2 = getConnection();
// At this time only detailed invoice is supported.
$mdb2 = getConnection();
// At this time only detailed invoice is supported.
diff --git
a/WEB-INF/templates/footer.tpl
b/WEB-INF/templates/footer.tpl
index
d067501
..
1279cfa
100644
(file)
--- a/
WEB-INF/templates/footer.tpl
+++ b/
WEB-INF/templates/footer.tpl
@@
-12,7
+12,7
@@
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.13.15.374
5
| Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.13.15.374
6
| Copyright © <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>
<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>
diff --git
a/initialize.php
b/initialize.php
index
29425c0
..
689925d
100644
(file)
--- a/
initialize.php
+++ b/
initialize.php
@@
-197,7
+197,6
@@
if (!$lang) {
// Load i18n file.
$i18n->load($lang);
// Load i18n file.
$i18n->load($lang);
-$GLOBALS['I18N'] = &$i18n;
// Assign things for smarty to use in template files.
$smarty->assign('i18n', $i18n->keys);
// Assign things for smarty to use in template files.
$smarty->assign('i18n', $i18n->keys);
diff --git
a/mobile/user_add.php
b/mobile/user_add.php
index
c1f7e29
..
24adc11
100644
(file)
--- a/
mobile/user_add.php
+++ b/
mobile/user_add.php
@@
-107,7
+107,6
@@
class RateCellRenderer extends DefaultCellRenderer {
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row, 'id'));
$field->setFormName($table->getFormName());
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row, 'id'));
$field->setFormName($table->getFormName());
- $field->localize($GLOBALS['I18N']);
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
diff --git
a/mobile/user_edit.php
b/mobile/user_edit.php
index
204e713
..
e8a116f
100644
(file)
--- a/
mobile/user_edit.php
+++ b/
mobile/user_edit.php
@@
-137,7
+137,6
@@
class RateCellRenderer extends DefaultCellRenderer {
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row,'id'));
$field->setFormName($table->getFormName());
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row,'id'));
$field->setFormName($table->getFormName());
- $field->localize($GLOBALS['I18N']);
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
diff --git
a/user_add.php
b/user_add.php
index
3c91905
..
b8b5d30
100644
(file)
--- a/
user_add.php
+++ b/
user_add.php
@@
-107,7
+107,6
@@
class RateCellRenderer extends DefaultCellRenderer {
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row, 'id'));
$field->setFormName($table->getFormName());
global $assigned_projects;
$field = new FloatField('rate_'.$table->getValueAtName($row, 'id'));
$field->setFormName($table->getFormName());
- $field->localize($GLOBALS['I18N']);
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
diff --git
a/user_edit.php
b/user_edit.php
index
c860877
..
d7a3feb
100644
(file)
--- a/
user_edit.php
+++ b/
user_edit.php
@@
-135,9
+135,9
@@
class NameCellRenderer extends DefaultCellRenderer {
class RateCellRenderer extends DefaultCellRenderer {
function render(&$table, $value, $row, $column, $selected = false) {
global $assigned_projects;
class RateCellRenderer extends DefaultCellRenderer {
function render(&$table, $value, $row, $column, $selected = false) {
global $assigned_projects;
+
$field = new FloatField('rate_'.$table->getValueAtName($row,'id'));
$field->setFormName($table->getFormName());
$field = new FloatField('rate_'.$table->getValueAtName($row,'id'));
$field->setFormName($table->getFormName());
- $field->localize($GLOBALS['I18N']);
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {