Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
5a7ebc8a8b
|
@ -478,8 +478,8 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$rebroadcastAbsoluteFormValues = array();
|
$rebroadcastAbsoluteFormValues = array();
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
||||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_date_$i"] = $rebroadcast['start_date'];
|
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
|
|
||||||
for($i=1; $i<=10; $i++) {
|
for($i=1; $i<=10; $i++) {
|
||||||
|
|
||||||
$text = new Zend_Form_Element_Text("add_show_rebroadcast_absolute_date_$i");
|
$text = new Zend_Form_Element_Text("add_show_rebroadcast_date_absolute_$i");
|
||||||
$text->setAttrib('class', 'input_text');
|
$text->setAttrib('class', 'input_text');
|
||||||
$text->addFilter('StringTrim');
|
$text->addFilter('StringTrim');
|
||||||
$text->addValidator('date', false, array('YYYY-MM-DD'));
|
$text->addValidator('date', false, array('YYYY-MM-DD'));
|
||||||
|
@ -19,7 +19,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
$text->setDecorators(array('ViewHelper'));
|
$text->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($text);
|
$this->addElement($text);
|
||||||
|
|
||||||
$text = new Zend_Form_Element_Text("add_show_rebroadcast_absolute_time_$i");
|
$text = new Zend_Form_Element_Text("add_show_rebroadcast_time_absolute_$i");
|
||||||
$text->setAttrib('class', 'input_text');
|
$text->setAttrib('class', 'input_text');
|
||||||
$text->addFilter('StringTrim');
|
$text->addFilter('StringTrim');
|
||||||
$text->addValidator('date', false, array('HH:mm'));
|
$text->addValidator('date', false, array('HH:mm'));
|
||||||
|
@ -34,9 +34,9 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
|
|
||||||
$valid = true;
|
$valid = true;
|
||||||
|
|
||||||
for($i=1; $i<=5; $i++) {
|
for($i=1; $i<=10; $i++) {
|
||||||
|
|
||||||
$day = $formData['add_show_rebroadcast_absolute_date_'.$i];
|
$day = $formData['add_show_rebroadcast_date_absolute_'.$i];
|
||||||
|
|
||||||
if($day == "") {
|
if($day == "") {
|
||||||
continue;
|
continue;
|
||||||
|
@ -52,11 +52,11 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
$show_end->add(new DateInterval("PT$duration[1]M"));
|
$show_end->add(new DateInterval("PT$duration[1]M"));
|
||||||
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
|
$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 = $day."".$formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||||
$rebroad_start = new DateTime($rebroad_start);
|
$rebroad_start = new DateTime($rebroad_start);
|
||||||
|
|
||||||
if($rebroad_start < $show_end) {
|
if($rebroad_start < $show_end) {
|
||||||
$this->getElement('add_show_rebroadcast_absolute_time_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
|
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Must wait at least 1 hour to rebroadcast"));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,7 +731,7 @@ class Show {
|
||||||
//adding rows to cc_show_rebroadcast
|
//adding rows to cc_show_rebroadcast
|
||||||
if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType != -1) {
|
if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType != -1) {
|
||||||
|
|
||||||
for ($i=1; $i<=5; $i++) {
|
for ($i=1; $i<=10; $i++) {
|
||||||
|
|
||||||
if ($data['add_show_rebroadcast_date_'.$i]) {
|
if ($data['add_show_rebroadcast_date_'.$i]) {
|
||||||
$showRebroad = new CcShowRebroadcast();
|
$showRebroad = new CcShowRebroadcast();
|
||||||
|
@ -743,16 +743,16 @@ class Show {
|
||||||
}
|
}
|
||||||
} else if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType == -1){
|
} else if ($isRecorded && $data['add_show_rebroadcast'] && $repeatType == -1){
|
||||||
|
|
||||||
for ($i=1; $i<=5; $i++) {
|
for ($i=1; $i<=10; $i++) {
|
||||||
|
|
||||||
if ($data['add_show_rebroadcast_absolute_date_'.$i]) {
|
if ($data['add_show_rebroadcast_date_absolute_'.$i]) {
|
||||||
$sql = "SELECT date '{$data['add_show_rebroadcast_absolute_date_'.$i]}' - date '{$data['add_show_start_date']}' ";
|
$sql = "SELECT date '{$data['add_show_rebroadcast_date_absolute_'.$i]}' - date '{$data['add_show_start_date']}' ";
|
||||||
$r = $con->query($sql);
|
$r = $con->query($sql);
|
||||||
$offset_days = $r->fetchColumn(0);
|
$offset_days = $r->fetchColumn(0);
|
||||||
|
|
||||||
$showRebroad = new CcShowRebroadcast();
|
$showRebroad = new CcShowRebroadcast();
|
||||||
$showRebroad->setDbDayOffset($offset_days." days");
|
$showRebroad->setDbDayOffset($offset_days." days");
|
||||||
$showRebroad->setDbStartTime($data['add_show_rebroadcast_absolute_time_'.$i]);
|
$showRebroad->setDbStartTime($data['add_show_rebroadcast_time_absolute_'.$i]);
|
||||||
$showRebroad->setDbShowId($showId);
|
$showRebroad->setDbShowId($showId);
|
||||||
$showRebroad->save();
|
$showRebroad->save();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,18 +5,24 @@
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="add_show_rebroadcast_day-element" class="block-display clearfix">
|
<dd id="add_show_rebroadcast_day-element" class="block-display clearfix">
|
||||||
<ul class="formrow-repeat">
|
<ul class="formrow-repeat">
|
||||||
<?php for($i=1; $i<=5; $i++): ?>
|
<?php for($i=1; $i<=10; $i++): ?>
|
||||||
<li>
|
<li <?php if(($i > 1) && ($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getValue() == "")){echo 'style=display:none';} ?>>
|
||||||
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?>
|
<?php echo $this->element->getElement('add_show_rebroadcast_date_absolute_'.$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_time_absolute_'.$i) ?>
|
||||||
|
<?php if($i > 1): ?>
|
||||||
|
<a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_absolute_<?php echo $i ?>">
|
||||||
|
<span class="ui-icon ui-icon-closethick"></span>
|
||||||
|
<span class="ui-button-text">Remove</span>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php if(($this->element->getElement('add_show_rebroadcast_absolute_date_'.$i)->hasErrors())
|
<?php if(($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->hasErrors())
|
||||||
|| ($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->hasErrors())) : ?>
|
|| ($this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->hasErrors())) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
<?php $errors = array_merge(
|
<?php $errors = array_merge(
|
||||||
$this->element->getElement('add_show_rebroadcast_absolute_date_'.$i)->getMessages(),
|
$this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getMessages(),
|
||||||
$this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->getMessages()
|
$this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getMessages()
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -27,6 +33,10 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">
|
||||||
|
<span class="ui-icon ui-icon-plusthick"></span>
|
||||||
|
<span class="ui-button-text">Add</span>
|
||||||
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -4,30 +4,40 @@
|
||||||
<label for="add_show_rebroadcast_repeat_day" class="optional">Repeat Days:</label>
|
<label for="add_show_rebroadcast_repeat_day" class="optional">Repeat Days:</label>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="add_show_rebroadcast_repeat_day-element" class="block-display clearfix">
|
<dd id="add_show_rebroadcast_repeat_day-element" class="block-display clearfix">
|
||||||
<ul class="formrow-repeat">
|
<ul class="formrow-repeat">
|
||||||
<?php for($i=1; $i<=5; $i++): ?>
|
<?php for($i=1; $i<=10; $i++): ?>
|
||||||
<li>
|
<li <?php if(($i > 1) && (is_null($this->element->getElement('add_show_rebroadcast_date_'.$i)->getValue()))){echo 'style=display:none';} ?>>
|
||||||
<?php echo $this->element->getElement('add_show_rebroadcast_date_'.$i) ?>
|
<?php echo $this->element->getElement('add_show_rebroadcast_date_'.$i) ?>
|
||||||
<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>
|
<?php if($i > 1): ?>
|
||||||
|
<a class="ui-button ui-button-icon-only ui-widget ui-state-default" id="remove_rebroadcast_<?php echo $i ?>">
|
||||||
|
<span class="ui-icon ui-icon-closethick"></span>
|
||||||
|
<span class="ui-button-text">Remove</span>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</li>
|
||||||
|
|
||||||
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors())
|
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors())
|
||||||
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?>
|
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?>
|
||||||
<ul class='errors'>
|
<ul class='errors'>
|
||||||
<?php $errors = array_merge(
|
<?php $errors = array_merge(
|
||||||
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(),
|
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(),
|
||||||
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages()
|
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages()
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php foreach($errors as $error): ?>
|
<?php foreach($errors as $error): ?>
|
||||||
<li><?php echo $error; ?></li>
|
<li><?php echo $error; ?></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">
|
||||||
|
<span class="ui-icon ui-icon-plusthick"></span>
|
||||||
|
<span class="ui-button-text">Add</span>
|
||||||
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -8,14 +8,15 @@
|
||||||
echo "******************************** Install Begin *********************************".PHP_EOL;
|
echo "******************************** Install Begin *********************************".PHP_EOL;
|
||||||
|
|
||||||
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
||||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
|
||||||
|
|
||||||
AirtimeInstall::ExitIfNotRoot();
|
|
||||||
AirtimeIni::CreateIniFile();
|
AirtimeIni::CreateIniFile();
|
||||||
AirtimeIni::UpdateIniFiles();
|
AirtimeIni::UpdateIniFiles();
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||||
|
|
||||||
|
AirtimeInstall::ExitIfNotRoot();
|
||||||
|
|
||||||
echo PHP_EOL."*** Installing Airtime ".AIRTIME_VERSION." ***".PHP_EOL;
|
echo PHP_EOL."*** Installing Airtime ".AIRTIME_VERSION." ***".PHP_EOL;
|
||||||
|
|
||||||
echo PHP_EOL."*** Database Installation ***".PHP_EOL;
|
echo PHP_EOL."*** Database Installation ***".PHP_EOL;
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
//Pear classes.
|
//Pear classes.
|
||||||
set_include_path(__DIR__.'/../../library/pear' . PATH_SEPARATOR . get_include_path());
|
set_include_path(__DIR__.'/../../library/pear' . PATH_SEPARATOR . get_include_path());
|
||||||
|
|
||||||
require_once('DB.php');
|
require_once('DB.php');
|
||||||
require_once(dirname(__FILE__).'/../../application/configs/conf.php');
|
|
||||||
|
|
||||||
class AirtimeInstall {
|
class AirtimeInstall {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -150,14 +150,55 @@ function setAddShowEvents() {
|
||||||
defaultTime: '01:00'
|
defaultTime: '01:00'
|
||||||
});
|
});
|
||||||
|
|
||||||
form.find('input[name^="add_show_rebroadcast_absolute_date"]').datepicker({
|
form.find('input[name^="add_show_rebroadcast_date_absolute"]').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_time"]').timepicker({
|
||||||
amPmText: ['', ''],
|
amPmText: ['', ''],
|
||||||
defaultTime: ''
|
defaultTime: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
form.find(".add_absolute_rebroadcast_day").click(function(){
|
||||||
|
var li = $(this).prev().find("li:visible:last").next();
|
||||||
|
|
||||||
|
li.show();
|
||||||
|
li = li.next();
|
||||||
|
if(li.length === 0) {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
form.find('a[id^="remove_rebroadcast"]').click(function(){
|
||||||
|
var list = $(this).parent().parent();
|
||||||
|
var li_num = $(this).parent().index();
|
||||||
|
var num = list.find("li").length;
|
||||||
|
var count = num - li_num;
|
||||||
|
|
||||||
|
var curr = $(this).parent();
|
||||||
|
var next = curr.next();
|
||||||
|
|
||||||
|
for(var i=0; i<=count; i++) {
|
||||||
|
var date = next.find('[name^="add_show_rebroadcast_date"]').val();
|
||||||
|
curr.find('[name^="add_show_rebroadcast_date"]').val(date);
|
||||||
|
var time = next.find('[name^="add_show_rebroadcast_time"]').val();
|
||||||
|
curr.find('[name^="add_show_rebroadcast_time"]').val(time);
|
||||||
|
|
||||||
|
curr = next;
|
||||||
|
next = curr.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
list.find("li:visible:last")
|
||||||
|
.find('[name^="add_show_rebroadcast_date"]')
|
||||||
|
.val('')
|
||||||
|
.end()
|
||||||
|
.find('[name^="add_show_rebroadcast_time"]')
|
||||||
|
.val('')
|
||||||
|
.end()
|
||||||
|
.hide();
|
||||||
|
|
||||||
|
list.next().show();
|
||||||
|
});
|
||||||
|
|
||||||
form.find("#add_show_hosts_autocomplete").autocomplete({
|
form.find("#add_show_hosts_autocomplete").autocomplete({
|
||||||
source: findHosts,
|
source: findHosts,
|
||||||
|
@ -166,7 +207,7 @@ function setAddShowEvents() {
|
||||||
});
|
});
|
||||||
|
|
||||||
form.find("#schedule-show-style input").ColorPicker({
|
form.find("#schedule-show-style input").ColorPicker({
|
||||||
onChange: function (hsb, hex, rgb, el) {
|
onChange: function (hsb, hex, rgb, el) {
|
||||||
$(el).val(hex);
|
$(el).val(hex);
|
||||||
},
|
},
|
||||||
onSubmit: function(hsb, hex, rgb, el) {
|
onSubmit: function(hsb, hex, rgb, el) {
|
||||||
|
@ -186,15 +227,17 @@ function setAddShowEvents() {
|
||||||
|
|
||||||
var y = $("#schedule_calendar").width();
|
var y = $("#schedule_calendar").width();
|
||||||
var z = $("#schedule-add-show").width();
|
var z = $("#schedule-add-show").width();
|
||||||
$("#schedule_calendar").width(y+z+50);
|
|
||||||
$("#schedule_calendar").fullCalendar('render');
|
$("#schedule_calendar").width(y+z+50)
|
||||||
|
.fullCalendar('render');
|
||||||
|
|
||||||
$("#add-show-form").hide();
|
$("#add-show-form").hide();
|
||||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||||
$("#add-show-form")
|
$("#add-show-form")
|
||||||
.empty()
|
.empty()
|
||||||
.append(json.form);
|
.append(json.form);
|
||||||
|
|
||||||
setAddShowEvents();
|
setAddShowEvents();
|
||||||
});
|
});
|
||||||
makeAddShowButton();
|
makeAddShowButton();
|
||||||
});
|
});
|
||||||
|
@ -204,7 +247,8 @@ function setAddShowEvents() {
|
||||||
var addShowButton = $(this);
|
var addShowButton = $(this);
|
||||||
if (!addShowButton.hasClass("disabled")){
|
if (!addShowButton.hasClass("disabled")){
|
||||||
addShowButton.addClass("disabled");
|
addShowButton.addClass("disabled");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue