diff --git a/admin-dev/themes/default/template/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/helpers/list/list_footer.tpl
index 9fabbe9f6..d867bfccb 100644
--- a/admin-dev/themes/default/template/helpers/list/list_footer.tpl
+++ b/admin-dev/themes/default/template/helpers/list/list_footer.tpl
@@ -68,27 +68,27 @@
/ {$list_total} {l s='result(s)'}
-
+
');
- $id_wishlist = false;
- foreach ($wishlists AS $row)
- if ($row['id_wishlist'] == Tools::getValue('id_wishlist'))
- {
- $id_wishlist = (int)(Tools::getValue('id_wishlist'));
- break;
- }
- if (!$id_wishlist)
- $id_wishlist = $wishlists[0]['id_wishlist'];
- $this->_html .= '
-
-
-
-
';
- $this->_displayProducts((int)($id_wishlist));
- $this->_html .= '
- ';
- }
-
public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blockwishlist.css', 'all');
@@ -332,5 +272,137 @@ class BlockWishList extends Module
{
return $this->l('You must be logged in to manage your wishlists.');
}
-}
+
+ public function renderJS()
+ {
+ return "";
+ }
+
+ public function renderForm()
+ {
+ $customers = Customer::getCustomers();
+ foreach ($customers as $key => $val)
+ $customers[$key]['name'] = $val['firstname'].' '.$val['lastname'];
+
+ $fields_form = array(
+ 'form' => array(
+ 'legend' => array(
+ 'title' => $this->l('Listing'),
+ 'icon' => 'icon-cogs'
+ ),
+ 'input' => array(
+ array(
+ 'type' => 'select',
+ 'label' => $this->l('Customers :'),
+ 'name' => 'id_customer',
+ 'options' => array(
+ 'default' => array('value' => 0, 'label' => $this->l('Choose customer')),
+ 'query' => $customers,
+ 'id' => 'id_customer',
+ 'name' => 'name'
+ ),
+ )
+ ),
+ ),
+ );
+
+ if ($id_customer = Tools::getValue('id_customer'))
+ {
+ require_once(dirname(__FILE__).'/WishList.php');
+ $wishlists = WishList::getByIdCustomer($id_customer);
+ $fields_form['form']['input'][] = array(
+ 'type' => 'select',
+ 'label' => $this->l('Wishlist :'),
+ 'name' => 'id_wishlist',
+ 'options' => array(
+ 'default' => array('value' => 0, 'label' => $this->l('Choose wishlist')),
+ 'query' => $wishlists,
+ 'id' => 'id_wishlist',
+ 'name' => 'name'
+ ),
+ );
+ }
+
+ $helper = new HelperForm();
+ $helper->show_toolbar = false;
+ $helper->table = $this->table;
+ $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
+ $helper->default_form_language = $lang->id;
+ $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
+ $this->fields_form = array();
+ $helper->identifier = $this->identifier;
+ $helper->submit_action = 'submitModule';
+ $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
+ $helper->token = Tools::getAdminTokenLite('AdminModules');
+ $helper->tpl_vars = array(
+ 'fields_value' => $this->getConfigFieldsValues(),
+ 'languages' => $this->context->controller->getLanguages(),
+ 'id_language' => $this->context->language->id
+ );
+
+ return $helper->generateForm(array($fields_form));
+ }
+
+ public function getConfigFieldsValues()
+ {
+ return array(
+ 'id_customer' => Tools::getValue('id_customer'),
+ 'id_wishlist' => Tools::getValue('id_wishlist'),
+ );
+ }
+
+ public function renderList($id_wishlist)
+ {
+ $wishlist = new WishList($id_wishlist);
+ $products = WishList::getProductByIdCustomer($id_wishlist, $wishlist->id_customer, $this->context->language->id);
+
+ foreach ($products as $key => $val)
+ {
+ $image = Image::getCover($val['id_product']);
+ $products[$key]['image'] = $this->context->link->getImageLink($val['link_rewrite'], $image['id_image'], 'small');
+ }
+
+ $fields_list = array(
+ 'image' => array(
+ 'title' => $this->l('Image'),
+ 'type' => 'image',
+ ),
+ 'name' => array(
+ 'title' => $this->l('Product'),
+ 'type' => 'text',
+ ),
+ 'attributes_small' => array(
+ 'title' => $this->l('Combination'),
+ 'type' => 'text',
+ ),
+ 'quantity' => array(
+ 'title' => $this->l('Quantity'),
+ 'type' => 'text',
+ ),
+ 'priority' => array(
+ 'title' => $this->l('Priority'),
+ 'type' => 'priority',
+ 'values' => array($this->l('High'), $this->l('Medium'), $this->l('Low')),
+ )
+ );
+
+
+ $helper = new HelperList();
+ $helper->shopLinkType = '';
+ $helper->simple_header = true;
+ $helper->actions = array();
+ $helper->show_toolbar = false;
+ $helper->module = $this;
+ $helper->identifier = 'image';
+ $helper->title = $this->l('Product list');
+ $helper->table = $this->name;
+ $helper->token = Tools::getAdminTokenLite('AdminModules');
+ $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
+ $helper->tpl_vars = array('priority' => array($this->l('High'), $this->l('Medium'), $this->l('Low')));
+
+ return $helper->generateList($products, $fields_list);
+ }
+}
\ No newline at end of file
diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php
index 9955efdcb..ed193e9a3 100644
--- a/modules/dashactivity/dashactivity.php
+++ b/modules/dashactivity/dashactivity.php
@@ -115,13 +115,7 @@ class Dashactivity extends Module
'.($maintenance_ips ? 'AND ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '');
$online_visitor = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
}
-
- $order_nbr = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
- SELECT COUNT(*)
- FROM `'._DB_PREFIX_.'orders`
- WHERE `invoice_date` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
- '.Shop::addSqlRestriction(Shop::SHARE_ORDER));
-
+
$pending_orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'orders` o
@@ -210,7 +204,6 @@ class Dashactivity extends Module
return array(
'data_value' => array(
- 'order_nbr' => $order_nbr,
'pending_orders' => $pending_orders,
'return_exchanges' => $return_exchanges,
'abandoned_cart' => $abandoned_cart,
@@ -352,6 +345,8 @@ class Dashactivity extends Module
public function getConfigFieldsValues()
{
return array(
+ 'DASHACTIVITY_SHOW_STOCK' => Configuration::get('PS_STOCK_MANAGEMENT'),
+ 'DASHACTIVITY_SHOW_RETURNS' => Configuration::get('PS_ORDER_RETURN'),
'DASHACTIVITY_SHOW_PENDING' => Tools::getValue('DASHACTIVITY_SHOW_PENDING', Configuration::get('DASHACTIVITY_SHOW_PENDING')),
'DASHACTIVITY_SHOW_NOTIFICATION' => Tools::getValue('DASHACTIVITY_SHOW_NOTIFICATION', Configuration::get('DASHACTIVITY_SHOW_NOTIFICATION')),
'DASHACTIVITY_SHOW_CUSTOMERS' => Tools::getValue('DASHACTIVITY_SHOW_CUSTOMERS', Configuration::get('DASHACTIVITY_SHOW_CUSTOMERS')),
diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
index 39e3fa0b2..dff99310d 100644
--- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
+++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
@@ -24,7 +24,7 @@
*}