2012-03-29 16:42:09 -04:00
|
|
|
var wizard;
|
|
|
|
|
|
2012-09-17 17:08:41 -04:00
|
|
|
// Extend timeout for all Ext.Ajax.requests to 90 seconds.
|
|
|
|
|
// Ext.Ajax is a singleton, this statement will extend the timeout
|
|
|
|
|
// for all subsequent Ext.Ajax calls.
|
2016-03-11 11:04:03 -04:00
|
|
|
Ext.Ajax.timeout = 900000;
|
2012-03-29 16:42:09 -04:00
|
|
|
|
2012-04-11 18:39:16 -04:00
|
|
|
Ext.onReady(function(){
|
2012-09-17 17:08:41 -04:00
|
|
|
|
|
|
|
|
Ext.QuickTips.init();
|
|
|
|
|
|
2012-04-11 18:39:16 -04:00
|
|
|
wizard = new Ext.ux.Wiz({
|
2014-05-07 11:18:09 -04:00
|
|
|
height: 555,
|
2012-04-11 18:39:16 -04:00
|
|
|
width : 780,
|
|
|
|
|
id : 'wizard',
|
|
|
|
|
closable: false,
|
2012-04-26 13:21:41 -04:00
|
|
|
modal : false,
|
|
|
|
|
draggable: false,
|
|
|
|
|
|
2012-04-11 18:39:16 -04:00
|
|
|
headerConfig : {
|
|
|
|
|
title : ' '
|
|
|
|
|
},
|
|
|
|
|
cardPanelConfig : {
|
|
|
|
|
defaults : {
|
|
|
|
|
bodyStyle : 'padding:20px 10px 10px 20px;background-color:#F6F6F6;',
|
|
|
|
|
border : false
|
2012-04-04 18:02:32 -04:00
|
|
|
}
|
2012-03-29 16:42:09 -04:00
|
|
|
},
|
2012-04-11 18:39:16 -04:00
|
|
|
cards : steps,
|
|
|
|
|
loadMaskConfig: {
|
|
|
|
|
'default': 'Checking...',
|
|
|
|
|
'finishing': 'Finishing...'
|
2012-03-29 16:42:09 -04:00
|
|
|
},
|
2012-04-11 18:39:16 -04:00
|
|
|
listeners: {
|
|
|
|
|
finish: finishInstallation
|
2012-03-29 16:42:09 -04:00
|
|
|
}
|
|
|
|
|
});
|
2012-09-17 17:08:41 -04:00
|
|
|
|
2012-04-11 18:39:16 -04:00
|
|
|
// show the wizard
|
|
|
|
|
wizard.show();
|
2012-09-17 17:08:41 -04:00
|
|
|
});
|
2012-03-29 16:42:09 -04:00
|
|
|
|
|
|
|
|
function finishInstallation()
|
|
|
|
|
{
|
2013-04-19 11:06:20 -04:00
|
|
|
Ext.MessageBox.show({
|
|
|
|
|
msg: _('ID_INSTALLING_WORKSPACE'),
|
|
|
|
|
progressText: 'Saving...',
|
|
|
|
|
width:300,
|
|
|
|
|
wait:true,
|
|
|
|
|
waitConfig: {interval:200},
|
|
|
|
|
animEl: 'mb7'
|
|
|
|
|
});
|
2013-03-11 11:13:58 -04:00
|
|
|
wizard.showLoadMask(true, _('ID_FINISH'));
|
2012-03-29 16:42:09 -04:00
|
|
|
Ext.Ajax.request({
|
|
|
|
|
url: 'createWorkspace',
|
|
|
|
|
success: function(response){
|
2013-04-19 11:06:20 -04:00
|
|
|
Ext.MessageBox.hide();
|
2012-03-29 16:42:09 -04:00
|
|
|
var response = Ext.util.JSON.decode(response.responseText);
|
|
|
|
|
Ext.getCmp('finish_message').setValue(getFieldOutput(response.message, response.result));
|
|
|
|
|
wizard.showLoadMask(false);
|
|
|
|
|
if (response.result) {
|
|
|
|
|
wizard.onClientValidation(4, false);
|
|
|
|
|
|
|
|
|
|
//Ext.msgBoxSlider.msgTopCenter(
|
|
|
|
|
PMExt.info(
|
2013-03-11 11:13:58 -04:00
|
|
|
_('ID_PROCESSMAKER_INSTALLATION'),
|
|
|
|
|
response.messageFinish,
|
2012-03-29 16:42:09 -04:00
|
|
|
function(){
|
|
|
|
|
_redirect(response.uri);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//setTimeout("_redirect('"+response.url+"')", 3000);
|
|
|
|
|
// Ext.Msg.alert(
|
2012-09-17 17:08:41 -04:00
|
|
|
// 'ProcessMaker was successfully installed',
|
|
|
|
|
// 'Workspace "' + Ext.getCmp('workspace').getValue() + '" was installed correctly now you will be redirected to your new workspace.',
|
2012-03-29 16:42:09 -04:00
|
|
|
// function() {_redirectwindow.location = response.url;}
|
|
|
|
|
// );
|
|
|
|
|
}
|
2012-04-26 13:21:41 -04:00
|
|
|
else {
|
|
|
|
|
PMExt.error('ERROR', response.message, function(){
|
|
|
|
|
if (response.canRedirect) {
|
2012-09-17 17:08:41 -04:00
|
|
|
_redirect(response.uri);
|
2012-04-26 13:21:41 -04:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2012-03-29 16:42:09 -04:00
|
|
|
},
|
2013-04-19 11:06:20 -04:00
|
|
|
failure: function(){Ext.MessageBox.hide(); wizard.showLoadMask(false);},
|
2012-03-29 16:42:09 -04:00
|
|
|
params: {
|
2014-05-07 11:18:09 -04:00
|
|
|
'db_engine' : Ext.getCmp('db_engine' ).getValue(),
|
|
|
|
|
'db_hostname' : Ext.getCmp('db_hostname' ).getValue(),
|
|
|
|
|
'db_username' : Ext.getCmp('db_username' ).getValue(),
|
|
|
|
|
'db_password' : Ext.getCmp('db_password' ).getValue(),
|
|
|
|
|
'db_port' : Ext.getCmp('db_port' ).getValue(),
|
|
|
|
|
'pathConfig' : Ext.getCmp('pathConfig' ).getValue(),
|
|
|
|
|
'pathLanguages' : Ext.getCmp('pathLanguages' ).getValue(),
|
|
|
|
|
'pathPlugins' : Ext.getCmp('pathPlugins' ).getValue(),
|
|
|
|
|
'pathXmlforms' : Ext.getCmp('pathXmlforms' ).getValue(),
|
|
|
|
|
'pathShared' : Ext.getCmp('pathShared' ).getValue(),
|
|
|
|
|
'workspace' : Ext.getCmp('workspace' ).getValue(),
|
|
|
|
|
'adminUsername' : Ext.getCmp('adminUsername' ).getValue(),
|
|
|
|
|
'adminPassword' : Ext.getCmp('adminPassword' ).getValue(),
|
|
|
|
|
'wfDatabase' : Ext.getCmp('wfDatabase' ).getValue(),
|
|
|
|
|
'deleteDB' : Ext.getCmp('deleteDB' ).getValue(),
|
|
|
|
|
'userLogged' : Ext.getCmp('createUserLogged' ).getValue()
|
2016-03-11 11:04:03 -04:00
|
|
|
}
|
2012-03-29 16:42:09 -04:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function _redirect(_uri){
|
2012-09-17 17:08:41 -04:00
|
|
|
//console.log('redirecting:: '+_uri);
|
2012-03-29 16:42:09 -04:00
|
|
|
window.location = _uri;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getFieldOutput(txt, assert)
|
|
|
|
|
{
|
|
|
|
|
if(assert == true) {
|
|
|
|
|
img = 'dialog-ok-apply.png';
|
|
|
|
|
size = 'width=12 height=12';
|
|
|
|
|
color = 'green';
|
|
|
|
|
} else {
|
|
|
|
|
img = 'delete.png';
|
|
|
|
|
size = 'width=15 height=15';
|
|
|
|
|
color = 'red';
|
|
|
|
|
}
|
|
|
|
|
return '<font color='+color+'>'+txt + '</font> <img src="/images/'+img+'" '+size+'/>';
|
2012-04-05 18:12:27 -04:00
|
|
|
}
|