本文整理汇总了PHP中AdminController::renderView方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::renderView方法的具体用法?PHP AdminController::renderView怎么用?PHP AdminController::renderView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::renderView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderView
public function renderView()
{
$this->initPageHeaderToolbar();
$this->tpl_view_vars = array('version' => array('php' => phpversion(), 'server' => $_SERVER['SERVER_SOFTWARE'], 'memory_limit' => ini_get('memory_limit'), 'max_execution_time' => ini_get('max_execution_time')), 'database' => array('version' => Db::getInstance()->getVersion(), 'prefix' => _DB_PREFIX_, 'engine' => _MYSQL_ENGINE_), 'uname' => function_exists('php_uname') ? php_uname('s') . ' ' . php_uname('v') . ' ' . php_uname('m') : '', 'apache_instaweb' => Tools::apacheModExists('mod_instaweb'), 'shop' => array('ps' => _PS_VERSION_, 'url' => Tools::getHttpHost(true) . __PS_BASE_URI__, 'theme' => _THEME_NAME_), 'mail' => Configuration::get('PS_MAIL_METHOD') == 1, 'smtp' => array('server' => Configuration::get('PS_MAIL_SERVER'), 'user' => Configuration::get('PS_MAIL_USER'), 'password' => Configuration::get('PS_MAIL_PASSWD'), 'encryption' => Configuration::get('PS_MAIL_SMTP_ENCRYPTION'), 'port' => Configuration::get('PS_MAIL_SMTP_PORT')), 'user_agent' => $_SERVER['HTTP_USER_AGENT']);
$this->tpl_view_vars = array_merge($this->getTestResult(), $this->tpl_view_vars);
return parent::renderView();
}
示例2: renderView
public function renderView()
{
$this->context = Context::getContext();
if (!($group = $this->loadObject(true))) {
return;
}
$this->tpl_view_vars = array('group' => $group, 'language' => $this->context->language, 'customerList' => $this->renderCustomersList($group), 'categorieReductions' => $this->formatCategoryDiscountList($group->id));
return parent::renderView();
}
示例3: renderView
public function renderView()
{
$this->initTabModuleList();
$this->filterTabModuleList();
$this->context->smarty->assign('panel_title', $this->l('Use one of our recommended carrier modules'));
$this->tpl_view_vars = array('modules_list' => $this->renderModulesList());
unset($this->page_header_toolbar_btn['modules-list']);
return parent::renderView();
}
示例4: renderView
public function renderView()
{
$this->initPageHeaderToolbar();
$hosting_vars = array();
if (!defined('_PS_HOST_MODE_')) {
$hosting_vars = array('version' => array('php' => phpversion(), 'server' => $_SERVER['SERVER_SOFTWARE'], 'memory_limit' => ini_get('memory_limit'), 'max_execution_time' => ini_get('max_execution_time')), 'database' => array('version' => Db::getInstance()->getVersion(), 'server' => _DB_SERVER_, 'name' => _DB_NAME_, 'user' => _DB_USER_, 'prefix' => _DB_PREFIX_, 'engine' => _MYSQL_ENGINE_, 'driver' => Db::getClass()), 'uname' => function_exists('php_uname') ? php_uname('s') . ' ' . php_uname('v') . ' ' . php_uname('m') : '', 'apache_instaweb' => Tools::apacheModExists('mod_instaweb'));
}
$shop_vars = array('shop' => array('ps' => _PS_VERSION_, 'url' => $this->context->shop->getBaseURL(), 'theme' => $this->context->shop->theme_name), 'mail' => Configuration::get('PS_MAIL_METHOD') == 1, 'smtp' => array('server' => Configuration::get('PS_MAIL_SERVER'), 'user' => Configuration::get('PS_MAIL_USER'), 'password' => Configuration::get('PS_MAIL_PASSWD'), 'encryption' => Configuration::get('PS_MAIL_SMTP_ENCRYPTION'), 'port' => Configuration::get('PS_MAIL_SMTP_PORT')), 'user_agent' => $_SERVER['HTTP_USER_AGENT']);
$this->tpl_view_vars = array_merge($this->getTestResult(), array_merge($hosting_vars, $shop_vars));
return parent::renderView();
}
示例5: renderView
public function renderView()
{
$this->toolbar_title = $this->l('Payment');
unset($this->toolbar_btn['back']);
$shop_context = !Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP;
if (!$shop_context) {
$this->tpl_view_vars = array('shop_context' => $shop_context);
return parent::renderView();
}
$this->tpl_view_vars = array('modules_list' => $this->renderModulesList('back-office,AdminPayment,index'), 'ps_base_uri' => __PS_BASE_URI__, 'url_submit' => self::$currentIndex . '&token=' . $this->token, 'shop_context' => $shop_context);
return parent::renderView();
}
示例6: renderView
public function renderView()
{
$this->initWizard();
if (Tools::getValue('id_carrier') && $this->access('edit')) {
$carrier = $this->loadObject();
} elseif ($this->access('add')) {
$carrier = new Carrier();
}
if (!$this->access('edit') && Tools::getValue('id_carrier') || !$this->access('add') && !Tools::getValue('id_carrier')) {
$this->errors[] = $this->trans('You do not have permission to use this wizard.', array(), 'Admin.Shipping.Notification');
return;
}
$currency = $this->getActualCurrency();
$this->tpl_view_vars = array('currency_sign' => $currency->sign, 'PS_WEIGHT_UNIT' => Configuration::get('PS_WEIGHT_UNIT'), 'enableAllSteps' => Validate::isLoadedObject($carrier), 'wizard_steps' => $this->wizard_steps, 'validate_url' => $this->context->link->getAdminLink('AdminCarrierWizard'), 'carrierlist_url' => $this->context->link->getAdminLink('AdminCarriers') . '&conf=' . ((int) Validate::isLoadedObject($carrier) ? 4 : 3), 'multistore_enable' => Shop::isFeatureActive(), 'wizard_contents' => array('contents' => array(0 => $this->renderStepOne($carrier), 1 => $this->renderStepThree($carrier), 2 => $this->renderStepFour($carrier), 3 => $this->renderStepFive($carrier))), 'labels' => array('next' => $this->trans('Next', array(), 'Admin.Global'), 'previous' => $this->trans('Previous', array(), 'Admin.Global'), 'finish' => $this->trans('Finish', array(), 'Admin.Actions')));
if (Shop::isFeatureActive()) {
array_splice($this->tpl_view_vars['wizard_contents']['contents'], 1, 0, array(0 => $this->renderStepTwo($carrier)));
}
$this->context->smarty->assign(array('carrier_logo' => Validate::isLoadedObject($carrier) && file_exists(_PS_SHIP_IMG_DIR_ . $carrier->id . '.jpg') ? _THEME_SHIP_DIR_ . $carrier->id . '.jpg' : false));
$this->context->smarty->assign(array('logo_content' => $this->createTemplate('logo.tpl')->fetch()));
$this->addjQueryPlugin(array('ajaxfileupload'));
return parent::renderView();
}
示例7: renderView
public function renderView()
{
if (!($manufacturer = $this->loadObject())) {
return;
}
$this->toolbar_btn['new'] = array('href' => $this->context->link->getAdminLink('AdminManufacturers') . '&addaddress=1&id_manufacturer=' . (int) $manufacturer->id, 'desc' => $this->l('Add address'));
$this->toolbar_title = is_array($this->breadcrumbs) ? array_unique($this->breadcrumbs) : array($this->breadcrumbs);
$this->toolbar_title[] = $manufacturer->name;
$addresses = $manufacturer->getAddresses($this->context->language->id);
$products = $manufacturer->getProductsLite($this->context->language->id);
$total_product = count($products);
for ($i = 0; $i < $total_product; $i++) {
$products[$i] = new Product($products[$i]['id_product'], false, $this->context->language->id);
$products[$i]->loadStockData();
/* Build attributes combinations */
$combinations = $products[$i]->getAttributeCombinations($this->context->language->id);
foreach ($combinations as $k => $combination) {
$comb_array[$combination['id_product_attribute']]['reference'] = $combination['reference'];
$comb_array[$combination['id_product_attribute']]['ean13'] = $combination['ean13'];
$comb_array[$combination['id_product_attribute']]['upc'] = $combination['upc'];
$comb_array[$combination['id_product_attribute']]['quantity'] = $combination['quantity'];
$comb_array[$combination['id_product_attribute']]['attributes'][] = array($combination['group_name'], $combination['attribute_name'], $combination['id_attribute']);
}
if (isset($comb_array)) {
foreach ($comb_array as $key => $product_attribute) {
$list = '';
foreach ($product_attribute['attributes'] as $attribute) {
$list .= $attribute[0] . ' - ' . $attribute[1] . ', ';
}
$comb_array[$key]['attributes'] = rtrim($list, ', ');
}
isset($comb_array) ? $products[$i]->combination = $comb_array : '';
unset($comb_array);
}
}
$this->tpl_view_vars = array('manufacturer' => $manufacturer, 'addresses' => $addresses, 'products' => $products, 'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'), 'shopContext' => Shop::getContext());
return parent::renderView();
}
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:38,代码来源:AdminManufacturersController.php
示例8: renderView
public function renderView()
{
$this->toolbar_title = $this->l('Payment: ');
unset($this->toolbar_btn['back']);
$shop_context = !Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP;
if (!$shop_context) {
$this->tpl_view_vars = array('shop_context' => $shop_context);
return parent::renderView();
}
// link to modules page
if (isset($this->payment_modules[0])) {
$token_modules = Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) $this->context->employee->id);
}
$display_restrictions = false;
foreach ($this->payment_modules as $module) {
if ($module->active) {
$display_restrictions = true;
break;
}
}
$lists = array(array('items' => Currency::getCurrencies(), 'title' => $this->l('Currency restrictions'), 'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'), 'name_id' => 'currency', 'identifier' => 'id_currency', 'icon' => 'icon-money'), array('items' => Group::getGroups($this->context->language->id), 'title' => $this->l('Group restrictions'), 'desc' => $this->l('Please mark each checkbox for the customer group(s), in which you want the payment module(s) to be available.'), 'name_id' => 'group', 'identifier' => 'id_group', 'icon' => 'icon-group'), array('items' => Country::getCountries($this->context->language->id), 'title' => $this->l('Country restrictions'), 'desc' => $this->l('Please mark each checkbox for the country, or countries, in which you want the payment module(s) to be available.'), 'name_id' => 'country', 'identifier' => 'id_country', 'icon' => 'icon-globe'));
foreach ($lists as $key_list => $list) {
$list['check_list'] = array();
foreach ($list['items'] as $key_item => $item) {
$name_id = $list['name_id'];
foreach ($this->payment_modules as $key_module => $module) {
if (isset($module->{$name_id}) && in_array($item['id_' . $name_id], $module->{$name_id})) {
$list['items'][$key_item]['check_list'][$key_module] = 'checked';
} else {
$list['items'][$key_item]['check_list'][$key_module] = 'unchecked';
}
if (!isset($module->{$name_id})) {
$module->{$name_id} = array();
}
if (!isset($module->currencies_mode)) {
$module->currencies_mode = '';
}
if (!isset($module->currencies)) {
$module->currencies = '';
}
// If is a country list and the country is limited, remove it from list
if ($name_id == 'country' && isset($module->limited_countries) && !empty($module->limited_countries) && is_array($module->limited_countries) && !in_array(strtoupper($item['iso_code']), array_map('strtoupper', $module->limited_countries))) {
$list['items'][$key_item]['check_list'][$key_module] = null;
}
}
}
// update list
$lists[$key_list] = $list;
}
$this->tpl_view_vars = array('modules_list' => $this->renderModulesList(), 'display_restrictions' => $display_restrictions, 'lists' => $lists, 'ps_base_uri' => __PS_BASE_URI__, 'payment_modules' => $this->payment_modules, 'url_submit' => self::$currentIndex . '&token=' . $this->token, 'shop_context' => $shop_context);
return parent::renderView();
}
示例9: renderView
public function renderView()
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order)) {
$this->errors[] = Tools::displayError('The order cannot be found within your database.');
}
$customer = new Customer($order->id_customer);
$carrier = new Carrier($order->id_carrier);
$products = $this->getProducts($order);
$currency = new Currency((int) $order->id_currency);
// Carrier module call
$carrier_module_call = null;
if ($carrier->is_module) {
$module = Module::getInstanceByName($carrier->external_module_name);
if (method_exists($module, 'displayInfoByCart')) {
$carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart);
}
}
// Retrieve addresses information
$addressInvoice = new Address($order->id_address_invoice, $this->context->language->id);
if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) {
$invoiceState = new State((int) $addressInvoice->id_state);
}
if ($order->id_address_invoice == $order->id_address_delivery) {
$addressDelivery = $addressInvoice;
if (isset($invoiceState)) {
$deliveryState = $invoiceState;
}
} else {
$addressDelivery = new Address($order->id_address_delivery, $this->context->language->id);
if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) {
$deliveryState = new State((int) $addressDelivery->id_state);
}
}
$this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname);
if (Shop::isFeatureActive()) {
$shop = new Shop((int) $order->id_shop);
$this->toolbar_title .= ' - ' . sprintf($this->l('Shop: %s'), $shop->name);
}
// gets warehouses to ship products, if and only if advanced stock management is activated
$warehouse_list = null;
$order_details = $order->getOrderDetailList();
foreach ($order_details as $order_detail) {
$product = new Product($order_detail['product_id']);
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management) {
$warehouses = Warehouse::getWarehousesByProductId($order_detail['product_id'], $order_detail['product_attribute_id']);
foreach ($warehouses as $warehouse) {
if (!isset($warehouse_list[$warehouse['id_warehouse']])) {
$warehouse_list[$warehouse['id_warehouse']] = $warehouse;
}
}
}
}
$payment_methods = array();
foreach (PaymentModule::getInstalledPaymentModules() as $payment) {
$module = Module::getInstanceByName($payment['name']);
if (Validate::isLoadedObject($module) && $module->active) {
$payment_methods[] = $module->displayName;
}
}
// display warning if there are products out of stock
$display_out_of_stock_warning = false;
$current_order_state = $order->getCurrentOrderState();
if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) {
$display_out_of_stock_warning = true;
}
// products current stock (from stock_available)
foreach ($products as &$product) {
// Get total customized quantity for current product
$customized_product_quantity = 0;
if (is_array($product['customizedDatas'])) {
foreach ($product['customizedDatas'] as $customizationPerAddress) {
foreach ($customizationPerAddress as $customizationId => $customization) {
$customized_product_quantity += (int) $customization['quantity'];
}
}
}
$product['customized_product_quantity'] = $customized_product_quantity;
$product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']);
$resume = OrderSlip::getProductSlipResume($product['id_order_detail']);
$product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity'];
$product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl'];
$product['amount_refundable_tax_incl'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl'];
$product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl'], $currency);
$product['refund_history'] = OrderSlip::getProductSlipDetail($product['id_order_detail']);
$product['return_history'] = OrderReturn::getProductReturnDetail($product['id_order_detail']);
// if the current stock requires a warning
if ($product['current_stock'] == 0 && $display_out_of_stock_warning) {
$this->displayWarning($this->l('This product is out of stock: ') . ' ' . $product['product_name']);
}
if ($product['id_warehouse'] != 0) {
$warehouse = new Warehouse((int) $product['id_warehouse']);
$product['warehouse_name'] = $warehouse->name;
$warehouse_location = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']);
if (!empty($warehouse_location)) {
$product['warehouse_location'] = $warehouse_location;
} else {
$product['warehouse_location'] = false;
}
} else {
//.........这里部分代码省略.........
示例10: renderView
public function renderView()
{
if (Tools::isSubmit('profitability_conf')) {
return parent::renderOptions();
}
// $translations = array(
// 'Calendar' => $this->trans('Calendar', array(),'Admin.Global'),
// 'Day' => $this->trans('Day', array(), 'Admin.Global'),
// 'Month' => $this->trans('Month', array(), 'Admin.Global'),
// 'Year' => $this->trans('Year', array(), 'Admin.Global'),
// 'From' => $this->trans('From:', array(), 'Admin.Global'),
// 'To' => $this->trans('To:', array(), 'Admin.Global'),
// 'Save' => $this->trans('Save', array(), 'Admin.Global')
// );
if ($this->context->cookie->__get('stats_date_update') < strtotime(date('Y-m-d'))) {
switch ($this->context->employee->preselect_date_range) {
case 'day':
$date_from = date('Y-m-d');
$date_to = date('Y-m-d');
break;
case 'prev-day':
$date_from = date('Y-m-d', strtotime('-1 day'));
$date_to = date('Y-m-d', strtotime('-1 day'));
break;
case 'month':
default:
$date_from = date('Y-m-01');
$date_to = date('Y-m-d');
break;
case 'prev-month':
$date_from = date('Y-m-01', strtotime('-1 month'));
$date_to = date('Y-m-t', strtotime('-1 month'));
break;
case 'year':
$date_from = date('Y-01-01');
$date_to = date('Y-m-d');
break;
case 'prev-year':
$date_from = date('Y-m-01', strtotime('-1 year'));
$date_to = date('Y-12-t', strtotime('-1 year'));
break;
}
$this->context->employee->stats_date_from = $date_from;
$this->context->employee->stats_date_to = $date_to;
$this->context->employee->update();
$this->context->cookie->__set('stats_date_update', strtotime(date('Y-m-d')));
$this->context->cookie->write();
}
$calendar_helper = new HelperCalendar();
$calendar_helper->setDateFrom(Tools::getValue('date_from', $this->context->employee->stats_date_from));
$calendar_helper->setDateTo(Tools::getValue('date_to', $this->context->employee->stats_date_to));
$stats_compare_from = $this->context->employee->stats_compare_from;
$stats_compare_to = $this->context->employee->stats_compare_to;
if (is_null($stats_compare_from) || $stats_compare_from == '0000-00-00') {
$stats_compare_from = null;
}
if (is_null($stats_compare_to) || $stats_compare_to == '0000-00-00') {
$stats_compare_to = null;
}
$calendar_helper->setCompareDateFrom($stats_compare_from);
$calendar_helper->setCompareDateTo($stats_compare_to);
$calendar_helper->setCompareOption(Tools::getValue('compare_date_option', $this->context->employee->stats_compare_option));
$params = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to);
$moduleManagerBuilder = ModuleManagerBuilder::getInstance();
$moduleManager = $moduleManagerBuilder->build();
$this->tpl_view_vars = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to, 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne', $params), 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo', $params), 'action' => '#', 'warning' => $this->getWarningDomainName(), 'new_version_url' => Tools::getCurrentUrlProtocolPrefix() . _PS_API_DOMAIN_ . '/version/check_version.php?v=' . _PS_VERSION_ . '&lang=' . $this->context->language->iso_code . '&autoupgrade=' . (int) ($moduleManager->isInstalled('autoupgrade') && $moduleManager->isEnabled('autoupgrade')) . '&hosted_mode=' . (int) defined('_PS_HOST_MODE_'), 'dashboard_use_push' => Configuration::get('PS_DASHBOARD_USE_PUSH'), 'calendar' => $calendar_helper->generate(), 'PS_DASHBOARD_SIMULATION' => Configuration::get('PS_DASHBOARD_SIMULATION'), 'datepickerFrom' => Tools::getValue('datepickerFrom', $this->context->employee->stats_date_from), 'datepickerTo' => Tools::getValue('datepickerTo', $this->context->employee->stats_date_to), 'preselect_date_range' => Tools::getValue('preselectDateRange', $this->context->employee->preselect_date_range));
return parent::renderView();
}
示例11: renderView
public function renderView()
{
if (Tools::isSubmit('profitability_conf')) {
return parent::renderOptions();
}
// $translations = array(
// 'Calendar' => $this->l('Calendar', 'AdminStatsTab'),
// 'Day' => $this->l('Day', 'AdminStatsTab'),
// 'Month' => $this->l('Month', 'AdminStatsTab'),
// 'Year' => $this->l('Year', 'AdminStatsTab'),
// 'From' => $this->l('From:', 'AdminStatsTab'),
// 'To' => $this->l('To:', 'AdminStatsTab'),
// 'Save' => $this->l('Save', 'AdminStatsTab')
// );
if ($this->context->cookie->__get('stats_date_update') < strtotime(date('Y-m-d'))) {
switch ($this->context->employee->preselect_date_range) {
case 'day':
$date_from = date('Y-m-d');
$date_to = date('Y-m-d');
break;
case 'prev-day':
$date_from = date('Y-m-d', strtotime('-1 day'));
$date_to = date('Y-m-d', strtotime('-1 day'));
break;
case 'month':
default:
$date_from = date('Y-m-01');
$date_to = date('Y-m-d');
break;
case 'prev-month':
$date_from = date('Y-m-01', strtotime('-1 month'));
$date_to = date('Y-m-t', strtotime('-1 month'));
break;
case 'year':
$date_from = date('Y-01-01');
$date_to = date('Y-m-d');
break;
case 'prev-year':
$date_from = date('Y-m-01', strtotime('-1 year'));
$date_to = date('Y-12-t', strtotime('-1 year'));
break;
}
$this->context->employee->stats_date_from = $date_from;
$this->context->employee->stats_date_to = $date_to;
$this->context->employee->update();
$this->context->cookie->__set('stats_date_update', strtotime(date('Y-m-d')));
$this->context->cookie->write();
}
$calendar_helper = new HelperCalendar();
$calendar_helper->setDateFrom(Tools::getValue('date_from', $this->context->employee->stats_date_from));
$calendar_helper->setDateTo(Tools::getValue('date_to', $this->context->employee->stats_date_to));
$stats_compare_from = $this->context->employee->stats_compare_from;
$stats_compare_to = $this->context->employee->stats_compare_to;
if (is_null($stats_compare_from) || $stats_compare_from == '0000-00-00') {
$stats_compare_from = null;
}
if (is_null($stats_compare_to) || $stats_compare_to == '0000-00-00') {
$stats_compare_to = null;
}
$calendar_helper->setCompareDateFrom($stats_compare_from);
$calendar_helper->setCompareDateTo($stats_compare_to);
$calendar_helper->setCompareOption(Tools::getValue('compare_date_option', $this->context->employee->stats_compare_option));
$params = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to);
$this->tpl_view_vars = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to, 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne', $params), 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo', $params), 'action' => '#', 'warning' => $this->getWarningDomainName(), 'dashboard_use_push' => Configuration::get('PS_DASHBOARD_USE_PUSH'), 'calendar' => $calendar_helper->generate(), 'PS_DASHBOARD_SIMULATION' => Configuration::get('PS_DASHBOARD_SIMULATION'), 'datepickerFrom' => Tools::getValue('datepickerFrom', $this->context->employee->stats_date_from), 'datepickerTo' => Tools::getValue('datepickerTo', $this->context->employee->stats_date_to), 'preselect_date_range' => Tools::getValue('preselectDateRange', $this->context->employee->preselect_date_range));
return parent::renderView();
}
示例12: renderView
public function renderView()
{
if (!($cart = $this->loadObject(true))) {
return;
}
$customer = new Customer($cart->id_customer);
$currency = new Currency($cart->id_currency);
$this->context->cart = $cart;
$this->context->currency = $currency;
$this->context->customer = $customer;
$this->toolbar_title = sprintf($this->l('Cart #%06d'), $this->context->cart->id);
$products = $cart->getProducts();
$customized_datas = Product::getAllCustomizedDatas((int) $cart->id);
Product::addCustomizationPrice($products, $customized_datas);
$summary = $cart->getSummaryDetails();
/* Display order information */
$id_order = (int) Order::getOrderByCartId($cart->id);
$order = new Order($id_order);
if (Validate::isLoadedObject($order)) {
$tax_calculation_method = $order->getTaxCalculationMethod();
$id_shop = (int) $order->id_shop;
} else {
$id_shop = (int) $cart->id_shop;
$tax_calculation_method = Group::getPriceDisplayMethod(Group::getCurrent()->id);
}
if ($tax_calculation_method == PS_TAX_EXC) {
$total_products = $summary['total_products'];
$total_discounts = $summary['total_discounts_tax_exc'];
$total_wrapping = $summary['total_wrapping_tax_exc'];
$total_price = $summary['total_price_without_tax'];
$total_shipping = $summary['total_shipping_tax_exc'];
} else {
$total_products = $summary['total_products_wt'];
$total_discounts = $summary['total_discounts'];
$total_wrapping = $summary['total_wrapping'];
$total_price = $summary['total_price'];
$total_shipping = $summary['total_shipping'];
}
foreach ($products as $k => &$product) {
if ($tax_calculation_method == PS_TAX_EXC) {
$product['product_price'] = $product['price'];
$product['product_total'] = $product['total'];
} else {
$product['product_price'] = $product['price_wt'];
$product['product_total'] = $product['total_wt'];
}
$image = array();
if (isset($product['id_product_attribute']) && (int) $product['id_product_attribute']) {
$image = Db::getInstance()->getRow('SELECT id_image FROM ' . _DB_PREFIX_ . 'product_attribute_image WHERE id_product_attribute = ' . (int) $product['id_product_attribute']);
}
if (!isset($image['id_image'])) {
$image = Db::getInstance()->getRow('SELECT id_image FROM ' . _DB_PREFIX_ . 'image WHERE id_product = ' . (int) $product['id_product'] . ' AND cover = 1');
}
$product_obj = new Product($product['id_product']);
$product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int) $id_shop);
$image_product = new Image($image['id_image']);
$product['image'] = isset($image['id_image']) ? ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $image_product->getExistingImgPath() . '.jpg', 'product_mini_' . (int) $product['id_product'] . (isset($product['id_product_attribute']) ? '_' . (int) $product['id_product_attribute'] : '') . '.jpg', 45, 'jpg') : '--';
}
$helper = new HelperKpi();
$helper->id = 'box-kpi-cart';
$helper->icon = 'icon-shopping-cart';
$helper->color = 'color1';
$helper->title = $this->l('Total Cart', null, null, false);
$helper->subtitle = sprintf($this->l('Cart #%06d', null, null, false), $cart->id);
$helper->value = Tools::displayPrice($total_price, $currency);
$kpi = $helper->generate();
$this->tpl_view_vars = array('kpi' => $kpi, 'products' => $products, 'discounts' => $cart->getCartRules(), 'order' => $order, 'cart' => $cart, 'currency' => $currency, 'customer' => $customer, 'customer_stats' => $customer->getStats(), 'total_products' => $total_products, 'total_discounts' => $total_discounts, 'total_wrapping' => $total_wrapping, 'total_price' => $total_price, 'total_shipping' => $total_shipping, 'customized_datas' => $customized_datas);
return parent::renderView();
}
示例13: renderView
public function renderView()
{
if (!($id_customer_thread = (int) Tools::getValue('id_customer_thread'))) {
return;
}
$this->context = Context::getContext();
if (!($thread = $this->loadObject())) {
return;
}
$this->context->cookie->{'customer_threadFilter_cl!id_contact'} = $thread->id_contact;
$employees = Employee::getEmployees();
$messages = CustomerThread::getMessageCustomerThreads($id_customer_thread);
$next_thread = CustomerThread::getNextThread((int) $thread->id);
$actions = array();
if ($next_thread) {
$actions['next_thread'] = array('href' => self::$currentIndex . '&id_customer_thread=' . (int) $next_thread . '&viewcustomer_thread&token=' . $this->token, 'name' => $this->l('Reply to the next unanswered message in this category.'));
} else {
$actions['next_thread'] = array('href' => false, 'name' => $this->l('All other messages in this category have been answered.'));
}
if ($thread->status != 'closed') {
$actions['closed'] = array('href' => self::$currentIndex . '&viewcustomer_thread&setstatus=2&id_customer_thread=' . (int) Tools::getValue('id_customer_thread') . '&viewmsg&token=' . $this->token, 'name' => $this->l('Mark this message as handled.'));
}
if ($thread->status != 'pending1') {
$actions['pending1'] = array('href' => self::$currentIndex . '&viewcustomer_thread&setstatus=3&id_customer_thread=' . (int) Tools::getValue('id_customer_thread') . '&viewmsg&token=' . $this->token, 'name' => $this->l('Mark this message as "pending 1" (will be answered later).'));
} else {
$actions['pending1'] = array('href' => self::$currentIndex . '&viewcustomer_thread&setstatus=1&id_customer_thread=' . (int) Tools::getValue('id_customer_thread') . '&viewmsg&token=' . $this->token, 'name' => $this->l('Disable pending status.'));
}
if ($thread->status != 'pending2') {
$actions['pending2'] = array('href' => self::$currentIndex . '&viewcustomer_thread&setstatus=4&id_customer_thread=' . (int) Tools::getValue('id_customer_thread') . '&viewmsg&token=' . $this->token, 'name' => $this->l('Mark this message as "pending 2" (will be answered later).'));
} else {
$actions['pending2'] = array('href' => self::$currentIndex . '&viewcustomer_thread&setstatus=1&id_customer_thread=' . (int) Tools::getValue('id_customer_thread') . '&viewmsg&token=' . $this->token, 'name' => $this->l('Disable pending status.'));
}
if ($thread->id_customer) {
$customer = new Customer($thread->id_customer);
$orders = Order::getCustomerOrders($customer->id);
if ($orders && count($orders)) {
$total_ok = 0;
$orders_ok = array();
foreach ($orders as $key => $order) {
if ($order['valid']) {
$orders_ok[] = $order;
$total_ok += $order['total_paid_real'];
}
$orders[$key]['date_add'] = Tools::displayDate($order['date_add']);
$orders[$key]['total_paid_real'] = Tools::displayPrice($order['total_paid_real'], new Currency((int) $order['id_currency']));
}
}
$products = $customer->getBoughtProducts();
if ($products && count($products)) {
foreach ($products as $key => $product) {
$products[$key]['date_add'] = Tools::displayDate($product['date_add'], null, true);
}
}
}
foreach ($messages as $key => $message) {
$messages[$key] = $this->displayMessage($message);
}
$this->tpl_view_vars = array('id_customer_thread' => $id_customer_thread, 'thread' => $thread, 'actions' => $actions, 'employees' => $employees, 'messages' => $messages, 'next_thread' => $next_thread, 'orders' => isset($orders) ? $orders : false, 'customer' => isset($customer) ? $customer : false, 'products' => isset($products) ? $products : false, 'total_ok' => isset($total_ok) ? Tools::displayPrice($total_ok, $this->context->currency) : false, 'orders_ok' => isset($orders_ok) ? $orders_ok : false, 'count_ok' => isset($orders_ok) ? count($orders_ok) : false);
return parent::renderView();
}
示例14: renderView
public function renderView()
{
$this->tpl_view_vars['query'] = Tools::safeOutput($this->query);
$this->tpl_view_vars['show_toolbar'] = true;
if (count($this->errors)) {
return parent::renderView();
} else {
$nb_results = 0;
foreach ($this->_list as $list) {
if ($list != false) {
$nb_results += count($list);
}
}
$this->tpl_view_vars['nb_results'] = $nb_results;
if (isset($this->_list['features']) && count($this->_list['features'])) {
$this->tpl_view_vars['features'] = $this->_list['features'];
}
if (isset($this->_list['categories']) && count($this->_list['categories'])) {
$categories = array();
foreach ($this->_list['categories'] as $category) {
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
}
$this->tpl_view_vars['categories'] = $categories;
}
if (isset($this->_list['products']) && count($this->_list['products'])) {
$view = '';
$this->initProductList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_product';
$helper->actions = array('edit');
$helper->show_toolbar = false;
$helper->table = 'product';
$helper->currentIndex = $this->context->link->getAdminLink('AdminProducts', false);
$helper->token = Tools::getAdminTokenLite('AdminProducts');
if ($this->_list['products']) {
$view = $helper->generateList($this->_list['products'], $this->fields_list['products']);
}
$this->tpl_view_vars['products'] = $view;
}
if (isset($this->_list['customers']) && count($this->_list['customers'])) {
$view = '';
$this->initCustomerList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_customer';
$helper->actions = array('edit', 'view');
$helper->show_toolbar = false;
$helper->table = 'customer';
$helper->currentIndex = $this->context->link->getAdminLink('AdminCustomers', false);
$helper->token = Tools::getAdminTokenLite('AdminCustomers');
if ($this->_list['customers']) {
foreach ($this->_list['customers'] as $key => $val) {
$this->_list['customers'][$key]['orders'] = Order::getCustomerNbOrders((int) $val['id_customer']);
}
$view = $helper->generateList($this->_list['customers'], $this->fields_list['customers']);
}
$this->tpl_view_vars['customers'] = $view;
}
if (isset($this->_list['orders']) && count($this->_list['orders'])) {
$view = '';
$this->initOrderList();
$helper = new HelperList();
$helper->shopLinkType = '';
$helper->simple_header = true;
$helper->identifier = 'id_order';
$helper->actions = array('view');
$helper->show_toolbar = false;
$helper->table = 'order';
$helper->currentIndex = $this->context->link->getAdminLink('AdminOrders', false);
$helper->token = Tools::getAdminTokenLite('AdminOrders');
if ($this->_list['orders']) {
$view = $helper->generateList($this->_list['orders'], $this->fields_list['orders']);
}
$this->tpl_view_vars['orders'] = $view;
}
if (isset($this->_list['modules']) && count($this->_list['modules'])) {
$this->tpl_view_vars['modules'] = $this->_list['modules'];
}
if (isset($this->_list['addons']) && count($this->_list['addons'])) {
$this->tpl_view_vars['addons'] = $this->_list['addons'];
}
return parent::renderView();
}
}
示例15: renderView
public function renderView()
{
if (Tools::isSubmit('profitability_conf')) {
return parent::renderOptions();
}
// $translations = array(
// 'Calendar' => $this->l('Calendar', 'AdminStatsTab'),
// 'Day' => $this->l('Day', 'AdminStatsTab'),
// 'Month' => $this->l('Month', 'AdminStatsTab'),
// 'Year' => $this->l('Year', 'AdminStatsTab'),
// 'From' => $this->l('From:', 'AdminStatsTab'),
// 'To' => $this->l('To:', 'AdminStatsTab'),
// 'Save' => $this->l('Save', 'AdminStatsTab')
// );
$calendar_helper = new HelperCalendar();
$calendar_helper->setDateFrom(Tools::getValue('date_from', $this->context->employee->stats_date_from));
$calendar_helper->setDateTo(Tools::getValue('date_to', $this->context->employee->stats_date_to));
$stats_compare_from = $this->context->employee->stats_compare_from;
$stats_compare_to = $this->context->employee->stats_compare_to;
if (is_null($stats_compare_from) || $stats_compare_from == '0000-00-00') {
$stats_compare_from = null;
}
if (is_null($stats_compare_to) || $stats_compare_to == '0000-00-00') {
$stats_compare_to = null;
}
$calendar_helper->setCompareDateFrom($stats_compare_from);
$calendar_helper->setCompareDateTo($stats_compare_to);
$calendar_helper->setCompareOption(Tools::getValue('compare_date_option', $this->context->employee->stats_compare_option));
$params = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to);
$this->tpl_view_vars = array('date_from' => $this->context->employee->stats_date_from, 'date_to' => $this->context->employee->stats_date_to, 'hookDashboardZoneOne' => Hook::exec('dashboardZoneOne', $params), 'hookDashboardZoneTwo' => Hook::exec('dashboardZoneTwo', $params), 'action' => '#', 'warning' => $this->getWarningDomainName(), 'new_version_url' => Tools::getCurrentUrlProtocolPrefix() . 'api.prestashop.com/version/check_version.php?v=' . _PS_VERSION_ . '&lang=' . $this->context->language->iso_code . '&autoupgrade=' . (int) (Module::isInstalled('autoupgrade') && Module::isEnabled('autoupgrade')) . '&hosted_mode=' . (int) defined('_PS_HOST_MODE_'), 'dashboard_use_push' => Configuration::get('PS_DASHBOARD_USE_PUSH'), 'calendar' => $calendar_helper->generate(), 'PS_DASHBOARD_SIMULATION' => Configuration::get('PS_DASHBOARD_SIMULATION'), 'datepickerFrom' => Tools::getValue('datepickerFrom', $this->context->employee->stats_date_from), 'datepickerTo' => Tools::getValue('datepickerTo', $this->context->employee->stats_date_to), 'preselect_date_range' => Tools::getValue('preselectDateRange', $this->context->employee->preselect_date_range));
return parent::renderView();
}