Fixed error in submit - #3153

Former-commit-id: a1c21457db7a4d4d6297fd0935b8beada7cde63c
This commit is contained in:
tatiana.llorente@artica.es 2018-12-10 15:18:53 +01:00
parent 7e40392740
commit f98b3e2ea5
2 changed files with 22 additions and 15 deletions

View File

@ -252,7 +252,7 @@ div.installation_step {
.popup-button-green{
background-color: #82B92E;
border: 1px solid transparent;
color: blue;
color: #FFF;
}
.popup-button-green span{
@ -262,7 +262,7 @@ div.installation_step {
.popup-button-green:hover{
background-color: transparent !important;
border: 1px solid #82B92E;
color: red !important;
color: #82B92E !important;
}
.popup-button-green:hover span{

View File

@ -33,6 +33,9 @@
<script type="text/javascript">
options_text = new Array('An existing Database','A new Database');
options_values = new Array('db_exist','db_new');
var userHasConfirmed = false;
function ChangeDBDrop(causer) {
if (causer.value != 'db_exist') {
window.document.step2_form.drop.checked = 0;
@ -79,6 +82,19 @@
document.getElementById('open_popup').style["display"] = "none";
document.getElementById('open_popup').style["visibility"] = "hidden";
}
function handleConfirmClick (event) {
userHasConfirmed = true;
var step3_form = document.getElementsByName('step2_form')[0];
step3_form.submit();
}
function handleStep3FormSubmit (event) {
var dbOverride = document.getElementById("drop").checked;
if (dbOverride && !userHasConfirmed) {
event.preventDefault();
popupShow();
return false;
}
}
</script>
<body>
<div id='add-lightbox' onclick='popupClose();' class='popup-lightbox'></div>
@ -87,12 +103,12 @@
<span id='title_popup'>Warning</span>
<a href='#' onclick='popupClose();'><img src='./images/icono_cerrar.png' alt='close' title='Close' style='float:right;'/></a>
</div>
<div id='editor_section' class='popup-inner' style='padding: 20px 40px;'>
<div class='popup-inner' style='padding: 20px 40px;'>
<?php
echo "<p><strong>Attention</strong>, you are going to <strong>overwrite the data</strong> of your current installation.</p><p>This means that if you do not have a backup <strong>you will irremissibly LOSE ALL THE STORED DATA</strong>, the configuration and everything relevant to your installation.</p><p><strong>Are you sure of what you are going to do?</strong></p>";
echo "<div style='text-align:right;';>";
echo "<a id='step4popup' href='install.php?step=4'><button type='submit' class='btn_install_next'><span class='btn_install_next_text'>Yes, I'm sure I want to delete everything</span></button></a>";
echo "<a href='javascript:popupClose();'><button type='submit' class='btn_install_next popup-button-green'><span class='btn_install_next_text'>Cancel</span></button></a>";
echo "<button type='button' class='btn_install_next' onclick='javascript:handleConfirmClick();'><span class='btn_install_next_text'>Yes, I'm sure I want to delete everything</span></button>";
echo "<button type='button' class='btn_install_next popup-button-green' onclick='javascript:popupClose();'><span class='btn_install_next_text'>Cancel</span></button>";
echo "</div>";
?>
</div>
@ -670,17 +686,8 @@ function install_step3() {
echo "</div>";
?>
<script type="text/javascript">
var checkDrop = document.getElementById('step4button').addEventListener("click", function(event){
if(document.getElementById("drop").checked){
popupShow();
}
else{
document.getElementsByName('step2_form')[0].submit();
}
event.preventDefault();
});
var step3_form = document.getElementsByName('step2_form')[0];
step3_form.addEventListener("submit", checkDrop, true);
step3_form.addEventListener("submit", handleStep3FormSubmit);
</script>
<?php
}