// Fix controllers file names + add missing files in override/ + ControllerFactory class is now deprecated, use Controller instead + fix NoticationCore
This commit is contained in:
4
404.php
4
404.php
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -39,4 +39,4 @@ elseif (in_array(substr($_SERVER['REQUEST_URI'], -3), array('.js', 'css')))
|
||||
die('');
|
||||
|
||||
require_once(dirname(__FILE__).'/config/config.inc.php');
|
||||
ControllerFactory::getController('PageNotFoundController')->run();
|
||||
Controller::getController('PageNotFoundController')->run();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -27,4 +27,4 @@
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
require(dirname(dirname(__FILE__)).'/config/config.inc.php');
|
||||
ControllerFactory::getController('getFileController')->run();
|
||||
Controller::getController('getFileController')->run();
|
||||
89
cache/class_index.php
vendored
89
cache/class_index.php
vendored
@@ -54,6 +54,8 @@
|
||||
'Contact' => 'override/classes/Contact.php',
|
||||
'ContextCore' => 'classes/Context.php',
|
||||
'Context' => 'override/classes/Context.php',
|
||||
'ControllerCore' => 'classes/Controller.php',
|
||||
'Controller' => 'override/classes/Controller.php',
|
||||
'ControllerFactoryCore' => 'classes/ControllerFactory.php',
|
||||
'ControllerFactory' => 'override/classes/ControllerFactory.php',
|
||||
'CookieCore' => 'classes/Cookie.php',
|
||||
@@ -93,13 +95,13 @@
|
||||
'FileLoggerCore' => 'classes/FileLogger.php',
|
||||
'FileLogger' => 'override/classes/FileLogger.php',
|
||||
'FileUploaderCore' => 'classes/FileUploader.php',
|
||||
'FileUploader' => '',
|
||||
'FileUploader' => 'override/classes/FileUploader.php',
|
||||
'FrontControllerCore' => 'classes/FrontController.php',
|
||||
'FrontController' => 'override/classes/FrontController.php',
|
||||
'GenderCore' => 'classes/Gender.php',
|
||||
'Gender' => 'override/classes/Gender.php',
|
||||
'GroupCore' => 'classes/Group.php',
|
||||
'Group' => '',
|
||||
'Group' => 'override/classes/Group.php',
|
||||
'GroupReductionCore' => 'classes/GroupReduction.php',
|
||||
'GroupReduction' => 'override/classes/GroupReduction.php',
|
||||
'GuestCore' => 'classes/Guest.php',
|
||||
@@ -146,7 +148,8 @@
|
||||
'ModuleGridEngine' => 'override/classes/ModuleGridEngine.php',
|
||||
'MySQLCore' => 'classes/MySQL.php',
|
||||
'MySQL' => 'override/classes/MySQL.php',
|
||||
'Notification' => 'classes/Notification.php',
|
||||
'NotificationCore' => 'classes/Notification.php',
|
||||
'Notification' => 'override/classes/Notification.php',
|
||||
'ObjectModelCore' => 'classes/ObjectModel.php',
|
||||
'ObjectModel' => 'override/classes/ObjectModel.php',
|
||||
'OrderCore' => 'classes/Order.php',
|
||||
@@ -271,4 +274,84 @@
|
||||
'TaxRulesTaxManagerCore' => 'classes/tax/TaxRulesTaxManager.php',
|
||||
'TaxRulesTaxManager' => 'override/classes/tax/TaxRulesTaxManager.php',
|
||||
'FB' => 'override/classes/fb.php',
|
||||
'AddressControllerCore' => 'controllers/AddressController.php',
|
||||
'AddressController' => 'override/controllers/AddressController.php',
|
||||
'AddressesControllerCore' => 'controllers/AddressesController.php',
|
||||
'AddressesController' => 'override/controllers/AddressesController.php',
|
||||
'AttachmentControllerCore' => 'controllers/AttachmentController.php',
|
||||
'AttachmentController' => 'override/controllers/AttachmentController.php',
|
||||
'AuthControllerCore' => 'controllers/AuthController.php',
|
||||
'AuthController' => 'override/controllers/AuthController.php',
|
||||
'BestSalesControllerCore' => 'controllers/BestSalesController.php',
|
||||
'BestSalesController' => 'override/controllers/BestSalesController.php',
|
||||
'CartControllerCore' => 'controllers/CartController.php',
|
||||
'CartController' => 'override/controllers/CartController.php',
|
||||
'CategoryControllerCore' => 'controllers/CategoryController.php',
|
||||
'CategoryController' => 'override/controllers/CategoryController.php',
|
||||
'ChangeCurrencyControllerCore' => 'controllers/ChangeCurrencyController.php',
|
||||
'ChangeCurrencyController' => 'override/controllers/ChangeCurrencyController.php',
|
||||
'CmsControllerCore' => 'controllers/CmsController.php',
|
||||
'CmsController' => 'override/controllers/CmsController.php',
|
||||
'CompareControllerCore' => 'controllers/CompareController.php',
|
||||
'CompareController' => 'override/controllers/CompareController.php',
|
||||
'ContactControllerCore' => 'controllers/ContactController.php',
|
||||
'ContactController' => 'override/controllers/ContactController.php',
|
||||
'DiscountControllerCore' => 'controllers/DiscountController.php',
|
||||
'DiscountController' => 'override/controllers/DiscountController.php',
|
||||
'GetFileControllerCore' => 'controllers/GetFileController.php',
|
||||
'GetFileController' => 'override/controllers/GetFileController.php',
|
||||
'GuestTrackingControllerCore' => 'controllers/GuestTrackingController.php',
|
||||
'GuestTrackingController' => 'override/controllers/GuestTrackingController.php',
|
||||
'HistoryControllerCore' => 'controllers/HistoryController.php',
|
||||
'HistoryController' => 'override/controllers/HistoryController.php',
|
||||
'IdentityControllerCore' => 'controllers/IdentityController.php',
|
||||
'IdentityController' => 'override/controllers/IdentityController.php',
|
||||
'IndexControllerCore' => 'controllers/IndexController.php',
|
||||
'IndexController' => 'override/controllers/IndexController.php',
|
||||
'ManufacturerControllerCore' => 'controllers/ManufacturerController.php',
|
||||
'ManufacturerController' => 'override/controllers/ManufacturerController.php',
|
||||
'MyAccountControllerCore' => 'controllers/MyAccountController.php',
|
||||
'MyAccountController' => 'override/controllers/MyAccountController.php',
|
||||
'NewProductsControllerCore' => 'controllers/NewProductsController.php',
|
||||
'NewProductsController' => 'override/controllers/NewProductsController.php',
|
||||
'OrderConfirmationControllerCore' => 'controllers/OrderConfirmationController.php',
|
||||
'OrderConfirmationController' => 'override/controllers/OrderConfirmationController.php',
|
||||
'OrderControllerCore' => 'controllers/OrderController.php',
|
||||
'OrderController' => 'override/controllers/OrderController.php',
|
||||
'OrderDetailControllerCore' => 'controllers/OrderDetailController.php',
|
||||
'OrderDetailController' => 'override/controllers/OrderDetailController.php',
|
||||
'OrderFollowControllerCore' => 'controllers/OrderFollowController.php',
|
||||
'OrderFollowController' => 'override/controllers/OrderFollowController.php',
|
||||
'OrderOpcControllerCore' => 'controllers/OrderOpcController.php',
|
||||
'OrderOpcController' => 'override/controllers/OrderOpcController.php',
|
||||
'OrderReturnControllerCore' => 'controllers/OrderReturnController.php',
|
||||
'OrderReturnController' => 'override/controllers/OrderReturnController.php',
|
||||
'OrderSlipControllerCore' => 'controllers/OrderSlipController.php',
|
||||
'OrderSlipController' => 'override/controllers/OrderSlipController.php',
|
||||
'PageNotFoundControllerCore' => 'controllers/PageNotFoundController.php',
|
||||
'PageNotFoundController' => 'override/controllers/PageNotFoundController.php',
|
||||
'ParentOrderControllerCore' => 'controllers/ParentOrderController.php',
|
||||
'ParentOrderController' => 'override/controllers/ParentOrderController.php',
|
||||
'PasswordControllerCore' => 'controllers/PasswordController.php',
|
||||
'PasswordController' => 'override/controllers/PasswordController.php',
|
||||
'PdfInvoiceControllerCore' => 'controllers/PdfInvoiceController.php',
|
||||
'PdfInvoiceController' => 'override/controllers/PdfInvoiceController.php',
|
||||
'PdfOrderReturnControllerCore' => 'controllers/PdfOrderReturnController.php',
|
||||
'PdfOrderReturnController' => 'override/controllers/pdfOrderReturnController.php',
|
||||
'PdfOrderSlipControllerCore' => 'controllers/PdfOrderSlipController.php',
|
||||
'PdfOrderSlipController' => 'override/controllers/pdfOrderSlipController.php',
|
||||
'PricesDropControllerCore' => 'controllers/PricesDropController.php',
|
||||
'PricesDropController' => 'override/controllers/PricesDropController.php',
|
||||
'ProductControllerCore' => 'controllers/ProductController.php',
|
||||
'ProductController' => 'override/controllers/ProductController.php',
|
||||
'SearchControllerCore' => 'controllers/SearchController.php',
|
||||
'SearchController' => 'override/controllers/SearchController.php',
|
||||
'SitemapControllerCore' => 'controllers/SitemapController.php',
|
||||
'SitemapController' => 'override/controllers/SitemapController.php',
|
||||
'StatisticsControllerCore' => 'controllers/StatisticsController.php',
|
||||
'StatisticsController' => 'override/controllers/StatisticsController.php',
|
||||
'StoresControllerCore' => 'controllers/StoresController.php',
|
||||
'StoresController' => 'override/controllers/StoresController.php',
|
||||
'SupplierControllerCore' => 'controllers/SupplierController.php',
|
||||
'SupplierController' => 'override/controllers/SupplierController.php',
|
||||
);
|
||||
@@ -122,8 +122,10 @@ class Autoload
|
||||
public function generateIndex()
|
||||
{
|
||||
$classes = array_merge(
|
||||
$this->getClassesFromDir('classes/', true),
|
||||
$this->getClassesFromDir('override/classes/', false)
|
||||
$this->getClassesFromDir('classes/'),
|
||||
$this->getClassesFromDir('override/classes/'),
|
||||
$this->getClassesFromDir('controllers/'),
|
||||
$this->getClassesFromDir('override/controllers/')
|
||||
);
|
||||
$content = '<?php return '.var_export($classes, true).';';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -25,12 +25,20 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated since 1.5.0
|
||||
*/
|
||||
class ControllerFactoryCore
|
||||
{
|
||||
/**
|
||||
* @deprecated since 1.5.0
|
||||
*/
|
||||
public static function includeController($className)
|
||||
{
|
||||
Tools::displayAsDeprecated();
|
||||
|
||||
if (!class_exists($className, false))
|
||||
{
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../controllers/'.$className.'.php');
|
||||
if (file_exists(dirname(__FILE__).'/../override/controllers/'.$className.'.php'))
|
||||
require_once(dirname(__FILE__).'/../override/controllers/'.$className.'.php');
|
||||
@@ -45,6 +53,9 @@ class ControllerFactoryCore
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.5.0
|
||||
*/
|
||||
public static function getController($className, $auth = false, $ssl = false)
|
||||
{
|
||||
ControllerFactory::includeController($className);
|
||||
|
||||
@@ -193,7 +193,7 @@ class DispatcherCore
|
||||
$this->controller = 'index';
|
||||
if (!isset($controllers[$this->controller]))
|
||||
$this->controller = 'pagenotfound';
|
||||
ControllerFactory::getController($controllers[$this->controller])->run();
|
||||
Controller::getController($controllers[$this->controller])->run();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,20 +25,20 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class FrontControllerCore
|
||||
class FrontControllerCore extends ControllerCore
|
||||
{
|
||||
public $errors = array();
|
||||
/**
|
||||
* @var Context
|
||||
*/
|
||||
protected $context;
|
||||
|
||||
|
||||
/* Deprecated shortcuts as of 1.5 - Use $context->var instead */
|
||||
protected static $smarty;
|
||||
protected static $cookie;
|
||||
protected static $link;
|
||||
protected static $cart;
|
||||
|
||||
|
||||
public $iso;
|
||||
|
||||
public $orderBy;
|
||||
@@ -59,7 +59,7 @@ class FrontControllerCore
|
||||
public static $initialized = false;
|
||||
|
||||
protected static $currentCustomerGroups;
|
||||
|
||||
|
||||
public $css_files;
|
||||
public $js_files;
|
||||
public $nb_items_per_page;
|
||||
@@ -94,17 +94,17 @@ class FrontControllerCore
|
||||
self::$initialized = true;
|
||||
|
||||
$this->context = Context::getContext();
|
||||
|
||||
|
||||
$this->id_current_shop = Context::getContext()->shop->getID();
|
||||
$this->id_current_group_shop = Context::getContext()->shop->getGroupID();
|
||||
|
||||
$this->css_files = array();
|
||||
$this->js_files = array();
|
||||
|
||||
|
||||
// For compatibility with globals, DEPRECATED as of version 1.5
|
||||
$css_files = $this->css_files;
|
||||
$js_files = $this->js_files;
|
||||
|
||||
|
||||
if ($this->ssl AND !Tools::usingSecureMode() AND Configuration::get('PS_SSL_ENABLED'))
|
||||
{
|
||||
header('HTTP/1.1 301 Moved Permanently');
|
||||
@@ -126,13 +126,13 @@ class FrontControllerCore
|
||||
$this->context->smarty->ps_currency = $currency;
|
||||
|
||||
$this->context->smarty->ps_language = $this->context->language;
|
||||
|
||||
|
||||
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR Tools::usingSecureMode()) ? 'https://' : 'http://';
|
||||
$useSSL = ((isset($this->ssl) AND $this->ssl AND Configuration::get('PS_SSL_ENABLED')) OR Tools::usingSecureMode()) ? true : false;
|
||||
$protocol_content = ($useSSL) ? 'https://' : 'http://';
|
||||
$link = new Link($protocol_link, $protocol_content);
|
||||
$this->context->link = $link;
|
||||
|
||||
|
||||
if ($this->auth AND !$this->context->customer->isLogged($this->guestAllowed))
|
||||
Tools::redirect('index.php?controller=authentication'.($this->authRedirection ? '&back='.$this->authRedirection : ''));
|
||||
|
||||
@@ -165,8 +165,8 @@ class FrontControllerCore
|
||||
if ($cart->OrderExists())
|
||||
unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
|
||||
/* Delete product of cart, if user can't make an order from his country */
|
||||
elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) AND
|
||||
!in_array(strtoupper($this->context->cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND
|
||||
elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) AND
|
||||
!in_array(strtoupper($this->context->cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND
|
||||
$cart->nbProducts() AND intval(Configuration::get('PS_GEOLOCATION_NA_BEHAVIOR')) != -1 AND
|
||||
!self::isInWhitelistForGeolocation())
|
||||
unset($this->context->cookie->id_cart, $cart);
|
||||
@@ -180,7 +180,7 @@ class FrontControllerCore
|
||||
$cart->update();
|
||||
}
|
||||
/* Select an address if not set */
|
||||
if (isset($cart) && (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0 ||
|
||||
if (isset($cart) && (!isset($cart->id_address_delivery) || $cart->id_address_delivery == 0 ||
|
||||
!isset($cart->id_address_invoice) || $cart->id_address_invoice == 0) && $this->context->cookie->id_customer)
|
||||
{
|
||||
$to_update = false;
|
||||
@@ -344,14 +344,14 @@ class FrontControllerCore
|
||||
|
||||
$this->iso = $iso;
|
||||
$this->setMedia();
|
||||
|
||||
|
||||
if($this->context->cookie->id_country)
|
||||
$customer->geoloc_id_country = (int)$this->context->cookie->id_country;
|
||||
if($this->context->cookie->id_state)
|
||||
$customer->geoloc_id_state = (int)$this->context->cookie->id_state;
|
||||
if($this->context->cookie->postcode)
|
||||
$customer->geoloc_postcode = (int)$this->context->cookie->postcode;
|
||||
|
||||
|
||||
$this->context->cart = $cart;
|
||||
$this->context->currency = $currency;
|
||||
$this->context->controller = $this;
|
||||
@@ -419,7 +419,7 @@ class FrontControllerCore
|
||||
$gi = geoip_open(realpath(_PS_GEOIP_DIR_.'GeoLiteCity.dat'), GEOIP_STANDARD);
|
||||
$record = geoip_record_by_addr($gi, '81.57.72.226');//Tools::getRemoteAddr());
|
||||
|
||||
if (is_object($record))
|
||||
if (is_object($record))
|
||||
{
|
||||
if (!in_array(strtoupper($record->country_code), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) AND !self::isInWhitelistForGeolocation())
|
||||
{
|
||||
@@ -501,7 +501,7 @@ class FrontControllerCore
|
||||
// if this function is called from a module, do a fast init
|
||||
else if (!$this->context)
|
||||
$this->context = Context::getContext();
|
||||
|
||||
|
||||
// P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies)
|
||||
header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
|
||||
|
||||
@@ -521,7 +521,7 @@ class FrontControllerCore
|
||||
'HOOK_TOP' => Module::hookExec('top'),
|
||||
'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn')
|
||||
));
|
||||
|
||||
|
||||
if ((Configuration::get('PS_CSS_THEME_CACHE') OR Configuration::get('PS_JS_THEME_CACHE')) AND is_writable(_PS_THEME_DIR_.'cache'))
|
||||
{
|
||||
// CSS compressor management
|
||||
@@ -573,7 +573,7 @@ class FrontControllerCore
|
||||
// 'orderbydefault' => Tools::getProductsOrder('by'),
|
||||
// 'orderwayposition' => Tools::getProductsOrder('way'), // Deprecated: orderwayposition
|
||||
// 'orderwaydefault' => Tools::getProductsOrder('way'),
|
||||
|
||||
|
||||
$stock_management = (int)(Configuration::get('PS_STOCK_MANAGEMENT')) ? true : false; // no display quantity order if stock management disabled
|
||||
$orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity');
|
||||
$orderWayValues = array(0 => 'asc', 1 => 'desc');
|
||||
@@ -599,7 +599,7 @@ class FrontControllerCore
|
||||
$this->init();
|
||||
elseif (!$this->context)
|
||||
$this->context = Context::getContext();
|
||||
|
||||
|
||||
$nArray = (int)(Configuration::get('PS_PRODUCTS_PER_PAGE')) != 10 ? array((int)(Configuration::get('PS_PRODUCTS_PER_PAGE')), 10, 20, 50) : array(10, 20, 50);
|
||||
asort($nArray);
|
||||
$this->n = abs((int)(Tools::getValue('n', ((isset($this->context->cookie->nb_item_per_page) AND $this->context->cookie->nb_item_per_page >= 10) ? $this->context->cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE'))))));
|
||||
@@ -639,7 +639,7 @@ class FrontControllerCore
|
||||
{
|
||||
if (!Group::isFeatureActive())
|
||||
return array();
|
||||
|
||||
|
||||
$context = Context::getContext();
|
||||
if (!$context->customer->id)
|
||||
return array();
|
||||
@@ -664,7 +664,7 @@ class FrontControllerCore
|
||||
$allowed = true;
|
||||
return $allowed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addCSS allows you to add stylesheet at any time.
|
||||
*
|
||||
@@ -680,7 +680,7 @@ class FrontControllerCore
|
||||
$this->addCSS($file, $media_type);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//overriding of modules css files
|
||||
$different = 0;
|
||||
$override_path = str_replace(__PS_BASE_URI__.'modules/', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/css/modules/', $css_uri, $different);
|
||||
@@ -707,7 +707,7 @@ class FrontControllerCore
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addJS load a javascript file in the header
|
||||
*
|
||||
@@ -756,6 +756,6 @@ class FrontControllerCore
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -25,18 +25,18 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class Notification
|
||||
{
|
||||
class NotificationCore
|
||||
{
|
||||
public $types;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->types = array('order', 'message', 'customer');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getLastElements return all the notifications (new order, new customer registration, and new customer message)
|
||||
* Get all the notifications
|
||||
* Get all the notifications
|
||||
*
|
||||
* @return array containing the notifications
|
||||
*/
|
||||
@@ -44,38 +44,38 @@ class Notification
|
||||
{
|
||||
$notifications = array();
|
||||
$employee_infos = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT id_last_order, id_last_message, id_last_customer
|
||||
FROM `'._DB_PREFIX_.'employee`
|
||||
SELECT id_last_order, id_last_message, id_last_customer
|
||||
FROM `'._DB_PREFIX_.'employee`
|
||||
WHERE `id_employee` = '.(int)Context::getContext()->employee->id);
|
||||
|
||||
|
||||
foreach ($this->types as $type)
|
||||
$notifications[$type] = Notification::getLastElementsIdsByType($type, $employee_infos['id_last_'.$type]);
|
||||
|
||||
return $notifications;
|
||||
|
||||
return $notifications;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getLastElementsIdsByType return all the element ids to show (order, customer registration, and customer message)
|
||||
* Get all the element ids
|
||||
*
|
||||
* @param string $type contains the field name of the Employee table
|
||||
* @param integer $id_last_element contains the id of the last seen element
|
||||
* @param integer $id_last_element contains the id of the last seen element
|
||||
* @return array containing the notifications
|
||||
*/
|
||||
public static function getLastElementsIdsByType($type, $id_last_element)
|
||||
{
|
||||
|
||||
|
||||
if ($type == 'order' || $type == 'message')
|
||||
$sql = 'SELECT id_order, id_customer, '.(($type == 'order') ? 'total_paid_real' : 'message').'
|
||||
FROM `'._DB_PREFIX_.(($type == 'order') ? pSQL($type).'s' : pSQL($type)).'`
|
||||
WHERE `id_'.pSQL($type).'` > '.(int)$id_last_element.'
|
||||
FROM `'._DB_PREFIX_.(($type == 'order') ? pSQL($type).'s' : pSQL($type)).'`
|
||||
WHERE `id_'.pSQL($type).'` > '.(int)$id_last_element.'
|
||||
ORDER BY `id_'.pSQL($type).'` DESC LIMIT 5';
|
||||
else
|
||||
$sql = 'SELECT id_'.pSQL($type).'
|
||||
FROM `'._DB_PREFIX_.pSQL($type).'`
|
||||
WHERE `id_'.pSQL($type).'` > '.(int)$id_last_element.'
|
||||
$sql = 'SELECT id_'.pSQL($type).'
|
||||
FROM `'._DB_PREFIX_.pSQL($type).'`
|
||||
WHERE `id_'.pSQL($type).'` > '.(int)$id_last_element.'
|
||||
ORDER BY `id_'.pSQL($type).'` DESC LIMIT 5';
|
||||
|
||||
|
||||
$json = array();
|
||||
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql) as $key => $value)
|
||||
{
|
||||
@@ -93,28 +93,28 @@ class Notification
|
||||
'message_customer' => ((isset($value['message'])) ? substr(strip_tags($value['message']), 0, 20) : '')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* updateEmployeeLastElement return 0 if the field doesn't exists in Employee table.
|
||||
* Updates the last seen element by the employee
|
||||
* Updates the last seen element by the employee
|
||||
*
|
||||
* @param string $type contains the field name of the Employee table
|
||||
* @return boolean if type exists or not
|
||||
*/
|
||||
public function updateEmployeeLastElement($type)
|
||||
{
|
||||
{
|
||||
if (in_array($type, $this->types))
|
||||
// We update the last item viewed
|
||||
return Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'employee`
|
||||
SET `id_last_'.pSQL($type).'` = (SELECT MAX(`id_'.$type.'`)
|
||||
FROM `'._DB_PREFIX_.(($type == 'order') ? pSQL($type).'s' : pSQL($type)).'`)
|
||||
WHERE `id_employee` = '.(int)Context::getContext()->employee->id);
|
||||
else
|
||||
UPDATE `'._DB_PREFIX_.'employee`
|
||||
SET `id_last_'.pSQL($type).'` = (SELECT MAX(`id_'.$type.'`)
|
||||
FROM `'._DB_PREFIX_.(($type == 'order') ? pSQL($type).'s' : pSQL($type)).'`)
|
||||
WHERE `id_employee` = '.(int)Context::getContext()->employee->id);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7331 $
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -25,7 +25,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class getFileControllerCore extends FrontController
|
||||
class GetFileControllerCore extends FrontController
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
ControllerFactory::includeController('ParentOrderController');
|
||||
|
||||
class OrderControllerCore extends ParentOrderController
|
||||
{
|
||||
public $step;
|
||||
@@ -98,11 +96,11 @@ class OrderControllerCore extends ParentOrderController
|
||||
$this->_assignCarrier();
|
||||
break;
|
||||
case 3:
|
||||
//Test that the conditions (so active) were accepted by the customer
|
||||
//Test that the conditions (so active) were accepted by the customer
|
||||
$cgv = Tools::getValue('cgv');
|
||||
if (Configuration::get('PS_CONDITIONS') AND (!Validate::isBool($cgv)))
|
||||
Tools::redirect('index.php?controller=order&step=2');
|
||||
|
||||
|
||||
if(Tools::isSubmit('processCarrier'))
|
||||
$this->processCarrier();
|
||||
$this->autoStep();
|
||||
@@ -135,7 +133,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
|
||||
$invoiceAddressFields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country, false, true);
|
||||
$deliveryAddressFields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country, false, true);
|
||||
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'inv_adr_fields' => $invoiceAddressFields,
|
||||
'dlv_adr_fields' => $deliveryAddressFields));
|
||||
@@ -144,7 +142,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'currencySign' => $this->context->currency->sign,
|
||||
'currencyRate' => $this->context->currency->conversion_rate,
|
||||
@@ -277,7 +275,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
|
||||
// Redirect instead of displaying payment modules if any module are grefted on
|
||||
Hook::backBeforePayment('order.php?step=3');
|
||||
|
||||
|
||||
/* We may need to display an order summary */
|
||||
$this->context->smarty->assign($this->context->cart->getSummaryDetails());
|
||||
$this->context->smarty->assign(array(
|
||||
@@ -285,7 +283,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
'taxes_enabled' => (int)(Configuration::get('PS_TAX'))
|
||||
));
|
||||
$this->context->cart->checkedTOS = '1';
|
||||
|
||||
|
||||
parent::_assignPayment();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
ControllerFactory::includeController('ParentOrderController');
|
||||
|
||||
class OrderOpcControllerCore extends ParentOrderController
|
||||
{
|
||||
public $php_self = 'order-opc';
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7104 $
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7104 $
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
7
override/classes/Controller.php
Normal file
7
override/classes/Controller.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
abstract class Controller extends ControllerCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
7
override/classes/FileUploader.php
Normal file
7
override/classes/FileUploader.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class FileUploader extends FileUploaderCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
7
override/classes/Group.php
Normal file
7
override/classes/Group.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Group extends GroupCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
7
override/classes/Notification.php
Normal file
7
override/classes/Notification.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class Notification extends NotificationCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
class CMSController extends CMSControllerCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
7
override/controllers/CmsController.php
Normal file
7
override/controllers/CmsController.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
class CmsController extends CmsControllerCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class pdfOrderReturnController extends pdfOrderReturnControllerCore
|
||||
class PdfOrderReturnController extends PdfOrderReturnControllerCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class pdfOrderSlipController extends pdfOrderSlipControllerCore
|
||||
class PdfOrderSlipController extends PdfOrderSlipControllerCore
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user