Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
f1e1b747ad
14 changed files with 93 additions and 37 deletions
|
@ -18,7 +18,11 @@ class NowplayingController extends Zend_Controller_Action
|
|||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
||||
|
||||
//nowplayingdatagrid.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowview.js','text/javascript');
|
||||
|
||||
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||
|
@ -104,7 +108,11 @@ class NowplayingController extends Zend_Controller_Action
|
|||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
||||
|
||||
//nowplayingdatagrid.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/nowplayingdatagrid.js','text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/nowplaying/dayview.js','text/javascript');
|
||||
}
|
||||
|
||||
|
|
|
@ -199,7 +199,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||
}
|
||||
var_dump($form->getValue('icecast_vorbis_metadata'));
|
||||
if(!$error){
|
||||
Application_Model_StreamSetting::setStreamSetting($values);
|
||||
$data = array();
|
||||
|
|
|
@ -46,8 +46,12 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile($baseUrl.'/js/fullcalendar/fullcalendar.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/timepicker/jquery.ui.timepicker-0.0.6.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/colorpicker/js/colorpicker.js','text/javascript');
|
||||
|
||||
//full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time
|
||||
$this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds");
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js','text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js','text/javascript');
|
||||
|
||||
|
|
|
@ -77,8 +77,9 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
|
|||
// which is something we don't want
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new PasswordNotEmpty(array('UploadToSoundcloudOption'=>'1'))
|
||||
)
|
||||
new ConditionalNotEmpty(array('UploadToSoundcloudOption'=>'1'))
|
||||
),
|
||||
'renderPassword' => true
|
||||
));
|
||||
|
||||
// Add the description element
|
||||
|
|
|
@ -28,7 +28,7 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
}
|
||||
|
||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Meatadata')
|
||||
$icecast_vorbis_metadata->setLabel('Icecast Vorbis Metadata')
|
||||
->setRequired(false)
|
||||
->setValue(($setting['icecast_vorbis_metadata'] == "true")?1:0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
|
|
|
@ -1538,23 +1538,44 @@ class Application_Model_Show {
|
|||
return $event;
|
||||
}
|
||||
|
||||
public function setShowFirstShow($s_date){
|
||||
/* Takes in a UTC DateTime object.
|
||||
* Converts this to local time, since cc_show days
|
||||
* requires local time. */
|
||||
public function setShowFirstShow($p_dt){
|
||||
|
||||
//clone object since we are modifying it and it was passed by reference.
|
||||
$dt = clone $p_dt;
|
||||
|
||||
$dt->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
|
||||
$showDay = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne();
|
||||
|
||||
$showDay->setDbFirstShow($s_date)
|
||||
$showDay->setDbFirstShow($dt)
|
||||
->save();
|
||||
|
||||
Logging::log("setting show's first show.");
|
||||
}
|
||||
|
||||
public function setShowLastShow($e_date){
|
||||
/* Takes in a UTC DateTime object
|
||||
* Converts this to local time, since cc_show days
|
||||
* requires local time. */
|
||||
public function setShowLastShow($p_dt){
|
||||
|
||||
//clone object since we are modifying it and it was passed by reference.
|
||||
$dt = clone $p_dt;
|
||||
|
||||
$dt->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
||||
|
||||
//add one day since the Last Show date in CcShowDays is non-inclusive.
|
||||
$dt->add(new DateInterval("P1D"));
|
||||
|
||||
$showDay = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->_showId)
|
||||
->findOne();
|
||||
|
||||
$showDay->setDbLastShow($e_date)
|
||||
$showDay->setDbLastShow($dt)
|
||||
->save();
|
||||
}
|
||||
|
||||
|
@ -1573,7 +1594,8 @@ class Application_Model_Show {
|
|||
." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
|
||||
." WHERE si.show_id = s.id"
|
||||
." AND si.starts <= TIMESTAMP '$timeNow'"
|
||||
." AND si.ends > TIMESTAMP '$timeNow'";
|
||||
." AND si.ends > TIMESTAMP '$timeNow'"
|
||||
." AND modified_instance != TRUE";
|
||||
|
||||
// Convert back to local timezone
|
||||
$rows = $CC_DBC->GetAll($sql);
|
||||
|
@ -1611,6 +1633,7 @@ class Application_Model_Show {
|
|||
." WHERE si.show_id = s.id"
|
||||
." AND si.starts >= TIMESTAMP '$timeStart'"
|
||||
." AND si.starts < TIMESTAMP $timeEnd"
|
||||
." AND modified_instance != TRUE"
|
||||
." ORDER BY si.starts";
|
||||
|
||||
// defaults to retrieve all shows within the interval if $limit not set
|
||||
|
@ -1633,6 +1656,9 @@ class Application_Model_Show {
|
|||
public static function ConvertToLocalTimeZone(&$rows, $columnsToConvert) {
|
||||
$timezone = date_default_timezone_get();
|
||||
|
||||
if (!is_array($rows)) {
|
||||
return;
|
||||
}
|
||||
foreach($rows as &$row) {
|
||||
foreach($columnsToConvert as $column) {
|
||||
$row[$column] = Application_Model_DateHelper::ConvertToLocalDateTimeString($row[$column]);
|
||||
|
|
|
@ -29,6 +29,10 @@ class Application_Model_ShowInstance {
|
|||
return new Application_Model_Show($this->getShowId());
|
||||
}
|
||||
|
||||
/* This function is weird. It should return a boolean, but instead returns
|
||||
* an integer if it is a rebroadcast, or returns null if it isn't. You can convert
|
||||
* it to boolean by using is_null(isRebroadcast), where true means isn't and false
|
||||
* means that it is. */
|
||||
public function isRebroadcast()
|
||||
{
|
||||
return $this->_showInstance->getDbOriginalShow();
|
||||
|
@ -231,9 +235,9 @@ class Application_Model_ShowInstance {
|
|||
$this->correctScheduleStartTimes();
|
||||
|
||||
$show = new Application_Model_Show($this->getShowId());
|
||||
if(!$show->isRepeating()){
|
||||
$show->setShowFirstShow($new_starts);
|
||||
$show->setShowLastShow($new_ends);
|
||||
if(!$show->isRepeating() && is_null($this->isRebroadcast())){
|
||||
$show->setShowFirstShow($newStartsDateTime);
|
||||
$show->setShowLastShow($newEndsDateTime);
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
|
|
|
@ -21,7 +21,23 @@ class Application_Model_StreamSetting {
|
|||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
|
||||
/* Retruns only global data as array*/
|
||||
public static function getGlobalData(){
|
||||
global $CC_DBC;
|
||||
$sql = "SELECT * "
|
||||
."FROM cc_stream_setting "
|
||||
."WHERE keyname IN ('output_sound_device', 'icecast_vorbis_metadata')";
|
||||
|
||||
$rows = $CC_DBC->getAll($sql);
|
||||
$data = array();
|
||||
|
||||
foreach($rows as $row){
|
||||
$data[$row["keyname"]] = $row["value"];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
/* Returns all information related to a specific stream. An example
|
||||
* of a stream id is 's1' or 's2'. */
|
||||
public static function getStreamData($p_streamId){
|
||||
|
@ -66,7 +82,6 @@ class Application_Model_StreamSetting {
|
|||
$CC_DBC->query($sql);
|
||||
}
|
||||
else{
|
||||
var_dump($key);
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
foreach($d as $k=>$v){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue