Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Yuchen Wang 2011-11-23 10:39:40 -05:00
commit 37da2bf0c5
6 changed files with 58 additions and 58 deletions
airtime_mvc
application
models
views/scripts/dashboard
public/js/airtime/schedule
dev_tools/fabric
install_minimal/DoctrineMigrations

View File

@ -1197,12 +1197,39 @@ class Application_Model_Show {
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
$dt = new DateTime($start, new DateTimeZone($timezone));
$dt->add(new DateInterval($p_interval));
$start = $dt->format("Y-m-d H:i:s");
$dt->setTimezone(new DateTimeZone('UTC'));
$utcStartDateTime = $dt;
if ($p_interval == 'P1M'){
/* When adding months, there is a problem if we are on January 31st and add one month with PHP.
* What ends up happening is that since February 31st doesn't exist, the date returned is
* March 3rd. For now let's ignore the day and assume we are always working with the
* first of each month, and use PHP to add 1 month to this (this will take care of rolling
* over the years 2011->2012, etc.). Then let's append the actual day, and use the php
* checkdate() function, to see if it is valid. If not, then we'll just skip this month. */
$startDt = new DateTime($start, new DateTimeZone($timezone));
/* pass in only the year and month (not the day) */
$dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone));
/* Keep adding 1 month, until we find the next month that contains the day
* we are looking for (31st day for example) */
do {
$dt->add(new DateInterval($p_interval));
} while(!checkdate($dt->format("m"), $startDt->format("d"), $dt->format("Y")));
$dt->setDate($dt->format("Y"), $dt->format("m"), $startDt->format("d"));
$start = $dt->format("Y-m-d H:i:s");
$dt->setTimezone(new DateTimeZone('UTC'));
$utcStartDateTime = $dt;
} else {
$dt = new DateTime($start, new DateTimeZone($timezone));
$dt->add(new DateInterval($p_interval));
$start = $dt->format("Y-m-d H:i:s");
$dt->setTimezone(new DateTimeZone('UTC'));
$utcStartDateTime = $dt;
}
}

View File

@ -28,8 +28,6 @@ $(document).ready(function(){
$("#combo-box").change(function(eventObject){
var elem = $("#combo-box option:selected");
console.log(elem);
setjPlayer(elem.attr("data-url"), elem.attr("data-type"), elem.attr("server-type"));
});

View File

@ -88,6 +88,15 @@ function adjustDateToServerDate(date, serverTimezoneOffset){
return date;
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
function dayClick(date, allDay, jsEvent, view) {
var now, today, selected, chosenDate, chosenTime;
@ -111,58 +120,23 @@ function dayClick(date, allDay, jsEvent, view) {
$(span).prev().remove();
$(span).remove();
}
chosenDate = selected.getFullYear();
var month = selected.getMonth() + 1;
if(month < 10) {
chosenDate = chosenDate+'-0'+month;
}
else {
chosenDate = chosenDate+'-'+month;
}
var day = selected.getDate();
if(day < 10) {
chosenDate = chosenDate+'-0'+day;
}
else {
chosenDate = chosenDate+'-'+day;
}
var min = selected.getMinutes();
var hours = selected.getHours();
if(min < 10){
chosenTime = hours+":0"+min;
}
else {
chosenTime = hours+":"+min;
}
if(hours < 10){
chosenTime = "0"+chosenTime;
}
// 1 hr
var duration = 60 * 60* 1000;
var endHour = hours + 1;
var chosenEndTime;
var endDateTime = new Date(selected.getTime() + duration);
if(min < 10){
chosenEndTime = endHour+":0"+min;
}
else {
chosenEndTime = endHour+":"+min;
}
if(endHour < 10){
chosenEndTime = "0"+chosenEndTime;
}
chosenDate = selected.getFullYear() + '-' + pad(selected.getMonth()+1,2) + '-' + pad(selected.getDate(),2);
chosenTime = pad(selected.getHours(),2) + ':' + pad(selected.getMinutes(),2);
var endDateFormat = endDateTime.getFullYear() + '-' + pad(endDateTime.getMonth()+1,2) + '-' + pad(endDateTime.getDate(),2);
var endTimeFormat = pad(endDateTime.getHours(),2) + ':' + pad(endDateTime.getMinutes(),2);
$("#add_show_start_date").val(chosenDate);
$("#add_show_end_date_no_repeat").val(chosenDate);
$("#add_show_end_date").datepicker("option", "minDate", chosenDate);
$("#add_show_end_date").val(chosenDate);
$("#add_show_end_date_no_repeat").val(endDateFormat);
$("#add_show_end_date").datepicker("option", "minDate", endDateFormat);
$("#add_show_end_date").val(endDateFormat);
$("#add_show_start_time").val(chosenTime);
$("#add_show_end_time").val(chosenEndTime);
$("#add_show_end_time").val(endTimeFormat);
$("#add_show_duration").val('1h');
$("#schedule-show-when").show();

View File

@ -58,7 +58,7 @@ def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
then they will most likey have a different host key, and ssh will fail, warning
about a possible man in the middle attack.
"""
local("rm ~/.ssh/known_hosts")
local("rm -f ~/.ssh/known_hosts")
vm_vdi_file = '%s.vdi'%vm_name
vm_xml_file = '%s.xml'%vm_name
@ -103,7 +103,7 @@ def create_fresh_os(vm_name, update_virtualenv=False, debian=False):
local('VBoxManage snapshot %s restore fresh_install'%vm_name)
local('VBoxManage modifyvm "%s" --bridgeadapter1 eth0'%vm_name)
local('VBoxManage modifyvm "%s" --bridgeadapter1 wlan0'%vm_name)
local('VBoxManage startvm %s'%vm_name)
print "Please wait while attempting to acquire IP address"

View File

@ -4,8 +4,9 @@ exec 2>&1
target="airtime_git_branch"
#airtime_versions=("" "airtime_182_tar" "airtime_194_tar")
airtime_versions=("")
ubuntu_versions=("ubuntu_lucid_32" "ubuntu_lucid_64" "ubuntu_maverick_32" "ubuntu_maverick_64" "ubuntu_natty_32" "ubuntu_natty_64" "ubuntu_oneiric_32" "ubuntu_oneiric_64" "debian_squeeze_32" "debian_squeeze_64")
airtime_versions=("" "airtime_182_tar" "airtime_195_tar")
#ubuntu_versions=("ubuntu_lucid_32" "ubuntu_lucid_64" "ubuntu_maverick_32" "ubuntu_maverick_64" "ubuntu_natty_32" "ubuntu_natty_64" "ubuntu_oneiric_32" "ubuntu_oneiric_64" "debian_squeeze_32" "debian_squeeze_64")
ubuntu_versions=("ubuntu_natty_32" "ubuntu_natty_64")
num1=${#ubuntu_versions[@]}
num2=${#airtime_versions[@]}

View File

@ -10,7 +10,7 @@ class Version20111114222927 extends AbstractMigration
public function up(Schema $schema)
{
$cc_show_instances = $schema->getTable('cc_show_instances');
$cc_show_instances->addColumn('deleted_instance', 'boolean', array('notnull' => true, 'default'=> '0'));
$cc_show_instances->addColumn('modified_instance', 'boolean', array('notnull' => true, 'default'=> '0'));
}
public function down(Schema $schema)