Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#
## About
## Contributing
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
### Requirements
Contributors **must** follow the following rules:
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
* Do not update the module's version number.
* Follow [the coding standards][1].
### Process in details
Contributors wishing to edit a module's files should follow the following process:
1. Create your GitHub account, if you do not have one already.
2. Fork the dashactivity project to your GitHub account.
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
4. Create a branch in your local clone of the module for your changes.
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
6. Push your changed branch to your fork in your GitHub account.
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
That's it: you have contributed to this open-source project! Congratulations!
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
[3]: https://help.github.com/articles/using-pull-requests

View File

@@ -0,0 +1,19 @@
{
"name": "prestashop/dashactivity",
"description": "PrestaShop module dashactivity",
"homepage": "https://github.com/PrestaShop/dashactivity",
"license": "AFL - Academic Free License (AFL 3.0)",
"authors": [
{
"name": "PrestaShop SA",
"email": "contact@prestashop.com"
}
],
"require": {
"php": ">=5.4"
},
"config": {
"preferred-install": "dist"
},
"type": "prestashop-module"
}

19
web/modules/dashactivity/composer.lock generated Normal file
View File

@@ -0,0 +1,19 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5f7bd9bacdc08766252f0d3baf36f99c",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4"
},
"platform-dev": []
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>dashactivity</name>
<displayName><![CDATA[Dashboard Activity]]></displayName>
<version><![CDATA[2.0.2]]></version>
<description><![CDATA[]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[dashboard]]></tab>
<is_configurable>0</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>dashactivity</name>
<displayName><![CDATA[Tableau de bord de l&#039;activit&eacute;]]></displayName>
<version><![CDATA[2.0.2]]></version>
<description><![CDATA[]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[dashboard]]></tab>
<is_configurable>0</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,525 @@
<?php
/**
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class dashactivity extends Module
{
protected static $colors = array('#1F77B4', '#FF7F0E', '#2CA02C');
public function __construct()
{
$this->name = 'dashactivity';
$this->tab = 'dashboard';
$this->version = '2.0.2';
$this->author = 'PrestaShop';
$this->push_filename = _PS_CACHE_DIR_.'push/activity';
$this->allow_push = true;
$this->push_time_limit = 180;
parent::__construct();
$this->displayName = $this->trans('Dashboard Activity', array(), 'Modules.Dashactivity.Admin');
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
}
public function install()
{
Configuration::updateValue('DASHACTIVITY_CART_ACTIVE', 30);
Configuration::updateValue('DASHACTIVITY_CART_ABANDONED_MIN', 24);
Configuration::updateValue('DASHACTIVITY_CART_ABANDONED_MAX', 48);
Configuration::updateValue('DASHACTIVITY_VISITOR_ONLINE', 30);
return (parent::install()
&& $this->registerHook('dashboardZoneOne')
&& $this->registerHook('dashboardData')
&& $this->registerHook('actionObjectOrderAddAfter')
&& $this->registerHook('actionObjectCustomerAddAfter')
&& $this->registerHook('actionObjectCustomerMessageAddAfter')
&& $this->registerHook('actionObjectCustomerThreadAddAfter')
&& $this->registerHook('actionObjectOrderReturnAddAfter')
&& $this->registerHook('actionAdminControllerSetMedia')
);
}
public function hookActionAdminControllerSetMedia()
{
if (get_class($this->context->controller) == 'AdminDashboardController') {
if (method_exists($this->context->controller, 'addJquery')) {
$this->context->controller->addJquery();
}
$this->context->controller->addJs($this->_path.'views/js/'.$this->name.'.js');
$this->context->controller->addJs(
array(
_PS_JS_DIR_.'date.js',
_PS_JS_DIR_.'tools.js'
) // retro compat themes 1.5
);
}
}
public function hookDashboardZoneOne($params)
{
$gapi_mode = 'configure';
if (!Module::isInstalled('gapi')) {
$gapi_mode = 'install';
} elseif (($gapi = Module::getInstanceByName('gapi')) && Validate::isLoadedObject($gapi) && $gapi->isConfigured()) {
$gapi_mode = false;
}
$this->context->smarty->assign($this->getConfigFieldsValues());
$this->context->smarty->assign(
array(
'gapi_mode' => $gapi_mode,
'dashactivity_config_form' => $this->renderConfigForm(),
'date_subtitle' => $this->trans('(from %s to %s)', array(), 'Modules.Dashactivity.Admin'),
'date_format' => $this->context->language->date_format_lite,
'link' => $this->context->link
)
);
return $this->display(__FILE__, 'dashboard_zone_one.tpl');
}
public function hookDashboardData($params)
{
if (Tools::strlen($params['date_from']) == 10) {
$params['date_from'] .= ' 00:00:00';
}
if (Tools::strlen($params['date_to']) == 10) {
$params['date_to'] .= ' 23:59:59';
}
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
$days = (strtotime($params['date_to']) - strtotime($params['date_from'])) / 3600 / 24;
$online_visitor = rand(10, 50);
$visits = rand(200, 2000) * $days;
return array(
'data_value' => array(
'pending_orders' => round(rand(0, 5)),
'return_exchanges' => round(rand(0, 5)),
'abandoned_cart' => round(rand(5, 50)),
'products_out_of_stock' => round(rand(1, 10)),
'new_messages' => round(rand(1, 10) * $days),
'product_reviews' => round(rand(5, 50) * $days),
'new_customers' => round(rand(1, 5) * $days),
'online_visitor' => round($online_visitor),
'active_shopping_cart' => round($online_visitor / 10),
'new_registrations' => round(rand(1, 5) * $days),
'total_suscribers' => round(rand(200, 2000)),
'visits' => round($visits),
'unique_visitors' => round($visits * 0.6),
),
'data_trends' => array(
'orders_trends' => array('way' => 'down', 'value' => 0.42),
),
'data_list_small' => array(
'dash_traffic_source' => array(
'<i class="icon-circle" style="color:'.self::$colors[0].'"></i> prestashop.com' => round($visits / 2),
'<i class="icon-circle" style="color:'.self::$colors[1].'"></i> google.com' => round($visits / 3),
'<i class="icon-circle" style="color:'.self::$colors[2].'"></i> Direct Traffic' => round($visits / 4)
)
),
'data_chart' => array(
'dash_trends_chart1' => array(
'chart_type' => 'pie_chart_trends',
'data' => array(
array('key' => 'prestashop.com', 'y' => round($visits / 2), 'color' => self::$colors[0]),
array('key' => 'google.com', 'y' => round($visits / 3), 'color' => self::$colors[1]),
array('key' => 'Direct Traffic', 'y' => round($visits / 4), 'color' => self::$colors[2])
)
)
)
);
}
$gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false;
if (Validate::isLoadedObject($gapi) && $gapi->isConfigured()) {
$visits = $unique_visitors = $online_visitor = 0;
if ($result = $gapi->requestReportData('', 'ga:visits,ga:visitors', Tools::substr($params['date_from'], 0, 10), Tools::substr($params['date_to'], 0, 10), null, null, 1, 1)) {
$visits = $result[0]['metrics']['visits'];
$unique_visitors = $result[0]['metrics']['visitors'];
}
} else {
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT COUNT(*) as visits, COUNT(DISTINCT `id_guest`) as unique_visitors
FROM `'._DB_PREFIX_.'connections`
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(false)
);
extract($row);
}
// Online visitors is only available with Analytics Real Time still in private beta at this time (October 18th, 2013).
// if ($result = $gapi->requestReportData('', 'ga:activeVisitors', null, null, null, null, 1, 1))
// $online_visitor = $result[0]['metrics']['activeVisitors'];
if ($maintenance_ips = Configuration::get('PS_MAINTENANCE_IP')) {
$maintenance_ips = implode(',', array_map('ip2long', array_map('trim', explode(',', $maintenance_ips))));
}
if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) {
$sql = 'SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, pt.name as page
FROM `'._DB_PREFIX_.'connections` c
LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections
LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page = cp.id_page
LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.id_page_type = pt.id_page_type
INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest
WHERE (g.id_customer IS NULL OR g.id_customer = 0)
'.Shop::addSqlRestriction(false, 'c').'
AND cp.`time_end` IS NULL
AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', cp.`time_start`)) < 900
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
GROUP BY c.id_connections
ORDER BY c.date_add DESC';
} else {
$sql = 'SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, "-" as page
FROM `'._DB_PREFIX_.'connections` c
INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest
WHERE (g.id_customer IS NULL OR g.id_customer = 0)
'.Shop::addSqlRestriction(false, 'c').'
AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', c.`date_add`)) < 900
'.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').'
ORDER BY c.date_add DESC';
}
Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
$online_visitor = Db::getInstance()->NumRows();
$pending_orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (o.current_state = os.id_order_state)
WHERE os.paid = 1 AND os.shipped = 0
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$abandoned_cart = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'cart`
WHERE `date_upd` BETWEEN "'.pSQL(date('Y-m-d H:i:s', strtotime('-'.(int)Configuration::get('DASHACTIVITY_CART_ABANDONED_MAX').' MIN'))).'" AND "'.pSQL(date('Y-m-d H:i:s', strtotime('-'.(int)Configuration::get('DASHACTIVITY_CART_ABANDONED_MIN').' MIN'))).'"
AND id_cart NOT IN (SELECT id_cart FROM `'._DB_PREFIX_.'orders`)
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$return_exchanges = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_return` or2 ON o.id_order = or2.id_order
WHERE or2.`date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o')
);
$products_out_of_stock = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT SUM(IF(IFNULL(stock.quantity, 0) > 0, 0, 1))
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON p.id_product = pa.id_product
'.Product::sqlStock('p', 'pa').'
WHERE p.active = 1'
);
$new_messages = AdminStatsController::getPendingMessages();
$active_shopping_cart = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'cart`
WHERE date_upd > "'.pSQL(date('Y-m-d H:i:s', strtotime('-'.(int)Configuration::get('DASHACTIVITY_CART_ACTIVE').' MIN'))).'"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$new_customers = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'customer`
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$new_registrations = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'customer`
WHERE `newsletter_date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
AND newsletter = 1
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$total_suscribers = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'customer`
WHERE newsletter = 1
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
if (Module::isInstalled('blocknewsletter')) {
$new_registrations += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'newsletter`
WHERE active = 1
AND `newsletter_date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
$total_suscribers += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(
'
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'newsletter`
WHERE active = 1
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
}
$product_reviews = 0;
if (Module::isInstalled('productcomments')) {
$product_reviews += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'product_comment` pc
LEFT JOIN `'._DB_PREFIX_.'product` p ON (pc.id_product = p.id_product)
'.Shop::addSqlAssociation('product', 'p').'
WHERE pc.deleted = 0
AND pc.`date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
'.Shop::addSqlRestriction(Shop::SHARE_ORDER)
);
}
return array(
'data_value' => array(
'pending_orders' => (int)$pending_orders,
'return_exchanges' => (int)$return_exchanges,
'abandoned_cart' => (int)$abandoned_cart,
'products_out_of_stock' => (int)$products_out_of_stock,
'new_messages' => (int)$new_messages,
'product_reviews' => (int)$product_reviews,
'new_customers' => (int)$new_customers,
'online_visitor' => (int)$online_visitor,
'active_shopping_cart' => (int)$active_shopping_cart,
'new_registrations' => (int)$new_registrations,
'total_suscribers' => (int)$total_suscribers,
'visits' => (int)$visits,
'unique_visitors' => (int)$unique_visitors,
),
'data_trends' => array(
'orders_trends' => array('way' => 'down', 'value' => 0.42),
),
'data_list_small' => array(
'dash_traffic_source' => $this->getTrafficSources($params['date_from'], $params['date_to']),
),
'data_chart' => array(
'dash_trends_chart1' => $this->getChartTrafficSource($params['date_from'], $params['date_to']),
),
);
}
protected function getChartTrafficSource($date_from, $date_to)
{
$referers = $this->getReferer($date_from, $date_to);
$return = array('chart_type' => 'pie_chart_trends', 'data' => array());
$i = 0;
foreach ($referers as $referer_name => $n) {
$return['data'][] = array('key' => $referer_name, 'y' => $n, 'color' => self::$colors[$i++]);
}
return $return;
}
protected function getTrafficSources($date_from, $date_to)
{
$referrers = $this->getReferer($date_from, $date_to, 3);
$traffic_sources = array();
$i = 0;
foreach ($referrers as $referrer_name => $n) {
$traffic_sources['<i class="icon-circle" style="color:'.self::$colors[$i++].'"></i> '.$referrer_name] = $n;
}
return $traffic_sources;
}
protected function getReferer($date_from, $date_to, $limit = 3)
{
$gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false;
if (Validate::isLoadedObject($gapi) && $gapi->isConfigured()) {
$websites = array();
if ($result = $gapi->requestReportData(
'ga:source',
'ga:visitors',
Tools::substr($date_from, 0, 10),
Tools::substr($date_to, 0, 10),
'-ga:visitors',
null,
1,
$limit
)) {
foreach ($result as $row) {
$websites[$row['dimensions']['source']] = $row['metrics']['visitors'];
}
}
} else {
$direct_link = $this->trans('Direct link', array(), 'Admin.Orderscustomers.Notification');
$websites = array($direct_link => 0);
$result = Db::getInstance()->ExecuteS('
SELECT http_referer
FROM '._DB_PREFIX_.'connections
WHERE date_add BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"
'.Shop::addSqlRestriction().'
LIMIT '.(int)$limit
);
foreach ($result as $row) {
if (!isset($row['http_referer']) || empty($row['http_referer'])) {
++$websites[$direct_link];
} else {
$website = preg_replace('/^www./', '', parse_url($row['http_referer'], PHP_URL_HOST));
if (!isset($websites[$website])) {
$websites[$website] = 1;
} else {
++$websites[$website];
}
}
}
arsort($websites);
}
return $websites;
}
public function renderConfigForm()
{
$fields_form = array(
'form' => array(
'id_form' => 'step_carrier_general',
'input' => array(),
'submit' => array(
'title' => $this->trans('Save', array(), 'Admin.Actions'),
'class' => 'btn btn-default pull-right submit_dash_config',
'reset' => array(
'title' => $this->trans('Cancel', array(), 'Admin.Actions'),
'class' => 'btn btn-default cancel_dash_config',
)
)
),
);
$fields_form['form']['input'][] = array(
'label' => $this->trans('Active cart', array(), 'Modules.Dashactivity.Admin'),
'hint' => $this->trans('How long (in minutes) a cart is to be considered as active after the last recorded change (default: 30 min).', array(), 'Modules.Dashactivity.Admin'),
'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),
),
'id' => 'id',
'name' => 'name',
),
);
$fields_form['form']['input'][] = array(
'label' => $this->trans('Online visitor', array(), 'Modules.Dashactivity.Admin'),
'hint' => $this->trans('How long (in minutes) a visitor is to be considered as online after their last action (default: 30 min).', array(), 'Modules.Dashactivity.Admin'),
'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->trans('Abandoned cart (min)', array(), 'Modules.Dashactivity.Admin'),
'hint' => $this->trans('How long (in hours) after the last action a cart is to be considered as abandoned (default: 24 hrs).', array(), 'Modules.Dashactivity.Admin'),
'name' => 'DASHACTIVITY_CART_ABANDONED_MIN',
'type' => 'text',
'suffix' => $this->trans('hrs', array(), 'Modules.Dashactivity.Admin'),
);
$fields_form['form']['input'][] = array(
'label' => $this->trans('Abandoned cart (max)', array(), 'Modules.Dashactivity.Admin'),
'hint' => $this->trans('How long (in hours) after the last action a cart is no longer to be considered as abandoned (default: 24 hrs).', array(), 'Modules.Dashactivity.Admin'),
'name' => 'DASHACTIVITY_CART_ABANDONED_MAX',
'type' => 'text',
'suffix' => $this->trans('hrs', array(), 'Modules.Dashactivity.Admin'),
);
$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->id = (int)Tools::getValue('id_carrier');
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitDashConfig';
$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(
'DASHACTIVITY_CART_ACTIVE' => Tools::getValue('DASHACTIVITY_CART_ACTIVE', Configuration::get('DASHACTIVITY_CART_ACTIVE')),
'DASHACTIVITY_CART_ABANDONED_MIN' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MIN', Configuration::get('DASHACTIVITY_CART_ABANDONED_MIN')),
'DASHACTIVITY_CART_ABANDONED_MAX' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MAX', Configuration::get('DASHACTIVITY_CART_ABANDONED_MAX')),
'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')),
);
}
public function hookActionObjectCustomerMessageAddAfter($params)
{
return $this->hookActionObjectOrderAddAfter($params);
}
public function hookActionObjectCustomerThreadAddAfter($params)
{
return $this->hookActionObjectOrderAddAfter($params);
}
public function hookActionObjectCustomerAddAfter($params)
{
return $this->hookActionObjectOrderAddAfter($params);
}
public function hookActionObjectOrderReturnAddAfter($params)
{
return $this->hookActionObjectOrderAddAfter($params);
}
public function hookActionObjectOrderAddAfter($params)
{
Tools::changeFileMTime($this->push_filename);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit17e4b2a0650913d0988dc48aa1554c2a::getLoader();

View File

@@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

View File

@@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,9 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,52 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit17e4b2a0650913d0988dc48aa1554c2a
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit17e4b2a0650913d0988dc48aa1554c2a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit17e4b2a0650913d0988dc48aa1554c2a', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit17e4b2a0650913d0988dc48aa1554c2a::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}

View File

@@ -0,0 +1,15 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit17e4b2a0650913d0988dc48aa1554c2a
{
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
}, null, ClassLoader::class);
}
}

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,156 @@
/**
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function pie_chart_trends(widget_name, chart_details)
{
nv.addGraph(function() {
var chart = nv.models.pieChart()
.x(function(d) { return d.key })
.y(function(d) { return d.y })
.color(d3.scale.category10().range())
.donut(true)
.showLabels(false)
.showLegend(false);
d3.select("#dash_traffic_chart2 svg")
.datum(chart_details.data)
.transition().duration(1200)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
}
//TODO unify this with other function in calenda.js and replace date.js functions
Date.parseDate = function(date, format) {
if (format === undefined)
format = 'Y-m-d';
var formatSeparator = format.match(/[.\/\-\s].*?/);
var formatParts = format.split(/\W+/);
var parts = date.split(formatSeparator);
var date = new Date();
if (parts.length === formatParts.length) {
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
for (var i=0; i<=formatParts.length; i++) {
switch(formatParts[i]) {
case 'dd':
case 'd':
case 'j':
date.setDate(parseInt(parts[i], 10)||1);
break;
case 'mm':
case 'm':
date.setMonth((parseInt(parts[i], 10)||1) - 1);
break;
case 'yy':
case 'y':
date.setFullYear(2000 + (parseInt(parts[i], 10)||1));
break;
case 'yyyy':
case 'Y':
date.setFullYear(parseInt(parts[i], 10)||1);
break;
}
}
}
return date;
};
Date.prototype.format = function(format) {
if (format === undefined)
return this.toString();
var formatSeparator = format.match(/[.\/\-\s].*?/);
var formatParts = format.split(/\W+/);
var result = '';
for (var i=0; i<=formatParts.length; i++) {
switch(formatParts[i]) {
case 'd':
case 'j':
result += this.getDate() + formatSeparator;
break;
case 'dd':
result += (this.getDate() < 10 ? '0' : '')+this.getDate() + formatSeparator;
break;
case 'm':
result += (this.getMonth() + 1) + formatSeparator;
break;
case 'mm':
result += (this.getMonth() < 9 ? '0' : '')+(this.getMonth() + 1) + formatSeparator;
break;
case 'yy':
case 'y':
result += this.getFullYear() + formatSeparator;
break;
case 'yyyy':
case 'Y':
result += this.getFullYear() + formatSeparator;
break;
}
}
return result.slice(0, -1);
}
$(document).ready(function() {
if (typeof date_subtitle === "undefined")
var date_subtitle = '(from %s to %s)';
if (typeof date_format === "undefined")
var date_format = 'Y-mm-dd';
$('#date-start').change(function() {
start = Date.parseDate($('#date-start').val(), 'Y-m-d');
end = Date.parseDate($('#date-end').val(), 'Y-m-d');
$('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format)));
$('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format)));
});
$('#date-end').change(function() {
start = Date.parseDate($('#date-start').val(), 'Y-m-d');
end = Date.parseDate($('#date-end').val(), 'Y-m-d');
$('#customers-newsletters-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format)));
$('#traffic-subtitle').html(sprintf(date_subtitle, start.format(date_format), end.format(date_format)));
});
});

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,178 @@
{*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section id="dashactivity" class="panel widget{if $allow_push} allow_push{/if}">
<div class="panel-heading">
<i class="icon-time"></i> {l s='Activity overview' d='Modules.Dashactivity.Admin'}
<span class="panel-heading-action">
<a class="list-toolbar-btn" href="#" onclick="toggleDashConfig('dashactivity'); return false;" title="{l s='Configure' d='Admin.Actions'}">
<i class="process-icon-configure"></i>
</a>
<a class="list-toolbar-btn" href="#" onclick="refreshDashboard('dashactivity'); return false;" title="{l s='Refresh' d='Admin.Actions'}">
<i class="process-icon-refresh"></i>
</a>
</span>
</div>
<section id="dashactivity_config" class="dash_config hide">
<header><i class="icon-wrench"></i> {l s='Configuration' d='Admin.Global'}</header>
{$dashactivity_config_form}
</section>
<section id="dash_live" class="loading">
<ul class="data_list_large">
<li>
<span class="data_label size_l">
<a href="{$link->getAdminLink('AdminStats')|escape:'html':'UTF-8'}&amp;module=statslive">{l s='Online Visitors' d='Modules.Dashactivity.Admin'}</a>
<small class="text-muted"><br/>
{l s='in the last %d minutes' sprintf=$DASHACTIVITY_VISITOR_ONLINE|intval d='Modules.Dashactivity.Admin'}
</small>
</span>
<span class="data_value size_xxl">
<span id="online_visitor"></span>
</span>
</li>
<li>
<span class="data_label size_l">
<a href="{$link->getAdminLink('AdminCarts')|escape:'html':'UTF-8'}">{l s='Active Shopping Carts' d='Modules.Dashactivity.Admin'}</a>
<small class="text-muted"><br/>
{l s='in the last %d minutes' sprintf=$DASHACTIVITY_CART_ACTIVE|intval d='Modules.Dashactivity.Admin'}
</small>
</span>
<span class="data_value size_xxl">
<span id="active_shopping_cart"></span>
</span>
</li>
</ul>
</section>
<section id="dash_pending" class="loading">
<header><i class="icon-time"></i> {l s='Currently Pending' d='Modules.Dashactivity.Admin'}</header>
<ul class="data_list">
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}">{l s='Orders' d='Admin.Global'}</a></span>
<span class="data_value size_l">
<span id="pending_orders"></span>
</span>
</li>
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminReturn')|escape:'html':'UTF-8'}">{l s='Return/Exchanges' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_l">
<span id="return_exchanges"></span>
</span>
</li>
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminCarts')|escape:'html':'UTF-8'}">{l s='Abandoned Carts' d='Admin.Global'}</a></span>
<span class="data_value size_l">
<span id="abandoned_cart"></span>
</span>
</li>
{if isset($stock_management) && $stock_management}
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminTracking')|escape:'html':'UTF-8'}">{l s='Out of Stock Products' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_l">
<span id="products_out_of_stock"></span>
</span>
</li>
{/if}
</ul>
</section>
<section id="dash_notifications" class="loading">
<header><i class="icon-exclamation-sign"></i> {l s='Notifications' d='Admin.Advparameters.Feature'}</header>
<ul class="data_list_vertical">
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'html':'UTF-8'}">{l s='New Messages' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_l">
<span id="new_messages"></span>
</span>
</li>
{if Module::isInstalled('productcomments')}
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminModules')|escape:'html':'UTF-8'}&amp;configure=productcomments&amp;tab_module=front_office_features&amp;module_name=productcomments">{l s='Product Reviews' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_l">
<span id="product_reviews"></span>
</span>
</li>
{/if}
</ul>
</section>
<section id="dash_customers" class="loading">
<header><i class="icon-user"></i> {l s='Customers & Newsletters' d='Modules.Dashactivity.Admin'} <span class="subtitle small" id="customers-newsletters-subtitle"></span></header>
<ul class="data_list">
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminCustomers')|escape:'html':'UTF-8'}">{l s='New Customers' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_md">
<span id="new_customers"></span>
</span>
</li>
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminStats')|escape:'html':'UTF-8'}&amp;module=statsnewsletter">{l s='New Subscriptions' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_md">
<span id="new_registrations"></span>
</span>
</li>
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminModules')|escape:'html':'UTF-8'}&amp;configure=ps_emailsubscription&amp;module_name=ps_emailsubscription">{l s='Total Subscribers' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_md">
<span id="total_suscribers"></span>
</span>
</li>
</ul>
</section>
<section id="dash_traffic" class="loading">
<header>
<i class="icon-globe"></i> {l s='Traffic' d='Modules.Dashactivity.Admin'} <span class="subtitle small" id="traffic-subtitle"></span>
</header>
<ul class="data_list">
{if $gapi_mode}
<li>
<span class="data_label">
<img src="../modules/dashactivity/gapi-logo.gif" width="16" height="16" alt=""/> <a href="{$link->getAdminLink('AdminModules')|escape:'html':'UTF-8'}&amp;{$gapi_mode}=gapi">{l s='Link to your Google Analytics account' d='Modules.Dashactivity.Admin'}</a>
</span>
</li>
{/if}
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminStats')|escape:'html':'UTF-8'}&amp;module=statsforecast">{l s='Visits' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_md">
<span id="visits"></span>
</span>
</li>
<li>
<span class="data_label"><a href="{$link->getAdminLink('AdminStats')|escape:'html':'UTF-8'}&amp;module=statsvisits">{l s='Unique Visitors' d='Modules.Dashactivity.Admin'}</a></span>
<span class="data_value size_md">
<span id="unique_visitors"></span>
</span>
</li>
<li>
<span class="data_label">{l s='Traffic Sources' d='Modules.Dashactivity.Admin'}</span>
<ul class="data_list_small" id="dash_traffic_source">
</ul>
<div id="dash_traffic_chart2" class='chart with-transitions'>
<svg></svg>
</div>
</li>
</ul>
</section>
</section>
<script type="text/javascript">
date_subtitle = "{$date_subtitle|escape:'html':'UTF-8'}";
date_format = "{$date_format|escape:'html':'UTF-8'}";
</script>

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;