Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x

This commit is contained in:
Martin Konecny 2013-05-17 13:20:40 -04:00
commit 01d16348db
44 changed files with 34420 additions and 34571 deletions

View file

@ -62,7 +62,7 @@ class LocaleController extends Zend_Controller_Action
"Deselect all" => _("Deselect all"),
"Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
"Scheduled" => _("Scheduled"),
"Playlist" => _("Playlist"),
"Playlist" => _("Playlist / Block"),
"Title" => _("Title"),
"Creator" => _("Creator"),
"Album" => _("Album"),

View file

@ -29,24 +29,6 @@ WHERE ends > now() AT TIME ZONE 'UTC'
AND file_id is not null
SQL;
/* If an instance id gets passed into this function we need to check
* if it is a repeating show. If it is a repeating show, we need to
* check for any files scheduled in the future in the linked instances
* as well
*/
if (!is_null($instanceId)) {
$excludeIds = array();
$ccShow = CcShowInstancesQuery::create()
->findPk($instanceId)
->getCcShow();
if ($ccShow->isLinked()) {
foreach ($ccShow->getOtherInstances($instanceId) as $instance) {
$excludeIds[] = $instance->getDbId();
}
$sql .= " AND instance_id IN (".implode(",", $excludeIds).")";
}
}
$files = Application_Common_Database::prepareAndExecute( $sql, array());
$real_files = array();

View file

@ -1323,7 +1323,7 @@ SQL;
}
public static function setIsScheduled($p_scheduleItem, $p_status,
$p_fileId=null, $instanceId=null) {
$p_fileId=null) {
if (is_null($p_fileId)) {
$fileId = Application_Model_Schedule::GetFileId($p_scheduleItem);
@ -1334,7 +1334,7 @@ SQL;
$updateIsScheduled = false;
if (!is_null($fileId) && !in_array($fileId,
Application_Model_Schedule::getAllFutureScheduledFiles($instanceId))) {
Application_Model_Schedule::getAllFutureScheduledFiles())) {
$file->_file->setDbIsScheduled($p_status)->save();
$updateIsScheduled = true;
}
@ -1344,26 +1344,25 @@ SQL;
public static function updatePastFilesIsScheduled()
{
/* Retrieve files that are scheduled in the past OR that belong
* to a show that has ended. We need to check if the show has
* ended incase a track is overbooked, since that alone will
* indicate the show is still scheduled in the future
/* Set the is_scheduled flag to false where it was true in the
* past, and where tracks are not scheduled in the future and do
* not belong to a show that has not ended yet. We need to check
* for show end times in case a track is overbooked, which would
* indicate it is still scheduled in the future
*/
$sql = <<<SQL
SELECT s.file_id, s.instance_id FROM cc_schedule AS s
UPDATE cc_files SET is_scheduled = false
WHERE is_scheduled = true
AND id NOT IN (
SELECT s.file_id FROM cc_schedule AS s
LEFT JOIN cc_show_instances AS i
ON s.instance_id = i.id
WHERE s.ends < now() at time zone 'UTC'
OR i.ends < now() at time zone 'UTC'
WHERE s.ends > now() at time zone 'UTC'
AND i.ends > now() at time zone 'UTC'
)
SQL;
$files = Application_Common_Database::prepareAndExecute($sql);
foreach ($files as $file) {
if (!is_null($file['file_id'])) {
self::setIsScheduled(null, false, $file['file_id'], $file['instance_id']);
}
}
Application_Common_Database::prepareAndExecute($sql, array(),
Application_Common_Database::EXECUTE);
}
public function getRealClipLength($p_cuein, $p_cueout) {

View file

@ -194,7 +194,7 @@ class CcShow extends BaseCcShow {
{
return CcShowInstancesQuery::create()
->filterByCcShow($this)
->filterByDbId($instanceId, Criteria::NOT_IN)
->filterByDbId($instanceId, Criteria::NOT_EQUAL)
->find();
}
} // CcShow

View file

@ -569,6 +569,8 @@ SQL;
$this->deleteShowInstances($ccShowInstances, $ccShowInstance->getDbShowId());
}
Application_Model_StoredFile::updatePastFilesIsScheduled();
Application_Model_RabbitMq::PushSchedule();
$con->commit();
@ -876,10 +878,13 @@ SQL;
/*
* Make sure start date is less than populate until date AND
* last show date is null OR start date is less than last show date
*
* (NOTE: We cannot call getTimestamp() to compare the dates because of
* a PHP 5.3.3 bug with DatePeriod objects - See CC-5159 for more details)
*/
if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() &&
if ($utcStartDateTime->format("Y-m-d H:i:s") <= $populateUntil->format("Y-m-d H:i:s") &&
( is_null($utcLastShowDateTime) ||
$utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) {
$utcStartDateTime->format("Y-m-d H:i:s") < $utcLastShowDateTime->format("Y-m-d H:i:s")) ) {
/* There may not always be an instance when editing a show
* This will be the case when we are adding a new show day to

View file

@ -330,8 +330,8 @@ INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_GB', 'English (Brit
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_US', 'English (USA)');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('cs_CZ', 'Český');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('hu_HU', 'hʌŋɡəri');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_AT', 'Österreichisches Deutsch');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('hu_HU', 'Magyar');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('es_ES', 'Español');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('fr_FR', 'Français');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('it_IT', 'Italiano');

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Airtime 2.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-16 12:46-0400\n"
"PO-Revision-Date: 2013-05-16 12:46-0500\n"
"POT-Creation-Date: 2013-05-17 11:38-0400\n"
"PO-Revision-Date: 2013-05-17 11:38-0500\n"
"Last-Translator: Denise Rigato <denise.rigato@sourcefabric.org>\n"
"Language-Team: Hungarian Localization <contact@sourcefabric.org>\n"
"Language: \n"
@ -1977,7 +1977,7 @@ msgid "Scheduled"
msgstr ""
#: airtime_mvc/application/controllers/LocaleController.php:65
msgid "Playlist"
msgid "Playlist / Block"
msgstr ""
#: airtime_mvc/application/controllers/LocaleController.php:69

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View file

@ -2006,6 +2006,14 @@ span.errors.sp-errors{
.small-icon.show-partial-filled, .small-icon.media-item-in-use {
background:url(images/icon_alert_cal_alt2.png) no-repeat 0 0;
}
.small-icon.is_scheduled {
background:url(images/is_scheduled.png) no-repeat 0 0;
height: 16px !important;
}
.small-icon.is_playlist {
background:url(images/is_playlist.png) no-repeat 0 0;
height: 16px !important;
}
.medium-icon {
display:block;
width:25px;

View file

@ -468,7 +468,7 @@ var AIRTIME = (function(AIRTIME) {
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
/* Is Scheduled */ { "sTitle" : $.i18n._("Scheduled") , "mDataProp" : "is_scheduled" , "bSearchable" : false , "sWidth" : "90px" , "sClass" : "library_is_scheduled"} ,
/* Is Playlist */ { "sTitle" : $.i18n._("Playlist") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "70px" , "sClass" : "library_is_playlist"} ,
/* Is Playlist */ { "sTitle" : $.i18n._("Playlist / Block") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "110px" , "sClass" : "library_is_playlist"} ,
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
@ -618,12 +618,12 @@ var AIRTIME = (function(AIRTIME) {
}
if (aData.is_scheduled) {
$(nRow).find("td.library_is_scheduled").html('<span class="small-icon media-item-in-use"></span>');
$(nRow).find("td.library_is_scheduled").html('<span class="small-icon is_scheduled"></span>');
} else if (!aData.is_scheduled) {
$(nRow).find("td.library_is_scheduled").html('');
}
if (aData.is_playlist) {
$(nRow).find("td.library_is_playlist").html('<span class="small-icon media-item-in-use"></span>');
$(nRow).find("td.library_is_playlist").html('<span class="small-icon is_playlist"></span>');
} else if (!aData.is_playlist) {
$(nRow).find("td.library_is_playlist").html('');
}

View file

@ -16,4 +16,4 @@ UPDATE cc_files
SET is_playlist = true
WHERE id IN (SELECT DISTINCT(file_id) FROM cc_blockcontents);
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('hu_HU', 'hʌŋɡəri');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('hu_HU', 'Magyar');