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

This commit is contained in:
Martin Konecny 2012-04-19 15:03:28 -04:00
commit 1e111f176e
15 changed files with 579 additions and 54 deletions

View File

@ -263,9 +263,10 @@ class ScheduleController extends Zend_Controller_Action
}
} else {
if($instance->isRepeating()){
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array());
/*$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array());
$menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/populate-show-instance-form");
$menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");
$menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");*/
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
}else{
if($instance->isRebroadcast()){
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/populate-show-form");
@ -284,9 +285,10 @@ class ScheduleController extends Zend_Controller_Action
if ($isAdminOrPM || $isDJ) {
if($instance->isRepeating()){
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array());
/*$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array());
$menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/populate-show-instance-form");
$menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");
$menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");*/
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form");
}else{
if($instance->isRebroadcast()){
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/populate-show-form");
@ -439,7 +441,9 @@ class ScheduleController extends Zend_Controller_Action
unset($this->view->showContent);
}
public function populateShowInstanceFormAction(){
// we removed edit show instance option in menu item
// this feature is disabled in 2.1 and should be back in 2.2
/*public function populateShowInstanceFormAction(){
$formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho();
$formWhen = new Application_Form_AddShowWhen();
@ -496,15 +500,15 @@ class ScheduleController extends Zend_Controller_Action
$formRepeats->disable();
$formStyle->disable();
/*
$formRecord->disable();
$formAbsoluteRebroadcast->disable();
$formRebroadcast->disable();
*/
//$formRecord->disable();
//$formAbsoluteRebroadcast->disable();
//$formRebroadcast->disable();
$this->view->action = "edit-show-instance";
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
}
}*/
public function populateShowFormAction()
{
@ -518,12 +522,12 @@ class ScheduleController extends Zend_Controller_Action
// repeating shows. It's value is either "instance","rebroadcast", or "all"
$type = $this->_getParam('type');
if($type == "rebroadcast") {
$this->view->action = "edit-show-rebroadcast";
/*if($type == "rebroadcast") {
//$this->view->action = "edit-show-rebroadcast";
} else {
$this->view->action = "edit-show";
}
}*/
$this->view->action = "edit-show";
try{
$showInstance = new Application_Model_ShowInstance($showInstanceId);
}catch(Exception $e){
@ -677,10 +681,6 @@ class ScheduleController extends Zend_Controller_Action
$formRepeats->disable();
$formStyle->disable();
}
if($type == "rebroadcast"){
$formWhen->disable();
}
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
$this->view->entries = 5;
@ -726,7 +726,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->edit = true;
}
public function editShowInstanceAction(){
/*public function editShowInstanceAction(){
$js = $this->_getParam('data');
$data = array();
@ -743,7 +743,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->addNewShow = false;
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
}
}
}*/
public function editShowAction(){
@ -775,6 +775,7 @@ class ScheduleController extends Zend_Controller_Action
if (!array_key_exists('add_show_start_time', $data)){
$startTime = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartTime());
$data['add_show_start_time'] = $startTime->format("H:i");
$validateStartTime = false;
}
$validateStartDate = false;
}
@ -789,6 +790,9 @@ class ScheduleController extends Zend_Controller_Action
if (!$validateStartDate){
$this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true));
}
if(!$validateStartTime){
$this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true));
}
$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
$this->view->addNewShow = false;
$this->view->form = $this->view->render('schedule/add-show-form.phtml');

View File

@ -1265,9 +1265,7 @@ class Application_Model_Show {
Logging::log('$start time of non repeating record '.$start);
if ($newInstance){
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
}
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
}
}

View File

@ -45,8 +45,8 @@ class CcShowTableMap extends TableMap {
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
$this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null);
$this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null);
$this->addColumn('LIVE_STREAM_USING_AIRTIME_AUTH', 'DbLiveStreamUsingAirtimeAuth', 'BOOLEAN', false, null, null);
$this->addColumn('LIVE_STREAM_USING_CUSTOM_AUTH', 'DbLiveStreamUsingCustomAuth', 'BOOLEAN', false, null, null);
$this->addColumn('LIVE_STREAM_USING_AIRTIME_AUTH', 'DbLiveStreamUsingAirtimeAuth', 'BOOLEAN', false, null, false);
$this->addColumn('LIVE_STREAM_USING_CUSTOM_AUTH', 'DbLiveStreamUsingCustomAuth', 'BOOLEAN', false, null, false);
$this->addColumn('LIVE_STREAM_USER', 'DbLiveStreamUser', 'VARCHAR', false, 255, null);
$this->addColumn('LIVE_STREAM_PASS', 'DbLiveStreamPass', 'VARCHAR', false, 255, null);
// validators

View File

@ -71,12 +71,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent
/**
* The value for the live_stream_using_airtime_auth field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $live_stream_using_airtime_auth;
/**
* The value for the live_stream_using_custom_auth field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $live_stream_using_custom_auth;
@ -138,6 +140,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->name = '';
$this->url = '';
$this->genre = '';
$this->live_stream_using_airtime_auth = false;
$this->live_stream_using_custom_auth = false;
}
/**
@ -412,7 +416,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$v = (boolean) $v;
}
if ($this->live_stream_using_airtime_auth !== $v) {
if ($this->live_stream_using_airtime_auth !== $v || $this->isNew()) {
$this->live_stream_using_airtime_auth = $v;
$this->modifiedColumns[] = CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH;
}
@ -432,7 +436,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$v = (boolean) $v;
}
if ($this->live_stream_using_custom_auth !== $v) {
if ($this->live_stream_using_custom_auth !== $v || $this->isNew()) {
$this->live_stream_using_custom_auth = $v;
$this->modifiedColumns[] = CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH;
}
@ -502,6 +506,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return false;
}
if ($this->live_stream_using_airtime_auth !== false) {
return false;
}
if ($this->live_stream_using_custom_auth !== false) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()

View File

@ -75,7 +75,6 @@ $(document).ready(function(){
<ul class="jp-controls">
<li><a title="mute" tabindex="1" class="jp-mute" href="javascript:;">mute</a></li>
<li><a title="unmute" tabindex="1" class="jp-unmute" href="javascript:;">unmute</a></li>
<!--<li><a title="max volume" tabindex="1" class="jp-volume-max" href="javascript:;">max volume</a></li>-->
</ul>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>

View File

@ -146,8 +146,8 @@
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
<column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/>
<column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/>
<column name="live_stream_using_airtime_auth" phpName="DbLiveStreamUsingAirtimeAuth" type="BOOLEAN" required="false"/>
<column name="live_stream_using_custom_auth" phpName="DbLiveStreamUsingCustomAuth" type="BOOLEAN" required="false"/>
<column name="live_stream_using_airtime_auth" phpName="DbLiveStreamUsingAirtimeAuth" type="BOOLEAN" required="false" defaultValue="false"/>
<column name="live_stream_using_custom_auth" phpName="DbLiveStreamUsingCustomAuth" type="BOOLEAN" required="false" defaultValue="false"/>
<column name="live_stream_user" phpName="DbLiveStreamUser" type="VARCHAR" size="255" required="false"/>
<column name="live_stream_pass" phpName="DbLiveStreamPass" type="VARCHAR" size="255" required="false"/>
</table>

View File

@ -178,8 +178,8 @@ CREATE TABLE "cc_show"
"description" VARCHAR(512),
"color" VARCHAR(6),
"background_color" VARCHAR(6),
"live_stream_using_airtime_auth" BOOLEAN,
"live_stream_using_custom_auth" BOOLEAN,
"live_stream_using_airtime_auth" BOOLEAN default 'f',
"live_stream_using_custom_auth" BOOLEAN default 'f',
"live_stream_user" VARCHAR(255),
"live_stream_pass" VARCHAR(255),
PRIMARY KEY ("id")

View File

@ -434,7 +434,7 @@ function init() {
$('.listen-control-button').click(function() {
if (stream_window == null || stream_window.closed)
stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=178');
stream_window=window.open(baseUrl+"Dashboard/stream-player", 'name', 'width=400,height=158');
stream_window.focus();
return false;
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

View File

@ -18,11 +18,7 @@ class Version20120405114454 extends AbstractMigration
$cc_subjs_token->addColumn('token', 'string', array('length' => 40, 'notnull' => 1));
$cc_subjs_token->addColumn('created', 'datetime', array('notnull' => 1));
$cc_subjs_token->setPrimaryKey(array('id'));
$cc_subjs = $schema->getTable('cc_subjs');
$cc_subjs_token->addNamedForeignKeyConstraint('cc_subjs_token_userid_fkey', $cc_subjs, array('user_id'), array('id'));
$cc_subjs_token->addUniqueIndex(array('token'), 'uniq_token');
$cc_subjs_token->setPrimaryKey(array('id'));
//end create cc_subjs_token table
}

View File

@ -12,6 +12,14 @@ class Version20120410104441 extends AbstractMigration
*/
public function up(Schema $schema)
{
$this->_addSql("DROP TRIGGER calculate_position ON cc_playlistcontents");
$this->_addSql("DROP FUNCTION calculate_position()");
$this->_addSql("ALTER TABLE cc_subjs_token ALTER COLUMN created TYPE timestamp");
$this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_idx UNIQUE (token);");
$this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_userid_fkey FOREIGN KEY (user_id) REFERENCES cc_subjs(id) ON DELETE CASCADE");
//add temp columns for changing bitrate and sample rate to integers.
$this->_addSql("ALTER TABLE cc_files ADD temp_br integer");
$this->_addSql("ALTER TABLE cc_files ADD temp_sr integer");
@ -26,8 +34,8 @@ class Version20120410104441 extends AbstractMigration
$this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_br TO bit_rate");
//add utime, lptime
$this->_addSql("ALTER TABLE cc_files ADD utime timestamp(6)");
$this->_addSql("ALTER TABLE cc_files ADD lptime timestamp(6)");
$this->_addSql("ALTER TABLE cc_files ADD utime timestamp");
$this->_addSql("ALTER TABLE cc_files ADD lptime timestamp");
//setting these to a default now for timeline refresh purposes.
$now = gmdate("Y-m-d H:i:s");

View File

@ -19,7 +19,7 @@ class Version20120410143340 extends AbstractMigration
$this->_addSql("ALTER TABLE cc_playlist ADD CONSTRAINT cc_playlist_createdby_fkey FOREIGN KEY (creator_id) REFERENCES cc_subjs(id) NOT DEFERRABLE INITIALLY IMMEDIATE");
$this->_addSql("ALTER TABLE cc_playlist ADD utime timestamp(6)");
$this->_addSql("ALTER TABLE cc_playlist ADD utime timestamp");
//set the initial created to modified time since this is the closest we can get to inital creation time.
$this->_addSql("UPDATE cc_playlist SET utime = mtime");

View File

@ -14,24 +14,27 @@ class Version20120411102907 extends AbstractMigration
*/
public function up(Schema $schema)
{
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval");
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN file_exists DROP NOT NULL");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cuein TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cuein TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length TYPE interval DEFAULT '00:00:00'");
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled TYPE interval");
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled TYPE interval DEFAULT '00:00:00'");
//remove old columns from cc_schedule that deal with groups or playlists.
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN group_id");
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN schedule_group_played");
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN playlist_id");
$this->_addSql("ALTER TABLE cc_schedule ADD playout_status integer DEFAULT 1 NOT NULL");
$this->_addSql("ALTER TABLE cc_schedule ADD playout_status smallint DEFAULT 1 NOT NULL");
$this->_addSql("ALTER TABLE cc_music_dirs ALTER COLUMN exists DROP NOT NULL, ALTER COLUMN watched DROP NOT NULL");
}
public function down(Schema $schema)

View File

@ -12,8 +12,8 @@ class Version20120411174904 extends AbstractMigration
*/
public function up(Schema $schema)
{
$this->_addSql("ALTER TABLE cc_show_instances ADD created timestamp(6)");
$this->_addSql("ALTER TABLE cc_show_instances ADD last_scheduled timestamp(6)");
$this->_addSql("ALTER TABLE cc_show_instances ADD created timestamp");
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN created SET NOT NULL");
//setting these to a default now for timeline refresh purposes.
$now = gmdate("Y-m-d H:i:s");