Merge branch 'master' of dev.sourcefabric.org:airtime

This commit is contained in:
martin 2011-04-02 13:30:15 -04:00
commit c67ab97dbc
11 changed files with 246 additions and 99 deletions

View File

@ -355,6 +355,10 @@ class ScheduleController extends Zend_Controller_Action
$data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days'); $data['add_show_day_check'] = $this->_getParam('days');
if($data['add_show_day_check'] == "") {
$data['add_show_day_check'] = null;
}
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho(); $formWho = new Application_Form_AddShowWho();
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
@ -389,20 +393,40 @@ class ScheduleController extends Zend_Controller_Action
} }
if($data["add_show_repeats"]) { if($data["add_show_repeats"]) {
$repeats = $formRepeats->isValid($data); $repeats = $formRepeats->isValid($data);
if($repeats) { if($repeats) {
$repeats = $formRepeats->checkReliantFields($data); $repeats = $formRepeats->checkReliantFields($data);
} }
$formAbsoluteRebroadcast->reset();
//make it valid, results don't matter anyways.
$rebroadAb = 1;
if ($data["add_show_rebroadcast"]) {
$rebroad = $formRebroadcast->isValid($data);
if($rebroad) {
$rebroad = $formRebroadcast->checkReliantFields($data);
}
}
} }
else { else {
$repeats = 1; //make it valid, results don't matter anyways. $formRebroadcast->reset();
//make it valid, results don't matter anyways.
$repeats = 1;
$rebroad = 1;
if ($data["add_show_rebroadcast"]) {
$rebroadAb = $formAbsoluteRebroadcast->isValid($data);
if($rebroadAb) {
$rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data);
}
}
} }
$who = $formWho->isValid($data); $who = $formWho->isValid($data);
$style = $formStyle->isValid($data); $style = $formStyle->isValid($data);
$record = $formRecord->isValid($data); $record = $formRecord->isValid($data);
$rebroadAb = $formAbsoluteRebroadcast->isValid($data);
$rebroad = $formRebroadcast->isValid($data);
if ($what && $when && $repeats && $who && $style && $record && $rebroadAb && $rebroad) { if ($what && $when && $repeats && $who && $style && $record && $rebroadAb && $rebroad) {
@ -421,6 +445,7 @@ class ScheduleController extends Zend_Controller_Action
'add_show_duration' => '1:00')); 'add_show_duration' => '1:00'));
$formRepeats->reset(); $formRepeats->reset();
$formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); $formRepeats->populate(array('add_show_end_date' => date("Y-m-d")));
$formStyle->reset(); $formStyle->reset();
$formRecord->reset(); $formRecord->reset();
$formAbsoluteRebroadcast->reset(); $formAbsoluteRebroadcast->reset();

View File

@ -36,8 +36,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -69,8 +69,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -102,8 +102,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -135,8 +135,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -168,8 +168,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -178,6 +178,38 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
} }
public function checkReliantFields($formData) {
$valid = true;
for($i=1; $i<=5; $i++) {
$day = $formData['add_show_rebroadcast_absolute_date_'.$i];
if($day == "") {
continue;
}
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
$show_end = new DateTime($show_start_time);
$duration = $formData['add_show_duration'];
$duration = explode(":", $duration);
$show_end->add(new DateInterval("PT$duration[0]H"));
$show_end->add(new DateInterval("PT$duration[1]M"));
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
$rebroad_start = $day."".$formData['add_show_rebroadcast_absolute_time_'.$i];
$rebroad_start = new DateTime($rebroad_start);
if($rebroad_start < $show_end) {
$this->getElement('add_show_rebroadcast_absolute_time_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
$valid = false;
}
}
return $valid;
}
} }

View File

@ -33,8 +33,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -58,8 +58,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -83,8 +83,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -108,8 +108,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
@ -133,13 +133,51 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
'value' => '', 'value' => '',
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', array('date', false, array('HH:mm')),
array('date', false, array('HH:mm')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
), ),
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
) )
)); ));
} }
public function checkReliantFields($formData) {
$valid = true;
for($i=1; $i<=5; $i++) {
$days = $formData['add_show_rebroadcast_date_'.$i];
if($days == "") {
continue;
}
$days = explode(" ", $days);
$day = $days[0];
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
$show_end = new DateTime($show_start_time);
$duration = $formData['add_show_duration'];
$duration = explode(":", $duration);
$show_end->add(new DateInterval("PT$duration[0]H"));
$show_end->add(new DateInterval("PT$duration[1]M"));
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
$rebroad_start = $formData['add_show_start_date']."".$formData['add_show_rebroadcast_time_'.$i];
$rebroad_start = new DateTime($rebroad_start);
$rebroad_start->add(new DateInterval("P".$day."D"));
if($rebroad_start < $show_end) {
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
$valid = false;
}
}
return $valid;
}
} }

View File

@ -31,7 +31,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
'filters' => array('StringTrim'), 'filters' => array('StringTrim'),
'validators' => array( 'validators' => array(
'NotEmpty', 'NotEmpty',
array('date', false, array('HH:mm')) array('date', false, array('HH:mm')),
array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))
) )
)); ));

View File

@ -260,12 +260,15 @@ class Show {
} }
/** /**
* Get all the show instances in the given time range.
*
* @param string $start_timestamp * @param string $start_timestamp
* In the format "YYYY-MM-DD HH:mm:ss" * In the format "YYYY-MM-DD HH:mm:ss". This time is inclusive.
* @param string $end_timestamp * @param string $end_timestamp
* In the format "YYYY-MM-DD HH:mm:ss" * In the format "YYYY-MM-DD HH:mm:ss". This time is inclusive.
* @param unknown_type $excludeInstance * @param unknown_type $excludeInstance
* @param boolean $onlyRecord * @param boolean $onlyRecord
* @return array
*/ */
public static function getShows($start_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=FALSE) public static function getShows($start_timestamp, $end_timestamp, $excludeInstance=NULL, $onlyRecord=FALSE)
{ {

View File

@ -14,9 +14,15 @@ require_once __DIR__.'/../../../library/propel/runtime/lib/Propel.php';
Propel::init(__DIR__.'/../../configs/airtime-conf.php'); Propel::init(__DIR__.'/../../configs/airtime-conf.php');
AirtimeInstall::DbConnect(true); AirtimeInstall::DbConnect(true);
$sql = "DELETE FROM cc_show";
$CC_DBC->query($sql);
$sql = "DELETE FROM cc_show_days";
$CC_DBC->query($sql);
$sql = "DELETE FROM cc_show_instances";
$CC_DBC->query($sql);
/*
// Create a playlist // Create a playlist
$playlist = new Playlist(); $playlist = new Playlist();
$playlist->create("Calendar Load test playlist ".uniqid()); $playlist->create("Calendar Load test playlist ".uniqid());
@ -34,65 +40,64 @@ $result = $playlist->addAudioClip($storedFile2->getId());
$result = $playlist->addAudioClip($storedFile2->getId()); $result = $playlist->addAudioClip($storedFile2->getId());
echo "Created playlist ".$playlist->getName()." with ID ".$playlist->getId()."\n"; echo "Created playlist ".$playlist->getName()." with ID ".$playlist->getId()."\n";
*/
// Create the shows // Create the shows
$data = array();
$currentDate = date("Y\\-m\\-d"); function createTestShow($showNumber, $showTime, $duration = "1:00")
$year = date("Y");
$month = date("m");
$day = date("d");
$nextDay = $currentDate;
#echo $currentDate;
$currentHour = date("H");
$setHour = $currentHour + 1;
$showNumber = 1;
for ($days=1; $days<100; $days=$days+1)
{ {
// Adding shows until the end of the day $data = array();
while ($setHour < 24) $strTime = $showTime->format("Y-m-d H:i");
{ echo "Adding show: $strTime\n";
echo 'Adding show: '.$nextDay. ' '.$setHour.":00\n"; $data['add_show_name'] = 'automated show '.$showNumber;
$data['add_show_name'] = 'automated show '.$showNumber; $data['add_show_start_date'] = $showTime->format("Y-m-d");
$data['add_show_start_date'] = $nextDay; $data['add_show_start_time'] = $showTime->format("H:i");
$data['add_show_start_time'] = $setHour.':00'; $data['add_show_duration'] = $duration;
$showNumber = $showNumber + 1; $data['add_show_no_end'] = 0;
$data['add_show_duration'] = '1:00'; $data['add_show_repeats'] = 0;
$data['add_show_no_end'] = 0; $data['add_show_description'] = 'automated show';
$data['add_show_repeats'] = 0; $data['add_show_url'] = 'http://www.OfirGal.com';
$data['add_show_description'] = 'automated show'; $data['add_show_color'] = "";
$data['add_show_url'] = 'http://www.OfirGal.com'; $data['add_show_background_color'] = "";
$data['add_show_color'] = ""; $data['add_show_record'] = 0;
$data['add_show_background_color'] = ""; $data['add_show_hosts'] ="";
$data['add_show_record'] = 0; $showId = Show::create($data);
$data['add_show_hosts'] =""; //echo "show created, ID: $showId\n";
$showId = Show::create($data);
Show::populateShowUntil($showId, "2012-01-01 00:00:00");
// populating the show with a playlist // populating the show with a playlist
$show = new ShowInstance($showId); $instances = Show::getShows($showTime->format("Y-m-d H:i:s"), $showTime->format("Y-m-d H:i:s"));
$show->scheduleShow(array($playlist->getId())); $instance = array_pop($instances);
$show = new ShowInstance($instance["instance_id"]);
$setHour = $setHour + 1; //echo "Adding playlist to show instance ".$show->getShowInstanceId()."\n";
} $show->scheduleShow(array(1));
// set the next day //echo "done\n";
$setHour = 0; //$show->scheduleShow(array($playlist->getId()));
if ($day<30) {
$day = $day + 1;
} else {
$day = 1;
if ($month<12)
{
$month = $month + 1;
} else {
$month = 1;
$year = $year + 1;
}
}
$nextDay = $year."-".$month."-".$day;
} }
$showTime = new DateTime();
$resolution = "minute";
$showNumber = 1;
$numberOfDays = 0;
$numberOfHours = 1;
$endDate = new DateTime();
$endDate->add(new DateInterval("P".$numberOfDays."DT".$numberOfHours."H"));
echo "End date: ".$endDate->format("Y-m-d H:i")."\n";
while ($showTime < $endDate) {
echo $showTime->format("Y-m-d H:i")." < " .$endDate->format("Y-m-d H:i")."\n";
if ($resolution == "minute") {
createTestShow($showNumber, $showTime, "0:01");
$showTime->add(new DateInterval("PT1M"));
} elseif ($resolution == "hour") {
createTestShow($showNumber, $showTime);
$showTime->add(new DateInterval("PT1H"));
}
$showNumber = $showNumber + 1;
}
RabbitMq::PushScheduleFinal();

View File

@ -1,4 +1,4 @@
<fieldset> <fieldset id="add_show_rebroadcast_absolute">
<dl> <dl>
<dt id="add_show_hosts_rebroadcast_day-label" class="block-display"> <dt id="add_show_hosts_rebroadcast_day-label" class="block-display">
<label for="add_show_rebroadcast_day" class="optional">Choose Days:</label> <label for="add_show_rebroadcast_day" class="optional">Choose Days:</label>
@ -10,10 +10,21 @@
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?> <?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?>
<span class="inline-text">@</span> <span class="inline-text">@</span>
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_time_'.$i) ?> <?php echo $this->element->getElement('add_show_rebroadcast_absolute_time_'.$i) ?>
<?php if($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->hasErrors()) : ?>
<?php echo var_dump($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->getMessages()); ?>
<?php endif; ?>
</li> </li>
<?php if(($this->element->getElement('add_show_rebroadcast_absolute_date_'.$i)->hasErrors())
|| ($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->hasErrors())) : ?>
<ul class='errors'>
<?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_absolute_date_'.$i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->getMessages()
);
?>
<?php foreach($errors as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
</dd> </dd>

View File

@ -1,4 +1,4 @@
<fieldset> <fieldset id="add_show_rebroadcast_relative">
<dl> <dl>
<dt id="add_show_hosts_rebroadcast_repeat_day-label" class="block-display"> <dt id="add_show_hosts_rebroadcast_repeat_day-label" class="block-display">
<label for="add_show_rebroadcast_repeat_day" class="optional">Repeat Days:</label> <label for="add_show_rebroadcast_repeat_day" class="optional">Repeat Days:</label>
@ -11,6 +11,21 @@
<span class="inline-text">@</span> <span class="inline-text">@</span>
<?php echo $this->element->getElement('add_show_rebroadcast_time_'.$i) ?> <?php echo $this->element->getElement('add_show_rebroadcast_time_'.$i) ?>
</li> </li>
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors())
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?>
<ul class='errors'>
<?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages()
);
?>
<?php foreach($errors as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
</dd> </dd>

View File

@ -1085,7 +1085,7 @@ button.ui-button-icons-only {
padding-right: 2.1em; padding-right: 2.1em;
} }
/* no icon support for input elements, provide padding by default */ /* no icon support for input elements, provide padding by default */
input.ui-button { input.ui-button, button.ui-button {
padding: .4em 1em; padding: .4em 1em;
} }
/*button icon element(s) */ /*button icon element(s) */
@ -1117,10 +1117,11 @@ input.ui-button {
} }
/* workarounds */ /* workarounds */
button.ui-button::-moz-focus-inner { /*button.ui-button::-moz-focus-inner {
border: 0; border: 0;
padding: 0; padding: 0;
} /* reset extra padding in Firefox */ }*/
/* reset extra padding in Firefox */
/* /*
* jQuery UI Dialog 1.8.6 * jQuery UI Dialog 1.8.6
* *

View File

@ -1268,6 +1268,9 @@ div.success{
height: 28px; height: 28px;
margin: 0 0 8px 0; margin: 0 0 8px 0;
} }
#schedule-add-show .button-bar.bottom {
margin: 16px 0 0 0;
}
.schedule { .schedule {
text-align:left; text-align:left;

View File

@ -12,6 +12,7 @@ function startDpSelect(dateText, inst) {
date = new Date(time[0], time[1] - 1, time[2]); date = new Date(time[0], time[1] - 1, time[2]);
$("#add_show_end_date").datepicker("option", "minDate", date); $("#add_show_end_date").datepicker("option", "minDate", date);
$('input[name^="add_show_rebroadcast_absolute_date"]').datepicker("option", "minDate", date);
} }
function endDpSelect(dateText, inst) { function endDpSelect(dateText, inst) {
@ -64,6 +65,10 @@ function setAddShowEvents() {
if(!form.find("#add_show_repeats").attr('checked')) { if(!form.find("#add_show_repeats").attr('checked')) {
form.find("#schedule-show-when > fieldset:last").hide(); form.find("#schedule-show-when > fieldset:last").hide();
$("#add_show_rebroadcast_relative").hide();
}
else {
$("#add_show_rebroadcast_absolute").hide();
} }
if(!form.find("#add_show_record").attr('checked')) { if(!form.find("#add_show_record").attr('checked')) {
@ -82,12 +87,12 @@ function setAddShowEvents() {
if(form.find("#add_show_rebroadcast").attr('checked')) { if(form.find("#add_show_rebroadcast").attr('checked')) {
if($(this).attr('checked')){ if($(this).attr('checked')){
form.find("#schedule-record-rebroadcast > fieldset:eq(1)").hide(); form.find("#add_show_rebroadcast_absolute").hide();
form.find("#schedule-record-rebroadcast > fieldset:last").show(); form.find("#add_show_rebroadcast_relative").show();
} }
else { else {
form.find("#schedule-record-rebroadcast > fieldset:eq(1)").show(); form.find("#add_show_rebroadcast_absolute").show();
form.find("#schedule-record-rebroadcast > fieldset:last").hide(); form.find("#add_show_rebroadcast_relative").hide();
} }
} }
}); });
@ -100,10 +105,10 @@ function setAddShowEvents() {
form.find("#add_show_rebroadcast").click(function(){ form.find("#add_show_rebroadcast").click(function(){
$(this).blur(); $(this).blur();
if($(this).attr('checked') && !form.find("#add_show_repeats").attr('checked')) { if($(this).attr('checked') && !form.find("#add_show_repeats").attr('checked')) {
form.find("#schedule-record-rebroadcast > fieldset:eq(1)").show(); form.find("#add_show_rebroadcast_absolute").show();
} }
else if($(this).attr('checked') && form.find("#add_show_repeats").attr('checked')) { else if($(this).attr('checked') && form.find("#add_show_repeats").attr('checked')) {
form.find("#schedule-record-rebroadcast > fieldset:last").show(); form.find("#add_show_rebroadcast_relative").show();
} }
else { else {
form.find("#schedule-record-rebroadcast > fieldset:not(:first-child)").hide(); form.find("#schedule-record-rebroadcast > fieldset:not(:first-child)").hide();
@ -140,7 +145,7 @@ function setAddShowEvents() {
}); });
form.find('input[name^="add_show_rebroadcast_absolute_date"]').datepicker({ form.find('input[name^="add_show_rebroadcast_absolute_date"]').datepicker({
//minDate: new Date(), minDate: new Date(),
dateFormat: 'yy-mm-dd' dateFormat: 'yy-mm-dd'
}); });
form.find('input[name^="add_show_rebroadcast_absolute_time"], input[name^="add_show_rebroadcast_time"]').timepicker({ form.find('input[name^="add_show_rebroadcast_absolute_time"], input[name^="add_show_rebroadcast_time"]').timepicker({
@ -248,6 +253,14 @@ function showErrorSections() {
if($("#schedule-show-style .errors").length > 0) { if($("#schedule-show-style .errors").length > 0) {
$("#schedule-show-style").show(); $("#schedule-show-style").show();
} }
if($("#add_show_rebroadcast_absolute .errors").length > 0) {
$("#schedule-record-rebroadcast").show();
$("#add_show_rebroadcast_absolute").show();
}
if($("#add_show_rebroadcast_relative .errors").length > 0) {
$("#schedule-record-rebroadcast").show();
$("#add_show_rebroadcast_relative").show();
}
} }
$(document).ready(function() { $(document).ready(function() {