Fixing js in the installation process for single/several DBs

skala
Julio Montoya 15 years ago
parent 8bffd44426
commit 73126a53f5
  1. 43
      main/install/index.php
  2. 2
      main/install/install.lib.php

@ -17,11 +17,11 @@
/* CONSTANTS */
define('SYSTEM_INSTALLATION', 1);
define('INSTALL_TYPE_UPDATE', 'update');
define('FORM_FIELD_DISPLAY_LENGTH', 40);
define('DATABASE_FORM_FIELD_DISPLAY_LENGTH', 25);
define('MAX_FORM_FIELD_LENGTH', 80);
define('SYSTEM_INSTALLATION', 1);
define('INSTALL_TYPE_UPDATE', 'update');
define('FORM_FIELD_DISPLAY_LENGTH', 40);
define('DATABASE_FORM_FIELD_DISPLAY_LENGTH', 25);
define('MAX_FORM_FIELD_LENGTH', 80);
/* PHP VERSION CHECK */
@ -317,13 +317,13 @@ if ($encryptPassForm == '1') {
$(document).ready( function() {
//checked
if ($('#singleDb1').attr('checked')==false) {
$('#dbStatsForm').removeAttr('disabled');
$('#dbUserForm').removeAttr('disabled');
//$('#dbStatsForm').removeAttr('disabled');
//$('#dbUserForm').removeAttr('disabled');
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
} else if($('#singleDb1').attr('checked')==true){
$('#dbStatsForm').attr('disabled','disabled');
$('#dbUserForm').attr('disabled','disabled');
//$('#dbStatsForm').attr('disabled','disabled');
//$('#dbUserForm').attr('disabled','disabled');
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
}
@ -341,11 +341,13 @@ if ($encryptPassForm == '1') {
if (my_option=='singleDb1') {
$('#optional_param2').hide();
$('#optional_param4').hide();
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
} else if (my_option=='singleDb0') {
$('#optional_param2').show();
$('#optional_param4').show();
$('#dbStatsForm').attr('value','chamilo_main');
$('#dbUserForm').attr('value','chamilo_main');
}
@ -353,14 +355,21 @@ if ($encryptPassForm == '1') {
</script>
<script language="javascript">
init_visibility=0;
function show_hide_option() {
if(init_visibility == 0) {
document.getElementById('optional_param1').style.display = '';
document.getElementById('optional_param2').style.display = '';
if(document.getElementById('optional_param3')) {
function show_hide_option() {
if (init_visibility == 0) {
$('#optional_param1').show();
if ($('#singleDb1').attr("checked") == true) {
$('#optional_param2').hide();
$('#optional_param4').hide();
} else {
$('#optional_param2').show();
$('#optional_param4').show();
}
//document.getElementById('optional_param2').style.display = '';
if (document.getElementById('optional_param3')) {
document.getElementById('optional_param3').style.display = '';
}
document.getElementById('optional_param4').style.display = '';
//document.getElementById('optional_param5').style.display = '';
document.getElementById('optional_param6').style.display = '';
init_visibility = 1;
@ -368,7 +377,7 @@ if ($encryptPassForm == '1') {
} else {
document.getElementById('optional_param1').style.display = 'none';
document.getElementById('optional_param2').style.display = 'none';
if(document.getElementById('optional_param3')) {
if (document.getElementById('optional_param3')) {
document.getElementById('optional_param3').style.display = 'none';
}
document.getElementById('optional_param4').style.display = 'none';

@ -1654,7 +1654,7 @@ function display_database_settings_form($installType, $dbHostForm, $dbUsernameFo
</tr>
</div>
<?php
display_database_parameter($installType, get_lang('MainDB'), 'dbNameForm', $dbNameForm, '&nbsp;', null, 'id="optional_param1" style="display:none;"');
display_database_parameter($installType, get_lang('MainDB'), 'dbNameForm', $dbNameForm, '&nbsp;', null, 'id="optional_param1" style="display:none;"');
display_database_parameter($installType, get_lang('StatDB'), 'dbStatsForm', $dbStatsForm, '&nbsp;', null, 'id="optional_param2" style="display:none;"');
if ($installType == 'update' && in_array($_POST['old_version'], $update_from_version_6)) {
display_database_parameter($installType, get_lang('ScormDB'), 'dbScormForm', $dbScormForm, '&nbsp;', null, 'id="optional_param3" style="display:none;"');

Loading…
Cancel
Save