diff --git a/airtime_mvc/application/controllers/ListenerstatController.php b/airtime_mvc/application/controllers/ListenerstatController.php index 195f98996..7e862788c 100644 --- a/airtime_mvc/application/controllers/ListenerstatController.php +++ b/airtime_mvc/application/controllers/ListenerstatController.php @@ -60,17 +60,18 @@ class ListenerstatController extends Zend_Controller_Action $request = $this->getRequest(); $baseUrl = Application_Common_OsPath::getBaseDir(); + $headScript = $this->view->headScript(); + AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']); Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics'); $this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/listenerstat/showlistenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/TableTools-2.1.5/js/ZeroClipboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/TableTools-2.1.5/js/TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'js/datatables/plugin/TableTools-2.1.5/css/TableTools.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']); @@ -99,7 +100,6 @@ class ListenerstatController extends Zend_Controller_Action public function getDataAction(){ list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest()); - $data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT), $endsDT->format(DEFAULT_TIMESTAMP_FORMAT)); $this->_helper->json->sendJson($data); @@ -114,9 +114,8 @@ class ListenerstatController extends Zend_Controller_Action } public function getAllShowData(){ list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest()); - $show_id = $this->getRequest()->getParam("show_id", null); $data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT), - $endsDT->format(DEFAULT_TIMESTAMP_FORMAT),$show_id); + $endsDT->format(DEFAULT_TIMESTAMP_FORMAT)); return $data; } @@ -124,7 +123,7 @@ class ListenerstatController extends Zend_Controller_Action list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest()); $show_id = $this->getRequest()->getParam("show_id", null); $data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange($startsDT->format(DEFAULT_TIMESTAMP_FORMAT), - $endsDT->format(DEFAULT_TIMESTAMP_FORMAT),$show_id); + $endsDT->format(DEFAULT_TIMESTAMP_FORMAT)); $this->_helper->json->sendJson($data); } } diff --git a/airtime_mvc/application/forms/ShowListenerStat.php b/airtime_mvc/application/forms/ShowListenerStat.php new file mode 100644 index 000000000..60b4eb875 --- /dev/null +++ b/airtime_mvc/application/forms/ShowListenerStat.php @@ -0,0 +1,68 @@ +setDecorators(array( + array('ViewScript', array('viewScript' => 'form/daterange.phtml')) + )); + + // Add start date element + $startDate = new Zend_Form_Element_Text('his_date_start'); + $startDate->class = 'input_text'; + $startDate->setRequired(true) + ->setLabel(_('Date Start:')) + ->setValue(date("Y-m-d")) + ->setFilters(array('StringTrim')) + ->setValidators(array( + 'NotEmpty', + array('date', false, array('YYYY-MM-DD')))) + ->setDecorators(array('ViewHelper')); + $startDate->setAttrib('alt', 'date'); + $this->addElement($startDate); + + // Add start time element + $startTime = new Zend_Form_Element_Text('his_time_start'); + $startTime->class = 'input_text'; + $startTime->setRequired(true) + ->setValue('00:00') + ->setFilters(array('StringTrim')) + ->setValidators(array( + 'NotEmpty', + array('date', false, array('HH:mm')), + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered'))))) + ->setDecorators(array('ViewHelper')); + $startTime->setAttrib('alt', 'time'); + $this->addElement($startTime); + + // Add end date element + $endDate = new Zend_Form_Element_Text('his_date_end'); + $endDate->class = 'input_text'; + $endDate->setRequired(true) + ->setLabel(_('Date End:')) + ->setValue(date("Y-m-d")) + ->setFilters(array('StringTrim')) + ->setValidators(array( + 'NotEmpty', + array('date', false, array('YYYY-MM-DD')))) + ->setDecorators(array('ViewHelper')); + $endDate->setAttrib('alt', 'date'); + $this->addElement($endDate); + + // Add end time element + $endTime = new Zend_Form_Element_Text('his_time_end'); + $endTime->class = 'input_text'; + $endTime->setRequired(true) + ->setValue('01:00') + ->setFilters(array('StringTrim')) + ->setValidators(array( + 'NotEmpty', + array('date', false, array('HH:mm')), + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered'))))) + ->setDecorators(array('ViewHelper')); + $endTime->setAttrib('alt', 'time'); + $this->addElement($endTime); + } +} diff --git a/airtime_mvc/application/views/scripts/listenerstat/show.phtml b/airtime_mvc/application/views/scripts/listenerstat/show.phtml new file mode 100644 index 000000000..6e31dc36e --- /dev/null +++ b/airtime_mvc/application/views/scripts/listenerstat/show.phtml @@ -0,0 +1,22 @@ +
+ | + | + | + |
---|