diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 9a0eaa452..d9467cfc1 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -186,6 +186,7 @@ SQL; /* Check if the show being resized and any of its repeats * overlap with other scheduled shows */ + $utc = new DateTimeZone("UTC"); foreach ($showInstances as $si) { $startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC")); @@ -223,15 +224,10 @@ SQL; $sql_gen = << :current_timestamp1) - AND ((ends + interval :deltaDay2 + interval :interval2 - starts) <= interval '24:00') - -UPDATE cc_show_days -SET duration = (CAST(duration AS interval) + interval :deltaDay3 + interval :interval3) -WHERE show_id = :show_id2 - AND ((CAST(duration AS interval) + interval :deltaDay4 + interval :interval4) <= interval '24:00') + AND ((ends + :deltaDay2::INTERVAL + :interval2::INTERVAL - starts) <= interval '24:00') SQL; Application_Common_Database::prepareAndExecute($sql_gen, @@ -241,7 +237,18 @@ SQL; ':show_id1' => $this->_showId, ':current_timestamp1' => $current_timestamp, ':deltaDay2' => "$deltaDay days", - ':interval2' => "$hours:$mins", + ':interval2' => "$hours:$mins" + ), "execute"); + + $sql_gen = << "$deltaDay days", ':interval3' => "$hours:$mins", ':show_id2' => $this->_showId, diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 795bcb010..2f70037cd 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -1089,7 +1089,7 @@ function validateAdvancedSearch(divs) { if (!valid) allValid = false; } - addRemoveValidationIcons(valid, $(field)); + addRemoveValidationIcons(valid, $(field), searchTermType); /* Empty fields should not have valid/invalid indicator * Range values are considered valid even if only the @@ -1114,9 +1114,20 @@ function validateAdvancedSearch(divs) { return allValid; } -function addRemoveValidationIcons(valid, field) { - var validIndicator = "", - invalidIndicator = ""; +function addRemoveValidationIcons(valid, field, searchTermType) { + var title = ''; + if (searchTermType === 'i') { + title = 'Input must be a positive number'; + } else if (searchTermType === 'n') { + title = 'Input must be a number'; + } else if (searchTermType === 't') { + title = 'Input must be in the format: yyyy-mm-dd'; + } else if (searchTermType === 'l') { + title = 'Input must be in the format: hh:mm:ss.t'; + } + + var validIndicator = " ", + invalidIndicator = " "; if (valid) { if (!field.closest('div').children(':last-child').hasClass('checked-icon')) {