setup.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. function WizardAsyncAction(sActionCode, oParams, OnErrorFunction)
  2. {
  3. var sStepClass = $('#_class').val();
  4. var sStepState = $('#_state').val();
  5. var oMap = { operation: 'async_action', step_class: sStepClass, step_state: sStepState, code: sActionCode, params: oParams };
  6. var ErrorFn = OnErrorFunction;
  7. $(document).ajaxError(function(event, request, settings) {
  8. $('#async_action').html('<pre>'+request.responseText+'</pre>').show();
  9. if (ErrorFn)
  10. {
  11. ErrorFn();
  12. }
  13. });
  14. $.post(GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php', oMap, function(data) {
  15. $('#async_action').html(data);
  16. });
  17. }
  18. function WizardUpdateButtons()
  19. {
  20. if (CanMoveForward())
  21. {
  22. $("#btn_next").removeAttr("disabled");
  23. }
  24. else
  25. {
  26. $("#btn_next").attr("disabled", "disabled");
  27. }
  28. if (CanMoveBackward())
  29. {
  30. $("#btn_back").removeAttr("disabled");
  31. }
  32. else
  33. {
  34. $("#btn_back").attr("disabled", "disabled");
  35. }
  36. }
  37. function ExecuteStep(sStep)
  38. {
  39. var oParams = { installer_step: sStep, installer_config: $('#installer_parameters').val() };
  40. WizardAsyncAction('execute_step', oParams, function() {
  41. $('#wiz_form').data('installation_status', 'error');
  42. WizardUpdateButtons();
  43. } );
  44. }