Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
ff998ea6f2
|
@ -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();
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -178,13 +178,27 @@ class Application_Model_Show {
|
|||
* Sunday are removed.
|
||||
*
|
||||
* @param array p_uncheckedDays
|
||||
* An array specifying which days should be removed.
|
||||
* An array specifying which days should be removed. (in the local timezone)
|
||||
*/
|
||||
public function removeUncheckedDaysInstances($p_uncheckedDays)
|
||||
{
|
||||
global $CC_DBC;
|
||||
|
||||
$uncheckedDaysImploded = implode(",", $p_uncheckedDays);
|
||||
|
||||
//need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC)
|
||||
$daysRemovedUTC = array();
|
||||
|
||||
$showDays = CcShowDaysQuery::create()
|
||||
->filterByDbShowId($this->getId())
|
||||
->find();
|
||||
foreach($showDays as $showDay) {
|
||||
if (in_array($showDay->getDbDay(), $p_uncheckedDays)) {
|
||||
$startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone()));
|
||||
$startDay->setTimezone(new DateTimeZone("UTC"));
|
||||
$daysRemovedUTC[] = $startDay->format("w");
|
||||
}
|
||||
}
|
||||
|
||||
$uncheckedDaysImploded = implode(",", $daysRemovedUTC);
|
||||
$showId = $this->getId();
|
||||
|
||||
$timestamp = gmdate("Y-m-d H:i:s");
|
||||
|
@ -194,9 +208,6 @@ class Application_Model_Show {
|
|||
." AND starts > TIMESTAMP '$timestamp'"
|
||||
." AND show_id = $showId";
|
||||
|
||||
Logging::log("sql for removing unchecked days");
|
||||
Logging::log($sql);
|
||||
|
||||
$CC_DBC->query($sql);
|
||||
}
|
||||
|
||||
|
@ -797,6 +808,7 @@ class Application_Model_Show {
|
|||
$daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']);
|
||||
|
||||
if (count($daysRemoved) > 0){
|
||||
|
||||
$this->removeUncheckedDaysInstances($daysRemoved);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue