Skip to content

Commit

Permalink
Normalize some property names.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 26, 2013
1 parent b0143a9 commit ce17f42
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions hermes/js/hermes.js
Expand Up @@ -1388,7 +1388,7 @@ HermesCore = {
$('hermesTimerDialog').fade({ duration: this.effectDur });
this.inTimerForm = false;
} else {
r.e = 0;
r.elapsed = 0;
this.insertTimer(r, $F('hermesTimerTitle'));
}
},
Expand All @@ -1401,7 +1401,7 @@ HermesCore = {
*/
insertTimer: function(r, d)
{
var title = new Element('div').update(d + ' (' + r.e + ' ' + Hermes.text['hours'] + ')'),
var title = new Element('div').update(d + ' (' + r.elapsed + ' ' + Hermes.text['hours'] + ')'),
controls = new Element('span', { 'class': 'timerControls' }),
stop = new Element('span', { 'class': 'timerControls timer-saveable' }),
timer = new Element('div', { 'class': 'horde-resource-none' }).store('tid', r.id),
Expand All @@ -1410,7 +1410,7 @@ HermesCore = {


details = new Element('span', { 'class': 'hermesTimerDetails' }).update(
(client_text ? client_text + '/' : '') + (r._deliverable_text ? r._deliverable_text : ''));
(client_text ? client_text + '/' : '') + (r.deliverable_text ? r.deliverable_text : ''));
if (r.paused) {
controls.addClassName('timer-paused');
wrapperClass = 'inactive-timer';
Expand Down Expand Up @@ -1509,7 +1509,7 @@ HermesCore = {
$('hermesTimeFormJobtype').setValue(r.jobtype_id).disable();
}
if (r.deliverable_id) {
$('hermesTimeFormCostobject').insert(new Element('option', { selected: 'selected', value: r.deliverable_id }).update(r._deliverable_text)).disable();
$('hermesTimeFormCostobject').insert(new Element('option', { selected: 'selected', value: r.deliverable_id }).update(r.deliverable_text)).disable();
}
}
elt.up().fade({
Expand Down Expand Up @@ -2087,7 +2087,7 @@ HermesCore = {
var t = r[i];
$('hermesMenuTimers').select('.horde-resource-none').each(function(elt) {
if (elt.retrieve('tid') == t['id']) {
elt.down('div').update(t.name + ' (' + t.e + Hermes.text['hours'] + ')');
elt.down('div').update(t.name + ' (' + t.elapsed + Hermes.text['hours'] + ')');
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion hermes/lib/Ajax/Application/Handler.php
Expand Up @@ -434,7 +434,7 @@ public function stopTimer()
Hermes::clearTimer($this->vars->t);
if ($this->vars->restart == 'true') {
$now = time();
$timer['elapsed'] = $results['e'] = 0;
$timer['elapsed'] = 0;
$timer['paused'] = $results['paused'] = true;
$timer['time'] = $now;
Hermes::updateTimer($this->vars->t, $timer);
Expand Down
4 changes: 2 additions & 2 deletions hermes/lib/Application.php
Expand Up @@ -213,7 +213,7 @@ public function menu($menu)
$entry = Horde::url('entry.php');
foreach ($timers as $i => $timer) {
$menu->add($entry->add('timer', $timer['id']),
$timer['name'] . sprintf(" (%s)", $timer['e']),
$timer['name'] . sprintf(" (%s)", $timer['elapsed']),
'hermes-stop', null, '', null, '__noselection'
);
}
Expand Down Expand Up @@ -305,7 +305,7 @@ public function topbarCreate(
$tree->addNode(array(
'id' => $parent . '__timer_' . $i,
'parent' => $parent,
'label' => $timer['name'] . sprintf(" (%s)", $timer['e']),
'label' => $timer['name'] . sprintf(" (%s)", $timer['elapsed']),
'expanded' => false,
'params' => array(
'icon' => Horde_Themes::img('timer-stop.png'),
Expand Down
2 changes: 1 addition & 1 deletion hermes/lib/Hermes.php
Expand Up @@ -391,7 +391,7 @@ public static function listTimers($running_only = false)
continue;
}
$elapsed = (!$timer['paused'] ? time() - $timer['time'] : 0 ) + $timer['elapsed'];
$timer['e'] = round((float)$elapsed / 3600, 2);
$timer['elapsed'] = round((float)$elapsed / 3600, 2);
$timer['id'] = $id;
unset($timer['elapsed']);
$text = Hermes::getCostObjectByID($timer['deliverable_id']);
Expand Down

0 comments on commit ce17f42

Please sign in to comment.