Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ class CarrierCore extends ObjectModel
|
||||
'max_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_height' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'grade' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 1),
|
||||
'external_module_name' => array('type' => self::TYPE_STRING, 'size' => 64),
|
||||
'is_module' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
|
||||
@@ -2298,7 +2298,7 @@ class AdminControllerCore extends Controller
|
||||
else
|
||||
{
|
||||
$fieldValue = $this->getFieldValue($obj, $input['name']);
|
||||
if (empty($fieldValue) && isset($input['default_value']))
|
||||
if ($fieldValue === false && isset($input['default_value']))
|
||||
$fieldValue = $input['default_value'];
|
||||
$this->fields_value[$input['name']] = $fieldValue;
|
||||
}
|
||||
@@ -2320,9 +2320,9 @@ class AdminControllerCore extends Controller
|
||||
public function getFieldValue($obj, $key, $id_lang = null)
|
||||
{
|
||||
if ($id_lang)
|
||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : '';
|
||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||
else
|
||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : '';
|
||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
||||
|
||||
return Tools::getValue($key.($id_lang ? '_'.$id_lang : ''), $default_value);
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ class FrontControllerCore extends Controller
|
||||
$this->displayRestrictedCountryPage();
|
||||
|
||||
if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess())
|
||||
die(Tools::displayError());
|
||||
Tools::redirect('index.php?controller=404');
|
||||
|
||||
$this->iso = $iso;
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ class AdminModulesPositionsControllerCore extends AdminController
|
||||
{
|
||||
$url = $this->context->shop->getBaseURL().Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$url = str_replace('index.php', Language::getIsoById($this->context->employee->id_lang).'/', $url);
|
||||
$url = str_replace('index.php', ((count(Language::getLanguages(true)) > 1)? Language::getIsoById($this->context->employee->id_lang).'/' : ''), $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
@@ -379,8 +379,8 @@ class AuthControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('An account using this email address has already been registered.', false);
|
||||
// Preparing customer
|
||||
$customer = new Customer();
|
||||
$lastnameAddress = $_POST['lastname'];
|
||||
$firstnameAddress = $_POST['firstname'];
|
||||
$lastnameAddress = Tools::getValue('lastname');
|
||||
$firstnameAddress = Tools::getValue('firstname');
|
||||
$_POST['lastname'] = Tools::getValue('customer_lastname');
|
||||
$_POST['firstname'] = Tools::getValue('customer_firstname');
|
||||
|
||||
|
||||
@@ -405,9 +405,11 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
if (!$this->isLogged)
|
||||
{
|
||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_EXTRACARRIER' => null,
|
||||
'HOOK_EXTRACARRIER_ADDR' => null,
|
||||
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
|
||||
'carriers' => $carriers,
|
||||
'checked' => $this->context->cart->simulateCarrierSelectedOutput(),
|
||||
@@ -494,6 +496,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
$wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
|
||||
$wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
|
||||
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
||||
|
||||
$vars = array(
|
||||
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
|
||||
@@ -513,6 +516,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'delivery_option' => $delivery_option,
|
||||
'address_collection' => $this->context->cart->getAddressCollection(),
|
||||
'opc' => true,
|
||||
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
|
||||
'carriers' => $carriers,
|
||||
'delivery_option_list' => $this->context->cart->getDeliveryOptionList(),
|
||||
@@ -538,6 +542,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
)),
|
||||
'carrier_block' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-carrier.tpl')
|
||||
);
|
||||
|
||||
Cart::addExtraCarriers($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,9 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->processConfigureShop();
|
||||
elseif (Tools::getValue('installModules') && !empty($this->session->process_validated['configureShop']))
|
||||
$this->processInstallModules();
|
||||
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModules']))
|
||||
elseif (Tools::getValue('installModulesAddons') && !empty($this->session->process_validated['installModules']))
|
||||
$this->processInstallAddonsModules();
|
||||
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModulesAddons']))
|
||||
$this->processInstallFixtures();
|
||||
elseif (Tools::getValue('installTheme') && !empty($this->session->process_validated['installModules']))
|
||||
$this->processInstallTheme();
|
||||
@@ -231,6 +233,23 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->session->process_validated = array_merge($this->session->process_validated, array('installModules' => true));
|
||||
$this->ajaxJsonAnswer(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installModulesAddons
|
||||
* Install modules from addons
|
||||
*/
|
||||
public function processInstallAddonsModules()
|
||||
{
|
||||
$this->initializeContext();
|
||||
if ($module = Tools::getValue('module') && $id_module = Tools::getValue('id_module'))
|
||||
$result = $this->model_install->installModulesAddons(array('name' => $module, 'id_module' => $id_module));
|
||||
else
|
||||
$result = $this->model_install->installModulesAddons();
|
||||
if (!$result || $this->model_install->getErrors())
|
||||
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
|
||||
$this->session->process_validated = array_merge($this->session->process_validated, array('installModulesAddons' => true));
|
||||
$this->ajaxJsonAnswer(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installFixtures
|
||||
@@ -312,6 +331,8 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
*/
|
||||
public function display()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
// The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :)
|
||||
$low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M');
|
||||
|
||||
@@ -333,12 +354,17 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->process_steps[] = $populate_step;
|
||||
$this->process_steps[] = array('key' => 'configureShop', 'lang' => $this->l('Configure shop information'));
|
||||
|
||||
|
||||
$install_modules = array('key' => 'installModules', 'lang' => $this->l('Install modules'));
|
||||
if ($low_memory)
|
||||
foreach ($this->model_install->getModulesList() as $module)
|
||||
$install_modules['subtasks'][] = array('module' => $module);
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
|
||||
if ($low_memory)
|
||||
foreach ($this->model_install->getAddonsModulesList() as $module)
|
||||
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
// Fixtures are installed only if option is selected
|
||||
if ($this->session->install_type == 'full')
|
||||
|
||||
@@ -144,7 +144,7 @@ CREATE TABLE `PREFIX_carrier` (
|
||||
`max_width` int(10) DEFAULT 0,
|
||||
`max_height` int(10) DEFAULT 0,
|
||||
`max_depth` int(10) DEFAULT 0,
|
||||
`max_weight` int(10) DEFAULT 0,
|
||||
`max_weight` DECIMAL(20,6) DEFAULT 0,
|
||||
`grade` int(10) DEFAULT 0,
|
||||
PRIMARY KEY (`id_carrier`),
|
||||
KEY `deleted` (`deleted`,`active`),
|
||||
|
||||
@@ -585,7 +585,6 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
'statsvisits',
|
||||
);
|
||||
}
|
||||
|
||||
return $modules;
|
||||
}
|
||||
|
||||
@@ -602,18 +601,16 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
return $addons_modules;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PROCESS : installModules
|
||||
* Download module from addons and Install all modules in ~/modules/ directory
|
||||
*/
|
||||
public function installModules($module = null)
|
||||
public function installModulesAddons($module = null)
|
||||
{
|
||||
$modules = $module ? array($module) : $this->getModulesList();
|
||||
$addons_modules = $module ? array($module) : $this->getAddonsModulesList();
|
||||
$modules = array();
|
||||
if (!InstallSession::getInstance()->safe_mode)
|
||||
{
|
||||
$addons_modules = $this->getAddonsModulesList();
|
||||
|
||||
foreach($addons_modules as $addons_module)
|
||||
if (file_put_contents(_PS_MODULE_DIR_.$addons_module['name'].'.zip', Tools::addonsRequest('module', array('id_module' => $addons_module['id_module']))))
|
||||
if (Tools::ZipExtract(_PS_MODULE_DIR_.$addons_module['name'].'.zip', _PS_MODULE_DIR_))
|
||||
@@ -622,6 +619,27 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
unlink(_PS_MODULE_DIR_.$addons_module['name'].'.zip');
|
||||
}
|
||||
}
|
||||
$errors = array();
|
||||
foreach ($modules as $module_name)
|
||||
if (!$this->installModules($module_name))
|
||||
$errors[] = $this->language->l('Cannot install module "%s"', $module_name);
|
||||
|
||||
if ($errors)
|
||||
{
|
||||
$this->setError($errors);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installModules
|
||||
* Download module from addons and Install all modules in ~/modules/ directory
|
||||
*/
|
||||
public function installModules($module = null)
|
||||
{
|
||||
$modules = $module ? array($module) : $this->getModulesList();
|
||||
|
||||
$errors = array();
|
||||
foreach ($modules as $module_name)
|
||||
{
|
||||
@@ -634,7 +652,7 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
}
|
||||
|
||||
if ($errors)
|
||||
{
|
||||
{
|
||||
$this->setError($errors);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE `PREFIX_carrier` CHANGE `max_weight` `max_weight` DECIMAL( 20, 6 ) NULL DEFAULT '0';
|
||||
@@ -1267,10 +1267,11 @@ a.iframe {font-weight:bold}
|
||||
width:723px;
|
||||
border:1px solid #ccc
|
||||
}
|
||||
|
||||
#order-opc #opc_delivery_methods #message {
|
||||
width: 757px;
|
||||
}
|
||||
#order-opc #opc_payment_methods {margin-bottom:20px}
|
||||
#order-opc #opc_payment_methods #opc_payment_methods-content p{margin:0}
|
||||
|
||||
.delivery_option_carrier td {width:200px}
|
||||
.delivery_option_carrier td + td {width:280px;}
|
||||
.delivery_option_carrier td + td + td {width:200px}
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<h3>{l s='Leave a message'}</h3>
|
||||
<div>
|
||||
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
|
||||
<p><textarea cols="120" rows="3" name="message" id="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p>
|
||||
<p><textarea cols="120" rows="3" name="message" id="message">{if isset($oldMessage)}{$oldMessage|escape:'htmlall':'UTF-8'}{/if}</textarea></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user