Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
57ab56216e
airtime_mvc
application
public
|
@ -900,15 +900,19 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$startParam = $this->_getParam('startTime');
|
||||
$endParam = $this->_getParam('endTime');
|
||||
|
||||
$startDateTime = new DateTime($startParam);
|
||||
$endDateTime = new DateTime($endParam);
|
||||
try{
|
||||
$startDateTime = new DateTime($startParam);
|
||||
$endDateTime = new DateTime($endParam);
|
||||
|
||||
$UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
$UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
$UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
$UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
$duration = $UTCEndDateTime->diff($UTCStartDateTime);
|
||||
$duration = $UTCEndDateTime->diff($UTCStartDateTime);
|
||||
|
||||
$result = $duration->format('%r%Hh %Im');
|
||||
$result = $duration->format('%r%Hh %Im');
|
||||
}catch (Exception $e){
|
||||
$result = "Invalid Date";
|
||||
}
|
||||
|
||||
echo Zend_Json::encode($result);
|
||||
exit();
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
</dt>
|
||||
<dd id="add_show_duration-element">
|
||||
<?php echo $this->element->getElement('add_show_duration') ?>
|
||||
<img id="icon-loader-small" src="/css/images/loader-small.gif" style="vertical-align:middle; display:none;"/>
|
||||
</dd>
|
||||
<?php if($this->element->getElement('add_show_duration')->hasErrors()){ ?>
|
||||
<ul class='errors'>
|
||||
|
|
|
@ -24,9 +24,12 @@
|
|||
<h3>Source Streams</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<div id="scheduled_play_div" class="source-label"> Scheduled Play</div>
|
||||
<div id="master_dj_div" class="source-label">
|
||||
<a id="master_dj" class="source-kick-button" onclick="kickSource(this)"></a>
|
||||
Master Source
|
||||
</div>
|
||||
<div class="line-to-switch"></div>
|
||||
<a href="#" id="scheduled_play" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->scheduled_play_switch?></span></a>
|
||||
<a href="#" id="master_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->master_dj_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -39,12 +42,9 @@
|
|||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="master_dj_div" class="source-label">
|
||||
<a id="master_dj" class="source-kick-button" onclick="kickSource(this)"></a>
|
||||
Master Source
|
||||
</div>
|
||||
<div id="scheduled_play_div" class="source-label"> Scheduled Play</div>
|
||||
<div class="line-to-switch"></div>
|
||||
<a href="#" id="master_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->master_dj_switch?></span></a>
|
||||
<a href="#" id="scheduled_play" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->scheduled_play_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
Binary file not shown.
After ![]() (image error) Size: 673 B |
|
@ -460,9 +460,12 @@ function setAddShowEvents() {
|
|||
})
|
||||
|
||||
function calculateDuration(endDateTime, startDateTime){
|
||||
var duration;
|
||||
var loadingIcon = $('#icon-loader-small');
|
||||
|
||||
loadingIcon.show();
|
||||
$.post("/Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
|
||||
$('#add_show_duration').val(JSON.parse(data));
|
||||
loadingIcon.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue