// Fix bug when fixtures are disabled + move install type (fixtures or not) to configure step

This commit is contained in:
rMalie
2012-02-07 13:37:37 +00:00
parent b63c04a22b
commit 85bee87920
7 changed files with 29 additions and 24 deletions
@@ -38,6 +38,7 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
// Save shop configuration // Save shop configuration
$this->session->shop_name = trim(Tools::getValue('shop_name')); $this->session->shop_name = trim(Tools::getValue('shop_name'));
$this->session->shop_activity = Tools::getValue('shop_activity'); $this->session->shop_activity = Tools::getValue('shop_activity');
$this->session->install_type = Tools::getValue('db_mode');
$this->session->shop_country = Tools::getValue('shop_country'); $this->session->shop_country = Tools::getValue('shop_country');
$this->session->shop_timezone = Tools::getValue('shop_timezone'); $this->session->shop_timezone = Tools::getValue('shop_timezone');
@@ -420,6 +421,9 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
sort($list_activities); sort($list_activities);
$this->list_activities = $list_activities; $this->list_activities = $list_activities;
// Install type
$this->install_type = ($this->session->install_type) ? $this->session->install_type : 'full';
$this->displayTemplate('configure'); $this->displayTemplate('configure');
} }
+1 -5
View File
@@ -54,8 +54,6 @@ class InstallControllerHttpDatabase extends InstallControllerHttp
*/ */
public function processNextStep() public function processNextStep()
{ {
$this->session->install_type = Tools::getValue('db_mode');
// Save database config // Save database config
$this->session->database_server = trim(Tools::getValue('dbServer')); $this->session->database_server = trim(Tools::getValue('dbServer'));
$this->session->database_name = trim(Tools::getValue('dbName')); $this->session->database_name = trim(Tools::getValue('dbName'));
@@ -151,7 +149,7 @@ class InstallControllerHttpDatabase extends InstallControllerHttp
*/ */
public function display() public function display()
{ {
if (!$this->session->install_type) if (!$this->session->database_server)
{ {
if (file_exists(_PS_ROOT_DIR_.'/config/settings.inc.php')) if (file_exists(_PS_ROOT_DIR_.'/config/settings.inc.php'))
{ {
@@ -174,7 +172,6 @@ class InstallControllerHttpDatabase extends InstallControllerHttp
} }
$this->database_clear = true; $this->database_clear = true;
$this->install_type = 'full';
$this->use_smtp = false; $this->use_smtp = false;
$this->smtp_server = 'smtp.'; $this->smtp_server = 'smtp.';
$this->smtp_encryption = 'off'; $this->smtp_encryption = 'off';
@@ -192,7 +189,6 @@ class InstallControllerHttpDatabase extends InstallControllerHttp
$this->database_prefix = $this->session->database_prefix; $this->database_prefix = $this->session->database_prefix;
$this->database_clear = $this->session->database_clear; $this->database_clear = $this->session->database_clear;
$this->install_type = $this->session->install_type;
$this->use_smtp = $this->session->use_smtp; $this->use_smtp = $this->session->use_smtp;
$this->smtp_server = $this->session->smtp_server; $this->smtp_server = $this->session->smtp_server;
$this->smtp_encryption = $this->session->smtp_encryption; $this->smtp_encryption = $this->session->smtp_encryption;
+1 -2
View File
@@ -91,7 +91,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->processInstallModules(); $this->processInstallModules();
else if (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModules'])) else if (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModules']))
$this->processInstallFixtures(); $this->processInstallFixtures();
else if (Tools::getValue('installTheme') && !empty($this->session->process_validated['installFixtures'])) else if (Tools::getValue('installTheme') && !empty($this->session->process_validated['installModules']))
$this->processInstallTheme(); $this->processInstallTheme();
else else
{ {
@@ -220,7 +220,6 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->model_install->xml_loader_ids = $this->session->xml_loader_ids; $this->model_install->xml_loader_ids = $this->session->xml_loader_ids;
if (!$this->model_install->installFixtures() || $this->model_install->getErrors()) if (!$this->model_install->installFixtures() || $this->model_install->getErrors())
$this->ajaxJsonAnswer(false, $this->model_install->getErrors()); $this->ajaxJsonAnswer(false, $this->model_install->getErrors());
$this->session->process_validated['installFixtures'] = true;
$this->ajaxJsonAnswer(true); $this->ajaxJsonAnswer(true);
} }
+2 -2
View File
@@ -12,7 +12,7 @@ function start_install()
if (is_installing) if (is_installing)
return; return;
is_installing = true; is_installing = true;
$('.process_step').removeClass('fail').removeClass('success').hide(); $('.process_step').removeClass('fail').removeClass('success').hide();
$('.error_log').hide(); $('.error_log').hide();
$('#progress_bar').show(); $('#progress_bar').show();
@@ -88,7 +88,7 @@ function install_error(step, errors)
var list_errors = errors; var list_errors = errors;
if ($.type(list_errors) == 'string') if ($.type(list_errors) == 'string')
list_errors = [list_errors]; list_errors = [list_errors];
var display = '<ol>'; var display = '<ol>';
$.each(list_errors, function(k, v) $.each(list_errors, function(k, v)
{ {
+5 -1
View File
@@ -215,9 +215,13 @@ div.field {
width:245px; width:245px;
vertical-align: top; vertical-align: top;
} }
div.field div.contentinput label {
display:inline;
margin-right: 10px;
}
div.field .userInfos { div.field .userInfos {
display:inline-block; display:inline-block;
width:200px; width:210px;
font-size:11px; font-size:11px;
font-family:Georgia; font-family:Georgia;
font-style:italic; font-style:italic;
+16
View File
@@ -34,6 +34,22 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
<p class="userInfos aligned"><?php echo $this->l('This information is not required, it will only be used for statistical purposes. This information does not change anything in your store.') ?></p> <p class="userInfos aligned"><?php echo $this->l('This information is not required, it will only be used for statistical purposes. This information does not change anything in your store.') ?></p>
</div> </div>
<!-- Install type (with fixtures or not) -->
<div class="field clearfix">
<label class="aligned"><?php echo $this->l('Install demo products:') ?></label>
<div class="contentinput">
<label>
<input value="full" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'full'): ?>checked="checked"<?php endif; ?> />
<?php echo $this->l('Yes') ?>
</label>
<label>
<input value="lite" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'lite'): ?>checked="checked"<?php endif; ?> />
<?php echo $this->l('No'); ?>
</label>
</div>
<p class="userInfos aligned"><?php echo $this->l('Demo products are a good way to learn how to use PrestaShop. You should install them if you are not familiar with it.') ?></p>
</div>
<!-- Country list --> <!-- Country list -->
<div class="field clearfix"> <div class="field clearfix">
<label for="infosCountry" class="aligned"><?php echo $this->l('Default country:') ?></label> <label for="infosCountry" class="aligned"><?php echo $this->l('Default country:') ?></label>
-14
View File
@@ -57,20 +57,6 @@
</div> </div>
</div> </div>
<!-- Install type (with fixtures or not) -->
<div id="dbTableParam">
<div>
<h2><?php echo $this->l('Installation type') ?></h2>
<p id="dbModeSetter" style="line-height: 20px;">
<input value="lite" type="radio" name="db_mode" id="db_mode_simple" style="vertical-align: middle;" <?php if ($this->install_type == 'lite'): ?>checked="checked"<?php endif; ?> />
<label for="db_mode_simple"><?php echo $this->l('Simple mode: Basic installation (FREE)'); ?></label><br />
<input value="full" type="radio" name="db_mode" id="db_mode_complet" style="vertical-align: middle;" <?php if ($this->install_type == 'full'): ?>checked="checked"<?php endif; ?> />
<label for="db_mode_complet"><?php echo $this->l('Sandbox mode: includes demo products (FREE)') ?></label>
</p>
</div>
</div>
<!-- Email configuration --> <!-- Email configuration -->
<div id="mailPart"> <div id="mailPart">
<h2><?php echo $this->l('E-mail delivery set-up') ?></h2> <h2><?php echo $this->l('E-mail delivery set-up') ?></h2>