cannot schedule anything in a show that overlaps.

This commit is contained in:
naomiaro 2011-02-06 23:58:58 -05:00
parent 74210b4c6d
commit c0d379e306
2 changed files with 13 additions and 1 deletions

View File

@ -295,6 +295,12 @@ class ScheduleController extends Zend_Controller_Action
$show = new ShowInstance($showInstanceId);
$start_timestamp = $show->getShowStart();
$end_timestamp = $show->getShowEnd();
//check to make sure show doesn't overlap.
if(Show::getShows($start_timestamp, $end_timestamp, array($showInstanceId))) {
$this->view->error = "cannot schedule an overlapping show.";
return;
}
$start = explode(" ", $start_timestamp);
$end = explode(" ", $end_timestamp);

View File

@ -165,8 +165,14 @@ function buildContentDialog(json){
}
function buildScheduleDialog(json){
var dialog = $(json.dialog);
var dialog;
if(json.error) {
alert(json.error);
return;
}
dialog = $(json.dialog);
makeScheduleDialog(dialog, json);
dialog.dialog({