#2029 Campcaster-Web: 'Could not connect to scheduler' error message even when scheduler is running
This commit is contained in:
parent
c9baf9063a
commit
017b23e08c
|
@ -1,4 +1,4 @@
|
||||||
{if $SCHEDULER->getErrorMsg()}
|
{if !$SCHEDULER->getSchedulerTime()}
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
alert("{$SCHEDULER->getErrorMsg()|escape:"quotes"}");
|
alert("{$SCHEDULER->getErrorMsg()|escape:"quotes"}");
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -16,8 +16,8 @@ function incClock() {
|
||||||
|
|
||||||
{/literal}
|
{/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"},
|
myClock({$_now|date_format:"%Y"|string_format:"%d"}, {$_now|date_format:"%m"|string_format:"%d"}, {$_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"},
|
{$_now|date_format:"%H"|string_format:"%d"}, {$_now|date_format:"%M"|string_format:"%d"}, {$_now|date_format:"%S"|string_format:"%d"},
|
||||||
1000);
|
1000);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,8 +10,12 @@
|
||||||
<td>
|
<td>
|
||||||
<div id="time">
|
<div id="time">
|
||||||
##Station Time##
|
##Station Time##
|
||||||
<h1><span id="servertime" class="clock">{$smarty.now|date_format:"%H:%M:%S"}</span></h1>
|
{assign var="_now value=$SCHEDULER->getSchedulerTime(true)}
|
||||||
{$smarty.now|date_format:"%Z"}
|
{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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ class uiScheduler extends uiCalendar {
|
||||||
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
|
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
|
||||||
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
||||||
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
||||||
$this->error =& $_SESSION['SCHEDULER']['error'];
|
#$this->error =& $_SESSION['SCHEDULER']['error'];
|
||||||
|
|
||||||
if (!is_array($this->curr)) {
|
if (!is_array($this->curr)) {
|
||||||
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
|
$this->curr['view'] = UI_SCHEDULER_DEFAULT_VIEW;
|
||||||
|
@ -1261,6 +1261,21 @@ class uiScheduler extends uiCalendar {
|
||||||
|
|
||||||
return $status;
|
return $status;
|
||||||
} // fn scheduleImportClose
|
} // 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
|
} // class uiScheduler
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue