From 9ac024fa72a7d3fe052ece85245771a83bf7b427 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 19 Jun 2012 16:59:59 -0400 Subject: [PATCH 01/13] CC-3993: Validate that reporting stats are correct on Airtime PRO instances -done -if no log data for the past 24 hours, update current record with current date, and delete old records --- airtime_mvc/application/models/LiveLog.php | 311 ++++++++++++--------- 1 file changed, 175 insertions(+), 136 deletions(-) diff --git a/airtime_mvc/application/models/LiveLog.php b/airtime_mvc/application/models/LiveLog.php index b641ef6ef..5635f1e66 100644 --- a/airtime_mvc/application/models/LiveLog.php +++ b/airtime_mvc/application/models/LiveLog.php @@ -20,58 +20,77 @@ class Application_Model_LiveLog if ($rows != null) { $last_row = self::UpdateLastLogEndTime(array_pop($rows)); array_push($rows, $last_row); + $skip = false; + } else { + $sql = "SELECT * FROM CC_LIVE_LOG" + ." WHERE state = 'L'" + ." ORDER BY id"; + $rows = $con->query($sql)->fetchAll(); + + if ($rows != null) { + $last_row = self::UpdateLastLogEndTime(array_pop($rows)); + array_push($rows, $last_row); + foreach ($rows as $row) { + $sql_delete = "DELETE FROM CC_LIVE_LOG" + ." WHERE id = '{$row['id']}'"; + $con->exec($sql_delete); + } + } + $skip = true; } $hours = 0; $minutes = 0; $seconds = 0; - foreach ($rows as $row) { - $end = new DateTime($row['end_time']); - $start = new DateTime($row['start_time']); - $duration = $start->diff($end); - $duration = $duration->format("%H:%i:%s"); - $intervals = explode(":", $duration); - for ($i = 0; $i < sizeof($intervals); $i++) { - if (!isset($intervals[$i])) { - $intervals[$i] = 0; + if (!$skip) { + foreach ($rows as $row) { + $end = new DateTime($row['end_time']); + $start = new DateTime($row['start_time']); + $duration = $start->diff($end); + $duration = $duration->format("%H:%i:%s"); + $intervals = explode(":", $duration); + for ($i = 0; $i < sizeof($intervals); $i++) { + if (!isset($intervals[$i])) { + $intervals[$i] = 0; + } + } + + // Trim milliseconds (DateInterval does not support) + $sec = explode(".", $intervals[2]); + if (isset($sec[0])) { + $intervals[2] = $sec[0]; + } + + $seconds += $intervals[2]; + if ($seconds / 60 >= 1) { + $minutes += 1; + $seconds -= 60; + } + + $minutes += $intervals[1]; + if ($minutes / 60 >= 1) { + $hours += 1; + $minutes -= 60; + } + + $hours += $intervals[0]; + + if (!$p_keepData) { + // Delete data we just used to start a new log history + $sql_delete = "DELETE FROM CC_LIVE_LOG" + ." WHERE id = '{$row['id']}'"; + $con->exec($sql_delete); } } - - // Trim milliseconds (DateInterval does not support) - $sec = explode(".", $intervals[2]); - if (isset($sec[0])) { - $intervals[2] = $sec[0]; + //Trim milliseconds + $seconds = explode(".", $seconds); + if (isset($seconds[0])) { + $minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]); } - - $seconds += $intervals[2]; - if ($seconds / 60 >= 1) { - $minutes += 1; - $seconds -= 60; + else { + $minutes = (double)(($hours*60)+$minutes); } - - $minutes += $intervals[1]; - if ($minutes / 60 >= 1) { - $hours += 1; - $minutes -= 60; - } - - $hours += $intervals[0]; - - if (!$p_keepData) { - // Delete data we just used to start a new log history - $sql_delete = "DELETE FROM CC_LIVE_LOG" - ." WHERE id = '{$row['id']}'"; - $con->exec($sql_delete); - } - } - //Trim milliseconds - $seconds = explode(".", $seconds); - if (isset($seconds[0])) { - $minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]); - } - else { - $minutes = (double)(($hours*60)+$minutes); } return $minutes; } catch (Exception $e) { @@ -99,121 +118,141 @@ class Application_Model_LiveLog if ($rows != null) { $last_row = self::UpdateLastLogEndTime(array_pop($rows)); array_push($rows, $last_row); + $skip = false; + } + else { + $sql = "SELECT * FROM CC_LIVE_LOG" + ." WHERE state = 'S'" + ." ORDER BY id"; + $rows = $con->query($sql)->fetchAll(); + + if ($rows != null) { + $last_row = self::UpdateLastLogEndTime(array_pop($rows)); + array_push($rows, $last_row); + foreach ($rows as $row) { + $sql_delete = "DELETE FROM CC_LIVE_LOG" + ." WHERE id = '{$row['id']}'"; + $con->exec($sql_delete); + } + } + $skip = true; } $hours = 0; $minutes = 0; $seconds = 0; - /* Get all shows and tracks from cc_schedule that played - * during a scheduled state - */ - foreach ($rows as $row) { - $sql_get_tracks = "SELECT * FROM cc_schedule" - ." WHERE starts >= '{$row['start_time']}'" - ." AND starts < '{$row['end_time']}'" - ." AND file_id IS NOT NULL" - ." AND media_item_played IS TRUE"; - $tracks = $con->query($sql_get_tracks)->fetchAll(); - foreach ($tracks as $track) { - if ($track['ends'] > $row['end_time']) { - $scheduled_ends = new DateTime($row['end_time']); - $track_ends = new DateTime($track['ends']); - $extra_time = $scheduled_ends->diff($track_ends); + if (!$skip) { + /* Get all shows and tracks from cc_schedule that played + * during a scheduled state + */ + foreach ($rows as $row) { + $sql_get_tracks = "SELECT * FROM cc_schedule" + ." WHERE starts >= '{$row['start_time']}'" + ." AND starts < '{$row['end_time']}'" + ." AND file_id IS NOT NULL" + ." AND media_item_played IS TRUE"; + $tracks = $con->query($sql_get_tracks)->fetchAll(); + foreach ($tracks as $track) { + if ($track['ends'] > $row['end_time']) { + $scheduled_ends = new DateTime($row['end_time']); + $track_ends = new DateTime($track['ends']); + $extra_time = $scheduled_ends->diff($track_ends); - /* Get difference between clip_length - * and the extra time. We need to subtract - * this difference from the track's - * clip length. - */ - $clip_length = $track['clip_length']; - //Convert clip_length into seconds - $clip_length_intervals = explode(":", $clip_length); - for ($i = 0; $i < sizeof($clip_length_intervals); $i++) { - if (!isset($clip_length_intervals[$i])) { - $clip_length_intervals[$i] = 0; + /* Get difference between clip_length + * and the extra time. We need to subtract + * this difference from the track's + * clip length. + */ + $clip_length = $track['clip_length']; + //Convert clip_length into seconds + $clip_length_intervals = explode(":", $clip_length); + for ($i = 0; $i < sizeof($clip_length_intervals); $i++) { + if (!isset($clip_length_intervals[$i])) { + $clip_length_intervals[$i] = 0; + } } - } - $clip_length_seconds = $clip_length_intervals[0]*3600 + $clip_length_intervals[1]*60 + $clip_length_intervals[2]; - - $extra_time = $extra_time->format("%H:%i:%s"); - //Convert extra_time into seconds; - $extra_time_intervals = explode(":", $extra_time); - for ($i = 0; $i < sizeof($extra_time_intervals); $i++) { - if (!isset($extra_time_intervals[$i])) { - $extra_time_intervals[$i] = 0; + $clip_length_seconds = $clip_length_intervals[0]*3600 + $clip_length_intervals[1]*60 + $clip_length_intervals[2]; + + $extra_time = $extra_time->format("%H:%i:%s"); + //Convert extra_time into seconds; + $extra_time_intervals = explode(":", $extra_time); + for ($i = 0; $i < sizeof($extra_time_intervals); $i++) { + if (!isset($extra_time_intervals[$i])) { + $extra_time_intervals[$i] = 0; + } } - } - $extra_time_seconds = $extra_time_intervals[0]*3600 + $extra_time_intervals[1]*60 + $extra_time_intervals[2]; + $extra_time_seconds = $extra_time_intervals[0]*3600 + $extra_time_intervals[1]*60 + $extra_time_intervals[2]; - $clip_length_seconds -= $extra_time_seconds; - - //Convert new clip_length into "H-i-s" format - $clip_length_arr = array(); - if ($clip_length_seconds / 3600 >= 1) { - array_push($clip_length_arr, str_pad(floor($clip_length_seconds / 3600), 2, "0", STR_PAD_LEFT)); - $clip_length_seconds -= floor($clip_length_seconds / 3600); + $clip_length_seconds -= $extra_time_seconds; + + //Convert new clip_length into "H-i-s" format + $clip_length_arr = array(); + if ($clip_length_seconds / 3600 >= 1) { + array_push($clip_length_arr, str_pad(floor($clip_length_seconds / 3600), 2, "0", STR_PAD_LEFT)); + $clip_length_seconds -= floor($clip_length_seconds / 3600); + } + else { + array_push($clip_length_arr, "00"); + } + if ($clip_length_seconds / 60 >= 1) { + array_push($clip_length_arr, str_pad(floor($clip_length_seconds / 60), 2, "0", STR_PAD_LEFT)); + $clip_length_seconds -= floor($clip_length_seconds / 60); + } + else { + array_push($clip_length_arr, "00"); + } + + array_push($clip_length_arr, str_pad($clip_length_seconds, 2, "0", STR_PAD_LEFT)); + $clip_length = implode(":", $clip_length_arr); } else { - array_push($clip_length_arr, "00"); - } - if ($clip_length_seconds / 60 >= 1) { - array_push($clip_length_arr, str_pad(floor($clip_length_seconds / 60), 2, "0", STR_PAD_LEFT)); - $clip_length_seconds -= floor($clip_length_seconds / 60); - } - else { - array_push($clip_length_arr, "00"); + $clip_length = $track['clip_length']; } - array_push($clip_length_arr, str_pad($clip_length_seconds, 2, "0", STR_PAD_LEFT)); - $clip_length = implode(":", $clip_length_arr); - } - else { - $clip_length = $track['clip_length']; - } - - $intervals = explode(":", $clip_length); - for ($i = 0; $i < sizeof($intervals); $i++) { - if (!isset($intervals[$i])) { - $intervals[$i] = 0; + $intervals = explode(":", $clip_length); + for ($i = 0; $i < sizeof($intervals); $i++) { + if (!isset($intervals[$i])) { + $intervals[$i] = 0; + } } - } - // Trim milliseconds (DateInteral does not support) - $sec = explode(".", $intervals[2]); - if (isset($sec[0])) { - $intervals[2] = $sec[0]; + // Trim milliseconds (DateInteral does not support) + $sec = explode(".", $intervals[2]); + if (isset($sec[0])) { + $intervals[2] = $sec[0]; + } + + $seconds += $intervals[2]; + if ($seconds / 60 >= 1) { + $minutes += 1; + $seconds -= 60; + } + + $minutes += $intervals[1]; + if ($minutes / 60 >= 1) { + $hours += 1; + $minutes -= 60; + } + + $hours += $intervals[0]; } - $seconds += $intervals[2]; - if ($seconds / 60 >= 1) { - $minutes += 1; - $seconds -= 60; + if (!$p_keepData) { + //Delete row because we do not need data anymore + $sql_delete = "DELETE FROM CC_LIVE_LOG" + ." WHERE id = '{$row['id']}'"; + $con->exec($sql_delete); } - - $minutes += $intervals[1]; - if ($minutes / 60 >= 1) { - $hours += 1; - $minutes -= 60; - } - - $hours += $intervals[0]; } - if (!$p_keepData) { - //Delete row because we do not need data anymore - $sql_delete = "DELETE FROM CC_LIVE_LOG" - ." WHERE id = '{$row['id']}'"; - $con->exec($sql_delete); + + $seconds = explode(".", $seconds); + if (isset($seconds[0])) { + $minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]); + } + else { + $minutes = (double)(($hours*60)+$minutes); } - } - - - $seconds = explode(".", $seconds); - if (isset($seconds[0])) { - $minutes = (double)(($hours*60)+$minutes . "." . $seconds[0]); - } - else { - $minutes = (double)(($hours*60)+$minutes); } return $minutes; } catch (Exception $e) { From 832e210609aa05a5ea2a4d01c8658475a9d2b6aa Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 15:20:26 -0400 Subject: [PATCH 02/13] CC-3994: Install script hard-codes storage path, instead of using value in airtime-install.ini - done --- install_minimal/DoctrineMigrations/Version20110711161043.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_minimal/DoctrineMigrations/Version20110711161043.php b/install_minimal/DoctrineMigrations/Version20110711161043.php index ec11eeeb2..7c0de0ee3 100644 --- a/install_minimal/DoctrineMigrations/Version20110711161043.php +++ b/install_minimal/DoctrineMigrations/Version20110711161043.php @@ -15,8 +15,11 @@ class Version20110711161043 extends AbstractMigration { public function up(Schema $schema) { + $ini = parse_ini_file(__DIR__."../include/airtime-install.ini"); + $stor_dir = $ini["storage_dir"]; + /* 1) update cc_files table to include to "directory" column */ - $this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('stor', '/srv/airtime/stor/');"); + $this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('stor', $stor_dir);"); $this->_addSql("INSERT INTO cc_music_dirs (type, directory) VALUES ('link', '');"); From 6a75fd6c76d8fe98e611c3268fdd47764713d68e Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 16:35:34 -0400 Subject: [PATCH 03/13] CC-3979: Playout History export should include date range in file and/or filename - done --- .../js/airtime/playouthistory/historytable.js | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 35c8fdb96..6e6df0be2 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -1,3 +1,22 @@ +function getFileName(){ + var filename = $("#his_date_start").val()+"_"+$("#his_time_start").val()+"m--"+$("#his_date_end").val()+"_"+$("#his_time_end").val()+"m" + filename = filename.replace(/:/g,"h") + return filename; +} + +function setFlashFileName( nButton, oConfig, oFlash ) { + var filename = getFileName() + oFlash.setFileName( filename ); + this.fnSetText( oFlash, + "title:"+ this.fnGetTitle(oConfig) +"\n"+ + "message:"+ oConfig.sPdfMessage +"\n"+ + "colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+ + "orientation:"+ oConfig.sPdfOrientation +"\n"+ + "size:"+ oConfig.sPdfSize +"\n"+ + "--/TableToolsOpts--\n" + + this.fnGetTableData(oConfig)); +} + var AIRTIME = (function(AIRTIME) { var mod; @@ -65,7 +84,23 @@ var AIRTIME = (function(AIRTIME) { "sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>', "oTableTools": { - "sSwfPath": "/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf" + "sSwfPath": "/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf", + "aButtons": [ + "copy", + { + "sExtends": "csv", + "fnClick": setFlashFileName + }, + { + "sExtends": "xls", + "fnClick": setFlashFileName + }, + { + "sExtends": "pdf", + "fnClick": setFlashFileName + }, + "print" + ] } }); oTable.fnSetFilteringDelay(350); From e40d9731a2dbb68c9ce8954dd6e45eaa2126e293 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 16:47:11 -0400 Subject: [PATCH 04/13] CC-3979: Playout History export should include date range in file and/or filename - fix --- .../js/airtime/playouthistory/historytable.js | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 6e6df0be2..082927375 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -1,20 +1,30 @@ -function getFileName(){ +function getFileName(ext){ var filename = $("#his_date_start").val()+"_"+$("#his_time_start").val()+"m--"+$("#his_date_end").val()+"_"+$("#his_time_end").val()+"m" filename = filename.replace(/:/g,"h") + if(ext == "pdf"){ + filename = filename+".pdf" + }else{ + filename = filename+".csv" + } return filename; } function setFlashFileName( nButton, oConfig, oFlash ) { - var filename = getFileName() + var filename = getFileName(oConfig.sExtends) oFlash.setFileName( filename ); - this.fnSetText( oFlash, - "title:"+ this.fnGetTitle(oConfig) +"\n"+ - "message:"+ oConfig.sPdfMessage +"\n"+ - "colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+ - "orientation:"+ oConfig.sPdfOrientation +"\n"+ - "size:"+ oConfig.sPdfSize +"\n"+ - "--/TableToolsOpts--\n" + - this.fnGetTableData(oConfig)); + if(oConfig.sExtends == "pdf"){ + this.fnSetText( oFlash, + "title:"+ this.fnGetTitle(oConfig) +"\n"+ + "message:"+ oConfig.sPdfMessage +"\n"+ + "colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+ + "orientation:"+ oConfig.sPdfOrientation +"\n"+ + "size:"+ oConfig.sPdfSize +"\n"+ + "--/TableToolsOpts--\n" + + this.fnGetTableData(oConfig)); + }else{ + this.fnSetText( oFlash, + this.fnGetTableData(oConfig)); + } } var AIRTIME = (function(AIRTIME) { From 3a32e7240add7bc6ab3fd74d4a5596689bf82eee Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 16:49:41 -0400 Subject: [PATCH 05/13] CC-3984: Now Playing scissor and trashcan buttons are incorrectly labelled in tooltips - fixed --- airtime_mvc/public/js/airtime/showbuilder/builder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 94ce25608..4649a0415 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -890,8 +890,8 @@ var AIRTIME = (function(AIRTIME){ $ul = $("
    "); $ul.append('
  • ') - .append('
  • ') - .append('
  • '); + .append('
  • ') + .append('
  • '); $toolbar.append($ul); $ul = $("
      "); From 5c43fa5a7b4972f5aabecc9283b8c251d25687e6 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 16:51:34 -0400 Subject: [PATCH 06/13] CC-3978: Playout History table says Artist when it should say Creator - fixed --- airtime_mvc/public/js/airtime/playouthistory/historytable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 082927375..69c2781da 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -66,7 +66,7 @@ var AIRTIME = (function(AIRTIME) { "aoColumns": [ {"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */ - {"sTitle": "Artist", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */ + {"sTitle": "Creator", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */ {"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */ {"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */ {"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */ From 10fc5038c8403b1bf0c9a5f697f3f73febed9f9e Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 17:39:52 -0400 Subject: [PATCH 07/13] CC-3965: Clarify input/output stream settings by addding appropriate labels - fixed --- .../views/scripts/preference/stream-setting.phtml | 5 ++++- .../application/views/scripts/schedule/add-show-form.phtml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/views/scripts/preference/stream-setting.phtml b/airtime_mvc/application/views/scripts/preference/stream-setting.phtml index 5e9d94333..654149d3b 100644 --- a/airtime_mvc/application/views/scripts/preference/stream-setting.phtml +++ b/airtime_mvc/application/views/scripts/preference/stream-setting.phtml @@ -69,16 +69,19 @@ form->getSubform('live_stream_subform'); ?>
      +
      + Output Stream Settings num_stream;$i++){ echo $this->form->getSubform("s".$i."_subform"); } ?> +
      enable_stream_conf == "true"){?>
      -
      + diff --git a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml index be1c5d694..b5acbc546 100644 --- a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml +++ b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml @@ -16,7 +16,7 @@ when; ?> repeats; ?> -

      Live Stream

      +

      Live Stream Input

      live; ?>
      From 2480639e58f73ae7fed4dc0d9c95696094831e5c Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 17:42:49 -0400 Subject: [PATCH 08/13] CC-3980: Excel export button in Playout History does not really export Excel format - removed xls option --- airtime_mvc/public/js/airtime/playouthistory/historytable.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index 69c2781da..9a0db2680 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -101,10 +101,6 @@ var AIRTIME = (function(AIRTIME) { "sExtends": "csv", "fnClick": setFlashFileName }, - { - "sExtends": "xls", - "fnClick": setFlashFileName - }, { "sExtends": "pdf", "fnClick": setFlashFileName From c669d3cb47a3092ac27fb3995f0dc72955f0740d Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 18:02:46 -0400 Subject: [PATCH 09/13] CC-3969: Reset Password: specifying wrong e-mail keeps you on the same page without possibility to navigate back gracefully - done --- airtime_mvc/application/controllers/LoginController.php | 6 ++++++ airtime_mvc/application/forms/PasswordRestore.php | 8 ++++++++ .../application/views/scripts/form/password-restore.phtml | 3 +++ airtime_mvc/public/css/styles.css | 6 ++++++ airtime_mvc/public/js/airtime/login/password-restore.js | 3 +++ 5 files changed, 26 insertions(+) create mode 100644 airtime_mvc/public/js/airtime/login/password-restore.js diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index 5aab66d38..6cef61761 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -100,6 +100,12 @@ class LoginController extends Zend_Controller_Action public function passwordRestoreAction() { + global $CC_CONFIG; + + $request = $this->getRequest(); + $baseUrl = $request->getBaseUrl(); + $this->view->headScript()->appendFile($baseUrl.'/js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + if (!Application_Model_Preference::GetEnableSystemEmail()) { $this->_redirect('login'); } diff --git a/airtime_mvc/application/forms/PasswordRestore.php b/airtime_mvc/application/forms/PasswordRestore.php index 54bfbd47a..5544e0ec1 100644 --- a/airtime_mvc/application/forms/PasswordRestore.php +++ b/airtime_mvc/application/forms/PasswordRestore.php @@ -29,5 +29,13 @@ class Application_Form_PasswordRestore extends Zend_Form 'ViewHelper' ) )); + + $cancel = new Zend_Form_Element_Button("cancel"); + $cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center'; + $cancel->setLabel("Cancel") + ->setIgnore(True) + ->setAttrib('onclick', 'redirectToLogin();') + ->setDecorators(array('ViewHelper')); + $this->addElement($cancel); } } \ No newline at end of file diff --git a/airtime_mvc/application/views/scripts/form/password-restore.phtml b/airtime_mvc/application/views/scripts/form/password-restore.phtml index 5c8d099ac..a617ec971 100644 --- a/airtime_mvc/application/views/scripts/form/password-restore.phtml +++ b/airtime_mvc/application/views/scripts/form/password-restore.phtml @@ -21,5 +21,8 @@
      element->getElement('submit') ?>
      +
      + element->getElement('cancel') ?> +
      \ No newline at end of file diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 81d165a92..4f17a5d40 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -808,6 +808,12 @@ dt.block-display, dd.block-display { font-size:14px; padding: 6px 10px 6px; } + +.login-content dd button.ui-button, .login-content dd button.btn { + width:100%; + font-size:14px; + padding: 6px 10px 6px; +} .login-content .hidden, .hidden { display:none; } diff --git a/airtime_mvc/public/js/airtime/login/password-restore.js b/airtime_mvc/public/js/airtime/login/password-restore.js new file mode 100644 index 000000000..ac8e62e28 --- /dev/null +++ b/airtime_mvc/public/js/airtime/login/password-restore.js @@ -0,0 +1,3 @@ +function redirectToLogin(){ + window.location = "/Login" +} \ No newline at end of file From b081a9eb5fd099f42f1751d918ac85c73d976989 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 20 Jun 2012 18:24:28 -0400 Subject: [PATCH 10/13] CC-3955: System -> Preferences: Timezone setting is the first one in the list, not the current (local) timezone. - fixed --- install_minimal/include/AirtimeInstall.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 304cd6b35..e656bf983 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -318,8 +318,9 @@ class AirtimeInstall public static function SetDefaultTimezone() { - $con = Propel::getConnection(); - $defaultTimezone = exec("cat /etc/timezone"); + $con = Propel::getConnection(); + // we need to run php as commandline because we want to get the timezone in cli php.ini file + $defaultTimezone = exec("php -r 'echo date_default_timezone_get().PHP_EOL;'"); $sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('timezone', '$defaultTimezone')"; $result = $con->exec($sql); if ($result < 1) { From ffb7f2ff65e08db5524291a3d6ee026cf4a37494 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 22 Jun 2012 18:01:00 -0400 Subject: [PATCH 11/13] CC-3933: Replace Airtime version number in source code with a hash of the version + uniqueId. -done --- airtime_mvc/application/Bootstrap.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index f2ae6fe86..d7ba2d192 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -23,7 +23,9 @@ date_default_timezone_set('UTC'); date_default_timezone_set(Application_Model_Preference::GetTimezone()); global $CC_CONFIG; -$CC_CONFIG['airtime_version'] = Application_Model_Preference::GetAirtimeVersion(); +$airtime_version = Application_Model_Preference::GetAirtimeVersion(); +$uniqueid = Application_Model_Preference::GetUniqueId(); +$CC_CONFIG['airtime_version'] = md5($airtime_version + $uniqueid); require_once __DIR__."/configs/navigation.php"; From 8005049bdcf9201fc47bddc060ffec739508920d Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 25 Jun 2012 12:22:34 -0400 Subject: [PATCH 12/13] CC-3996: Undefined offset: 0 in StoredFile.php (Apache error) -fixed --- airtime_mvc/application/models/StoredFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 4e37a2bad..d69e28e19 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -888,7 +888,7 @@ Logging::log("getting media! - 2"); // Check if file is playable $command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file); exec($command, $output, $rv); - if ($rv != 0 || $output[0] == 'TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.') { + if ($rv != 0 || (!empty($output) && $output[0] == 'TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.')) { $result = array("code" => 110, "message" => "This file appears to be corrupted and will not be added to media library."); } else { From 8a2d548d5c6c2b3ec95c6268086c35d3466c712f Mon Sep 17 00:00:00 2001 From: James Date: Mon, 25 Jun 2012 17:25:57 -0400 Subject: [PATCH 13/13] CC-4001: Warnings in apache error log - upgrade script for 2.1.3 --- .../upgrades/airtime-2.1.3/DbUpgrade.php | 24 +++++++++++++++++++ .../airtime-2.1.3/airtime-upgrade.php | 8 +++++++ .../upgrades/airtime-2.1.3/data/upgrade.sql | 4 ++++ 3 files changed, 36 insertions(+) create mode 100644 install_minimal/upgrades/airtime-2.1.3/DbUpgrade.php create mode 100644 install_minimal/upgrades/airtime-2.1.3/airtime-upgrade.php create mode 100644 install_minimal/upgrades/airtime-2.1.3/data/upgrade.sql diff --git a/install_minimal/upgrades/airtime-2.1.3/DbUpgrade.php b/install_minimal/upgrades/airtime-2.1.3/DbUpgrade.php new file mode 100644 index 000000000..bda71b900 --- /dev/null +++ b/install_minimal/upgrades/airtime-2.1.3/DbUpgrade.php @@ -0,0 +1,24 @@ +&1 | grep -v \"will create implicit index\""); + } +} diff --git a/install_minimal/upgrades/airtime-2.1.3/airtime-upgrade.php b/install_minimal/upgrades/airtime-2.1.3/airtime-upgrade.php new file mode 100644 index 000000000..042b92d05 --- /dev/null +++ b/install_minimal/upgrades/airtime-2.1.3/airtime-upgrade.php @@ -0,0 +1,8 @@ +