From cf1178522a146d5ff679e564b26f14cf0456922f Mon Sep 17 00:00:00 2001 From: James Date: Thu, 9 Aug 2012 10:47:43 -0400 Subject: [PATCH 1/6] CC-4166: Playlist Builder -> Regular Playlist : clicking Fade in/out button for a empty playlist will cause PHP Fatal Error - changes made on phtml were cause some errors. fixed. --- .../application/views/scripts/playlist/playlist.phtml | 6 ++++-- .../application/views/scripts/playlist/smart-block.phtml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/views/scripts/playlist/playlist.phtml b/airtime_mvc/application/views/scripts/playlist/playlist.phtml index 5f0572b16..7d1a77021 100644 --- a/airtime_mvc/application/views/scripts/playlist/playlist.phtml +++ b/airtime_mvc/application/views/scripts/playlist/playlist.phtml @@ -1,6 +1,8 @@ obj->getContents(); -$count = count($contents); +if (isset($this->obj)) { + $contents = $this->obj->getContents(); + $count = count($contents); +} ?> obj)) : ?> diff --git a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml index ffa7b36a3..4351057e3 100644 --- a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml @@ -1,6 +1,8 @@ obj->getContents(); -$count = count($contents); +if (isset($this->obj)) { + $contents = $this->obj->getContents(); + $count = count($contents); +} ?> obj)) : ?> From ae5b6e58d76b5c6c21c25b46c712c1701930fe4c Mon Sep 17 00:00:00 2001 From: James Date: Thu, 9 Aug 2012 11:03:57 -0400 Subject: [PATCH 2/6] CC-4144: Playlist Builder: Adding smart playlist into regular playlist will reset the Fade in/out settings to default value - fixed --- .../controllers/PlaylistController.php | 3 +- airtime_mvc/application/models/Playlist.php | 25 ++++++++-------- airtime_mvc/public/js/airtime/library/spl.js | 29 +++++++++++++------ 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index da78aa47c..b8468af6b 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -195,15 +195,16 @@ class PlaylistController extends Zend_Controller_Action $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new Application_Model_User($userInfo->id); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $this->view->obj = $obj; if($isAdminOrPM || $obj->getCreatorId() == $userInfo->id){ - $this->view->obj = $obj; if($this->obj_sess->type == "block"){ $form = new Application_Form_SmartBlockCriteria(); $form->startForm($this->obj_sess->id); $this->view->form = $form; } } + $formatter = new LengthFormatter($obj->getLength()); $this->view->length = $formatter->format(); $this->view->type = $this->obj_sess->type; diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 60feea8fd..a6d540784 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -172,19 +172,19 @@ class Application_Model_Playlist */ $sql = <<<"EOT" (SELECT * FROM -((SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, - f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_playlistcontents AS pc +((SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, + f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_playlistcontents AS pc JOIN cc_files AS f ON pc.file_id=f.id WHERE pc.playlist_id = {$this->id} AND type = 0) UNION ALL -(SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, -ws.id as item_id, (ws.name || ': ' || ws.url) as title, sub.login as creator, 't'::boolean as exists, ws.url as path FROM cc_playlistcontents AS pc -JOIN cc_webstream AS ws on pc.stream_id=ws.id +(SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, +ws.id as item_id, (ws.name || ': ' || ws.url) as title, sub.login as creator, 't'::boolean as exists, ws.url as path FROM cc_playlistcontents AS pc +JOIN cc_webstream AS ws on pc.stream_id=ws.id LEFT JOIN cc_subjs as sub on sub.id = ws.creator_id WHERE pc.playlist_id = {$this->id} AND pc.type = 1) UNION ALL -(SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, -bl.id as item_id, bl.name as title, sbj.login as creator, 't'::boolean as exists, NULL::text as path FROM cc_playlistcontents AS pc -JOIN cc_block AS bl on pc.block_id=bl.id +(SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout, +bl.id as item_id, bl.name as title, sbj.login as creator, 't'::boolean as exists, NULL::text as path FROM cc_playlistcontents AS pc +JOIN cc_block AS bl on pc.block_id=bl.id JOIN cc_subjs as sbj ON bl.creator_id=sbj.id WHERE pc.playlist_id = {$this->id} AND pc.type = 2)) as temp ORDER BY temp.position); EOT; @@ -343,7 +343,7 @@ EOT; throw new Exception("Unknown file type"); } - if (isset($obj)) { + if (isset($obj)) { if (($obj instanceof CcFiles && $obj->getDbFileExists()) || $obj instanceof CcWebstream || $obj instanceof CcBlock) { $entry = $this->plItem; $entry["id"] = $obj->getDbId(); @@ -559,8 +559,9 @@ EOT; ->filterByDbPosition($pos) ->findOne(); - - + if (!$row) { + return NULL; + } #Propel returns values in form 00.000000 format which is for only seconds. $fadeIn = $row->getDbFadein(); $fadeOut = $row->getDbFadeout(); @@ -864,7 +865,7 @@ EOT; } } - // This function returns that are not owen by $p_user_id among $p_ids + // This function returns that are not owen by $p_user_id among $p_ids private static function playlistsNotOwnedByUser($p_ids, $p_userId){ $ownedByUser = CcPlaylistQuery::create()->filterByDbCreatorId($p_userId)->find()->getData(); $selectedPls = $p_ids; diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 90787fabb..f0a5354eb 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -379,7 +379,6 @@ var AIRTIME = (function(AIRTIME){ var isStatic = data.isStatic; delete data.type; if (isStatic) { - console.log(data); $.each(data, function(index, ele){ if (ele.track_title !== undefined) { $html += "
"+ele.track_title+" "+ele.creator+" "+ele.length+"
"; @@ -452,14 +451,26 @@ var AIRTIME = (function(AIRTIME){ playlistError(json); } else { - $pl.find("span.spl_main_fade_in") - .empty() - .append(json.fadeIn); - - $pl.find("span.spl_main_fade_out") - .empty() - .append(json.fadeOut); - + var fadeIn = $pl.find("span.spl_main_fade_in"); + var fadeOut = $pl.find("span.spl_main_fade_out"); + console.log(json); + if (json.fadeIn == null) { + console.log("fadein is null"); + fadeIn.parent().prev().hide(); + fadeIn.hide(); + } else { + fadeIn.parent().prev().show(); + fadeIn.show(); + fadeIn.empty().append(json.fadeIn); + } + if (json.fadeOut == null) { + fadeOut.parent().prev().hide(); + fadeOut.hide(); + } else { + fadeOut.parent().prev().show(); + fadeOut.show(); + fadeOut.empty().append(json.fadeOut); + } $pl.find("#crossfade_main").show(); } }); From 677d523ef46f0698a9921fab54fc92ee088dac09 Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 9 Aug 2012 11:20:49 -0400 Subject: [PATCH 3/6] CC-4187: Media Library -> Regular Playlist : Use legend instead of label for different elements in context view -done --- .../library/get-file-metadata.ajax.phtml | 50 ++++++++++++------- airtime_mvc/public/css/styles.css | 28 ++++++++--- 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml index ca14ac39f..468bcf57c 100644 --- a/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml +++ b/airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml @@ -23,19 +23,31 @@ type == "playlist" || $this->type == "block") : ?> -
Name:md["dc:title"]);?>
-
Creator:md["dc:creator"]);?>
-type == "block" && $this->blType == "Dynamic") { ?> -
Length:block->getFormattedLength();?>
- -
Length:md["dcterms:extent"]);?>
+
+ Name:md["dc:title"]);?>
+ Creator:md["dc:creator"]);?>
+ type == "block" && $this->blType == "Dynamic") { ?> + Length:block->getFormattedLength();?>
+ + Length:md["dcterms:extent"]);?>
+ + Description:md["dc:description"]);?> +
+ +type == "playlist") { ?> +
+o Web Stream
+o Dynamic Playlist
+o Static Playlist
+o Audio Track +
-
Description:md["dc:description"]);?>
+ type == "playlist" || ($this->type == "block" && $this->blType == "Static")) {?> type == "playlist") { ?> -
Playlist Contents:
+
Playlist Contents:
-
Static Playlist Contents:
+
Static Playlist Contents:
contents as $row) : ?> @@ -52,14 +64,17 @@ isStatic(); ?> - '> - - '> + + + + + + @@ -71,7 +86,7 @@
getFormattedLength(); ?>
blType == "Dynamic") { ?> -
Dynamic Playlist Criteria:
+
Dynamic Playlist Criteria:
contents["crit"] as $criterias) : ?> @@ -84,13 +99,14 @@ if (strlen($crit["display_name"]) > $critMaxStrLen) { $crit["display_name"] = substr($crit["display_name"], 0, 12)."..."; } - if (strlen($crit["modifier"]) > $critMaxStrLen) { - $crit["modifier"] = substr($crit["modifier"], 0, 12)."..."; + $modMaxStrLen = 16; + if (strlen($crit["modifier"]) > $modMaxStrLen) { + $crit["modifier"] = substr($crit["modifier"], 0, 15)."..."; } ?> - - + + diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index b4a398055..41d230e8a 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -446,11 +446,7 @@ table.library-get-file-md.table-small{ white-space: nowrap; } -.file-md-qtip-criteria-width-crit{ - width:70px; -} - -.file-md-qtip-criteria-width-mod{ +.file-md-qtip-criteria-width-small{ width:70px; } @@ -477,13 +473,29 @@ table.library-get-file-md.table-small{ font-style: italic; } -.file-md-qtip-playlist.dynamic td{ - color: #63a2f0; +.file-md-qtip-left{ + float: left; + width: 60%; } -.file-md-qtip-playlist.static td{ +.file-md-qtip-legend { + float: right; + width: 30%; + font-size: 9px; + padding: 0px; + vertical-align:top; + line-height: 13px; +} +.static { color: #f09839; } +.dynamic { + color: #63a2f0; +} +.webstream { + color: #4eba70; +} + /***** LIBRARY QTIP METADATA SPECIFIC STYLES END *****/ From 685354e000d34847d4f67387af8de62a69636621 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 9 Aug 2012 11:44:27 -0400 Subject: [PATCH 4/6] CC-4189: Playlist Builder -> Smart Playlist: Cannot change the position of manually added tracks - fixed --- airtime_mvc/application/models/Block.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 0078f6766..135d0ef41 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -196,7 +196,8 @@ class Application_Model_Block f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_blockcontents AS pc LEFT JOIN cc_files AS f ON pc.file_id=f.id LEFT JOIN cc_block AS bl ON pc.block_id = bl.id - WHERE pc.block_id = {$this->id}; + WHERE pc.block_id = {$this->id} + ORDER BY pc.position; EOT; $con = Propel::getConnection(); $rows = $con->query($sql)->fetchAll(); From ef0e800c92c1fb250af4ff808d7a8b2e00a8e0a5 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 9 Aug 2012 14:12:30 -0400 Subject: [PATCH 5/6] CC-4186: Playlist Builder -> Smart Playlist : The static Smart Playlist's length value will be empty if no file meet the criteria. - fixed --- airtime_mvc/application/models/Block.php | 1 + airtime_mvc/application/views/scripts/playlist/playlist.phtml | 4 ++-- .../application/views/scripts/playlist/smart-block.phtml | 4 ++-- airtime_mvc/public/js/airtime/library/spl.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 135d0ef41..5fa5e802a 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -883,6 +883,7 @@ EOT; public function deleteAllFilesFromBlock() { CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete(); + $this->block->reload(); } // smart block functions start diff --git a/airtime_mvc/application/views/scripts/playlist/playlist.phtml b/airtime_mvc/application/views/scripts/playlist/playlist.phtml index 7d1a77021..795c44a6d 100644 --- a/airtime_mvc/application/views/scripts/playlist/playlist.phtml +++ b/airtime_mvc/application/views/scripts/playlist/playlist.phtml @@ -17,10 +17,10 @@ if (isset($this->obj)) {
-

+

obj->getName(); ?>

-

length; ?>

+

length; ?>

diff --git a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml index 4351057e3..457615882 100644 --- a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml @@ -17,10 +17,10 @@ if (isset($this->obj)) {
-

+

obj->getName(); ?>

-

length; ?>

+

length; ?>

diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index f0a5354eb..c3ecab51e 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -296,7 +296,7 @@ var AIRTIME = (function(AIRTIME){ $('#spl_name > a') .empty() .append(json.name); - $('#spl_length') + $('#obj_length') .empty() .append(json.length); $('#fieldset-metadate_change textarea') From 1367bde7286c61b3f32132598a0a35fcdef3cc03 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 9 Aug 2012 14:18:15 -0400 Subject: [PATCH 6/6] CC-4185: Playlist Builder -> Smart Playlist: Able to create Smart Playlist more than 24 hours - fixed --- airtime_mvc/application/models/Block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 5fa5e802a..63bbb0bc0 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -945,7 +945,7 @@ EOT; $error[] = "Limit cannot be empty or smaller than 0"; } else { $mins = $data['etc']['sp_limit_value'] * $multiplier; - if ($mins > 14400) { + if ($mins > 1440) { $error[] = "Limit cannot be more than 24 hrs"; } }
to