Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @version $Id$
- * @package com_cn_reports
- * @copyright Copyright (C) 2015. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- * @author
- */
- // No direct access
- defined('_JEXEC') or die;
- jimport('joomla.application.component.view');
- JLoader::register('Cn_reportsDateHelper', JPATH_COMPONENT_ADMINISTRATOR .'/helpers/cn_reportsdatehelper.php');
- /**
- * View class for a list of Cn_reports.
- */
- class Cn_reportsViewArchivecommissionsales extends JViewLegacy
- {
- protected $items;
- protected $pagination;
- protected $state;
- /**
- * Display the view
- */
- public function display($tpl = null) {
- $this->state = $this->get('State');
- $this->items = $this->get('Items');
- $this->pagination = $this->get('Pagination');
- // Check for errors.
- if (count($errors = $this->get('Errors'))) {
- throw new Exception(implode("\n", $errors));
- }
- Cn_reportsHelper::addSubmenu('archivecommissionsales');
- // assign the server timezone as object
- $jtz = Cn_reportsDateHelper::getTimeZone();
- $this->assignRef('serverTz', $jtz);
- // Load second Model Named Cn_reportsModelArchivecommission
- $aModel = JModelLegacy::getInstance('Archivecommission', 'Cn_reportsModel');
- // load current state into model
- foreach ($this->state as $key => $value) {
- $aModel->setState($key,$value);
- }
- // assigne the model nto a referecne to us in other parts of the view
- $this->assignRef('archiveModel', $aModel);
- $this->addToolbar();
- $this->sidebar = JHtmlSidebar::render();
- parent::display($tpl);
- }
- /**
- * Add the page title and toolbar.
- *
- * @since 1.6
- */
- protected function addToolbar() {
- //TODO: Confirm Security on backend view.html.php in administrator/com_cn_reports/view/archivecommissionsales\view.html.php addToolbar() method
- JLoader::register('Cn_reportsHelper', JPATH_COMPONENT_ADMINISTRATOR .'/helpers/cn_reportshelper.php');
- $state = $this->get('State');
- $canDo = Cn_reportsHelper::getActions();
- JToolBarHelper::title(JText::_('COM_CN_REPORTS_TITLE_ARCHIVECOMMISSIONSALE'), 'rtreports.png');
- if ($canDo->get('core.admin')) {
- JToolBarHelper::preferences('com_cn_reports');
- }
- //Set sidebar action - New in 3.0
- JHtmlSidebar::setAction('index.php?option=com_cn_reports&view=archivecommissionsales');
- $this->extra_sidebar = '';
- //TODO: Add any filter custom Filters here. See: http://pastebin.com/w4CAhpgQ for example
- }
- /**
- * Gets the sort fields used in the display and for possible filters
- * @return multitype:string associative array with key of field and value from en-GB.com_cn_reports.ini file
- */
- protected function getSortFields()
- {
- // this array will show in the order created int he drop down coloum list.
- return array(
- 'arc.id' => JText::_('JGRID_HEADING_ID'),
- 'arc.order_id' => JText::_('COM_CN_REPORTS_FORM_LBL_ORDERID'),
- 'override_type_name' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_OVERRIDETYPENAME'),
- 'retail_partner_name' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_RETAILPARTNERNAME'),
- 'arc.order_count' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_ORDERCOUNT'),
- 'arc.order_voucher' => JText::_('COM_CN_REPORTS_FORM_LBL_VOUCHER'),
- 'arc.order_coupon' => JText::_('COM_CN_REPORTS_FORM_LBL_COUPON'),
- 'arc.order_shipping' => JText::_('COM_CN_REPORTS_FORM_LBL_SHIPPING'),
- 'arc.order_tax' => JText::_('COM_CN_REPORTS_FORM_LBL_TAX'),
- 'order_total' => JText::_('COM_CN_REPORTS_FORM_LBL_OT_TOTAL'),
- 'wholesale_price' => JText::_('COM_CN_REPORTS_FORM_LBL_WHOLESALE'),
- 'arc.wholesale_markup_amount' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_WHOLESALEMARKUPAMOUNT'),
- 'arc.profit_margin_actual' => JText::_('COM_CN_REPORTS_FORM_LBL_APM'),
- 'arc.commission_rate' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_COMMISSIONRATE'),
- 'arc.commission_amount' => JText::_('COM_CN_REPORTS_FORM_LBL_COMMISSION'),
- 'arc.date_start' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_DATESTART'),
- 'arc.date_end' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_DATEEND'),
- 'created_by_name' => JText::_('COM_CN_REPORTS_ARCHIVECOMMISSIONSALES_COLUMNS_CREATEDBYNAME')
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement