BUG 8875 "Feature: New ExtJS based for Install, Login & Main Proce..." UPDATED

- fixes for installer on IE9
- fixes for main uxmodern interface view on IE9
- ux-wizard extjs plugin updated
- ux-card-layout extjs plugin updated
- extjs library updated to 3.4.0 from 3.2.1
- draw2d library removed from load
This commit is contained in:
Erik Amaru Ortiz
2012-04-11 18:39:16 -04:00
parent bc79391223
commit 23ecc0369a
13 changed files with 1405 additions and 1444 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4784,6 +4784,9 @@ function getDirectorySize($path,$maxmtime=0)
*/ */
function getCheckSum($files) function getCheckSum($files)
{ {
G::LoadClass('system');
$key = System::getVersion();
if (!is_array($files)) { if (!is_array($files)) {
$tmp = $files; $tmp = $files;
$files = array(); $files = array();
@@ -4795,7 +4798,7 @@ function getDirectorySize($path,$maxmtime=0)
if (is_file($file)) if (is_file($file))
$checkSum .= md5_file($file); $checkSum .= md5_file($file);
} }
return md5($checkSum); return md5($checkSum.$key);
} }
/** /**

View File

@@ -287,7 +287,7 @@ class headPublisher {
// enabled for particular use // enabled for particular use
$head .= $this->getExtJsLibraries(); $head .= $this->getExtJsLibraries();
$head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n"; // $head .= " <script type='text/javascript' src='/js/ext/draw2d.js'></script>\n";
$head .= " <script type='text/javascript' src='/js/ext/translation.".SYS_LANG.".js'></script>\n"; $head .= " <script type='text/javascript' src='/js/ext/translation.".SYS_LANG.".js'></script>\n";
if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') { if (! isset ( $this->extJsSkin ) || $this->extJsSkin == '') {

View File

@@ -15,6 +15,8 @@ class Installer extends Controller {
var $link; #resource for database connection var $link; #resource for database connection
public $debug = 1;
public function __construct() { public function __construct() {
$this->path_config = PATH_CORE.'config/'; $this->path_config = PATH_CORE.'config/';
$this->path_languages = PATH_CORE.'content/languages/'; $this->path_languages = PATH_CORE.'content/languages/';
@@ -47,6 +49,8 @@ class Installer extends Controller {
$this->includeExtJS('installer/Wizard', false); $this->includeExtJS('installer/Wizard', false);
$this->includeExtJS('installer/Header', false); $this->includeExtJS('installer/Header', false);
$this->includeExtJS('installer/Card', false); $this->includeExtJS('installer/Card', false);
$this->includeExtJS('installer/installer_cards');
$this->includeExtJS('installer/main', false); $this->includeExtJS('installer/main', false);
$this->setJSVar('licenseTxt', $licenseContent); $this->setJSVar('licenseTxt', $licenseContent);

View File

@@ -81,6 +81,32 @@
-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2); -webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);
} }
a.options-tool{
color: #fff;
text-decoration: none;
font-weight: bold;
}
a.options-tool:hover {
color: #fff;
text-decoration: underline;
font-weight: bold;
}
a.options-tool:focus {
outline: thin dotted #333333;
outline-offset: -2px;
}
a.options-tool:hover, a:active {
outline: 0 none;
}
#x-panel-header{
height: 500px;
padding: 5px 5px 5px 5px;
}
.x-panel-header-text{ .x-panel-header-text{
text-shadow:#fff 0px 1px 1px; text-shadow:#fff 0px 1px 1px;
color:#444; color:#444;
@@ -988,21 +1014,18 @@ antes funcionaba.
background-image:url(/images/logout.gif); background-image:url(/images/logout.gif);
} }
.x-pm-headerbar1 { .x-pm-headerbar {
background-color: #32405a; background-color: #32405a;
background-image: url("/images/header_bg.jpg"); background-image: url("/images/header_bg.jpg");
color: #fff; color: #fff;
padding: 0px; padding: 0px;
font: 8pt Tahoma,sans-serif,MiscFixed; font: 8pt Tahoma,sans-serif,MiscFixed;
font-size: 12px; font-size: 12px;
width: 100%;
} }
.x-pm-headerbar2 {
background-color: #000; table.x-pm-headerbar td, table th {
background-image: url("/images/canvastile_bg1.jpg"); padding-left: 10px;
color: #fff;
padding: 5px;
font: 8pt Tahoma,sans-serif,MiscFixed;
font-size: 12px;
} }
.headerRightSection .headerRightSection
@@ -1532,4 +1555,5 @@ td.x-cnotes-label {
padding-bottom: 15px; padding-bottom: 15px;
padding-left: 3px; padding-left: 3px;
padding-right: 3px; padding-right: 3px;
} }

View File

@@ -1,5 +1,8 @@
<html> <!-- turn on quirks mode for IE -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
{header} {header}

View File

@@ -3,12 +3,26 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
{$_header} {$_header}
{literal}
<!--[if IE]>
<style>
table.x-pm-headerbar td, table th {
padding-top: 5px;
padding-bottom: 5px;
padding-right: 0px;
}
</style>
<![endif]-->
{/literal}
</head> </head>
<body> <body>
<div id="panel-header" >
<table class="x-pm-headerbar1" width="100%" height="" cellpadding="0" cellspacing="0" border="0"> <div id="panel-header" />
<div id="header-content" style="display:none">
<table class="x-pm-headerbar">
<tr> <tr>
<td width="33%" valign="middle" style="padding-left:10px"> <td width="33%" valign="middle">
<img src="{$logo_company}" width="180" height="24"/> <img src="{$logo_company}" width="180" height="24"/>
</td> </td>
@@ -17,17 +31,16 @@
<td width="33%" align="right" valign="top"> <td width="33%" align="right" valign="top">
<table width="100%" height="25" border="0" cellspacing="0" cellpadding="0" class="headerRightSection"> <table width="100%" height="25" border="0" cellspacing="0" cellpadding="0" class="headerRightSection">
<tr valign="middle"> <tr valign="middle">
<td width="50%" rowspan="2" valign="top"></td>
<td height="12" valign="middle" align="right" valign="top"> <td height="12" valign="middle" align="right" valign="top">
<a href="#" id="options-tool"> <a href="#" id="options-tool" class="options-tool">
<div class="headerRightSideBar"> {$userfullname}<br />
{$userfullname}&nbsp;<br /> <span style="font-size:9px">{$rolename}</span>
<span style="font-size:9px">{$rolename}</span>&nbsp; </a>
</div> </td>
<div id="user-avatar"> <td width="40" align="right">
<span id="user-avatar">
<img src="{$user_avatar}" width="25" height="25"/> <img src="{$user_avatar}" width="25" height="25"/>
</div> </span>
</a>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -37,515 +37,512 @@ Ext.namespace('Ext.ux');
*/ */
Ext.ux.Wiz = Ext.extend(Ext.Window, { Ext.ux.Wiz = Ext.extend(Ext.Window, {
/** /**
* @cfg {Object} An object containing the messages for the {@link Ext.LoadMask} * @cfg {Object} An object containing the messages for the {@link Ext.LoadMask}
* covering the card-panel on request, whereas the property identifies the * covering the card-panel on request, whereas the property identifies the
* msg-text to show, and the value is the message text itself. Defaults to * msg-text to show, and the value is the message text itself. Defaults to
<pre><code> <pre><code>
{ {
default : 'Saving...' default : 'Saving...'
} }
</code></pre> </code></pre>
* *
* Depending on the contexts the loadMask has to be shown in (using the method * Depending on the contexts the loadMask has to be shown in (using the method
* showLoadMask of this class), the object can be configure to hold * showLoadMask of this class), the object can be configure to hold
* various messages. * various messages.
<pre><code> <pre><code>
this.loadMaskConfig = { this.loadMaskConfig = {
default : 'Saving...', default : 'Saving...',
validating : 'Please wait, validating input...', validating : 'Please wait, validating input...',
}; };
// loadMask will be shown, displaying the message 'Please wait, validating input...' // loadMask will be shown, displaying the message 'Please wait, validating input...'
this.showLoadMask(true, 'validating'); this.showLoadMask(true, 'validating');
</code></pre> </code></pre>
*/ */
loadMaskConfig : { loadMaskConfig : {
'default' : 'Saving...' 'default' : 'Saving...'
}, },
/** /**
* @cfg {Number} height The height of the dialog. Defaults to "400". * @cfg {Number} height The height of the dialog. Defaults to "400".
*/ */
height : 400, height : 400,
/** /**
* @cfg {Number} width The width of the dialog. Defaults to "540". * @cfg {Number} width The width of the dialog. Defaults to "540".
*/ */
width : 540, width : 540,
/** /**
* @cfg {Boolean} closable Wether the dialog is closable. Defaults to "true". * @cfg {Boolean} closable Wether the dialog is closable. Defaults to "true".
* This property will be changed by the "switchDialogState"-method, which will * This property will be changed by the "switchDialogState"-method, which will
* enable/disable controls based on the passed argument. Thus, this config property * enable/disable controls based on the passed argument. Thus, this config property
* serves two purposes: Tell the init config to render a "close"-tool, and create a * serves two purposes: Tell the init config to render a "close"-tool, and create a
* "beforeclose"-listener which will either return true or false, indicating if the * "beforeclose"-listener which will either return true or false, indicating if the
* dialog may be closed. * dialog may be closed.
*/ */
closable : true, closable : true,
/** /**
* @cfg {Boolean} resizable Wether the dialog is resizable. Defaults to "false". * @cfg {Boolean} resizable Wether the dialog is resizable. Defaults to "false".
*/ */
resizable : false, resizable : false,
/** /**
* @cfg {Boolean} resizable Wether the dialog is modal. Defaults to "true". * @cfg {Boolean} resizable Wether the dialog is modal. Defaults to "true".
*/ */
modal : true, modal : true,
/** /**
* @cfg {Array} cards A numeric array with the configured {@link Ext.ux.Wiz.Card}s. * @cfg {Array} cards A numeric array with the configured {@link Ext.ux.Wiz.Card}s.
* The index of the cards in the array represent the order in which they get displayed * The index of the cards in the array represent the order in which they get displayed
* in the wizard (i.e. card at index 0 gets displayed in the first step, card at index 1 gets * in the wizard (i.e. card at index 0 gets displayed in the first step, card at index 1 gets
* displayed in the second step and so on). * displayed in the second step and so on).
*/ */
cards : null, cards : null,
/** /**
* @cfg {String} previousButtonText The text to render the previous-button with. * @cfg {String} previousButtonText The text to render the previous-button with.
* Defaults to "&lt; Back" (< Back) * Defaults to "&lt; Back" (< Back)
*/ */
previousButtonText : '&lt; Previous', previousButtonText : '&lt; Previous',
/** /**
* @cfg {String} nextButtonText The text to render the next-button with. * @cfg {String} nextButtonText The text to render the next-button with.
* Defaults to "Next &gt;" (Next >) * Defaults to "Next &gt;" (Next >)
*/ */
nextButtonText : 'Next &gt;', nextButtonText : 'Next &gt;',
/** /**
* @cfg {String} cancelButtonText The text to render the cancel-button with. * @cfg {String} cancelButtonText The text to render the cancel-button with.
* Defaults to "Cancel" * Defaults to "Cancel"
*/ */
cancelButtonText : 'Cancel', cancelButtonText : 'Cancel',
/** /**
* @cfg {String} finishButtonText The text to render the next-button with when the last * @cfg {String} finishButtonText The text to render the next-button with when the last
* step of the wizard is reached. Defaults to "Finish" * step of the wizard is reached. Defaults to "Finish"
*/ */
finishButtonText : 'Finish', finishButtonText : 'Finish',
/** /**
* @cfg {Object} headerConfig A config-object to use with {@link Ext.ux.Wiz.Header}. * @cfg {Object} headerConfig A config-object to use with {@link Ext.ux.Wiz.Header}.
* If not present, it defaults to an empty object. * If not present, it defaults to an empty object.
*/ */
headerConfig : {}, headerConfig : {},
/** /**
* @cfg {Object} cardPanelConfig A config-object to use with {@link Ext.Panel}, which * @cfg {Object} cardPanelConfig A config-object to use with {@link Ext.Panel}, which
* represents the card-panel in this dialog. * represents the card-panel in this dialog.
* If not present, it defaults to an empty object * If not present, it defaults to an empty object
*/ */
cardPanelConfig : {}, cardPanelConfig : {},
/** /**
* @param {Ext.Button} The window-button for paging to the previous card. * @param {Ext.Button} The window-button for paging to the previous card.
* @private * @private
*/ */
previousButton : null, previousButton : null,
/** /**
* @param {Ext.Button} The window-button for paging to the next card. When the * @param {Ext.Button} The window-button for paging to the next card. When the
* last card is reached, the event fired by and the text rendered to this button * last card is reached, the event fired by and the text rendered to this button
* will change. * will change.
* @private * @private
*/ */
nextButton : null, nextButton : null,
/** /**
* @param {Ext.Button} The window-button for canceling the wizard. The event * @param {Ext.Button} The window-button for canceling the wizard. The event
* fired by this button will usually close the dialog. * fired by this button will usually close the dialog.
* @private * @private
*/ */
cancelButton : null, cancelButton : null,
/** /**
* @param {Ex.Panel} The card-panel that holds the various wizard cards * @param {Ex.Panel} The card-panel that holds the various wizard cards
* ({@link Ext.ux.Wiz.Card}). The card-panel itself uses the custom * ({@link Ext.ux.Wiz.Card}). The card-panel itself uses the custom
* {@link Ext.ux.layout.CardLayout}, which needs to be accessible by this class. * {@link Ext.ux.layout.CardLayout}, which needs to be accessible by this class.
* You can get it at {@link http://www.siteartwork.de/cardlayout}. * You can get it at {@link http://www.siteartwork.de/cardlayout}.
* @private * @private
*/ */
cardPanel : null, cardPanel : null,
/** /**
* @param {Number} currentCard The current {@link Ext.ux.Wiz.Card} displayed. * @param {Number} currentCard The current {@link Ext.ux.Wiz.Card} displayed.
* Defaults to -1. * Defaults to -1.
* @private * @private
*/ */
currentCard : -1, currentCard : -1,
/** /**
* @param {Ext.ux.Wiz.Header} The header-panel of the wizard. * @param {Ext.ux.Wiz.Header} The header-panel of the wizard.
* @private * @private
*/ */
headPanel : null, headPanel : null,
/** /**
* @param {Number} cardCount Helper for storing the number of cards used * @param {Number} cardCount Helper for storing the number of cards used
* by this wizard. Defaults to 0 (inherits "cards.length" later on). * by this wizard. Defaults to 0 (inherits "cards.length" later on).
* @private * @private
*/ */
cardCount : 0, cardCount : 0,
/** /**
* Inits this component with the specified config-properties and automatically * Inits this component with the specified config-properties and automatically
* creates its components. * creates its components.
*/ */
initComponent : function() initComponent : function()
{ {
this.initButtons(); this.initButtons();
this.initPanels(); this.initPanels();
var title = this.title || this.headerConfig.title; var title = this.title || this.headerConfig.title;
title = title || ""; title = title || "";
Ext.apply(this, { Ext.apply(this, {
title : title, title : title,
layout : 'border', layout : 'border',
cardCount : this.cards.length, cardCount : this.cards.length,
buttons : [ buttons : [
this.previousButton, this.previousButton,
this.nextButton, this.nextButton,
this.cancelButton this.cancelButton
], ],
items : [ items : [
this.headPanel, this.headPanel,
this.cardPanel this.cardPanel
] ]
}); });
this.addEvents( this.addEvents(
/** /**
* @event cancel * @event cancel
* Fires after the cancel-button has been clicked. * Fires after the cancel-button has been clicked.
* @param {Ext.ux.Wiz} this * @param {Ext.ux.Wiz} this
*/ */
'cancel', 'cancel',
/** /**
* @event finish * @event finish
* Fires after the last card was reached in the wizard and the * Fires after the last card was reached in the wizard and the
* next/finish-button has been clicked. * next/finish-button has been clicked.
* @param {Ext.ux.Wiz} this * @param {Ext.ux.Wiz} this
* @param {Object} data The collected data of the cards, whereas * @param {Object} data The collected data of the cards, whereas
* the index is the id of the card and the specific values * the index is the id of the card and the specific values
* are objects with key/value pairs in the form formElementName : value * are objects with key/value pairs in the form formElementName : value
*/ */
'finish' 'finish'
); );
Ext.ux.Wiz.superclass.initComponent.call(this); Ext.ux.Wiz.superclass.initComponent.call(this);
}, },
// -------- helper // -------- helper
/** /**
* Returns the form-data of all cards in this wizard. The first index is the * Returns the form-data of all cards in this wizard. The first index is the
* id of the card in this wizard, * id of the card in this wizard,
* and the values are objects containing key/value pairs in the form of * and the values are objects containing key/value pairs in the form of
* fieldName : fieldValue. * fieldName : fieldValue.
* *
* @return {Array} * @return {Array}
*/ */
getWizardData : function() getWizardData : function()
{ {
var formValues = {}; var formValues = {};
var cards = this.cards; var cards = this.cards;
for (var i = 0, len = cards.length; i < len; i++) { for (var i = 0, len = cards.length; i < len; i++) {
if (cards[i].form) { if (cards[i].form) {
formValues[cards[i].id] = cards[i].form.getValues(false); formValues[cards[i].id] = cards[i].form.getValues(false);
} else { } else {
formValues[cards[i].id] = {}; formValues[cards[i].id] = {};
} }
} }
return formValues; return formValues;
}, },
/** /**
* Switches the state of this wizard between disabled/enabled. * Switches the state of this wizard between disabled/enabled.
* A disabled dialog will have a {@link Ext.LoadMask} covering the card-panel * A disabled dialog will have a {@link Ext.LoadMask} covering the card-panel
* to prevent user input, and the buttons will be rendered disabled/enabled. * to prevent user input, and the buttons will be rendered disabled/enabled.
* If the dialog is closable, the close-tool will be masked, too, and the dialog will not * If the dialog is closable, the close-tool will be masked, too, and the dialog will not
* be closable by clicking the "close" tool. * be closable by clicking the "close" tool.
* *
* @param {Boolean} enabled "false" to prevent user input and mask the elements, * @param {Boolean} enabled "false" to prevent user input and mask the elements,
* otherwise true. * otherwise true.
* @param {String} type The type of msg for the {@Ext.LoadMask} covering * @param {String} type The type of msg for the {@Ext.LoadMask} covering
* the cardPanel, as defined in the cfg property "loadMaskConfig" * the cardPanel, as defined in the cfg property "loadMaskConfig"
*/ */
switchDialogState : function(enabled, type) switchDialogState : function(enabled, type)
{ {
this.showLoadMask(!enabled, type); this.showLoadMask(!enabled, type);
this.previousButton.setDisabled(!enabled); this.previousButton.setDisabled(!enabled);
this.nextButton.setDisabled(!enabled); this.nextButton.setDisabled(!enabled);
this.cancelButton.setDisabled(!enabled); this.cancelButton.setDisabled(!enabled);
var ct = this.tools['close']; var ct = this.tools['close'];
if (ct) { if (ct) {
switch (enabled) { switch (enabled) {
case true: case true:
this.tools['close'].unmask(); this.tools['close'].unmask();
break; break;
default: default:
this.tools['close'].mask(); this.tools['close'].mask();
break; break;
} }
} }
this.closable = enabled; this.closable = enabled;
}, },
/** /**
* Shows the load mask for this wizard. By default, the cardPanel's body * Shows the load mask for this wizard. By default, the cardPanel's body
* will be masked. * will be masked.
* *
* @param {Boolean} show true to show the load mask, otherwise false. * @param {Boolean} show true to show the load mask, otherwise false.
* @param {String} type The type of message for the {@Ext.LoadMask} covering * @param {String} type The type of message for the {@Ext.LoadMask} covering
* the cardPanel, as defined in the cfg property "loadMaskConfig" * the cardPanel, as defined in the cfg property "loadMaskConfig"
*/ */
showLoadMask : function(show, type) showLoadMask : function(show, type)
{ {
if (!type) { if (!type) {
type = 'default'; type = 'default';
} }
if (show) { if (show) {
if (this.loadMask == null) { if (this.loadMask == null) {
this.loadMask = new Ext.LoadMask(this.body); this.loadMask = new Ext.LoadMask(this.body);
} }
this.loadMask.msg = this.loadMaskConfig[type]; this.loadMask.msg = this.loadMaskConfig[type];
this.loadMask.show(); this.loadMask.show();
} else { } else {
if (this.loadMask) { if (this.loadMask) {
this.loadMask.hide(); this.loadMask.hide();
} }
} }
}, },
/** /**
* Inits the listener for the various {@link Ext.ux.Wiz.Card}s used * Inits the listener for the various {@link Ext.ux.Wiz.Card}s used
* by this component. * by this component.
*/ */
initEvents : function() initEvents : function()
{ {
Ext.ux.Wiz.superclass.initEvents.call(this); Ext.ux.Wiz.superclass.initEvents.call(this);
this.on('beforeclose', this.onBeforeClose, this); this.on('beforeclose', this.onBeforeClose, this);
}, },
/** /**
* Creates the head- and the card-panel. * Creates the head- and the card-panel.
* Be sure to have the custom {@link Ext.ux.layout.CardLayout} available * Be sure to have the custom {@link Ext.ux.layout.CardLayout} available
* in order to make the card-panel work as expected by this component * in order to make the card-panel work as expected by this component
* ({@link http://www.siteartwork.de/cardlayout}). * ({@link http://www.siteartwork.de/cardlayout}).
*/ */
initPanels : function() initPanels : function()
{ {
var cards = this.cards; var cards = this.cards;
var cardPanelConfig = this.cardPanelConfig; var cardPanelConfig = this.cardPanelConfig;
Ext.apply(this.headerConfig, { Ext.apply(this.headerConfig, {
steps : cards.length steps : cards.length
}); });
this.headPanel = new Ext.ux.Wiz.Header(this.headerConfig); this.headPanel = new Ext.ux.Wiz.Header(this.headerConfig);
Ext.apply(cardPanelConfig, { Ext.apply(cardPanelConfig, {
layout : new Ext.ux.layout.CardLayout(), layout : new Ext.ux.layout.CardLayout(),
items : cards items : cards
}); });
Ext.applyIf(cardPanelConfig, { Ext.applyIf(cardPanelConfig, {
region : 'center', region : 'center',
border : false, border : false,
activeItem : 0 activeItem : 0
}); });
var cards = this.cards; var cards = this.cards;
for (var i = 0, len = cards.length; i < len; i++) { for (var i = 0, len = cards.length; i < len; i++) {
cards[i].on('show', this.onCardShow, this); cards[i].on('show', this.onCardShow, this);
cards[i].on('hide', this.onCardHide, this); cards[i].on('hide', this.onCardHide, this);
cards[i].on('clientvalidation', this.onClientValidation, this); cards[i].on('clientvalidation', this.onClientValidation, this);
} }
this.cardPanel = new Ext.Panel(cardPanelConfig); this.cardPanel = new Ext.Panel(cardPanelConfig);
}, },
/** /**
* Creates the instances for the the window buttons. * Creates the instances for the the window buttons.
*/ */
initButtons : function() initButtons : function()
{ {
this.previousButton = new Ext.Button({ this.previousButton = new Ext.Button({
text : this.previousButtonText, text : this.previousButtonText,
disabled : true, disabled : true,
minWidth : 75, minWidth : 75,
handler : this.onPreviousClick, handler : this.onPreviousClick,
scope : this scope : this
}); });
this.nextButton = new Ext.Button({ this.nextButton = new Ext.Button({
text : this.nextButtonText, text : this.nextButtonText,
minWidth : 75, minWidth : 75,
handler : this.onNextClick, handler : this.onNextClick,
scope : this scope : this
}); });
this.cancelButton = new Ext.Button({ this.cancelButton = new Ext.Button({
text : this.cancelButtonText, text : this.cancelButtonText,
handler : this.onCancelClick, handler : this.onCancelClick,
scope : this, scope : this,
minWidth : 75 minWidth : 75
}); });
}, },
// -------- listeners // -------- listeners
/** /**
* Listener for the beforeclose event. * Listener for the beforeclose event.
* This listener will return true or false based on the "closable" * This listener will return true or false based on the "closable"
* property by this component. This property will be changed by the "switchDialogState" * property by this component. This property will be changed by the "switchDialogState"
* method, indicating if there is currently any process running that should prevent * method, indicating if there is currently any process running that should prevent
* this dialog from being closed. * this dialog from being closed.
* *
* @param {Ext.Panel} panel The panel being closed * @param {Ext.Panel} panel The panel being closed
* *
* @return {Boolean} * @return {Boolean}
*/ */
onBeforeClose : function(panel) onBeforeClose : function(panel)
{ {
return this.closable; return this.closable;
}, },
/** /**
* By default, the card firing this event monitors user input in a frequent * By default, the card firing this event monitors user input in a frequent
* interval and fires the 'clientvalidation'-event along with it. This listener * interval and fires the 'clientvalidation'-event along with it. This listener
* will enable/disable the next/finish-button in accordance with it, based upon * will enable/disable the next/finish-button in accordance with it, based upon
* the parameter isValid. isValid" will be set by the form validation and depends * the parameter isValid. isValid" will be set by the form validation and depends
* on the validators you are using for the different input-elemnts in your form. * on the validators you are using for the different input-elemnts in your form.
* If the card does not contain any forms, this listener will never be called by the * If the card does not contain any forms, this listener will never be called by the
* card itself. * card itself.
* *
* @param {Ext.ux.Wiz.Card} The card that triggered the event. * @param {Ext.ux.Wiz.Card} The card that triggered the event.
* @param {Boolean} isValid "true", if the user input was valid, otherwise * @param {Boolean} isValid "true", if the user input was valid, otherwise
* "false" * "false"
*/ */
onClientValidation : function(card, isValid) onClientValidation : function(card, isValid)
{ {
if (!isValid) { if (!isValid) {
this.nextButton.setDisabled(true); this.nextButton.setDisabled(true);
} else { } else {
this.nextButton.setDisabled(false); this.nextButton.setDisabled(false);
} }
}, },
/** /**
* This will render the "next" button as disabled since the bindHandler's delay * This will render the "next" button as disabled since the bindHandler's delay
* of the next card to show might be lagging on slower systems * of the next card to show might be lagging on slower systems
* *
*/ */
onCardHide : function(card) onCardHide : function(card)
{ {
if (this.cardPanel.layout.activeItem.id === card.id) { if (this.cardPanel.layout.activeItem.id === card.id) {
this.nextButton.setDisabled(true); this.nextButton.setDisabled(true);
} }
}, },
/** /**
* Listener for the "show" event of the card that gets shown in the card-panel. * Listener for the "show" event of the card that gets shown in the card-panel.
* Renders the next/previous buttons based on the position of the card in the wizard * Renders the next/previous buttons based on the position of the card in the wizard
* and updates the head-panel accordingly. * and updates the head-panel accordingly.
* *
* @param {Ext.ux.Wiz.Card} The card being shown. * @param {Ext.ux.Wiz.Card} The card being shown.
*/ */
onCardShow : function(card) onCardShow : function(card)
{ {
var parent = card.ownerCt; var parent = card.ownerCt;
var items = parent.items; var items = parent.items;
for (var i = 0, len = items.length; i < len; i++) { for (var i = 0, len = items.length; i < len; i++) {
if (items.get(i).id == card.id) { if (items.get(i).id == card.id) {
break; break;
} }
} }
this.currentCard = i; this.currentCard = i;
this.headPanel.updateStep(i, '<b>'+card.title+'</b>'); this.headPanel.updateStep(i, card.title);
//erik: fix to set on main title the title of the current cardç
//this.setTitle(card.title);
if (i == len-1) { if (i == len-1) {
this.nextButton.setText(this.finishButtonText); this.nextButton.setText(this.finishButtonText);
} else { } else {
this.nextButton.setText(this.nextButtonText); this.nextButton.setText(this.nextButtonText);
} }
/*if (card.isValid()) { if (card.isValid()) {
this.nextButton.setDisabled(false); this.nextButton.setDisabled(false);
}*/ }
//this.nextButton.setDisabled(card.isValid());
if (i == 0) { if (i == 0) {
this.previousButton.setDisabled(true); this.previousButton.setDisabled(true);
} else { } else {
this.previousButton.setDisabled(false); this.previousButton.setDisabled(false);
} }
}, },
/** /**
* Fires the 'cancel'-event. Closes this dialog if the return value of the * Fires the 'cancel'-event. Closes this dialog if the return value of the
* listeners does not equal to "false". * listeners does not equal to "false".
*/ */
onCancelClick : function() onCancelClick : function()
{ {
if (this.fireEvent('cancel', this) !== false) { if (this.fireEvent('cancel', this) !== false) {
this.close(); this.close();
} }
}, },
/** /**
* Fires the 'finish'-event. Closes this dialog if the return value of the * Fires the 'finish'-event. Closes this dialog if the return value of the
* listeners does not equal to "false". * listeners does not equal to "false".
*/ */
onFinish : function() onFinish : function()
{ {
if (this.fireEvent('finish', this, this.getWizardData()) !== false) { if (this.fireEvent('finish', this, this.getWizardData()) !== false) {
this.close(); this.close();
} }
}, },
/** /**
* Listener for the previous-button. * Listener for the previous-button.
* Switches to the previous displayed {@link Ext.ux.Wiz.Card}. * Switches to the previous displayed {@link Ext.ux.Wiz.Card}.
*/ */
onPreviousClick : function() onPreviousClick : function()
{ {
if (this.currentCard > 0) { if (this.currentCard > 0) {
this.cardPanel.getLayout().setActiveItem(this.currentCard - 1); this.cardPanel.getLayout().setActiveItem(this.currentCard - 1);
} }
}, },
/** /**
* Listener for the next-button. Switches to the next {@link Ext.ux.Wiz.Card} * Listener for the next-button. Switches to the next {@link Ext.ux.Wiz.Card}
* if the 'beforehide'-method of it did not return false. The functionality * if the 'beforehide'-method of it did not return false. The functionality
* for this is implemented in {@link Ext.ux.layout.CardLayout}, which is needed * for this is implemented in {@link Ext.ux.layout.CardLayout}, which is needed
* as the layout for the card-panel of this component. * as the layout for the card-panel of this component.
*/ */
onNextClick : function() onNextClick : function()
{ {
if (this.currentCard == this.cardCount-1) { if (this.currentCard == this.cardCount-1) {
this.onFinish(); this.onFinish();
} else { } else {
this.cardPanel.getLayout().setActiveItem(this.currentCard+1); this.cardPanel.getLayout().setActiveItem(this.currentCard+1);
} }
} }
}); });

View File

@@ -0,0 +1,839 @@
var steps = [];
Ext.onReady(function(){
var storeDatabase = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'getEngines', method:'POST'}),
reader: new Ext.data.JsonReader({
fields: [{name: 'id'},{name: 'label'}]
}),
listeners: {load: function() {
Ext.getCmp('db_engine').setValue(Ext.getCmp('db_engine').store.getAt(0).id);
if (Ext.getCmp('db_engine').store.getAt(0).id == 'mysql') {
Ext.getCmp('db_port').setValue('3306');
Ext.getCmp('db_username').setValue('root');
}
else {
Ext.getCmp('db_port').setValue('1433');
Ext.getCmp('db_username').setValue('sa');
}
testConnection();
}}
});
var store = new Ext.data.ArrayStore({
fields: ['id', 'label'],
data : [['en', 'English'],['es', 'Spanish']]
});
var cmbLanguages = new Ext.form.ComboBox({
fieldLabel: 'Language',
store: store,
labelWidth: 200,
displayField:'label',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a language...',
selectOnFocus:true
});
// getting the system info
function getSystemInfo() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'getSystemInfo',
success: function(response){
var response = Ext.util.JSON.decode(response.responseText);
Ext.getCmp('php').setValue (getFieldOutput(response.php.version, response.php.result));
Ext.getCmp('mysql').setValue (getFieldOutput(response.mysql.version, response.mysql.result));
//Ext.getCmp('mssql').setValue (getFieldOutput(response.mssql.version, response.mssql.result));
Ext.getCmp('curl').setValue (getFieldOutput(response.curl.version, response.curl.result));
Ext.getCmp('openssl').setValue (getFieldOutput(response.openssl.version, response.openssl.result));
Ext.getCmp('dom').setValue (getFieldOutput(response.dom.version, response.dom.result));
Ext.getCmp('gd').setValue (getFieldOutput(response.gd.version, response.gd.result));
Ext.getCmp('multibyte').setValue (getFieldOutput(response.multibyte.version,response.multibyte.result));
Ext.getCmp('soap').setValue (getFieldOutput(response.soap.version, response.soap.result));
Ext.getCmp('ldap').setValue (getFieldOutput(response.ldap.version, response.ldap.result));
Ext.getCmp('memory').setValue (getFieldOutput(response.memory.version, response.memory.result));
dbReq = response.mysql.result || response.mssql.result;
phpReq = response.php.result && response.curl.result && response.dom.result && response.gd.result && response.multibyte.result && response.soap.result && response.memory.result;
wizard.onClientValidation(0, dbReq && phpReq);
wizard.showLoadMask(false);
},
failure: function(){},
params: {'clientBrowser': PMExt.getBrowser().name}
});
}
// getting the system info
function getPermissionInfo() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'getPermissionInfo',
success: function(response) {
var okImage = '<img src="/images/dialog-ok-apply.png" width="12" height="12" />';
var badImage = '<img src="/images/delete.png" width="15" height="15" />';
var response = Ext.util.JSON.decode(response.responseText);
Ext.get('pathConfigSpan').dom.innerHTML = (response.pathConfig.result ? okImage : badImage);
Ext.get('pathLanguagesSpan').dom.innerHTML = (response.pathLanguages.result ? okImage : badImage);
Ext.get('pathPluginsSpan').dom.innerHTML = (response.pathPlugins.result ? okImage : badImage);
Ext.get('pathXmlformsSpan').dom.innerHTML = (response.pathXmlforms.result ? okImage : badImage);
Ext.get('pathPublicSpan').dom.innerHTML = (response.pathPublic.result ? okImage : badImage);
Ext.get('pathSharedSpan').dom.innerHTML = (response.pathShared.result ? okImage : badImage);
Ext.get('pathLogFileSpan').dom.innerHTML = (response.pathLogFile.result ? okImage : badImage);
wizard.onClientValidation(1,
response.pathConfig.result &&
response.pathLanguages.result &&
response.pathPlugins.result &&
response.pathXmlforms.result &&
response.pathPublic.result &&
response.pathShared.result &&
response.pathLogFile.result
);
wizard.showLoadMask(false);
if (response.notify != '') {
Ext.msgBoxSlider.msgTopCenter('alert', '', response.notify, 30);
}
},
failure: function(){},
params: {
'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(),
'pathLogFile': Ext.getCmp('pathLogFile').getValue(),
'pathPublic': Ext.getCmp('pathPublic').getValue()
}
});
}
function checkLicenseAgree() {
wizard.onClientValidation(2, Ext.getCmp('agreeCheckbox').getValue());
}
function ckeckDBEnginesValuesLoaded() {
wizard.showLoadMask(true);
if (Ext.getCmp('db_engine').store.getCount() == 0) {
Ext.getCmp('db_engine').store.load();
}
else {
testConnection();
}
}
// test database Connection
function testConnection() {
wizard.showLoadMask(true);
if ((Ext.getCmp('db_engine').getValue() == '') || !Ext.getCmp('db_hostname').isValid() || !Ext.getCmp('db_username').isValid()) {
wizard.onClientValidation(3, false);
wizard.showLoadMask(false);
return false;
}
Ext.Ajax.request({
url: 'testConnection',
success: function(response){
var response = Ext.util.JSON.decode(response.responseText);
Ext.getCmp('db_message').setValue(getFieldOutput(response.message, response.result));
wizard.onClientValidation(3, response.result);
wizard.showLoadMask(false);
},
failure: function(){},
params: {
'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()
}
});
}
function checkWorkspaceConfiguration() {
var canInstall = false;
if (!Ext.getCmp('workspace').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter a valid Workspace Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('adminUsername').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter a valid Admin Username.', false));
wizard.onClientValidation(4, false);
return;
}
if (Ext.getCmp('adminPassword').getValue() == '') {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Admin Password.', false));
wizard.onClientValidation(4, false);
return;
}
if (Ext.getCmp('adminPassword').getValue() != Ext.getCmp('confirmPassword').getValue()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('The password confirmation is incorrect.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('wfDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Workflow Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('rbDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Rbac Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('rpDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Report Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
checkDatabases();
}
function checkDatabases() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'checkDatabases',
success: function(response){
var existMsg = '<span style="color: red;">(Exists)</span>';
var noExistsMsg = '<span style="color: green;">(No exists)</span>';
var response = Ext.util.JSON.decode(response.responseText);
Ext.get('wfDatabaseSpan').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
Ext.get('rbDatabaseSpan').dom.innerHTML = (response.rbDatabaseExists ? existMsg : noExistsMsg);
Ext.get('rpDatabaseSpan').dom.innerHTML = (response.rpDatabaseExists ? existMsg : noExistsMsg);
var dbFlag = ((!response.wfDatabaseExists && !response.rbDatabaseExists && !response.rpDatabaseExists) || Ext.getCmp('deleteDB').getValue());
wizard.onClientValidation(4, dbFlag);
if (dbFlag) {
Ext.getCmp('finish_message').setValue(getFieldOutput('The data is correct.', true));
}
else {
Ext.getCmp('finish_message').setValue(getFieldOutput('Rename the databases names or workspace name or check the "Delete Databases if exists" to overwrite the exiting databases.', false));
}
wizard.showLoadMask(false);
},
failure: function(){},
params: {
'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(),
'wfDatabase' : Ext.getCmp('wfDatabase').getValue(),
'rbDatabase' : Ext.getCmp('rbDatabase').getValue(),
'rpDatabase' : Ext.getCmp('rpDatabase').getValue()
}
});
}
var setIndex = 0;
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Pre-installation check',
monitorValid : false,
labelAlign: 'left',
labelWidth: 200,
defaults : {
},
items : [
{
border : false,
html : 'Pre-installation check',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 340,
items:[
{
region: 'west',
width: 250,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step1_txt
},
{
region: 'center',
xtype : 'fieldset',
labelWidth: 200,
items:[
{
xtype : 'displayfield',
fieldLabel: 'PHP Version >= 5.1',
id : 'php'
},
{
xtype : 'displayfield',
fieldLabel: 'MySQL Support',
id : 'mysql'
}/*,
{
xtype : 'displayfield',
fieldLabel: 'MSSQL Support (*)',
id : 'mssql'
}*/,
{
xtype : 'displayfield',
fieldLabel: 'cURL Version',
id : 'curl'
},
{
xtype : 'displayfield',
fieldLabel: 'OpenSSL Version (**)',
id : 'openssl'
},
{
xtype : 'displayfield',
fieldLabel: 'DOM/XML Support',
id : 'dom'
},
{
xtype : 'displayfield',
fieldLabel: 'GD Support',
id : 'gd'
},
{
xtype : 'displayfield',
fieldLabel: 'Multibyte Strings Support',
id : 'multibyte'
},
{
xtype : 'displayfield',
fieldLabel: 'Soap Support',
id : 'soap'
},
{
xtype : 'displayfield',
fieldLabel: 'LDAP Support (***)',
id : 'ldap'
},
{
xtype : 'displayfield',
fieldLabel: 'Memory Limit >= 80M',
id: 'memory',
value: '5.0 or greater'
},
new Ext.Button({
text : 'Check Again',
handler : getSystemInfo,
scope : this
})
]
}
]
}
],
listeners: {
show: getSystemInfo
}
});
// third card with Directory File Permission
steps[setIndex++] = new Ext.ux.Wiz.Card({
title:'Directory File Permission',
monitorValid : false,
labelAlign: 'left',
labelWidth: 200,
defaults : {
//labelStyle : 'font-size:11px'
},
items : [
{
border : false,
html:'Directory/File Permission',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 300,
items:[
{
region: 'north',
height: 55,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step3_txt
},
{
region: 'center',
xtype : 'fieldset',
alignField : 'left',
bodyStyle : 'padding-left:40px;font-size:12;',
labelWidth: 180,
items:[
{
xtype: 'textfield',
fieldLabel: '<span id="pathConfigSpan"></span> Config Directory',
id: 'pathConfig',
width: 430,
value: path_config,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathLanguagesSpan"></span> Language Directory',
id: 'pathLanguages',
width: 430,
value: path_languages,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathPluginsSpan"></span> Plugins Directory',
id: 'pathPlugins',
width: 430,
value: path_plugins,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathXmlformsSpan"></span> Xmlform Directory Directory',
id: 'pathXmlforms',
width: 430,
value: path_xmlforms,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathPublicSpan"></span> Public Index file',
id: 'pathPublic',
width: 430,
value: path_public,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathSharedSpan"></span> Workflow Data Directory',
id: 'pathShared',
width: 430,
value: path_shared,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(2, false);
if (Ext.getCmp('pathShared').getValue().substr(-1, 1) != path_sep) {
Ext.getCmp('pathLogFile').setValue(Ext.getCmp('pathShared').getValue() + path_sep + 'log' + path_sep + 'install.log');
}
else {
Ext.getCmp('pathLogFile').setValue(Ext.getCmp('pathShared').getValue() + 'log' + path_sep + 'install.log');
}
}}
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathLogFileSpan"></span> Installation log file',
id: 'pathLogFile',
width: 430,
value: path_shared + 'log' + path_sep + 'install.log',
disabled: true
},
new Ext.Button({
text : 'Check Again',
handler : getPermissionInfo,
scope : this
})
]
}
]
}
],
listeners: {
show: getPermissionInfo
}
} );
// third card with input field email-address
steps[setIndex++] = new Ext.ux.Wiz.Card({
title:'ProcessMaker Open Source License',
//monitorValid : false,
defaults : {
labelStyle : 'font-size:12px'
},
items : [
{
border : false,
html:'ProcessMaker Open Source License',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 340,
items:[
{
region: 'center',
xtype : 'fieldset',
items:[
new Ext.form.TextArea({
name : 'license',
readOnly : true,
width : 510,
height : 280,
style : 'font-size:13px',
value : licenseTxt
}),
new Ext.form.Checkbox({
boxLabel : 'I agree',
id : 'agreeCheckbox',
handler: function() {
wizard.onClientValidation(2, this.getValue());
}
})
]
}
]
}
],
listeners: {
show: checkLicenseAgree
}
});
// fourth card Database Configuration
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Database Configuration',
monitorValid : false,
items : [
{
border : false,
html : 'Database Configuration',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 360,
items:[
{
region: 'west',
width: 200,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step4_txt
},
{
region: 'center',
xtype : 'panel',
bodyStyle : 'background:none;padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:1.2em;',
items:[
{
xtype:'fieldset',
labelAlign: 'left',
labelWidth: 160,
items:[
new Ext.form.ComboBox({
fieldLabel: 'Database Engine',
width : 200,
store : storeDatabase,
displayField : 'label',
valueField : 'id',
mode : 'local',
editable : false,
forceSelection: true,
allowBlank: false,
triggerAction: 'all',
id: 'db_engine',
selectOnFocus : true,
listeners: {select: function() {
if (this.value == 'mysql') {
Ext.getCmp('db_port').setValue('3306');
Ext.getCmp('db_username').setValue('root');
}
else {
Ext.getCmp('db_port').setValue('1433');
Ext.getCmp('db_username').setValue('sa');
}
wizard.onClientValidation(3, false);
}}
}),
{
xtype : 'textfield',
fieldLabel: 'Host Name',
width : 180,
id: 'db_hostname',
value :'localhost',
allowBlank : false,
validator : function(v){
var t = /^[0-9\.a-zA-Z_\-]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Port',
width : 180,
id: 'db_port',
value :'',
allowBlank : false,
validator : function(v){
var t = /^[0-9]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Username',
width : 180,
id: 'db_username',
value :'root',
allowBlank : false,
validator : function(v){
var t = /^[.a-zA-Z_\-]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Password',
inputType : 'password',
value : '',
width : 180,
id: 'db_password',
allowBlank : true,
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'displayfield',
//fieldLabel: ',
id : 'db_message'
},
new Ext.Button({
text : ' Test Connection',
handler : testConnection,
scope : this
})
]
}
]
}
]
}
],
listeners: {
show: ckeckDBEnginesValuesLoaded
}
});
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Workspace Configuration',
monitorValid : false,
defaults : {
labelStyle : 'font-size:11px'
},
items : [
{
border : false,
html : 'Workspace Configuration',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 360,
items:[
{
region: 'west',
width: 200,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step5_txt
},
{
region: 'center',
xtype : 'panel',
bodyStyle : 'background:none;padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:1.2em;',
items:[
{
xtype:'fieldset',
//labelAlign: 'right',
labelWidth: 210,
items:[
{
xtype : 'textfield',
fieldLabel: 'Workspace Name',
value :'workflow',
maxLength: 29,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
id : 'workspace',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
if (!Ext.getCmp('changeDBNames').getValue()) {
Ext.getCmp('wfDatabase').setValue('wf_' + this.getValue());
Ext.getCmp('rbDatabase').setValue('rb_' + this.getValue());
Ext.getCmp('rpDatabase').setValue('rp_' + this.getValue());
}
}}
},
{
xtype : 'textfield',
fieldLabel: 'Admin Username',
value :'admin',
validator : function(v){
var t = /^[a-zA-Z_0-9.@-]+$/;
return t.test(v);
},
id : 'adminUsername',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Admin Password',
inputType : 'password',
id: 'adminPassword',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Confirm Admin Password',
inputType : 'password',
id : 'confirmPassword',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
}
]
},
{
xtype : 'fieldset',
labelAlign: 'left',
labelWidth: 210,
//labelWidth: 200,
//title: 'ProcessMaker Databases',
items:[
new Ext.form.Checkbox({
boxLabel: 'Change Database names',
id : 'changeDBNames',
handler: function() {
if (this.getValue()) {
Ext.getCmp('wfDatabase').enable();
Ext.getCmp('rbDatabase').enable();
Ext.getCmp('rpDatabase').enable();
Ext.getCmp('wfDatabase').validate();
Ext.getCmp('rbDatabase').validate();
Ext.getCmp('rpDatabase').validate();
}
else {
Ext.getCmp('wfDatabase').setValue('wf_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('rbDatabase').setValue('rb_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('rpDatabase').setValue('rp_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('wfDatabase').disable();
Ext.getCmp('rbDatabase').disable();
Ext.getCmp('rpDatabase').disable();
}
wizard.onClientValidation(4, false);
}
}),
{
xtype : 'textfield',
fieldLabel: 'Workflow Database Name <span id="wfDatabaseSpan"></span>',
id : 'wfDatabase',
value :'wf_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Rbac Database Name <span id="rbDatabaseSpan"></span>',
id : 'rbDatabase',
value :'rb_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Report Database Name <span id="rpDatabaseSpan"></span>',
id : 'rpDatabase',
value :'rp_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
new Ext.form.Checkbox({
boxLabel : "Delete Databases if exists",
id : 'deleteDB',
handler: function() {
wizard.onClientValidation(4, false);
}
}),
{
xtype : 'displayfield',
id : 'finish_message'
},
new Ext.Button({
id: 'checkWSConfiguration',
text: ' Check Workspace Configuration',
handler: checkWorkspaceConfiguration,
scope: this
})
]
}
]
}
]
}
],
listeners: {
show: function() {
checkWorkspaceConfiguration();
}
}
});
});

View File

@@ -1,4 +1,5 @@
<style> <style>
.ext-ux-wiz-Header { .ext-ux-wiz-Header {
background-color:white; background-color:white;
border-bottom:1px solid #99BBE8; border-bottom:1px solid #99BBE8;

View File

@@ -1,965 +1,41 @@
//var licenseTxt;
var wizard; var wizard;
var theme;
// 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.
Ext.Ajax.timeout = 90000;
Ext.onReady(function(){ Ext.onReady(function(){
Ext.QuickTips.init();
var steps = new Array(); Ext.QuickTips.init();
var storeDatabase = new Ext.data.Store({ wizard = new Ext.ux.Wiz({
proxy: new Ext.data.HttpProxy({url: 'getEngines', method:'POST'}), height: 520,
reader: new Ext.data.JsonReader({ width : 780,
fields: [{name: 'id'},{name: 'label'}] id : 'wizard',
}), closable: false,
listeners: {load: function() { headerConfig : {
Ext.getCmp('db_engine').setValue(Ext.getCmp('db_engine').store.getAt(0).id); title : '&nbsp'
if (Ext.getCmp('db_engine').store.getAt(0).id == 'mysql') {
Ext.getCmp('db_port').setValue('3306');
Ext.getCmp('db_username').setValue('root');
}
else {
Ext.getCmp('db_port').setValue('1433');
Ext.getCmp('db_username').setValue('sa');
}
testConnection();
}}
});
var store = new Ext.data.ArrayStore({
fields: ['id', 'label'],
data : [['en', 'English'],['es', 'Spanish']]
});
var cmbLanguages = new Ext.form.ComboBox({
fieldLabel: 'Language',
store: store,
labelWidth: 200,
displayField:'label',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a language...',
selectOnFocus:true
});
// getting the system info
function getSystemInfo() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'getSystemInfo',
success: function(response){
var response = Ext.util.JSON.decode(response.responseText);
Ext.getCmp('php').setValue (getFieldOutput(response.php.version, response.php.result));
Ext.getCmp('mysql').setValue (getFieldOutput(response.mysql.version, response.mysql.result));
//Ext.getCmp('mssql').setValue (getFieldOutput(response.mssql.version, response.mssql.result));
Ext.getCmp('curl').setValue (getFieldOutput(response.curl.version, response.curl.result));
Ext.getCmp('openssl').setValue (getFieldOutput(response.openssl.version, response.openssl.result));
Ext.getCmp('dom').setValue (getFieldOutput(response.dom.version, response.dom.result));
Ext.getCmp('gd').setValue (getFieldOutput(response.gd.version, response.gd.result));
Ext.getCmp('multibyte').setValue (getFieldOutput(response.multibyte.version,response.multibyte.result));
Ext.getCmp('soap').setValue (getFieldOutput(response.soap.version, response.soap.result));
Ext.getCmp('ldap').setValue (getFieldOutput(response.ldap.version, response.ldap.result));
Ext.getCmp('memory').setValue (getFieldOutput(response.memory.version, response.memory.result));
dbReq = response.mysql.result || response.mssql.result;
phpReq = response.php.result && response.curl.result && response.dom.result && response.gd.result && response.multibyte.result && response.soap.result && response.memory.result;
wizard.onClientValidation(0, dbReq && phpReq);
wizard.showLoadMask(false);
}, },
failure: function(){}, cardPanelConfig : {
params: {'clientBrowser': PMExt.getBrowser().name} defaults : {
}); bodyStyle : 'padding:20px 10px 10px 20px;background-color:#F6F6F6;',
} border : false
// getting the system info
function getPermissionInfo() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'getPermissionInfo',
success: function(response) {
var okImage = '<img src="/images/dialog-ok-apply.png" width="12" height="12" />';
var badImage = '<img src="/images/delete.png" width="15" height="15" />';
var response = Ext.util.JSON.decode(response.responseText);
Ext.get('pathConfigSpan').dom.innerHTML = (response.pathConfig.result ? okImage : badImage);
Ext.get('pathLanguagesSpan').dom.innerHTML = (response.pathLanguages.result ? okImage : badImage);
Ext.get('pathPluginsSpan').dom.innerHTML = (response.pathPlugins.result ? okImage : badImage);
Ext.get('pathXmlformsSpan').dom.innerHTML = (response.pathXmlforms.result ? okImage : badImage);
Ext.get('pathPublicSpan').dom.innerHTML = (response.pathPublic.result ? okImage : badImage);
Ext.get('pathSharedSpan').dom.innerHTML = (response.pathShared.result ? okImage : badImage);
Ext.get('pathLogFileSpan').dom.innerHTML = (response.pathLogFile.result ? okImage : badImage);
wizard.onClientValidation(1,
response.pathConfig.result &&
response.pathLanguages.result &&
response.pathPlugins.result &&
response.pathXmlforms.result &&
response.pathPublic.result &&
response.pathShared.result &&
response.pathLogFile.result
);
wizard.showLoadMask(false);
if (response.notify != '') {
Ext.msgBoxSlider.msgTopCenter('alert', '', response.notify, 30);
} }
}, },
failure: function(){}, cards : steps,
params: { loadMaskConfig: {
'pathConfig': Ext.getCmp('pathConfig').getValue(), 'default': 'Checking...',
'pathLanguages': Ext.getCmp('pathLanguages').getValue(), 'finishing': 'Finishing...'
'pathPlugins': Ext.getCmp('pathPlugins').getValue(), },
'pathXmlforms': Ext.getCmp('pathXmlforms').getValue(), listeners: {
'pathShared': Ext.getCmp('pathShared').getValue(), finish: finishInstallation
'pathLogFile': Ext.getCmp('pathLogFile').getValue(),
'pathPublic': Ext.getCmp('pathPublic').getValue()
} }
}); });
}
// show the wizard
function checkLicenseAgree() { wizard.show();
wizard.onClientValidation(2, Ext.getCmp('agreeCheckbox').getValue()); });
}
function ckeckDBEnginesValuesLoaded() {
wizard.showLoadMask(true);
if (Ext.getCmp('db_engine').store.getCount() == 0) {
Ext.getCmp('db_engine').store.load();
}
else {
testConnection();
}
}
// test database Connection
function testConnection() {
wizard.showLoadMask(true);
if ((Ext.getCmp('db_engine').getValue() == '') || !Ext.getCmp('db_hostname').isValid() || !Ext.getCmp('db_username').isValid()) {
wizard.onClientValidation(3, false);
wizard.showLoadMask(false);
return false;
}
Ext.Ajax.request({
url: 'testConnection',
success: function(response){
var response = Ext.util.JSON.decode(response.responseText);
Ext.getCmp('db_message').setValue(getFieldOutput(response.message, response.result));
wizard.onClientValidation(3, response.result);
wizard.showLoadMask(false);
},
failure: function(){},
params: {
'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()
}
});
}
function checkWorkspaceConfiguration() {
var canInstall = false;
if (!Ext.getCmp('workspace').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter a valid Workspace Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('adminUsername').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter a valid Admin Username.', false));
wizard.onClientValidation(4, false);
return;
}
if (Ext.getCmp('adminPassword').getValue() == '') {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Admin Password.', false));
wizard.onClientValidation(4, false);
return;
}
if (Ext.getCmp('adminPassword').getValue() != Ext.getCmp('confirmPassword').getValue()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('The password confirmation is incorrect.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('wfDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Workflow Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('rbDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Rbac Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
if (!Ext.getCmp('rpDatabase').isValid()) {
Ext.getCmp('finish_message').setValue(getFieldOutput('Please enter the Report Database Name.', false));
wizard.onClientValidation(4, false);
return;
}
checkDatabases();
}
function checkDatabases() {
wizard.showLoadMask(true);
Ext.Ajax.request({
url: 'checkDatabases',
success: function(response){
var existMsg = '<span style="color: red;">(Exists)</span>';
var noExistsMsg = '<span style="color: green;">(No exists)</span>';
var response = Ext.util.JSON.decode(response.responseText);
Ext.get('wfDatabaseSpan').dom.innerHTML = (response.wfDatabaseExists ? existMsg : noExistsMsg);
Ext.get('rbDatabaseSpan').dom.innerHTML = (response.rbDatabaseExists ? existMsg : noExistsMsg);
Ext.get('rpDatabaseSpan').dom.innerHTML = (response.rpDatabaseExists ? existMsg : noExistsMsg);
var dbFlag = ((!response.wfDatabaseExists && !response.rbDatabaseExists && !response.rpDatabaseExists) || Ext.getCmp('deleteDB').getValue());
wizard.onClientValidation(4, dbFlag);
if (dbFlag) {
Ext.getCmp('finish_message').setValue(getFieldOutput('The data is correct.', true));
}
else {
Ext.getCmp('finish_message').setValue(getFieldOutput('Rename the databases names or workspace name or check the "Delete Databases if exists" to overwrite the exiting databases.', false));
}
wizard.showLoadMask(false);
},
failure: function(){},
params: {
'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(),
'wfDatabase' : Ext.getCmp('wfDatabase').getValue(),
'rbDatabase' : Ext.getCmp('rbDatabase').getValue(),
'rpDatabase' : Ext.getCmp('rpDatabase').getValue()
}
});
}
var setIndex = 0;
// first card with welcome message
/* steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Setting language',
labelAlign: 'right',
labelWidth: 200,
items : [
{
border : false,
bodyStyle : 'background:none;',
html : 'Welcome to the Setup ProcessMaker wizard<br/>'+
'Select your language from the list.<br/><br/>'
},
{
border : false,
bodyStyle : 'background:none;padding-bottom:10px;',
html : 'ProcessMaker! 2.0.x Stable 18-Apr-2011 23:00 GMT:'
},
cmbLanguages,
{
border : false,
bodyStyle : 'background:none;padding-top:250px;padding-left:420px;',
html : 'Please click the "next"-button and fill out all form values.'+
'<br/>'
}
],
listeners: {
show: function(){
//alert('s');
//make akax call here
}
}
});
*/
// first card with Pre-Installation Check
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Pre-installation check',
monitorValid : false,
labelAlign: 'left',
labelWidth: 200,
defaults : {
},
items : [
{
border : false,
html : 'Pre-installation check',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 340,
items:[
{
region: 'west',
width: 250,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step1_txt
},
/*{
region: 'south',
xtype : 'fieldset',
bodyStyle : 'padding:-3px;font-size:1.2em;',
height : 45,
labelAlign: 'right',
items:[
new Ext.Button({
text : 'Check Again',
handler : getSystemInfo,
scope : this
})
]
},*/
{
region: 'center',
xtype : 'fieldset',
labelWidth: 200,
items:[
{
xtype : 'displayfield',
fieldLabel: 'PHP Version >= 5.1',
id : 'php'
},
{
xtype : 'displayfield',
fieldLabel: 'MySQL Support',
id : 'mysql'
}/*,
{
xtype : 'displayfield',
fieldLabel: 'MSSQL Support (*)',
id : 'mssql'
}*/,
{
xtype : 'displayfield',
fieldLabel: 'cURL Version',
id : 'curl'
},
{
xtype : 'displayfield',
fieldLabel: 'OpenSSL Version (**)',
id : 'openssl'
},
{
xtype : 'displayfield',
fieldLabel: 'DOM/XML Support',
id : 'dom'
},
{
xtype : 'displayfield',
fieldLabel: 'GD Support',
id : 'gd'
},
{
xtype : 'displayfield',
fieldLabel: 'Multibyte Strings Support',
id : 'multibyte'
},
{
xtype : 'displayfield',
fieldLabel: 'Soap Support',
id : 'soap'
},
{
xtype : 'displayfield',
fieldLabel: 'LDAP Support (***)',
id : 'ldap'
},
{
xtype : 'displayfield',
fieldLabel: 'Memory Limit >= 80M',
id: 'memory',
value: '5.0 or greater'
},
new Ext.Button({
text : 'Check Again',
handler : getSystemInfo,
scope : this
})
]
}
]
}
],
listeners: {
show: getSystemInfo
}
});
// second with Pre-Installation Check
/*
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Recomended Settings',
monitorValid : true,
labelAlign: 'right',
labelWidth: 200,
defaults : {
//labelStyle : 'font-size:11px'
},
items : [
{
border : false,
html:'Recomended Settings',
bodyStyle : 'background:none;padding-top:10px;padding-bottom:5px;font-weight:bold;'
},
{
xtype:'panel',
layout:'border',
height: 120,
items:[
{
region: 'west',
bodyStyle : 'padding:10px;font-size:1.2em;',
width: 250,
html: step2_txt
},
{
region: 'center',
xtype : 'fieldset',
defaultType: 'displayfield',
items:[
{
fieldLabel: 'PHP Version',
value: '5.1.0 or greater'
},
{
fieldLabel: 'MySql Version',
value: '5.0 or greater'
}
]
}
]
}
]
} );
*/
// third card with Directory File Permission
steps[setIndex++] = new Ext.ux.Wiz.Card({
title:'Directory File Permission',
monitorValid : false,
labelAlign: 'left',
labelWidth: 200,
defaults : {
//labelStyle : 'font-size:11px'
},
items : [
{
border : false,
html:'Directory/File Permission',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 300,
items:[
{
region: 'north',
height: 55,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step3_txt
},
{
region: 'center',
xtype : 'fieldset',
alignField : 'left',
bodyStyle : 'padding-left:40px;font-size:12;',
labelWidth: 180,
items:[
{
xtype: 'textfield',
fieldLabel: '<span id="pathConfigSpan"></span> Config Directory',
id: 'pathConfig',
width: 430,
value: path_config,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathLanguagesSpan"></span> Language Directory',
id: 'pathLanguages',
width: 430,
value: path_languages,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathPluginsSpan"></span> Plugins Directory',
id: 'pathPlugins',
width: 430,
value: path_plugins,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathXmlformsSpan"></span> Xmlform Directory Directory',
id: 'pathXmlforms',
width: 430,
value: path_xmlforms,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathPublicSpan"></span> Public Index file',
id: 'pathPublic',
width: 430,
value: path_public,
disabled: true
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathSharedSpan"></span> Workflow Data Directory',
id: 'pathShared',
width: 430,
value: path_shared,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(2, false);
if (Ext.getCmp('pathShared').getValue().substr(-1, 1) != path_sep) {
Ext.getCmp('pathLogFile').setValue(Ext.getCmp('pathShared').getValue() + path_sep + 'log' + path_sep + 'install.log');
}
else {
Ext.getCmp('pathLogFile').setValue(Ext.getCmp('pathShared').getValue() + 'log' + path_sep + 'install.log');
}
}}
},
{
xtype: 'textfield',
fieldLabel: '<span id="pathLogFileSpan"></span> Installation log file',
id: 'pathLogFile',
width: 430,
value: path_shared + 'log' + path_sep + 'install.log',
disabled: true
},
new Ext.Button({
text : 'Check Again',
handler : getPermissionInfo,
scope : this
})
]
}
]
}
],
listeners: {
show: getPermissionInfo
}
} );
// third card with input field email-address
steps[setIndex++] = new Ext.ux.Wiz.Card({
title:'ProcessMaker Open Source License',
//monitorValid : false,
defaults : {
labelStyle : 'font-size:12px'
},
items : [
{
border : false,
html:'ProcessMaker Open Source License',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 340,
items:[
{
region: 'center',
xtype : 'fieldset',
items:[
new Ext.form.TextArea({
name : 'license',
readOnly : true,
width : 510,
height : 280,
style : 'font-size:13px',
value : licenseTxt
}),
new Ext.form.Checkbox({
boxLabel : 'I agree',
id : 'agreeCheckbox',
handler: function() {
wizard.onClientValidation(2, this.getValue());
}
})
]
}
]
}
],
listeners: {
show: checkLicenseAgree
}
});
// fourth card Database Configuration
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Database Configuration',
monitorValid : false,
items : [
{
border : false,
html : 'Database Configuration',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 360,
items:[
{
region: 'west',
width: 200,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step4_txt
},
{
region: 'center',
xtype : 'panel',
bodyStyle : 'background:none;padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:1.2em;',
items:[
{
xtype:'fieldset',
labelAlign: 'left',
labelWidth: 160,
items:[
new Ext.form.ComboBox({
fieldLabel: 'Database Engine',
width : 200,
store : storeDatabase,
displayField : 'label',
valueField : 'id',
mode : 'local',
editable : false,
forceSelection: true,
allowBlank: false,
triggerAction: 'all',
id: 'db_engine',
selectOnFocus : true,
listeners: {select: function() {
if (this.value == 'mysql') {
Ext.getCmp('db_port').setValue('3306');
Ext.getCmp('db_username').setValue('root');
}
else {
Ext.getCmp('db_port').setValue('1433');
Ext.getCmp('db_username').setValue('sa');
}
wizard.onClientValidation(3, false);
}}
}),
{
xtype : 'textfield',
fieldLabel: 'Host Name',
width : 180,
id: 'db_hostname',
value :'localhost',
allowBlank : false,
validator : function(v){
var t = /^[0-9\.a-zA-Z_\-]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Port',
width : 180,
id: 'db_port',
value :'',
allowBlank : false,
validator : function(v){
var t = /^[0-9]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Username',
width : 180,
id: 'db_username',
value :'root',
allowBlank : false,
validator : function(v){
var t = /^[.a-zA-Z_\-]+$/;
return t.test(v);
},
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Password',
inputType : 'password',
value : '',
width : 180,
id: 'db_password',
allowBlank : true,
listeners: {change: function() {
wizard.onClientValidation(3, false);
}}
},
{
xtype : 'displayfield',
//fieldLabel: ',
id : 'db_message'
},
new Ext.Button({
text : ' Test Connection',
handler : testConnection,
scope : this
})
]
},
]
}
]
}
],
listeners: {
show: ckeckDBEnginesValuesLoaded
}
});
steps[setIndex++] = new Ext.ux.Wiz.Card({
title : 'Workspace Configuration',
monitorValid : false,
defaults : {
labelStyle : 'font-size:11px'
},
items : [
{
border : false,
html : 'Workspace Configuration',
bodyStyle : 'background:none;padding-top:0px;padding-bottom:5px;font-weight:bold;font-size:1.3em;'
},
{
xtype:'panel',
layout:'border',
height: 360,
items:[
{
region: 'west',
width: 200,
bodyStyle : 'padding:10px;font-size:1.2em;',
html: step5_txt
},
{
region: 'center',
xtype : 'panel',
bodyStyle : 'background:none;padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:1.2em;',
items:[
{
xtype:'fieldset',
//labelAlign: 'right',
labelWidth: 210,
items:[
{
xtype : 'textfield',
fieldLabel: 'Workspace Name',
value :'workflow',
maxLength: 29,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
id : 'workspace',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
if (!Ext.getCmp('changeDBNames').getValue()) {
Ext.getCmp('wfDatabase').setValue('wf_' + this.getValue());
Ext.getCmp('rbDatabase').setValue('rb_' + this.getValue());
Ext.getCmp('rpDatabase').setValue('rp_' + this.getValue());
}
}}
},
{
xtype : 'textfield',
fieldLabel: 'Admin Username',
value :'admin',
validator : function(v){
var t = /^[a-zA-Z_0-9.@-]+$/;
return t.test(v);
},
id : 'adminUsername',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Admin Password',
inputType : 'password',
id: 'adminPassword',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Confirm Admin Password',
inputType : 'password',
id : 'confirmPassword',
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
}
]
},
{
xtype : 'fieldset',
labelAlign: 'left',
labelWidth: 210,
//labelWidth: 200,
//title: 'ProcessMaker Databases',
items:[
new Ext.form.Checkbox({
boxLabel: 'Change Database names',
id : 'changeDBNames',
handler: function() {
if (this.getValue()) {
Ext.getCmp('wfDatabase').enable();
Ext.getCmp('rbDatabase').enable();
Ext.getCmp('rpDatabase').enable();
Ext.getCmp('wfDatabase').validate();
Ext.getCmp('rbDatabase').validate();
Ext.getCmp('rpDatabase').validate();
}
else {
Ext.getCmp('wfDatabase').setValue('wf_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('rbDatabase').setValue('rb_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('rpDatabase').setValue('rp_' + Ext.getCmp('workspace').getValue());
Ext.getCmp('wfDatabase').disable();
Ext.getCmp('rbDatabase').disable();
Ext.getCmp('rpDatabase').disable();
}
wizard.onClientValidation(4, false);
}
}),
{
xtype : 'textfield',
fieldLabel: 'Workflow Database Name <span id="wfDatabaseSpan"></span>',
id : 'wfDatabase',
value :'wf_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Rbac Database Name <span id="rbDatabaseSpan"></span>',
id : 'rbDatabase',
value :'rb_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
{
xtype : 'textfield',
fieldLabel: 'Report Database Name <span id="rpDatabaseSpan"></span>',
id : 'rpDatabase',
value :'rp_workflow',
allowBlank : false,
maxLength: 32,
validator : function(v){
var t = /^[a-zA-Z_0-9]+$/;
return t.test(v);
},
disabled: true,
enableKeyEvents: true,
listeners: {keyup: function() {
wizard.onClientValidation(4, false);
}}
},
new Ext.form.Checkbox({
boxLabel : "Delete Databases if exists",
id : 'deleteDB',
handler: function() {
wizard.onClientValidation(4, false);
}
}),
{
xtype : 'displayfield',
id : 'finish_message'
},
new Ext.Button({
id: 'checkWSConfiguration',
text: ' Check Workspace Configuration',
handler: checkWorkspaceConfiguration,
scope: this
})
]
}
]
}
]
}
],
listeners: {
show: function() {
checkWorkspaceConfiguration();
}
}
});
wizard = new Ext.ux.Wiz({
height: 520,
width : 780,
id : 'wizard',
closable: false,
headerConfig : {
title : '&nbsp'
},
cardPanelConfig : {
defaults : {
bodyStyle : 'padding:20px 10px 10px 20px;background-color:#F6F6F6;',
border : false
}
},
cards : steps,
loadMaskConfig: {
default: 'Checking...',
finishing: 'Finishing...'
},
listeners: {
finish: finishInstallation
}
});
// show the wizard
wizard.show();
});
function finishInstallation() function finishInstallation()
{ {

View File

@@ -30,8 +30,18 @@ var Main = function() {
Ext.getCmp('westPanel').hide(); Ext.getCmp('westPanel').hide();
Ext.getCmp('southPanel').hide(); Ext.getCmp('southPanel').hide();
Ext.getCmp('northPanel').update(Ext.fly('header-content').dom.innerHTML);
Ext.getCmp('centerPanel').ownerCt.doLayout(); Ext.getCmp('centerPanel').ownerCt.doLayout();
Ext.get('options-tool').on('click', function(eventObj, elRef) {
var conn = new Ext.data.Connection();
eventObj.stopEvent();
if (!this.ctxMenu) {
Main.buildUserMenu(this);
}
this.ctxMenu.show(elRef);
});
if (typeof flyNotify != 'undefined') { if (typeof flyNotify != 'undefined') {
Ext.msgBoxSlider.msgTopCenter(flyNotify.type, flyNotify.title, flyNotify.text, flyNotify.time); Ext.msgBoxSlider.msgTopCenter(flyNotify.type, flyNotify.title, flyNotify.text, flyNotify.time);
} }
@@ -82,8 +92,8 @@ Main.configureComponents = function()
this.configuration.northPanel = { this.configuration.northPanel = {
id:'northPanel', id:'northPanel',
region: 'north', region: 'north',
height: 40, height: 50,
applyTo: 'panel-header', //applyTo: 'panel-header',
margins: '0 0 0 0', // top right botom left margins: '0 0 0 0', // top right botom left
items: [] items: []
}; };
@@ -183,15 +193,6 @@ Main.buildComponents = function()
this.panels.push(new Ext.Panel(this.configuration.westPanel)); this.panels.push(new Ext.Panel(this.configuration.westPanel));
this.panels.push(new Ext.Panel(this.configuration.southPanel)); this.panels.push(new Ext.Panel(this.configuration.southPanel));
this.panels.push(new Ext.Panel(this.configuration.northPanel)); this.panels.push(new Ext.Panel(this.configuration.northPanel));
Ext.get('options-tool').on('click', function(eventObj, elRef) {
var conn = new Ext.data.Connection();
eventObj.stopEvent();
if (!this.ctxMenu) {
Main.buildUserMenu(this);
}
this.ctxMenu.show(elRef);
});
}; };
Main.buildUserMenu = function(obj) Main.buildUserMenu = function(obj)