// Fix PrestaShopException typo

This commit is contained in:
rMalie
2012-01-04 13:53:19 +00:00
parent 1ad456ad41
commit 4b17d64cf7
36 changed files with 96 additions and 86 deletions
+4 -4
View File
@@ -112,13 +112,13 @@ class AdminAccessControllerCore extends AdminController
public function ajaxProcessUpdateAccess()
{
if ($this->tabAccess['edit'] != '1')
throw new PrestashopException(Tools::displayError('You do not have permission to edit here.'));
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.'));
if (Tools::isSubmit('submitAddAccess'))
{
$perm = Tools::getValue('perm');
if (!in_array($perm, array('view', 'add', 'edit', 'delete', 'all')))
throw new PrestashopException('permission not exists');
throw new PrestaShopException('permission not exists');
$enabled = (int)Tools::getValue('enabled');
$id_tab = (int)Tools::getValue('id_tab');
@@ -165,7 +165,7 @@ class AdminAccessControllerCore extends AdminController
public function ajaxProcessUpdateModuleAccess()
{
if ($this->tabAccess['edit'] != '1')
throw new PrestashopException(Tools::displayError('You do not have permission to edit here.'));
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.'));
/* Update Access Modules */
if (Tools::isSubmit('changeModuleAccess'))
@@ -177,7 +177,7 @@ class AdminAccessControllerCore extends AdminController
$res = true;
if (!in_array($perm, array('view', 'configure')))
throw new PrestashopException('permission not exists');
throw new PrestaShopException('permission not exists');
if ($id_module == -1)
{
+1 -1
View File
@@ -67,7 +67,7 @@ class AdminCatalogControllerCore extends AdminController
}
self::$_category = new Category($id_category);
if (!Validate::isLoadedObject(self::$_category))
throw new PrestashopException('Category cannot be loaded');
throw new PrestaShopException('Category cannot be loaded');
$this->table = array('category', 'product');
// $this->adminCategories = new AdminCategories();
+1 -1
View File
@@ -560,7 +560,7 @@ class AdminModulesControllerCore extends AdminController
// We check if method of module exists
if (!method_exists($module, $method))
throw new PrestashopException('Method of module can\'t be found');
throw new PrestaShopException('Method of module can\'t be found');
// Get the return value of current method
$echo = $module->{$method}();
+9 -9
View File
@@ -195,9 +195,9 @@ class AdminOrdersControllerCore extends AdminController
$customer = new Customer((int)$order->id_customer);
$carrier = new Carrier((int)$order->id_carrier);
if (!Validate::isLoadedObject($customer))
throw new PrestashopException('Can\'t load Customer object');
throw new PrestaShopException('Can\'t load Customer object');
if (!Validate::isLoadedObject($carrier))
throw new PrestashopException('Can\'t load Carrier object');
throw new PrestaShopException('Can\'t load Carrier object');
$templateVars = array(
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
'{firstname}' => $customer->firstname,
@@ -644,14 +644,14 @@ class AdminOrdersControllerCore extends AdminController
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order))
throw new PrestashopException('Con\'t load Order object');
throw new PrestaShopException('Con\'t load Order object');
if (Tools::getValue('new_currency') != $order->id_currency && !$order->valid)
{
$old_currency = new Currency($order->id_currency);
$currency = new Currency(Tools::getValue('new_currency'));
if (!Validate::isLoadedObject($currency))
throw new PrestashopException('Can\'t load Currency object');
throw new PrestaShopException('Can\'t load Currency object');
// Update order detail amount
foreach($order->getOrderDetailList() as $row)
@@ -718,7 +718,7 @@ class AdminOrdersControllerCore extends AdminController
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order))
throw new PrestashopException('Order can\'t be loaded');
throw new PrestaShopException('Order can\'t be loaded');
if ($order->hasInvoice())
$this->_errors[] = Tools::displayError('This order has already invoice');
@@ -740,7 +740,7 @@ class AdminOrdersControllerCore extends AdminController
{
$order_invoice = new OrderInvoice($order_cart_rule->id_order_invoice);
if (!ValidateCore::isLoadedObject($order_invoice))
throw new PrestashopException('Can\'t load Order Invoice object');
throw new PrestaShopException('Can\'t load Order Invoice object');
// Update amounts of Order Invoice
$order_invoice->total_discount_tax_excl -= $order_cart_rule->value_tax_excl;
@@ -783,7 +783,7 @@ class AdminOrdersControllerCore extends AdminController
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order))
throw new PrestashopException('Can\'t load Order object');
throw new PrestaShopException('Can\'t load Order object');
if ($order->hasInvoice())
{
@@ -792,7 +792,7 @@ class AdminOrdersControllerCore extends AdminController
{
$order_invoice = new OrderInvoice(Tools::getValue('discount_invoice'));
if (!Validate::isLoadedObject($order_invoice))
throw new PrestashopException('Can\'t load Order Invoice object');
throw new PrestaShopException('Can\'t load Order Invoice object');
}
}
@@ -947,7 +947,7 @@ class AdminOrdersControllerCore extends AdminController
{
$order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order))
throw new PrestashopException('object can\'t be loaded');
throw new PrestaShopException('object can\'t be loaded');
$customer = new Customer($order->id_customer);
$carrier = new Carrier($order->id_carrier);
@@ -142,29 +142,29 @@ class AdminOutstandingControllerCore extends AdminController
{
$order_invoice = new OrderInvoice($id_invoice);
if (!Validate::isLoadedObject($order_invoice))
throw new PrestashopException('object OrderInvoice can\'t be loaded');
throw new PrestaShopException('object OrderInvoice can\'t be loaded');
$order = new Order($order_invoice->id_order);
if (!Validate::isLoadedObject($order))
throw new PrestashopException('object Order can\'t be loaded');
throw new PrestaShopException('object Order can\'t be loaded');
$customer = new Customer((int)$order->id_customer);
if (!Validate::isLoadedObject($order_invoice))
throw new PrestashopException('object Customer can\'t be loaded');
throw new PrestaShopException('object Customer can\'t be loaded');
return '<b>'.$customer->getOutstanding().'</b>';
}
/**
* View render
* @throws PrestashopException Invalid objects
* @throws PrestaShopException Invalid objects
*/
public function renderView()
{
$order_invoice = new OrderInvoice((int) Tools::getValue('id_order_invoice'));
if (!Validate::isLoadedObject($order_invoice))
throw new PrestashopException('object OrderInvoice can\'t be loaded');
throw new PrestaShopException('object OrderInvoice can\'t be loaded');
$order = new Order($order_invoice->id_order);
if (!Validate::isLoadedObject($order))
throw new PrestashopException('object Order can\'t be loaded');
throw new PrestaShopException('object Order can\'t be loaded');
$link = $this->context->link->getAdminLink('AdminOrders');
$link .= '&vieworder&id_order='.$order->id;
@@ -2153,7 +2153,7 @@ class AdminProductsControllerCore extends AdminController
$this->tpl_form_vars['product'] = $this->object;
if ($this->ajax)
if (!isset($this->tpl_form_vars['custom_form']))
throw new PrestashopException('custom_form empty for action '.$this->tab_display);
throw new PrestaShopException('custom_form empty for action '.$this->tab_display);
else
return $this->tpl_form_vars['custom_form'];
}
@@ -758,10 +758,10 @@ class AdminTranslationsControllerCore extends AdminController
${$var} = array();
if (!file_exists($dir))
if (!mkdir($dir, 0700))
throw new PrestashopException('Directory '.$dir.' cannot be created.');
throw new PrestaShopException('Directory '.$dir.' cannot be created.');
if (!file_exists($dir.DIRECTORY_SEPARATOR.$file))
if (!file_put_contents($dir.'/'.$file, "<?php\n\nglobal \$".$var.";\n\$".$var." = array();\n\n?>"))
throw new PrestashopException('File "'.$file.'" doesn\'t exists and cannot be created in '.$dir);
throw new PrestaShopException('File "'.$file.'" doesn\'t exists and cannot be created in '.$dir);
if (!is_writable($dir.DIRECTORY_SEPARATOR.$file))
$this->displayWarning(Tools::displayError('This file must be writable:').' '.$dir.'/'.$file);
include($dir.DIRECTORY_SEPARATOR.$file);