[svn r13194] Fix bug on new install with singledb whereby multiple databases were not created but the configuration setting was still giving a different name for stats, scorm and user databases.

Also removed SCORM database setting and added some javascript (not very elegant) to deactivate the user and stats fields on new installs when clicking "single DB" option
skala
Yannick Warnier 18 years ago
parent de462952c2
commit bd830c2b95
  1. 14
      main/install/index.php
  2. 13
      main/install/install_functions.inc.php

@ -381,9 +381,23 @@ elseif (!empty($_POST['step5']))
<input type="hidden" name="singleDbForm" value="<?php echo htmlentities($singleDbForm); ?>" />
<input type="hidden" name="dbPrefixForm" value="<?php echo htmlentities($dbPrefixForm); ?>" />
<input type="hidden" name="dbNameForm" value="<?php echo htmlentities($dbNameForm); ?>" />
<?php
if($installType == 'update' OR $singleDbForm == 0)
{
?>
<input type="hidden" name="dbStatsForm" value="<?php echo htmlentities($dbStatsForm); ?>" />
<input type="hidden" name="dbScormForm" value="<?php echo htmlentities($dbScormForm); ?>" />
<input type="hidden" name="dbUserForm" value="<?php echo htmlentities($dbUserForm); ?>" />
<?php
}
else
{
?>
<input type="hidden" name="dbStatsForm" value="<?php echo htmlentities($dbNameForm); ?>" />
<input type="hidden" name="dbUserForm" value="<?php echo htmlentities($dbNameForm); ?>" />
<?php
}
?>
<input type="hidden" name="enableTrackingForm" value="<?php echo htmlentities($enableTrackingForm); ?>" />
<input type="hidden" name="allowSelfReg" value="<?php echo htmlentities($allowSelfReg); ?>" />
<input type="hidden" name="allowSelfRegProf" value="<?php echo htmlentities($allowSelfRegProf); ?>" />

@ -710,11 +710,11 @@ function display_database_parameter($install_type, $parameter_name, $form_field_
echo "<td>$parameter_name&nbsp;&nbsp;</td>\n";
if ($install_type == INSTALL_TYPE_UPDATE && $display_when_update)
{
echo '<td><input type="hidden" name="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'.$parameter_value."</td>\n";
echo '<td><input type="hidden" name="'.$form_field_name.'" id="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'.$parameter_value."</td>\n";
}
else
{
echo '<td><input type="text" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'."</td>\n";
echo '<td><input type="text" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$form_field_name.'" id="'.$form_field_name.'" value="'.htmlentities($parameter_value).'" />'."</td>\n";
echo "<td>$extra_notice</td>\n";
}
echo "</tr>\n";
@ -822,7 +822,10 @@ function display_database_settings_form($installType, $dbHostForm, $dbUsernameFo
//fields for the four standard Dokeos databases
display_database_parameter($installType, get_lang('MainDB'), 'dbNameForm', $dbNameForm, '&nbsp;');
display_database_parameter($installType, get_lang('StatDB'), 'dbStatsForm', $dbStatsForm, '&nbsp;');
display_database_parameter($installType, get_lang('ScormDB'), 'dbScormForm', $dbScormForm, '&nbsp;');
if($installType == 'update')
{
display_database_parameter($installType, get_lang('ScormDB'), 'dbScormForm', $dbScormForm, '&nbsp;');
}
display_database_parameter($installType, get_lang('UserDB'), 'dbUserForm', $dbUserForm, '&nbsp;');
?>
<tr>
@ -846,8 +849,8 @@ function display_database_settings_form($installType, $dbHostForm, $dbUsernameFo
<td><input type="hidden" name="singleDbForm" value="<?php echo $singleDbForm; ?>" /><?php echo $singleDbForm? get_lang('One') : get_lang('Several'); ?></td>
<?php else: ?>
<td>
<input class="checkbox" type="radio" name="singleDbForm" value="1" id="singleDb1" <?php echo $singleDbForm?'checked="checked" ':''; ?>/> <label for="singleDb1"><?php echo get_lang('One'); ?></label>
<input class="checkbox" type="radio" name="singleDbForm" value="0" id="singleDb0" <?php echo $singleDbForm?'':'checked="checked" '; ?>/> <label for="singleDb0"><?php echo get_lang('Several'); ?></label>
<input class="checkbox" type="radio" name="singleDbForm" value="1" id="singleDb1" <?php echo $singleDbForm?'checked="checked" ':''; ?> onclick="document.getElementById('dbStatsForm').disabled='true'; document.getElementById('dbUserForm').disabled='true';" /> <label for="singleDb1"><?php echo get_lang('One'); ?></label>
<input class="checkbox" type="radio" name="singleDbForm" value="0" id="singleDb0" <?php echo $singleDbForm?'':'checked="checked" '; ?> onclick="document.getElementById('dbStatsForm').disabled='false'; document.getElementById('dbUserForm').disabled='false';" /> <label for="singleDb0"><?php echo get_lang('Several'); ?></label>
</td>
<?php endif; ?>

Loading…
Cancel
Save