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

This commit is contained in:
Martin Konecny 2012-09-06 14:52:18 -04:00
commit 1b597cf6ed
4 changed files with 24 additions and 15 deletions

View File

@ -460,9 +460,13 @@ class PlaylistController extends Zend_Controller_Action
$result = array(); $result = array();
if ($params['type'] == 'block') { if ($params['type'] == 'block') {
try {
$bl = new Application_Model_Block($params['obj_id']);
} catch (BlockNotFoundException $e) {
$this->playlistNotFound('block', true);
}
$form = new Application_Form_SmartBlockCriteria(); $form = new Application_Form_SmartBlockCriteria();
$form->startForm($params['obj_id']); $form->startForm($params['obj_id']);
$bl = new Application_Model_Block($params['obj_id']);
if ($form->isValid($params)) { if ($form->isValid($params)) {
$this->setPlaylistNameDescAction(); $this->setPlaylistNameDescAction();
$bl->saveSmartBlockCriteria($params['data']); $bl->saveSmartBlockCriteria($params['data']);

View File

@ -127,14 +127,14 @@ class Application_Model_Show
$sql = "SELECT first_name, last_name $sql = "SELECT first_name, last_name
FROM cc_show_hosts LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id FROM cc_show_hosts LEFT JOIN cc_subjs ON cc_show_hosts.subjs_id = cc_subjs.id
WHERE show_id = {$this->_showId}"; WHERE show_id = :show_id";
$hosts = $con->query($sql)->fetchAll(); $hosts = Application_Common_Database::prepareAndExecute( $sql,
array( ':show_id' => $this->getId() ), 'all');
$res = array(); $res = array_map( function($host) {
foreach ($hosts as $host) { return $host['first_name']." ".$host['last_name'];
$res[] = $host['first_name']." ".$host['last_name']; }, $hosts);
}
return $res; return $res;
} }
@ -145,9 +145,10 @@ class Application_Model_Show
$sql = "SELECT subjs_id $sql = "SELECT subjs_id
FROM cc_show_hosts FROM cc_show_hosts
WHERE show_id = {$this->_showId}"; WHERE show_id = :show_id";
$hosts = $con->query($sql)->fetchAll(); $hosts = Application_Common_Database::prepareAndExecute(
$sql, array( ':show_id' => $this->getId() ), 'all');
return $hosts; return $hosts;
} }
@ -1319,8 +1320,9 @@ class Application_Model_Show
$showInstance->correctScheduleStartTimes(); $showInstance->correctScheduleStartTimes();
} }
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}"; $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
$rebroadcasts = $con->query($sql)->fetchAll(); $rebroadcasts = Application_Common_Database::prepareAndExecute($sql,
array( ':show_id' => $show_id ), 'all');
if ($showInstance->isRecorded()) { if ($showInstance->isRecorded()) {
$showInstance->deleteRebroadcasts(); $showInstance->deleteRebroadcasts();
@ -1367,8 +1369,10 @@ class Application_Model_Show
//convert $last_show into a UTC DateTime object, or null if there is no last show. //convert $last_show into a UTC DateTime object, or null if there is no last show.
$utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id={$show_id}"; $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
$rebroadcasts = $con->query($sql)->fetchAll();
$rebroadcasts = Application_Common_Database::prepareAndExecute( $sql,
array( ':show_id' => $show_id ), 'all');
$show = new Application_Model_Show($show_id); $show = new Application_Model_Show($show_id);

View File

@ -650,7 +650,7 @@ class Application_Model_StoredFile
$displayColumns = array("id", "track_title", "artist_name", "album_title", "genre", "length", $displayColumns = array("id", "track_title", "artist_name", "album_title", "genre", "length",
"year", "utime", "mtime", "ftype", "track_number", "mood", "bpm", "composer", "info_url", "year", "utime", "mtime", "ftype", "track_number", "mood", "bpm", "composer", "info_url",
"bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime", "bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime",
"language", "filepath","owner" "language", "filepath","owner","conductor"
); );
//Logging::info($datatables); //Logging::info($datatables);

View File

@ -412,7 +412,8 @@ var AIRTIME = (function(AIRTIME) {
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" } , /* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } , /* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" } ,
/* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } , /* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } ,
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } /* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" } ,
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" }
], ],
"bProcessing": true, "bProcessing": true,