// validateControler => validateController

This commit is contained in:
fBrignoli
2011-08-10 15:39:15 +00:00
parent 2599e1c73a
commit 840c09aaaf
+15 -15
View File
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -35,7 +35,7 @@ class AddressControllerCore extends FrontController
public $php_self = 'address'; public $php_self = 'address';
public $authRedirection = 'addresses'; public $authRedirection = 'addresses';
public $ssl = true; public $ssl = true;
protected $_address; protected $_address;
public function preProcess() public function preProcess()
@@ -45,7 +45,7 @@ class AddressControllerCore extends FrontController
$this->context->smarty->assign('back', Tools::safeOutput($back)); $this->context->smarty->assign('back', Tools::safeOutput($back));
if ($mod = Tools::getValue('mod')) if ($mod = Tools::getValue('mod'))
$this->context->smarty->assign('mod', Tools::safeOutput($mod)); $this->context->smarty->assign('mod', Tools::safeOutput($mod));
if (Tools::isSubmit('ajax') AND Tools::isSubmit('type')) if (Tools::isSubmit('ajax') AND Tools::isSubmit('type'))
{ {
if (Tools::getValue('type') == 'delivery') if (Tools::getValue('type') == 'delivery')
@@ -57,7 +57,7 @@ class AddressControllerCore extends FrontController
} }
else else
$id_address = (int)Tools::getValue('id_address', 0); $id_address = (int)Tools::getValue('id_address', 0);
if ($id_address) if ($id_address)
{ {
$this->_address = new Address((int)$id_address); $this->_address = new Address((int)$id_address);
@@ -83,7 +83,7 @@ class AddressControllerCore extends FrontController
if (Tools::isSubmit('submitAddress')) if (Tools::isSubmit('submitAddress'))
{ {
$address = new Address(); $address = new Address();
$this->errors = $address->validateControler(); $this->errors = $address->validateController();
$address->id_customer = (int)$this->context->customer->id; $address->id_customer = (int)$this->context->customer->id;
if (!Tools::getValue('phone') AND !Tools::getValue('phone_mobile')) if (!Tools::getValue('phone') AND !Tools::getValue('phone_mobile'))
@@ -130,7 +130,7 @@ class AddressControllerCore extends FrontController
if ((int)($country->contains_states) AND !(int)($address->id_state)) if ((int)($country->contains_states) AND !(int)($address->id_state))
$this->errors[] = Tools::displayError('This country requires a state selection.'); $this->errors[] = Tools::displayError('This country requires a state selection.');
if (!sizeof($this->errors)) if (!sizeof($this->errors))
{ {
if (isset($id_address)) if (isset($id_address))
@@ -183,7 +183,7 @@ class AddressControllerCore extends FrontController
if (Tools::isSubmit('ajax')) if (Tools::isSubmit('ajax'))
{ {
$return = array( $return = array(
'hasError' => !empty($this->errors), 'hasError' => !empty($this->errors),
'errors' => $this->errors, 'errors' => $this->errors,
'id_address_delivery' => $this->context->cart->id_address_delivery, 'id_address_delivery' => $this->context->cart->id_address_delivery,
'id_address_invoice' => $this->context->cart->id_address_invoice 'id_address_invoice' => $this->context->cart->id_address_invoice
@@ -206,19 +206,19 @@ class AddressControllerCore extends FrontController
if (Tools::isSubmit('ajax') AND sizeof($this->errors)) if (Tools::isSubmit('ajax') AND sizeof($this->errors))
{ {
$return = array( $return = array(
'hasError' => !empty($this->errors), 'hasError' => !empty($this->errors),
'errors' => $this->errors 'errors' => $this->errors
); );
die(Tools::jsonEncode($return)); die(Tools::jsonEncode($return));
} }
} }
public function setMedia() public function setMedia()
{ {
parent::setMedia(); parent::setMedia();
$this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js'); $this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
} }
public function process() public function process()
{ {
parent::process(); parent::process();
@@ -257,9 +257,9 @@ class AddressControllerCore extends FrontController
$this->context->smarty->assign('vat_display', 0); $this->context->smarty->assign('vat_display', 0);
$this->context->smarty->assign('ajaxurl', _MODULE_DIR_); $this->context->smarty->assign('ajaxurl', _MODULE_DIR_);
$this->context->smarty->assign('vatnumber_ajax_call', (int)file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php')); $this->context->smarty->assign('vatnumber_ajax_call', (int)file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'countries_list' => $countriesList, 'countries_list' => $countriesList,
'countries' => $countries, 'countries' => $countries,
@@ -277,13 +277,13 @@ class AddressControllerCore extends FrontController
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, true, true); $dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, true, true);
$this->context->smarty->assign('ordered_adr_fields', $dlv_adr_fields); $this->context->smarty->assign('ordered_adr_fields', $dlv_adr_fields);
} }
public function displayHeader() public function displayHeader()
{ {
if (Tools::getValue('ajax') != 'true') if (Tools::getValue('ajax') != 'true')
parent::displayHeader(); parent::displayHeader();
} }
public function displayContent() public function displayContent()
{ {
parent::displayContent(); parent::displayContent();
@@ -291,7 +291,7 @@ class AddressControllerCore extends FrontController
$this->_processAddressFormat(); $this->_processAddressFormat();
$this->context->smarty->display(_PS_THEME_DIR_.'address.tpl'); $this->context->smarty->display(_PS_THEME_DIR_.'address.tpl');
} }
public function displayFooter() public function displayFooter()
{ {
if (Tools::getValue('ajax') != 'true') if (Tools::getValue('ajax') != 'true')