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();
|
||||
$i = 1;
|
||||
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_date_$i"] = $rebroadcast['start_date'];
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_absolute_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
|
||||
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->addFilter('StringTrim');
|
||||
$text->addValidator('date', false, array('YYYY-MM-DD'));
|
||||
|
@ -19,7 +19,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$text->setDecorators(array('ViewHelper'));
|
||||
$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->addFilter('StringTrim');
|
||||
$text->addValidator('date', false, array('HH:mm'));
|
||||
|
@ -34,9 +34,9 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
|
||||
$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 == "") {
|
||||
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("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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -731,7 +731,7 @@ class Show {
|
|||
//adding rows to cc_show_rebroadcast
|
||||
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]) {
|
||||
$showRebroad = new CcShowRebroadcast();
|
||||
|
@ -743,16 +743,16 @@ class Show {
|
|||
}
|
||||
} 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]) {
|
||||
$sql = "SELECT date '{$data['add_show_rebroadcast_absolute_date_'.$i]}' - date '{$data['add_show_start_date']}' ";
|
||||
if ($data['add_show_rebroadcast_date_absolute_'.$i]) {
|
||||
$sql = "SELECT date '{$data['add_show_rebroadcast_date_absolute_'.$i]}' - date '{$data['add_show_start_date']}' ";
|
||||
$r = $con->query($sql);
|
||||
$offset_days = $r->fetchColumn(0);
|
||||
|
||||
$showRebroad = new CcShowRebroadcast();
|
||||
$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->save();
|
||||
}
|
||||
|
|
|
@ -5,18 +5,24 @@
|
|||
</dt>
|
||||
<dd id="add_show_rebroadcast_day-element" class="block-display clearfix">
|
||||
<ul class="formrow-repeat">
|
||||
<?php for($i=1; $i<=5; $i++): ?>
|
||||
<li>
|
||||
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?>
|
||||
<?php for($i=1; $i<=10; $i++): ?>
|
||||
<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_date_absolute_'.$i) ?>
|
||||
<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>
|
||||
<?php if(($this->element->getElement('add_show_rebroadcast_absolute_date_'.$i)->hasErrors())
|
||||
|| ($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->hasErrors())) : ?>
|
||||
<?php if(($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->hasErrors())
|
||||
|| ($this->element->getElement('add_show_rebroadcast_time_absolute_'.$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()
|
||||
$this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getMessages(),
|
||||
$this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getMessages()
|
||||
);
|
||||
?>
|
||||
|
||||
|
@ -27,6 +33,10 @@
|
|||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
</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>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
|
|
@ -4,30 +4,40 @@
|
|||
<label for="add_show_rebroadcast_repeat_day" class="optional">Repeat Days:</label>
|
||||
</dt>
|
||||
<dd id="add_show_rebroadcast_repeat_day-element" class="block-display clearfix">
|
||||
<ul class="formrow-repeat">
|
||||
<?php for($i=1; $i<=5; $i++): ?>
|
||||
<li>
|
||||
<?php echo $this->element->getElement('add_show_rebroadcast_date_'.$i) ?>
|
||||
<span class="inline-text">@</span>
|
||||
<?php echo $this->element->getElement('add_show_rebroadcast_time_'.$i) ?>
|
||||
</li>
|
||||
<ul class="formrow-repeat">
|
||||
<?php for($i=1; $i<=10; $i++): ?>
|
||||
<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) ?>
|
||||
<span class="inline-text">@</span>
|
||||
<?php echo $this->element->getElement('add_show_rebroadcast_time_'.$i) ?>
|
||||
<?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())
|
||||
|| ($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 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; ?>
|
||||
</ul>
|
||||
<?php foreach($errors as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php endfor; ?>
|
||||
</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>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
|
|
@ -8,14 +8,15 @@
|
|||
echo "******************************** Install Begin *********************************".PHP_EOL;
|
||||
|
||||
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
|
||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||
|
||||
AirtimeInstall::ExitIfNotRoot();
|
||||
AirtimeIni::CreateIniFile();
|
||||
AirtimeIni::UpdateIniFiles();
|
||||
|
||||
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/../application/configs/conf.php');
|
||||
|
||||
AirtimeInstall::ExitIfNotRoot();
|
||||
|
||||
echo PHP_EOL."*** Installing Airtime ".AIRTIME_VERSION." ***".PHP_EOL;
|
||||
|
||||
echo PHP_EOL."*** Database Installation ***".PHP_EOL;
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
//Pear classes.
|
||||
set_include_path(__DIR__.'/../../library/pear' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
require_once('DB.php');
|
||||
require_once(dirname(__FILE__).'/../../application/configs/conf.php');
|
||||
|
||||
class AirtimeInstall {
|
||||
/**
|
||||
|
|
|
@ -150,14 +150,55 @@ function setAddShowEvents() {
|
|||
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(),
|
||||
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: ['', ''],
|
||||
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({
|
||||
source: findHosts,
|
||||
|
@ -166,7 +207,7 @@ function setAddShowEvents() {
|
|||
});
|
||||
|
||||
form.find("#schedule-show-style input").ColorPicker({
|
||||
onChange: function (hsb, hex, rgb, el) {
|
||||
onChange: function (hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
|
@ -186,15 +227,17 @@ function setAddShowEvents() {
|
|||
|
||||
var y = $("#schedule_calendar").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();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
||||
setAddShowEvents();
|
||||
setAddShowEvents();
|
||||
});
|
||||
makeAddShowButton();
|
||||
});
|
||||
|
@ -204,7 +247,8 @@ function setAddShowEvents() {
|
|||
var addShowButton = $(this);
|
||||
if (!addShowButton.hasClass("disabled")){
|
||||
addShowButton.addClass("disabled");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue