diff --git a/admin-dev/themes/default/template/helpers/tree/tree_header.tpl b/admin-dev/themes/default/template/helpers/tree/tree_header.tpl
index d7c8ef7a3..7ab49a6bc 100644
--- a/admin-dev/themes/default/template/helpers/tree/tree_header.tpl
+++ b/admin-dev/themes/default/template/helpers/tree/tree_header.tpl
@@ -22,7 +22,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
-
+
{if isset($toolbar)}{$toolbar}{/if}
\ No newline at end of file
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 16a1c5f9a..0908bf0fa 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -52,6 +52,7 @@ class AdminControllerCore extends Controller
/** @var string Object identifier inside the associated table */
protected $identifier = false;
+ protected $identifier_name = 'name';
/** @var string Tab name */
public $className;
@@ -1119,8 +1120,6 @@ class AdminControllerCore extends Controller
if (!is_array($this->toolbar_title))
$this->toolbar_title = array($this->toolbar_title);
- $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title);
-
switch ($this->display)
{
case 'view':
@@ -1135,9 +1134,14 @@ class AdminControllerCore extends Controller
'href' => $back,
'desc' => $this->l('Back to list')
);
+ $obj = $this->loadObject(true);
+ if (Validate::isLoadedObject($obj) && isset($obj->{$this->identifier_name}) && !empty($obj->{$this->identifier_name}))
+ {
+ array_pop($this->toolbar_title);
+ $this->toolbar_title[] = is_array($obj->{$this->identifier_name}) ? $obj->{$this->identifier_name}[$this->context->employee->id_lang] : $obj->{$this->identifier_name};
+ }
break;
case 'add':
- case 'edit':
// Default save button - action dynamically handled in javascript
$this->page_header_toolbar_btn['save'] = array(
'href' => '#',
@@ -1154,6 +1158,14 @@ class AdminControllerCore extends Controller
'href' => $back,
'desc' => $this->l('Cancel')
);
+ case 'edit':
+ $obj = $this->loadObject(true);
+ if (Validate::isLoadedObject($obj) && isset($obj->{$this->identifier_name}) && !empty($obj->{$this->identifier_name}))
+ {
+ array_pop($this->toolbar_title);
+ $this->toolbar_title[] = sprintf($this->l('Edit: %s'),
+ is_array($obj->{$this->identifier_name}) ? $obj->{$this->identifier_name}[$this->context->employee->id_lang] : $obj->{$this->identifier_name});
+ }
break;
case 'options':
// Default save button - action dynamically handled in javascript
@@ -1163,6 +1175,8 @@ class AdminControllerCore extends Controller
);
}
+ $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title);
+
if (is_array($this->page_header_toolbar_btn)
&& $this->page_header_toolbar_btn instanceof Traversable
|| trim($title) != '')
@@ -1959,8 +1973,8 @@ class AdminControllerCore extends Controller
//loads specific javascripts for the admin theme, bootstrap.js should be moved into /js root directory
$this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.js');
- $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/enquire.js');
- $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/admin-theme.js');
+ $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/modernizr.js');
+ $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/modernizr-loads.js');
if (!Tools::getValue('submitFormAjax'))
{
diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php
index 6ee52154d..de4877ab0 100644
--- a/controllers/admin/AdminCategoriesController.php
+++ b/controllers/admin/AdminCategoriesController.php
@@ -160,16 +160,14 @@ class AdminCategoriesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
- if (empty($this->display))
- {
+ parent::initPageHeaderToolbar();
+
+ if ($this->display != 'add')
$this->page_header_toolbar_btn['new_category'] = array(
'href' => self::$currentIndex.'&addcategory&token='.$this->token,
'desc' => $this->l('Add new category'),
'icon' => 'process-icon-new'
);
- }
-
- parent::initPageHeaderToolbar();
}
public function initContent()
diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php
index 28d83105f..d4152e260 100644
--- a/controllers/admin/AdminEmployeesController.php
+++ b/controllers/admin/AdminEmployeesController.php
@@ -150,6 +150,8 @@ class AdminEmployeesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
+ parent::initPageHeaderToolbar();
+
if (empty($this->display))
$this->page_header_toolbar_btn['new_employee'] = array(
'href' => self::$currentIndex.'&addemployee&token='.$this->token,
@@ -157,7 +159,16 @@ class AdminEmployeesControllerCore extends AdminController
'icon' => 'process-icon-new'
);
- parent::initPageHeaderToolbar();
+ if ($this->display == 'edit')
+ {
+ $obj = $this->loadObject(true);
+ if (Validate::isLoadedObject($obj))
+ {
+ array_pop($this->toolbar_title);
+ $this->toolbar_title[] = sprintf($this->l('Edit: %1$s %2$s'), $obj->lastname, $obj->firstname);
+ $this->page_header_toolbar_title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title);
+ }
+ }
}
public function renderList()
diff --git a/controllers/admin/AdminMetaController.php b/controllers/admin/AdminMetaController.php
index 92aa510e6..75eea4162 100644
--- a/controllers/admin/AdminMetaController.php
+++ b/controllers/admin/AdminMetaController.php
@@ -36,6 +36,7 @@ class AdminMetaControllerCore extends AdminController
parent::__construct();
$this->bootstrap = true;
+ $this->identifier_name = 'page';
$this->ht_file = _PS_ROOT_DIR_.'/.htaccess';
$this->rb_file = _PS_ROOT_DIR_.'/robots.txt';
$this->sm_file = _PS_ROOT_DIR_.'/sitemap.xml';
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index b8deeb6ba..d274cbec7 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -2414,6 +2414,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['add'] && $this->display != 'add')
$this->page_header_toolbar_btn['duplicate'] = array(
'short' => 'Duplicate',
+ 'href' => '#',
'desc' => $this->l('Duplicate'),
'confirm' => 1,
'js' => 'if (confirm(\''.$this->l('Also copy images').' ?\')) document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct\'; else document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct&noimage=1\';'
diff --git a/controllers/admin/AdminSearchConfController.php b/controllers/admin/AdminSearchConfController.php
index 0f9346dba..b7e601225 100644
--- a/controllers/admin/AdminSearchConfController.php
+++ b/controllers/admin/AdminSearchConfController.php
@@ -199,7 +199,7 @@ class AdminSearchConfControllerCore extends AdminController
'desc' => $this->l('Add new alias'),
'icon' => 'process-icon-new'
);
-
+ $this->identifier_name = 'alias';
parent::initPageHeaderToolbar();
}
diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php
index 7a571324b..df28cdcfc 100644
--- a/controllers/admin/AdminSearchEnginesController.php
+++ b/controllers/admin/AdminSearchEnginesController.php
@@ -86,6 +86,8 @@ class AdminSearchEnginesControllerCore extends AdminController
'desc' => $this->l('Add new search engine'),
'icon' => 'process-icon-new'
);
+
+ $this->identifier_name = 'server';
parent::initPageHeaderToolbar();
}
diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php
index 6b9d67a5f..bb030de49 100644
--- a/modules/dashactivity/dashactivity.php
+++ b/modules/dashactivity/dashactivity.php
@@ -87,7 +87,8 @@ class Dashactivity extends Module
'gapi_mode' => $gapi_mode,
'dashactivity_config_form' => $this->renderConfigForm(),
'date_subtitle' => $this->l('(from %s to %s)'),
- 'date_format' => $this->context->language->date_format_lite
+ 'date_format' => $this->context->language->date_format_lite,
+ 'link' => $this->context->link,
), $this->getConfigFieldsValues()));
return $this->display(__FILE__, 'dashboard_zone_one.tpl');
}
@@ -311,33 +312,49 @@ class Dashactivity extends Module
),
);
- $sub_widget = array(
- array('label' => $this->l('Show Pending'), 'config_name' => 'DASHACTIVITY_SHOW_PENDING'),
- array('label' => $this->l('Show Notifications'), 'config_name' => 'DASHACTIVITY_SHOW_NOTIFICATION'),
- array('label' => $this->l('Show Clients'), 'config_name' => 'DASHACTIVITY_SHOW_CUSTOMERS'),
- array('label' => $this->l('Show Newsletters'), 'config_name' => 'DASHACTIVITY_SHOW_NEWSLETTER'),
- array('label' => $this->l('Show Traffic'), 'config_name' => 'DASHACTIVITY_SHOW_TRAFFIC'),
- );
-
- foreach($sub_widget as $widget)
- $fields_form['form']['input'][] = array(
- 'type' => 'switch',
- 'label' => $widget['label'],
- 'name' => $widget['config_name'],
- 'is_bool' => true,
- 'values' => array(
- array(
- 'id' => 'active_on',
- 'value' => 1,
- 'label' => $this->l('Enabled')
+ $fields_form['form']['input'][] = array(
+ 'label' => $this->l('Cart as active'),
+ 'desc' => $this->l('Default time range to consider a Shopping cart as active (default 30, max 120)'),
+ 'name' => 'DASHACTIVITY_CART_ACTIVE',
+ 'type' => 'select',
+ 'options' => array(
+ 'query' => array(
+ array('id' => 15, 'name' => 15),
+ array('id' => 30, 'name' => 30),
+ array('id' => 45, 'name' => 45),
+ array('id' => 60, 'name' => 60),
+ array('id' => 90, 'name' => 90),
+ array('id' => 120, 'name' => 120),
),
- array(
- 'id' => 'active_off',
- 'value' => 0,
- 'label' => $this->l('Disabled')
- )
- ),
- );
+ 'id' => 'id',
+ 'name' => 'name',
+ ),
+ );
+ $fields_form['form']['input'][] = array(
+ 'label' => $this->l('Visitor online'),
+ 'desc' => $this->l('Default time range to consider a Visitor as online (default 30, max 120)'),
+ 'name' => 'DASHACTIVITY_VISITOR_ONLINE',
+ 'type' => 'select',
+ 'options' => array(
+ 'query' => array(
+ array('id' => 15, 'name' => 15),
+ array('id' => 30, 'name' => 30),
+ array('id' => 45, 'name' => 45),
+ array('id' => 60, 'name' => 60),
+ array('id' => 90, 'name' => 90),
+ array('id' => 120, 'name' => 120),
+ ),
+ 'id' => 'id',
+ 'name' => 'name',
+ ),
+ );
+ $fields_form['form']['input'][] = array(
+ 'label' => $this->l('Cart abandoned'),
+ 'desc' => $this->l('Default time range to consider a Shopping cart as abandoned (default 24hrs)'),
+ 'name' => 'DASHACTIVITY_CART_ABANDONED',
+ 'type' => 'text',
+ 'suffix' => $this->l('hrs'),
+ );
$helper = new HelperForm();
$helper->show_toolbar = false;
@@ -361,13 +378,9 @@ 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')),
- 'DASHACTIVITY_SHOW_NEWSLETTER' => Tools::getValue('DASHACTIVITY_SHOW_NEWSLETTER', Configuration::get('DASHACTIVITY_SHOW_NEWSLETTER')),
- 'DASHACTIVITY_SHOW_TRAFFIC' => Tools::getValue('DASHACTIVITY_SHOW_TRAFFIC', Configuration::get('DASHACTIVITY_SHOW_TRAFFIC')),
+ 'DASHACTIVITY_CART_ACTIVE' => Tools::getValue('DASHACTIVITY_CART_ACTIVE', Configuration::get('DASHACTIVITY_CART_ACTIVE')),
+ 'DASHACTIVITY_CART_ABANDONED' => Tools::getValue('DASHACTIVITY_CART_ABANDONED', Configuration::get('DASHACTIVITY_CART_ABANDONED')),
+ 'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')),
);
}
diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
index e96fba8f8..6f242d1cf 100644
--- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
+++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl
@@ -64,7 +64,6 @@
- {if $DASHACTIVITY_SHOW_PENDING}
{l s='Currently Pending' mod='dashactivity'}
@@ -74,32 +73,26 @@
- {if $DASHACTIVITY_SHOW_RETURNS}
-
{l s='Return/Exchanges' mod='dashactivity'}
- {/if}
-
{l s='Abandoned Carts' mod='dashactivity'}
- {if $DASHACTIVITY_SHOW_STOCK}
-
{l s='Products Out of Stock' mod='dashactivity'}
- {/if}
- {/if}
- {if $DASHACTIVITY_SHOW_NOTIFICATION}
{l s='Notifications' mod='dashactivity'}
- {/if}
- {if $DASHACTIVITY_SHOW_CUSTOMERS}
{l s='Customers & Newsletters' mod='dashactivity'}
- {/if}
- {if $DASHACTIVITY_SHOW_TRAFFIC}
{l s='Traffic' mod='dashactivity'}
@@ -184,9 +173,7 @@
- {/if}
-