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

This commit is contained in:
Yuchen Wang 2011-11-09 15:36:09 -05:00
commit 38719b1a4e
4 changed files with 86 additions and 13 deletions

View file

@ -310,13 +310,9 @@ class ScheduleController extends Zend_Controller_Action
return;
}
$start = explode(" ", $start_timestamp);
$end = explode(" ", $end_timestamp);
$startTime = explode(":", $start[1]);
$endTime = explode(":", $end[1]);
$dateInfo_s = getDate(strtotime($start_timestamp));
$dateInfo_e = getDate(strtotime($end_timestamp));
$dateInfo_s = getDate(strtotime(Application_Model_DateHelper::ConvertToLocalDateTimeString($start_timestamp)));
$dateInfo_e = getDate(strtotime(Application_Model_DateHelper::ConvertToLocalDateTimeString($end_timestamp)));
$this->view->showContent = $show->getShowContent();
$this->view->timeFilled = $show->getTimeScheduled();
$this->view->showName = $show->getName();
@ -329,8 +325,8 @@ class ScheduleController extends Zend_Controller_Action
$this->view->e_wday = $dateInfo_e['weekday'];
$this->view->e_month = $dateInfo_e['month'];
$this->view->e_day = $dateInfo_e['mday'];
$this->view->startTime = sprintf("%d:%02d", $startTime[0], $startTime[1]);
$this->view->endTime = sprintf("%d:%02d", $endTime[0], $endTime[1]);
$this->view->startTime = sprintf("%02d:%02d", $dateInfo_s['hours'], $dateInfo_s['minutes']);
$this->view->endTime = sprintf("%02d:%02d", $dateInfo_e['hours'], $dateInfo_e['minutes']);
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');

View file

@ -7,7 +7,7 @@ class Application_Model_Preference
global $CC_CONFIG, $CC_DBC;
//called from a daemon process
if(!Zend_Auth::getInstance()->hasIdentity()) {
if(!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) {
$id = NULL;
}
else {
@ -369,11 +369,16 @@ class Application_Model_Preference
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Application_Model_Schedule::getSchduledPlaylistCount();
$outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(date("Y-m-d H:i:s"));
$outputArray['UNIQUE_ID'] = self::GetUniqueId();
$outputArray['SAAS'] = self::GetPlanLevel();
$outputArray['INSTALL_METHOD'] = self::GetInstallMethod();
$outputArray = array_merge($systemInfoArray, $outputArray);
$outputString = "\n";
foreach($outputArray as $key => $out){
if($key == 'SAAS' && ($out != '' || $out != 'disabled')){
continue;
}
if($out != ''){
$outputString .= $key.' : '.$out."\n";
}
@ -386,6 +391,20 @@ class Application_Model_Preference
return $outputString;
}
}
public static function GetInstallMethod(){
$easy_install = file_exists('/usr/bin/airtime-easy-install');
$debian_install = file_exists('/var/lib/dpkg/info/airtime.config');
if($debian_install){
if($easy_install){
return "easy_install";
}else{
return "debian_install";
}
}else{
return "manual_install";
}
}
public static function SetRemindMeDate($now){
$weekAfter = mktime(0, 0, 0, date("m") , date("d")+7, date("Y"));
@ -446,7 +465,11 @@ class Application_Model_Preference
}
public static function GetPlanLevel(){
return self::GetValue("plan_level");
$plan = self::GetValue("plan_level");
if(trim($plan) == ''){
$plan = 'disabled';
}
return $plan;
}
public static function SetTrialEndingDate($date){