Blocking button of step 6 when installing/updating the platform see #2483

skala
Julio Montoya 14 years ago
parent b61509ff70
commit f77b9f5e46
  1. 37
      main/install/index.php
  2. 4
      main/install/install.lib.php

@ -126,6 +126,7 @@ $software_name = 'Chamilo';
$software_url = 'http://www.chamilo.org/'; $software_url = 'http://www.chamilo.org/';
// A protection measure for already installed systems. // A protection measure for already installed systems.
if (is_already_installed_system()) { if (is_already_installed_system()) {
// The system has already been installed, so block re-installation. // The system has already been installed, so block re-installation.
$global_error_code = 6; $global_error_code = 6;
@ -312,6 +313,7 @@ if ($encryptPassForm == '1') {
/*]]>*/ /*]]>*/
</style> </style>
<script type="text/javascript" src="../inc/lib/javascript/jquery.min.js"></script> <script type="text/javascript" src="../inc/lib/javascript/jquery.min.js"></script>
<script type="text/javascript" > <script type="text/javascript" >
$(document).ready( function() { $(document).ready( function() {
//checked //checked
@ -332,9 +334,13 @@ if ($encryptPassForm == '1') {
$("#is_executable").attr("value",$(this).attr("name")); $("#is_executable").attr("value",$(this).attr("name"));
}); });
} ); //Blocking step6 button
</script> $("#button_step6").click(function() {
<script type="text/javascript"> $("#button_step6").attr('disable', true);
$("#button_step6").html('<?php echo addslashes(get_lang('PleaseWait'));?>');
$("#is_executable").attr("value",'step6');
});
});
function show_hide_tracking_and_user_db (my_option) { function show_hide_tracking_and_user_db (my_option) {
if (my_option=='singleDb1') { if (my_option=='singleDb1') {
@ -351,8 +357,7 @@ if ($encryptPassForm == '1') {
$('#dbUserForm').attr('value','chamilo_main'); $('#dbUserForm').attr('value','chamilo_main');
} }
} }
</script>
<script language="javascript">
init_visibility=0; init_visibility=0;
function show_hide_option() { function show_hide_option() {
if (init_visibility == 0) { if (init_visibility == 0) {
@ -385,9 +390,7 @@ if ($encryptPassForm == '1') {
document.getElementById('optionalparameters').innerHTML='<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" /> <?php echo get_lang('OptionalParameters', ''); ?>'; document.getElementById('optionalparameters').innerHTML='<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" /> <?php echo get_lang('OptionalParameters', ''); ?>';
init_visibility = 0; init_visibility = 0;
} }
} }
</script>
<script language="javascript">
$(document).ready( function() { $(document).ready( function() {
$(".advanced_parameters").click(function() { $(".advanced_parameters").click(function() {
@ -432,6 +435,7 @@ if ($encryptPassForm == '1') {
} }
</script> </script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
</head> </head>
<body dir="<?php echo api_get_text_direction(); ?>"> <body dir="<?php echo api_get_text_direction(); ?>">
@ -453,7 +457,7 @@ if ($encryptPassForm == '1') {
</div> </div>
<div id="main"> <div id="main">
<form style="padding: 0px; margin: 0px;" method="post" action="<?php echo api_get_self(); ?>?running=1&amp;installType=<?php echo $installType; ?>&amp;updateFromConfigFile=<?php echo urlencode($updateFromConfigFile); ?>"> <form id="install_form" style="padding: 0px; margin: 0px;" method="post" action="<?php echo api_get_self(); ?>?running=1&amp;installType=<?php echo $installType; ?>&amp;updateFromConfigFile=<?php echo urlencode($updateFromConfigFile); ?>">
<div id="installation_steps" style="width:220px"> <div id="installation_steps" style="width:220px">
<br /> <br />
<ol> <ol>
@ -676,17 +680,22 @@ if ($_POST['step2']) {
<?php if ($installType == 'new'): ?> <?php if ($installType == 'new'): ?>
<div style="background-color:#FFFFFF"> <div style="background-color:#FFFFFF">
<p align="center"><strong><font color="red">
<?php echo get_lang('Warning'); ?> !<br /> <div class="warning-message"><center><h2><?php echo get_lang('Warning'); ?> !</h2></center><br />
<?php echo get_lang('TheInstallScriptWillEraseAllTables'); ?> <?php echo get_lang('TheInstallScriptWillEraseAllTables'); ?>
</font></strong></p> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<table width="100%"> <table width="100%">
<tr> <tr>
<td><button type="submit" class="back" name="step4" value="&lt; <?php echo get_lang('Previous'); ?>" /><?php echo get_lang('Previous'); ?></button></td> <td><button type="submit" class="back" name="step4" value="&lt; <?php echo get_lang('Previous'); ?>" /><?php echo get_lang('Previous'); ?></button></td>
<td align="right"><input type="hidden" name="is_executable" id="is_executable" value="-" /><button class="save" type="submit" name="step6" value="<?php echo get_lang('InstallDokeos'); ?> &gt;" onclick="javascript:if(this.value == '<?php $msg = get_lang('PleaseWait');?>...') return false; else this.value='<?php $msg = get_lang('InstallChamilo');?>...';" ><?php echo $msg; ?></button></td> <td align="right">
<input type="hidden" name="is_executable" id="is_executable" value="-" />
<input type="hidden" name="step6" value="1" />
<button id="button_step6" class="save" type="submit" name="button_step6" value="<?php echo get_lang('InstallChamilo'); ?>"><?php echo get_lang('InstallChamilo'); ?></button>
</td>
</tr> </tr>
</table> </table>

@ -1332,9 +1332,9 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
// Check wether a Chamilo configuration file already exists. // Check wether a Chamilo configuration file already exists.
elseif (file_exists(api_get_path(CONFIGURATION_PATH).'configuration.php')) { elseif (file_exists(api_get_path(CONFIGURATION_PATH).'configuration.php')) {
echo '<div style="color:red; background-color:white; font-weight:bold; text-align:center;">'; echo '<div class="warning-message"><h4><center>';
echo get_lang('WarningExistingDokeosInstallationDetected'); echo get_lang('WarningExistingDokeosInstallationDetected');
echo '</div>'; echo '</center></h4></div>';
} }
// And now display the choice buttons (go back or install) // And now display the choice buttons (go back or install)

Loading…
Cancel
Save