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"]])) {
$this->highlight = $highlight;
}
- function localize($i18n) {
+ function localize() {
global $user;
+ global $i18n;
$this->mMonthNames = $i18n->monthNames;
$this->mWeekDayShortNames = $i18n->weekdayShortNames;
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() {
$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 $i18n;
$this->mDateObj->setFormat($user->date_format);
}
function getHtml() {
+ global $user;
if (!$this->isEnabled()) {
$html = htmlspecialchars($this->getValue()).
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);
}
var $mFFormat;
function __construct($name) {
+ global $user;
+
$this->class = 'FloatField';
$this->name = $name;
+ $this->mDelimiter = $user->decimal_mark;
}
- function localize($i18n) {
+ function localize() {
global $user;
$this->mDelimiter = $user->decimal_mark;
}
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"]);
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;
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 ''; }
// 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);
// 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)) {
- $this->errors->add($GLOBALS['I18N']->getKey('error.upload'));
+ $this->errors->add($i18n->getKey('error.upload'));
return;
}
}
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;
}
}
// 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.
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.13.15.3745 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.13.15.3746 | 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>
// Load i18n file.
$i18n->load($lang);
-$GLOBALS['I18N'] = &$i18n;
// Assign things for smarty to use in template files.
$smarty->assign('i18n', $i18n->keys);
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) {
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) {
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) {
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->localize($GLOBALS['I18N']);
$field->setSize(5);
$field->setFormat('.2');
foreach ($assigned_projects as $p) {