view.html.php
67 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage core |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved. |
| 7 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL |
| 8 | * @link https://vikwp.com |
| 9 | */ |
| 10 | |
| 11 | // No direct access |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | /** |
| 15 | * VikAppointments employees reports view. |
| 16 | * |
| 17 | * @since 1.3 |
| 18 | */ |
| 19 | class VikAppointmentsViewreportsemp extends JViewVAP |
| 20 | { |
| 21 | /** |
| 22 | * VikAppointments view display method. |
| 23 | * |
| 24 | * @return void |
| 25 | */ |
| 26 | function display($tpl = null) |
| 27 | { |
| 28 | $input = JFactory::getApplication()->input; |
| 29 | |
| 30 | // set the toolbar |
| 31 | $this->addToolbar(); |
| 32 | |
| 33 | // get employees |
| 34 | $cid = $input->get('cid', array(), 'uint'); |
| 35 | |
| 36 | // load view model |
| 37 | $model = JModelVAP::getInstance('reportsemp'); |
| 38 | |
| 39 | // extract view filters |
| 40 | $this->filters = $model->getFiltersFromRequest(); |
| 41 | |
| 42 | // build form data |
| 43 | $this->employees = $model->getFormData($cid, $this->filters); |
| 44 | |
| 45 | // get return task |
| 46 | $this->from = $input->get('from', 'employees'); |
| 47 | |
| 48 | // display the template (default.php) |
| 49 | parent::display($tpl); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Setting the toolbar. |
| 54 | * |
| 55 | * @return void |
| 56 | */ |
| 57 | protected function addToolBar() |
| 58 | { |
| 59 | // add menu title and some buttons to the page |
| 60 | JToolBarHelper::title(JText::translate('VAPREPORTSEMPTITLE'), 'vikappointments'); |
| 61 | |
| 62 | JToolBarHelper::custom('reportsemp.download', 'download', 'download', JText::translate('VAPDOWNLOAD'), false); |
| 63 | |
| 64 | JToolBarHelper::cancel('employee.cancel', 'JTOOLBAR_CLOSE'); |
| 65 | } |
| 66 | } |
| 67 |