Skip to content

Commit

Permalink
Add device's currently cached heartbeat interval to the device display.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed May 16, 2014
1 parent 2a6a67b commit 6712a44
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions horde/admin/activesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
$js = array();
foreach ($devices as $key => $device) {
$dev = $state->loadDeviceInfo($device['device_id'], $device['device_user']);
$syncCache = new Horde_ActiveSync_SyncCache($state, $dev->id, $dev->user, $injector->getInstance('Horde_Log_Logger'));
$dev->hbinterval = $syncCache->hbinterval
? $syncCache->hbinterval
: ($syncCache->wait ? $syncCache->wait * 60 : _("Unavailable"));
$js[$dev->id] = array(
'id' => $dev->id,
'user' => $dev->user
Expand Down
4 changes: 4 additions & 0 deletions horde/lib/Prefs/Special/Activesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public function display(Horde_Core_Prefs_Ui $ui)
'id' => $dev->id,
'user' => $dev->user
);
$syncCache = new Horde_ActiveSync_SyncCache($state, $dev->id, $dev->user, $injector->getInstance('Horde_Log_Logger'));
$dev->hbinterval = $syncCache->hbinterval
? $syncCache->hbinterval
: ($syncCache->wait ? $syncCache->wait * 60 : _("Unavailable"));
$devs[] = $dev;
}

Expand Down
1 change: 1 addition & 0 deletions horde/templates/activesync/device_table.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<?php foreach ($d->getFormattedDeviceProperties() as $key => $value): ?>
<?php echo '<b>' . $key . '</b>: ' . $value . '<br />' ?>
<?php endforeach; ?>
<b><?php echo _("Cached Heartbeat (seconds)")?></b>: <?php echo $d->hbinterval ?><br />
</td>
<td>
<?php if ($d->policykey): ?>
Expand Down
1 change: 1 addition & 0 deletions horde/templates/prefs/activesync.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<?php foreach ($d->getFormattedDeviceProperties() as $key => $value): ?>
<?php echo '<b>' . $key . '</b>: ' . $value . '<br />' ?>
<?php endforeach; ?>
<b><?php echo _("Cached Heartbeat (seconds)")?></b>: <?php echo $d->hbinterval ?><br />
</td>
</tr>
<?php endforeach; ?>
Expand Down

0 comments on commit 6712a44

Please sign in to comment.