#2029 Campcaster-Web: 'Could not connect to scheduler' error message even when scheduler is running

This commit is contained in:
sebastian 2010-04-07 17:30:06 +00:00
parent c9baf9063a
commit 017b23e08c
4 changed files with 25 additions and 6 deletions

View File

@ -1,4 +1,4 @@
{if $SCHEDULER->getErrorMsg()}
{if !$SCHEDULER->getSchedulerTime()}
<script language="javascript">
alert("{$SCHEDULER->getErrorMsg()|escape:"quotes"}");
</script>

View File

@ -16,8 +16,8 @@ function incClock() {
{/literal}
myClock({$smarty.now|date_format:"%Y"|string_format:"%d"}, {$smarty.now|date_format:"%m"|string_format:"%d"}, {$smarty.now|date_format:"%d"|string_format:"%d"},
{$smarty.now|date_format:"%H"|string_format:"%d"}, {$smarty.now|date_format:"%M"|string_format:"%d"}, {$smarty.now|date_format:"%S"|string_format:"%d"},
myClock({$_now|date_format:"%Y"|string_format:"%d"}, {$_now|date_format:"%m"|string_format:"%d"}, {$_now|date_format:"%d"|string_format:"%d"},
{$_now|date_format:"%H"|string_format:"%d"}, {$_now|date_format:"%M"|string_format:"%d"}, {$_now|date_format:"%S"|string_format:"%d"},
1000);
</script>

View File

@ -10,8 +10,12 @@
<td>
<div id="time">
##Station Time##
<h1><span id="servertime" class="clock">{$smarty.now|date_format:"%H:%M:%S"}</span></h1>
{$smarty.now|date_format:"%Z"}
{assign var="_now value=$SCHEDULER->getSchedulerTime(true)}
{if !$_now}
{assign var="_now" value=$smarty.now}
{/if}
<h1><span id="servertime" class="clock">{$_now|date_format:"%H:%M:%S"}</span></h1>
{$_now|date_format:"%Z"}
</div>
</td>

View File

@ -74,7 +74,7 @@ class uiScheduler extends uiCalendar {
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
$this->error =& $_SESSION['SCHEDULER']['error'];
#$this->error =& $_SESSION['SCHEDULER']['error'];
if (!is_array($this->curr)) {
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
@ -1261,6 +1261,21 @@ class uiScheduler extends uiCalendar {
return $status;
} // fn scheduleImportClose
public function getSchedulerTime()
{
static $first, $cached;
if (!$first) {
$first = time();
$r = $this->spc->GetSchedulerTimeMethod();
if ($this->_isError($r)) {
return false;
}
$cached = self::datetimeToTimestamp($r['schedulerTime']);
}
$schedulerTime = $cached + time() - $first;
return $schedulerTime;
}
} // class uiScheduler
?>