Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x
This commit is contained in:
commit
24f4e589a4
|
@ -83,7 +83,11 @@ class DashboardController extends Zend_Controller_Action
|
||||||
if($source_connected){
|
if($source_connected){
|
||||||
$this->view->error = "You don't have permission to switch source.";
|
$this->view->error = "You don't have permission to switch source.";
|
||||||
}else{
|
}else{
|
||||||
$this->view->error = "There is no source connected to this input.";
|
if($sourcename == 'scheduled_play'){
|
||||||
|
$this->view->error = "You don't have permission to disconnect source.";
|
||||||
|
}else{
|
||||||
|
$this->view->error = "There is no source connected to this input.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,14 +83,16 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkReliantFields($formData, $validateStartDate, $originalStartDate=false) {
|
public function checkReliantFields($formData, $validateStartDate, $originalStartDate=null) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
|
|
||||||
$start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
|
$start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
|
||||||
|
$end_time = $formData['add_show_end_date_no_repeat']." ".$formData['add_show_end_time'];
|
||||||
|
|
||||||
//DateTime stores $start_time in the current timezone
|
//DateTime stores $start_time in the current timezone
|
||||||
$nowDateTime = new DateTime();
|
$nowDateTime = new DateTime();
|
||||||
$showStartDateTime = new DateTime($start_time);
|
$showStartDateTime = new DateTime($start_time);
|
||||||
|
$showEndDateTime = new DateTime($end_time);
|
||||||
if ($validateStartDate){
|
if ($validateStartDate){
|
||||||
if($showStartDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if($showStartDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
|
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
|
||||||
|
@ -99,6 +101,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
// if edit action, check if original show start time is in the past. CC-3864
|
// if edit action, check if original show start time is in the past. CC-3864
|
||||||
if($originalStartDate){
|
if($originalStartDate){
|
||||||
if($originalStartDate->getTimestamp() < $nowDateTime->getTimestamp()) {
|
if($originalStartDate->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
|
$this->getElement('add_show_start_time')->setValue($originalStartDate->format("H:i"));
|
||||||
|
$this->getElement('add_show_start_date')->setValue($originalStartDate->format("Y-m-d"));
|
||||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot modify start date/time of the show that is already started'));
|
$this->getElement('add_show_start_time')->setErrors(array('Cannot modify start date/time of the show that is already started'));
|
||||||
$this->disableStartDateAndTime();
|
$this->disableStartDateAndTime();
|
||||||
$valid = false;
|
$valid = false;
|
||||||
|
@ -106,6 +110,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if end time is in the past, return error
|
||||||
|
if($showEndDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||||
|
$this->getElement('add_show_end_time')->setErrors(array('End date/time cannot be in the past'));
|
||||||
|
$valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
$pattern = '/([0-9][0-9])h ([0-9][0-9])m/';
|
$pattern = '/([0-9][0-9])h ([0-9][0-9])m/';
|
||||||
preg_match($pattern, $formData['add_show_duration'], $matches);
|
preg_match($pattern, $formData['add_show_duration'], $matches);
|
||||||
$hours = $matches[1];
|
$hours = $matches[1];
|
||||||
|
|
|
@ -39,6 +39,11 @@ function openAudioPreview(p_event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function open_audio_preview(audioFileID, audioFileTitle, audioFileArtist) {
|
function open_audio_preview(audioFileID, audioFileTitle, audioFileArtist) {
|
||||||
|
// we need to remove soundcloud icon from audioFileTitle
|
||||||
|
var index = audioFileTitle.indexOf("<span class=");
|
||||||
|
if(index != -1){
|
||||||
|
audioFileTitle = audioFileTitle.substring(0,index);
|
||||||
|
}
|
||||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+audioFileID+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle);
|
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+audioFileID+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle);
|
||||||
_preview_window.focus();
|
_preview_window.focus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue