Merge pull request #1353 from jloguercio/1.11.x

Move "next" button after form in license page in install process - Refs #8394
remotes/angel/1.11.x
José Loguercio 8 years ago committed by GitHub
commit 5525bf5180
  1. 4
      main/inc/ajax/install.ajax.php
  2. 64
      main/install/index.php
  3. 23
      main/install/install.lib.php

@ -38,7 +38,7 @@ switch ($action) {
// save contact information with web service
// create a client
$client = new nusoap_client('http://version.chamilo.org/contact.php?wsdl', true);
$client = new SoapClient('https://version.chamilo.org/contact.php?wsdl');
// call method ws_add_contact_information
$contact_params = array(
@ -53,7 +53,7 @@ switch ($action) {
'company_city' => $company_city
);
$result = $client->call('ws_add_contact_information', array('contact_params' => $contact_params));
$result = $client->__soapCall('ws_add_contact_information', array('contact_params' => $contact_params));
echo $result;
}

@ -370,34 +370,44 @@ if ($encryptPassForm == '1') {
});
function send_contact_information() {
var data_post = "";
data_post += "person_name="+$("#person_name").val()+"&";
data_post += "person_email="+$("#person_email").val()+"&";
data_post += "company_name="+$("#company_name").val()+"&";
data_post += "company_activity="+$("#company_activity option:selected").val()+"&";
data_post += "person_role="+$("#person_role option:selected").val()+"&";
data_post += "company_country="+$("#country option:selected").val()+"&";
data_post += "company_city="+$("#company_city").val()+"&";
data_post += "language="+$("#language option:selected").val()+"&";
data_post += "financial_decision="+$("input[@name='financial_decision']:checked").val();
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {},
type: "POST",
url: "<?php echo api_get_path(WEB_AJAX_PATH) ?>install.ajax.php?a=send_contact_information",
data: data_post,
success: function(datos) {
if (datos == 'required_field_error') {
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
} else if (datos == '1') {
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
} else {
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
if (!document.getElementById('accept_licence').checked) {
alert('Debe aceptar la licencia para poder usar este software')
;return false;
} else {
var data_post = "";
data_post += "person_name="+$("#person_name").val()+"&";
data_post += "person_email="+$("#person_email").val()+"&";
data_post += "company_name="+$("#company_name").val()+"&";
data_post += "company_activity="+$("#company_activity option:selected").val()+"&";
data_post += "person_role="+$("#person_role option:selected").val()+"&";
data_post += "company_country="+$("#country option:selected").val()+"&";
data_post += "company_city="+$("#company_city").val()+"&";
data_post += "language="+$("#language option:selected").val()+"&";
data_post += "financial_decision="+$("input[name='financial_decision']:checked").val();
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {},
type: "POST",
url: "<?php echo api_get_path(WEB_AJAX_PATH) ?>install.ajax.php?a=send_contact_information",
beforeSend : function() {
$('#loader-button').append(' <em class="fa fa-spinner fa-pulse fa-fw"></em>');
},
data: data_post,
success: function(datos) {
if (datos == 'required_field_error') {
message = "<?php echo get_lang('FormHasErrorsPleaseComplete') ?>";
} else if (datos == '1') {
message = "<?php echo get_lang('ContactInformationHasBeenSent') ?>";
} else {
message = "<?php echo get_lang('Error').': '.get_lang('ContactInformationHasNotBeenSent') ?>";
}
alert(message);
$('#license-next').trigger('click');
$('#loader-button').html('');
}
alert(message);
}
});
});
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />

@ -1114,14 +1114,6 @@ function display_license_agreement()
<?php echo get_lang('IAccept'); ?>
</label>
</div>
<button type="submit" class="btn btn-default" name="step1" value="&lt; <?php echo get_lang('Previous'); ?>" >
<em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?>
</button>
<input type="hidden" name="is_executable" id="is_executable" value="-" />
<button type="submit" class="btn btn-success" name="step3" onclick="javascript: if(!document.getElementById('accept_licence').checked) { alert('<?php echo get_lang('YouMustAcceptLicence')?>');return false;}" value="<?php echo get_lang('Next'); ?> &gt;" >
<em class="fa fa-forward"> </em> <?php echo get_lang('Next'); ?>
</button>
</div>
</div>
<div class="row">
@ -1143,6 +1135,15 @@ function display_license_agreement()
<p><?php echo get_contact_registration_form() ?></p><br />
</div>
</div>
<button type="submit" class="btn btn-default" name="step1" value="&lt; <?php echo get_lang('Previous'); ?>" >
<em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?>
</button>
<input type="hidden" name="is_executable" id="is_executable" value="-" />
<button type="submit" id="license-next" class="btn btn-success" name="step3" onclick="javascript: if(!document.getElementById('accept_licence').checked) { alert('<?php echo get_lang('YouMustAcceptLicence')?>');return false;}" value="<?php echo get_lang('Next'); ?> &gt;" >
<em class="fa fa-forward"> </em> <?php echo get_lang('Next'); ?>
</button>
<?php
}
@ -1154,7 +1155,7 @@ function get_contact_registration_form()
{
$html ='
<form class="form-horizontal">
<div class="form-horizontal">
<div class="panel panel-default">
<div class="panel-body">
<div id="div_sent_information"></div>
@ -1263,13 +1264,13 @@ function get_contact_registration_form()
<div class="clear"></div>
<div class="form-group">
<div class="col-sm-3">&nbsp;</div>
<div class="col-sm-9"><button type="button" class="btn btn-default" onclick="javascript:send_contact_information();" value="'.get_lang('SendInformation').'" ><em class="fa fa-floppy-o"></em> '.get_lang('SendInformation').'</button></div>
<div class="col-sm-9"><button type="button" class="btn btn-default" onclick="javascript:send_contact_information();" value="'.get_lang('SendInformation').'" ><em class="fa fa-floppy-o"></em> '.get_lang('SendInformation').'</button> <span id="loader-button"></span></div>
</div>
<div class="form-group">
<div class="col-sm-3">&nbsp;</div>
<div class="col-sm-9"><span class="form_required">*</span><small>'.get_lang('FieldRequired').'</small></div>
</div></div></div>
</form>';
</div>';
return $html;
}

Loading…
Cancel
Save