From 4b12b4e01e2ead8a22c75805747d45f1a27da9be Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Nov 2011 10:15:44 -0500 Subject: [PATCH 1/6] SAAS-63: airtime-saas: Something is broken in Preference.php - fixed --- airtime_mvc/application/models/Preference.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index f7fca885e..0d417ccdb 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -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 { From 6c740effde2229819a990f709c635ce006d22c94 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Nov 2011 13:13:21 -0500 Subject: [PATCH 2/6] SAAS-52: New auto-feedback metrics: 1) Debian or manual install, 2) SaaS or Non-SaaS - done --- airtime_mvc/application/models/Preference.php | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 0d417ccdb..af7ea4924 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -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){ From 32743ca780ace65442b5ba7af3e12a30715f0924 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Nov 2011 13:35:22 -0500 Subject: [PATCH 3/6] CC-3016: Import files doesn't work on Debian(1.9.5, 2.0) - added extra comment --- .../media-monitor/airtimefilemonitor/airtimeprocessevent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py index af8658c2a..cfd605cf2 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py @@ -274,7 +274,8 @@ class AirtimeProcessEvent(ProcessEvent): # check if file exist # When whole directory is copied to the organized dir, # inotify doesn't fire IN_CLOSE_WRITE, hench we need special way of - # handling those cases. + # handling those cases. We are manully calling handle_created_file + # function. if os.path.exists(k): # check if file is open command = "lsof "+k From c3d35df55cb9a7a90664d18cf726da001704d363 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Nov 2011 14:29:52 -0500 Subject: [PATCH 4/6] CC-3026: Schedule Media: The show time displayed in this window is UTC time - fixed --- .../application/controllers/ScheduleController.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 6e8e445fa..cc4acd49e 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -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'); From 8f75bf18705daeb66db4232a4477c6151629c09b Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Wed, 9 Nov 2011 15:35:14 -0500 Subject: [PATCH 5/6] CC-2966: Remove minimum and maximum logo sizes - make them recommended instead Fixed by: 1. change wording 2. attach custom filter to the logo upload form, the filter scales down the image if it's larger than 600x600 --- .../application/forms/RegisterAirtime.php | 10 ++--- .../application/forms/SupportSettings.php | 10 ++--- .../forms/customfilters/ImageSize.php | 42 +++++++++++++++++++ .../views/scripts/form/register-dialog.phtml | 2 +- .../views/scripts/form/support-setting.phtml | 2 +- 5 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 airtime_mvc/application/forms/customfilters/ImageSize.php diff --git a/airtime_mvc/application/forms/RegisterAirtime.php b/airtime_mvc/application/forms/RegisterAirtime.php index 694224b9d..4ca52e27c 100644 --- a/airtime_mvc/application/forms/RegisterAirtime.php +++ b/airtime_mvc/application/forms/RegisterAirtime.php @@ -1,5 +1,7 @@ setRequired(false) ->setDecorators(array('File')) ->addValidator('Count', false, 1) - ->addValidator('Extension', false, 'jpg,png,gif') - ->addValidator('ImageSize', false, array( - 'minwidth' => 200, - 'minheight' => 200, - 'maxwidth' => 600, - 'maxheight' => 600)); + ->addValidator('Extension', false, 'jpg,jpeg,png,gif') + ->addFilter('ImageSize'); $this->addElement($upload); //enable support feedback diff --git a/airtime_mvc/application/forms/SupportSettings.php b/airtime_mvc/application/forms/SupportSettings.php index 605e85878..f0956cdf7 100644 --- a/airtime_mvc/application/forms/SupportSettings.php +++ b/airtime_mvc/application/forms/SupportSettings.php @@ -1,5 +1,7 @@ setRequired(false) ->setDecorators(array('File')) ->addValidator('Count', false, 1) - ->addValidator('Extension', false, 'jpg,png,gif') - ->addValidator('ImageSize', false, array( - 'minwidth' => 200, - 'minheight' => 200, - 'maxwidth' => 600, - 'maxheight' => 600)); + ->addValidator('Extension', false, 'jpg,jpeg,png,gif') + ->addFilter('ImageSize'); $upload->setAttrib('accept', 'image/jpeg,image/gif,image/png,image/jpg'); $this->addElement($upload); diff --git a/airtime_mvc/application/forms/customfilters/ImageSize.php b/airtime_mvc/application/forms/customfilters/ImageSize.php new file mode 100644 index 000000000..9dcfffffe --- /dev/null +++ b/airtime_mvc/application/forms/customfilters/ImageSize.php @@ -0,0 +1,42 @@ + diff --git a/airtime_mvc/application/views/scripts/form/register-dialog.phtml b/airtime_mvc/application/views/scripts/form/register-dialog.phtml index acb461be5..8faeb5913 100644 --- a/airtime_mvc/application/views/scripts/form/register-dialog.phtml +++ b/airtime_mvc/application/views/scripts/form/register-dialog.phtml @@ -144,7 +144,7 @@ element->getElement('Logo') ?> -

Min. size: 200x200 Max. size: 600x600

+

Note: Anything larger than 600x600 will be resized.

element->getElement('Logo')->hasErrors()) : ?>
    element->getElement('Logo')->getMessages() as $error): ?> diff --git a/airtime_mvc/application/views/scripts/form/support-setting.phtml b/airtime_mvc/application/views/scripts/form/support-setting.phtml index 9794f8159..e4b1621c4 100644 --- a/airtime_mvc/application/views/scripts/form/support-setting.phtml +++ b/airtime_mvc/application/views/scripts/form/support-setting.phtml @@ -138,7 +138,7 @@ element->getElement('Logo') ?> -

    Min. size: 200x200 Max. size: 600x600

    +

    Note: Anything larger than 600x600 will be resized.

    element->getElement('Logo')->hasErrors()) : ?>
      element->getElement('Logo')->getMessages() as $error): ?> From 5d741d84ee115b0a90c1817a61ec1bb7954a7430 Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Wed, 9 Nov 2011 16:03:32 -0500 Subject: [PATCH 6/6] CC-3001: Preferences->"Submit" button renamed to "Save", and should be at the top and the bottom of the screen Changed all other buttons that says "Submit" to "Save. Also added some CSS stuff so that the "Save" button at the top of Preference page have some space between itself and the form below. --- airtime_mvc/application/forms/AddUser.php | 2 +- airtime_mvc/application/forms/AdvancedSearch.php | 2 +- airtime_mvc/application/forms/EditAudioMD.php | 2 +- airtime_mvc/application/forms/PlaylistMetadata.php | 2 +- airtime_mvc/application/forms/SupportSettings.php | 2 +- airtime_mvc/public/css/styles.css | 4 ++++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/forms/AddUser.php b/airtime_mvc/application/forms/AddUser.php index 43b76495c..1f00f7865 100644 --- a/airtime_mvc/application/forms/AddUser.php +++ b/airtime_mvc/application/forms/AddUser.php @@ -81,7 +81,7 @@ class Application_Form_AddUser extends Zend_Form $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('class', 'ui-button ui-state-default right-floated'); $submit->setIgnore(true); - $submit->setLabel('Submit'); + $submit->setLabel('Save'); $this->addElement($submit); } diff --git a/airtime_mvc/application/forms/AdvancedSearch.php b/airtime_mvc/application/forms/AdvancedSearch.php index ff074718b..4c15795b7 100644 --- a/airtime_mvc/application/forms/AdvancedSearch.php +++ b/airtime_mvc/application/forms/AdvancedSearch.php @@ -16,7 +16,7 @@ class Application_Form_AdvancedSearch extends Zend_Form // Add the submit button $this->addElement('button', 'search_submit', array( 'ignore' => true, - 'label' => 'Submit', + 'label' => 'Save', 'order' => '-1' )); $this->getElement('search_submit')->removeDecorator('DtDdWrapper'); diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php index 423ef1025..a4968644f 100644 --- a/airtime_mvc/application/forms/EditAudioMD.php +++ b/airtime_mvc/application/forms/EditAudioMD.php @@ -134,7 +134,7 @@ class Application_Form_EditAudioMD extends Zend_Form $this->addElement('submit', 'submit', array( 'ignore' => true, 'class' => 'ui-button ui-state-default', - 'label' => 'Submit', + 'label' => 'Save', 'decorators' => array( 'ViewHelper' ) diff --git a/airtime_mvc/application/forms/PlaylistMetadata.php b/airtime_mvc/application/forms/PlaylistMetadata.php index 15de97699..d53a4ddab 100644 --- a/airtime_mvc/application/forms/PlaylistMetadata.php +++ b/airtime_mvc/application/forms/PlaylistMetadata.php @@ -24,7 +24,7 @@ class Application_Form_PlaylistMetadata extends Zend_Form{ // Add the comment element $this->addElement('button', 'new_playlist_submit', array( - 'label' => 'Submit', + 'label' => 'Save', 'ignore' => true )); } diff --git a/airtime_mvc/application/forms/SupportSettings.php b/airtime_mvc/application/forms/SupportSettings.php index f0956cdf7..ab97000e7 100644 --- a/airtime_mvc/application/forms/SupportSettings.php +++ b/airtime_mvc/application/forms/SupportSettings.php @@ -151,7 +151,7 @@ class Application_Form_SupportSettings extends Zend_Form $submit = new Zend_Form_Element_Submit("submit"); $submit->class = 'ui-button ui-state-default right-floated'; $submit->setIgnore(true) - ->setLabel("Submit") + ->setLabel("Save") ->setDecorators(array('ViewHelper')); $this->addElement($submit); } diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 297cc30f3..9671cf476 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -1618,6 +1618,10 @@ div.success{ width: 500px; } +.preferences .padded { + margin-top: 5px; /* Firefox needs this */ +} + dt.block-display, dd.block-display { display: block; float: none;