diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index f98c06f33..755cbc7f3 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -272,47 +272,25 @@ class ScheduleController extends Zend_Controller_Action } if ($showStartLocalDT->getTimestamp() <= $epochNow && - $epochNow < $showEndLocalDT->getTimestamp() && - ($isAdminOrPM || $isDJ)) { + $epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) { if ($instance->isRecorded()) { - if($isAdminOrPM){ - $menu["cancel_recorded"] = array("name"=> "Cancel Current Show", "icon" => "delete"); - } - } else { - if($instance->isRepeating()){ - /*$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array()); - $menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/populate-show-instance-form"); - $menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");*/ + $menu["cancel_recorded"] = array("name"=> "Cancel Current Show", "icon" => "delete"); + } + else { + + if (!$instance->isRebroadcast()) { $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form"); - }else{ - if($instance->isRebroadcast()){ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/populate-show-form"); - }else{ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form"); - } - } - if($isAdminOrPM){ - $menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete"); } + + $menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete"); } } if ($epochNow < $showStartLocalDT->getTimestamp()) { - if ($isAdminOrPM || $isDJ) { - - if($instance->isRepeating()){ - /*$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "items" => array()); - $menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/populate-show-instance-form"); - $menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/populate-show-form");*/ + if (!$instance->isRebroadcast() && $isAdminOrPM) { $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form"); - }else{ - if($instance->isRebroadcast()){ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/populate-show-form"); - }else{ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/populate-show-form"); - } } if ($instance->getShow()->isRepeating() && $isAdminOrPM) { @@ -324,11 +302,10 @@ class ScheduleController extends Zend_Controller_Action $menu["del"]["items"]["following"] = array("name"=> "Delete This Instance and All Following", "icon" => "delete", "url" => "/schedule/cancel-show"); } - else if($isAdminOrPM){ - //window["scheduleRefetchEvents"]' - $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/schedule/delete-show"); + else if ($isAdminOrPM){ + + $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/schedule/delete-show"); } - } } $this->view->items = $menu; diff --git a/airtime_mvc/application/forms/AddShowLiveStream.php b/airtime_mvc/application/forms/AddShowLiveStream.php index cc90cf6d6..680de4645 100644 --- a/airtime_mvc/application/forms/AddShowLiveStream.php +++ b/airtime_mvc/application/forms/AddShowLiveStream.php @@ -14,7 +14,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm ->setDecorators(array('ViewHelper')); $this->addElement($cb_airtime_auth); - $description2 = "Specify custom authentication which will work for only for this show."; + $description2 = "Specify custom authentication which will work only for this show."; $cb_custom_auth = new Zend_Form_Element_Checkbox("cb_custom_auth"); $cb_custom_auth ->setLabel("Use Custom Authentication:") ->setDescription($description2) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 0c6180176..50ce522eb 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -48,7 +48,8 @@ class Application_Model_Schedule { $range = array("env"=>APPLICATION_ENV, "schedulerTime"=>$timeNow, "previous"=>$results['previous'] !=null?$results['previous']:(count($shows['previousShow'])>0?$shows['previousShow'][0]:null), - "current"=>$results['current'] !=null?$results['current']:(count($shows['currentShow'])>0?$shows['currentShow'][0]:null), + "current"=>$results['current'] !=null?$results['current']:((count($shows['currentShow'])>0 && $shows['currentShow']['record'] == 1)?$shows['currentShow'][0]:null), + //"current"=>$results['current'] !=null?$results['current']:(count($shows['currentShow'])>0?$shows['currentShow'][0]:null), "next"=> $results['next'] !=null?$results['next']:(count($shows['nextShow'])>0?$shows['nextShow'][0]:null), "currentShow"=>$shows['currentShow'], "nextShow"=>$shows['nextShow'], diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 8c3d8d60c..dc8c29026 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1484,32 +1484,34 @@ class Application_Model_Show { Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp); } - $sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name, - color, background_color, file_id, cc_show_instances.id AS instance_id, - created, last_scheduled, time_filled - FROM cc_show_instances - LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id - WHERE cc_show_instances.modified_instance = FALSE"; + $sql = "SELECT si1.starts AS starts, si1.ends AS ends, si1.record AS record, si1.rebroadcast AS rebroadcast, si2.starts AS parent_starts, + si1.instance_id AS record_id, si1.show_id AS show_id, show.name AS name, + show.color AS color, show.background_color AS background_color, si1.file_id AS file_id, si1.id AS instance_id, + si1.created AS created, si1.last_scheduled AS last_scheduled, si1.time_filled AS time_filled + FROM cc_show_instances AS si1 + LEFT JOIN cc_show_instances AS si2 ON si1.instance_id = si2.id + LEFT JOIN cc_show AS show ON show.id = si1.show_id + WHERE si1.modified_instance = FALSE"; //only want shows that are starting at the time or later. $start_string = $start_timestamp->format("Y-m-d H:i:s"); $end_string = $end_timestamp->format("Y-m-d H:i:s"); if ($onlyRecord) { - $sql = $sql." AND (starts >= '{$start_string}' AND starts < timestamp '{$end_string}')"; - $sql = $sql." AND (record = 1)"; + $sql = $sql." AND (si1.starts >= '{$start_string}' AND si1.starts < timestamp '{$end_string}')"; + $sql = $sql." AND (si1.record = 1)"; } else { - $sql = $sql." AND ((starts >= '{$start_string}' AND starts < '{$end_string}') - OR (ends > '{$start_string}' AND ends <= '{$end_string}') - OR (starts <= '{$start_string}' AND ends >= '{$end_string}'))"; + $sql = $sql." AND ((si1.starts >= '{$start_string}' AND si1.starts < '{$end_string}') + OR (si1.ends > '{$start_string}' AND si1.ends <= '{$end_string}') + OR (si1.starts <= '{$start_string}' AND si1.ends >= '{$end_string}'))"; } if (isset($excludeInstance)) { foreach($excludeInstance as $instance) { - $sql_exclude[] = "cc_show_instances.id != {$instance}"; + $sql_exclude[] = "si1.id != {$instance}"; } $exclude = join(" OR ", $sql_exclude); @@ -1517,8 +1519,8 @@ class Application_Model_Show { $sql = $sql." AND ({$exclude})"; } - //Logging::log("getShows"); - //Logging::log($sql); + Logging::debug("getShows"); + Logging::debug($sql); $result = $con->query($sql)->fetchAll(); return $result; } @@ -1594,15 +1596,22 @@ class Application_Model_Show { $options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]); } + if (isset($show["parent_starts"])) { + $parentStartsDT = new DateTime($show["parent_starts"], new DateTimeZone("UTC")); + $parentStartsEpoch = intval($parentStartsDT->format("U")); + } $startsDT = new DateTime($show["starts"], new DateTimeZone("UTC")); $endsDT = new DateTime($show["ends"], new DateTimeZone("UTC")); $startsEpoch = intval($startsDT->format("U")); $endsEpoch = intval($endsDT->format("U")); - if ($p_editable && $show["record"] && $nowEpoch < $endsEpoch) { + if ($p_editable && $show["record"] && $nowEpoch > $startsEpoch) { $options["editable"] = false; } + else if ($p_editable && $show["rebroadcast"] && $nowEpoch > $parentStartsEpoch) { + $options["editable"] = false; + } else if ($p_editable && $nowEpoch < $endsEpoch) { $options["editable"] = true; } diff --git a/airtime_mvc/public/css/TableTools.css b/airtime_mvc/public/css/TableTools.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/TableTools_JUI.css b/airtime_mvc/public/css/TableTools_JUI.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/datatables/css/TableTools.css b/airtime_mvc/public/css/datatables/css/TableTools.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_copy.png b/airtime_mvc/public/css/images/icon_copy.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_cut.png b/airtime_mvc/public/css/images/icon_cut.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_delete.png b/airtime_mvc/public/css/images/icon_delete.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_door.png b/airtime_mvc/public/css/images/icon_door.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_edit.png b/airtime_mvc/public/css/images/icon_edit.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/images/icon_paste.png b/airtime_mvc/public/css/images/icon_paste.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/jquery.contextMenu.css b/airtime_mvc/public/css/jquery.contextMenu.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index e35027dd2..f7c435f62 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -108,11 +108,10 @@ select { .info-tooltip { cursor: help; position: relative; - - display:inline-block; zoom:1; display:inline; + display:inline-block; zoom:1; width:14px; height:14px; background:url(/css/images/icon_info.png) 0 0 no-repeat; - float:right; position:relative; top:4px; right:7px; left: 3px; + top:2px; right:7px; left: 3px; line-height:16px !important; } .info-tooltip span { diff --git a/airtime_mvc/public/js/contextmenu/jquery.contextMenu.js b/airtime_mvc/public/js/contextmenu/jquery.contextMenu.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/as3/ZeroClipboard.as b/airtime_mvc/public/js/datatables/plugin/TableTools/as3/ZeroClipboard.as old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/as3/ZeroClipboardPdf.as b/airtime_mvc/public/js/datatables/plugin/TableTools/as3/ZeroClipboardPdf.as old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/css/TableTools.css b/airtime_mvc/public/js/datatables/plugin/TableTools/css/TableTools.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/css/TableTools_JUI.css b/airtime_mvc/public/js/datatables/plugin/TableTools/css/TableTools_JUI.css old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/copy.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/copy.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/copy_hover.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/copy_hover.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/csv.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/csv.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/csv_hover.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/csv_hover.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/print.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/print.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/print_hover.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/print_hover.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/copy document.psd b/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/copy document.psd deleted file mode 100755 index ca207adc6..000000000 Binary files a/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/copy document.psd and /dev/null differ diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/file_types.psd b/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/file_types.psd old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/printer.psd b/airtime_mvc/public/js/datatables/plugin/TableTools/images/psd/printer.psd old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/xls.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/xls.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/images/xls_hover.png b/airtime_mvc/public/js/datatables/plugin/TableTools/images/xls_hover.png old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/js/TableTools.js b/airtime_mvc/public/js/datatables/plugin/TableTools/js/TableTools.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/TableTools/js/ZeroClipboard.js b/airtime_mvc/public/js/datatables/plugin/TableTools/js/ZeroClipboard.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.ColReorder.js b/airtime_mvc/public/js/datatables/plugin/dataTables.ColReorder.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js b/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.TableTools.js b/airtime_mvc/public/js/datatables/plugin/dataTables.TableTools.js old mode 100755 new mode 100644 diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.ZeroClipboard.js b/airtime_mvc/public/js/datatables/plugin/dataTables.ZeroClipboard.js old mode 100755 new mode 100644 diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py old mode 100755 new mode 100644