')) { $sAdminUrl = $_SERVER['SCRIPT_NAME'] . '?controller=AdminOrderTaxProfitReport&token=' . Tools::getAdminTokenLite('AdminOrderTaxProfitReport'); } else { $sAdminUrl = $_SERVER['SCRIPT_NAME'] . '?tab=AdminOrderTaxProfitReport&token=' . Tools::getAdminToken('AdminOrderTaxProfitReport'.(int)(Tab::getIdFromClassName('AdminOrderTaxProfitReport')).(Tools::getValue('id_employee', OrderTaxProfitReport::$oCookie->id_employee))); } // set smarty variables $aData['assign'] = array( 'bPS16' => version_compare(_PS_VERSION_, '1.6', '>'), 'bPS1606' => version_compare(_PS_VERSION_, '1.6.0.5', '>'), 'sURI' => BT_OtprModuleTools::truncateUri(), 'sActionSettings' => 'update', 'sTypeSettings' => 'settings', 'sDateFormat' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_DATE_FORMAT'], 'bUseHeadings' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_HEADINGS_TOTAL'], 'iFloatNumber' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_FLOAT_NUMBER'], 'sFloatSeparator' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_FLOAT_SEPARATOR'], 'bFixCellSize' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_FIX_CELL_SIZE'], 'iCellSize' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_CELL_SIZE'], 'iDefaultLang' => intval(OrderTaxProfitReport::$iCurrentLang), 'sHeaderTplPath' => _OTPR_PATH_TPL . _OTPR_TPL_ADMIN_PATH . _OTPR_TPL_HEADER, 'sModuleUptTplPath' => _OTPR_PATH_TPL . _OTPR_TPL_ADMIN_PATH . _OTPR_TPL_MODULE_UPDATE, 'aDateFormat' => $GLOBALS[_OTPR_MODULE_NAME . '_DATE_FORMAT'], 'sAdminTabUrl' => $sAdminUrl, 'sCurrentIso' => Language::getIsoById(OrderTaxProfitReport::$iCurrentLang), 'sDocUri' => _MODULE_DIR_ . _OTPR_MODULE_SET_NAME . '/', 'sDocName' => 'readme_' . ((OrderTaxProfitReport::$sCurrentLang == 'fr')? 'fr' : 'en') . '.pdf', 'sContactUs' => 'http://www.businesstech.fr/' . ((OrderTaxProfitReport::$sCurrentLang == 'fr')? 'fr/contactez-nous' : 'en/contact-us'), 'sTs' => time(), ); // set tpl $aData['tpl'] = _OTPR_TPL_ADMIN_PATH . _OTPR_TPL_SETTINGS; return $aData; } /** * _displaySearchForm() method displays search form of admin tab * * @param array $aPost * @return array */ private function _displaySearchForm(array $aPost) { $aData = array(); // get templates $aTemplates = BT_OtprModuleDao::getTemplates(); // set tpl title BT_OtprModuleTools::getTranslatedTplTitle($aTemplates); // set translation of columns title BT_OtprModuleTools::setColTitle(); // get categories $aCategories = BT_OtprModuleDao::getCategories(); // get different tax $aTax = BT_OtprModuleDao::getTax(); // get different customer group $aGroup = Group::getGroups(OrderTaxProfitReport::$iCurrentLang); $aFormatGroup = array(); foreach ($aGroup as $iKey => $aGroupId) { $aFormatGroup[$aGroupId['id_group']] = $aGroupId['name']; } unset($aGroup); // add indent for each category => display combo with indentation if (!empty($aCategories)) { foreach ($aCategories as $nKey => &$aCategory) { $aCategory['sIndent'] = str_repeat(' ', $aCategory['iNewLevel'] * 5); } } if (!empty(OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_PREFERENCES'])) { OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_PREFERENCES'] = unserialize(OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_PREFERENCES']); } // get preselection $aSelection = !empty(OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_STATUS_SELECTION'])? unserialize(OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_STATUS_SELECTION']) : OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_STATUS_SELECTION']; // get countries $aCountries = Country::getCountries(OrderTaxProfitReport::$iCurrentLang, true); // set smarty variables $aData['assign'] = array( 'sURI' => (Tools::getIsset('sAdminTabURI')? Tools::getValue('sAdminTabURI') : BT_OtprModuleTools::truncateUri()), 'sActionExport' => 'export', /* use case - different submit in post method without XHR */ 'aTypeExport' => $GLOBALS[_OTPR_MODULE_NAME . '_EXPORT_TYPE'], 'sDateFormat' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_DATE_FORMAT'], 'bUseHeadings' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_HEADINGS_TOTAL'], 'aPreferences' => OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_PREFERENCES'], 'aSelection' => $aSelection, 'iDefaultLang' => intval(OrderTaxProfitReport::$iCurrentLang), 'sDefaultLang' => OrderTaxProfitReport::$sCurrentLang, 'sHeaderTplPath' => _OTPR_PATH_TPL . _OTPR_TPL_ADMIN_PATH . _OTPR_TPL_HEADER, 'sModuleUptTplPath' => _OTPR_PATH_TPL . _OTPR_TPL_ADMIN_PATH . _OTPR_TPL_MODULE_UPDATE, 'aTemplates' => $aTemplates, 'aOrderStatusTitle' => BT_OtprModuleDao::getStatusOrder(), 'sDateFormat' => ((OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_DATE_FORMAT'] != false)? $GLOBALS[_OTPR_MODULE_NAME . '_DATE_FORMAT'][OrderTaxProfitReport::$aConfiguration[_OTPR_MODULE_NAME . '_DATE_FORMAT']]['format'] : $GLOBALS[_OTPR_MODULE_NAME . '_DATE_FORMAT']['en']['format']) , 'aSortGroupFields' => BT_OtprModuleTools::getSortFields(), 'aGroups' => $aFormatGroup, 'aTaxRate' => $aTax, 'aCategories' => $aCategories, 'aManufacturers' => Manufacturer::getManufacturers(), 'aSuppliers' => Supplier::getSuppliers(), 'aCountries' => ((count($aCountries) == 1)? false : $aCountries), 'aWayType' => $GLOBALS[_OTPR_MODULE_NAME . '_WAY'], 'bUseJqueryUI' => true, 'bUseJqueryFancy' => true, 'aImageSizes' => ImageType::getImagesTypes('products'), 'bSearchForm' => true, 'sCurrentIso' => Language::getIsoById(OrderTaxProfitReport::$iCurrentLang), 'bStockAdvanceEnable' => Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), ); // set tpl $aData['tpl'] = _OTPR_TPL_FORM; return $aData; } /** * create() method manages singleton * * @return obj */ public static function create() { static $oDisplay; if (null === $oDisplay) { $oDisplay = new BT_AdminDisplay(); } return $oDisplay; } }