Merge branch '2.2.x' of dev.sourcefabric.org:airtime into 2.2.x
This commit is contained in:
commit
90f14584b5
|
@ -176,7 +176,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||||
if ($obj_sess->type === "playlist") {
|
if ($obj_sess->type === "playlist") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||||
} elseif ($obj_sess->type === "block") {
|
} elseif ($obj_sess->type === "block" && $obj->isStatic()) {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Smart Block", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> "Add to Smart Block", "icon" => "add-playlist", "icon" => "copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -513,7 +513,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
} catch (BlockNotFoundException $e) {
|
} catch (BlockNotFoundException $e) {
|
||||||
$this->playlistNotFound('block', true);
|
$this->playlistNotFound('block', true);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Logging::info($e);
|
Logging::info($e);
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1191,7 +1191,7 @@ SQL;
|
||||||
$sizeOfInsert = count($insertList);
|
$sizeOfInsert = count($insertList);
|
||||||
|
|
||||||
// if block is not full and reapeat_track is check, fill up more
|
// if block is not full and reapeat_track is check, fill up more
|
||||||
while (!$isBlockFull && $repeat == 1) {
|
while (!$isBlockFull && $repeat == 1 && $sizeOfInsert > 0) {
|
||||||
$randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert));
|
$randomEleKey = array_rand(array_slice($insertList, 0, $sizeOfInsert));
|
||||||
$insertList[] = $insertList[$randomEleKey];
|
$insertList[] = $insertList[$randomEleKey];
|
||||||
$totalTime += $insertList[$randomEleKey]['length'];
|
$totalTime += $insertList[$randomEleKey]['length'];
|
||||||
|
|
|
@ -193,7 +193,8 @@ class Application_Model_Scheduler
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
||||||
foreach ($dynamicFiles as $fileId=>$f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->getDbFileExists()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
|
@ -250,7 +251,8 @@ class Application_Model_Scheduler
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
$dynamicFiles = $bl->getListOfFilesUnderLimit();
|
||||||
foreach ($dynamicFiles as $fileId=>$f) {
|
foreach ($dynamicFiles as $f) {
|
||||||
|
$fileId = $f['id'];
|
||||||
$file = CcFilesQuery::create()->findPk($fileId);
|
$file = CcFilesQuery::create()->findPk($fileId);
|
||||||
if (isset($file) && $file->getDbFileExists()) {
|
if (isset($file) && $file->getDbFileExists()) {
|
||||||
$data["id"] = $file->getDbId();
|
$data["id"] = $file->getDbId();
|
||||||
|
@ -445,7 +447,6 @@ class Application_Model_Scheduler
|
||||||
} else {
|
} else {
|
||||||
$sched = new CcSchedule();
|
$sched = new CcSchedule();
|
||||||
}
|
}
|
||||||
Logging::info($file);
|
|
||||||
$sched->setDbStarts($nextStartDT)
|
$sched->setDbStarts($nextStartDT)
|
||||||
->setDbEnds($endTimeDT)
|
->setDbEnds($endTimeDT)
|
||||||
->setDbCueIn($file['cuein'])
|
->setDbCueIn($file['cuein'])
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if (isset($this->obj)) : ?>
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<button class="btn btn-inverse" type="submit" id="webstream_save" name="submit">Save</button>
|
<button class="btn btn-inverse" type="submit" id="webstream_save" name="submit">Save</button>
|
||||||
</div>
|
</div>
|
||||||
<?php if (isset($this->obj)) : ?>
|
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button>
|
<button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,10 +8,16 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
mod = AIRTIME.library;
|
mod = AIRTIME.library;
|
||||||
|
|
||||||
mod.checkAddButton = function() {
|
mod.checkAddButton = function() {
|
||||||
var selected = mod.getChosenItemsLength(), sortable = $('#spl_sortable'), check = false;
|
|
||||||
|
|
||||||
// make sure audioclips are selected and a playlist is currently open.
|
var selected = mod.getChosenItemsLength(),
|
||||||
if (selected !== 0 && sortable.length !== 0) {
|
sortable = $('#spl_sortable:visible'),
|
||||||
|
check = false,
|
||||||
|
blockType = $('input[name=sp_type]:checked', '#smart-block-form').val();
|
||||||
|
|
||||||
|
// make sure audioclips are selected and a playlist or static block is currently open.
|
||||||
|
// static blocks have value of 0
|
||||||
|
// dynamic blocks have value of 1
|
||||||
|
if (selected !== 0 && (sortable.length !== 0 || blockType === "0")) {
|
||||||
check = true;
|
check = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +102,10 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
cursor : 'pointer',
|
cursor : 'pointer',
|
||||||
|
cursorAt: {
|
||||||
|
top: 30,
|
||||||
|
left: 100
|
||||||
|
},
|
||||||
connectToSortable : '#spl_sortable'
|
connectToSortable : '#spl_sortable'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -202,6 +202,7 @@ function setSmartBlockEvents() {
|
||||||
/********** CHANGE PLAYLIST TYPE **********/
|
/********** CHANGE PLAYLIST TYPE **********/
|
||||||
form.find('dd[id="sp_type-element"]').live("change", function(){
|
form.find('dd[id="sp_type-element"]').live("change", function(){
|
||||||
setupUI();
|
setupUI();
|
||||||
|
AIRTIME.library.checkAddButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
/********** CRITERIA CHANGE **********/
|
/********** CRITERIA CHANGE **********/
|
||||||
|
|
Loading…
Reference in New Issue