2010-12-02 23:34:41 +00:00
var installer = function ( )
{
this . make = function ( options )
{
this . options = {
target : inst . elements . content ,
vdef : {
wf : 'wf_workflow' ,
rb : 'rb_workflow' ,
rp : 'rp_workflow'
}
} . concat ( options || { } ) ;
this . html ( ) ;
this . check ( ) ;
} ;
this . html = function ( )
{
this . titleBar = document . createElement ( "div" ) ;
this . titleBar . className = "app_grid_headerBar___gray" ;
leimnud . dom . setStyle ( this . titleBar , {
height : "auto" ,
textAlign : "right"
} ) ;
this . options . target . appendChild ( this . titleBar ) ;
this . options . button0 = document . createElement ( "input" ) ;
this . options . button0 . type = "button" ;
this . options . button0 . value = "Test" ;
this . titleBar . appendChild ( this . options . button0 ) ;
this . options . button1 = document . createElement ( "input" ) ;
this . options . button1 . type = "button" ;
this . options . button1 . value = "Install" ;
this . titleBar . appendChild ( this . options . button1 ) ;
this . options . button2 = document . createElement ( "input" ) ;
this . options . button2 . type = "button" ;
this . options . button2 . value = "Reset" ;
this . titleBar . appendChild ( this . options . button2 ) ;
this . options . phpinfo = document . createElement ( "input" ) ;
this . options . phpinfo . type = "button" ;
this . options . phpinfo . style . fontWeight = "bold" ;
this . options . phpinfo . value = "phpinfo()" ;
this . titleBar . appendChild ( this . options . phpinfo ) ;
this . options . phpinfo . onmouseup = this . showPhpinfo ;
this . options . button1 . disabled = true ;
this . options . button0 . onmouseup = this . check ;
this . options . button1 . onmouseup = function ( ) { inst . selectTab ( 1 ) ; } . extend ( this ) ;
this . options . button2 . onmouseup = this . reset ;
this . buttonFun ( this . options . button0 ) ;
this . buttonFun ( this . options . button1 ) ;
this . buttonFun ( this . options . button2 ) ;
this . buttonFun ( this . options . phpinfo ) ;
//this.phpVersion =
this . table = $ ( document . createElement ( "table" ) ) ;
/ * t h i s . t a b l e . s e t S t y l e ( {
cellpadding : 23
} ) ; * /
this . table . className = "inst_table" ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>Requirements</b>" , className : "app_grid_title___gray title" , colSpan : 4 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
2010-12-09 07:30:55 +00:00
new DOM ( 'td' , { innerHTML : "PHP Version > 5.1.0" , className : "inst_td0" , colSpan : 2 } ) ,
2010-12-02 23:34:41 +00:00
this . phpVersion = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "MySQL" , className : "inst_td0" , colSpan : 2 } ) ,
this . mysqlVersion = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Maximum amount of memory a script may consume (memory_limit) >= 40M" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkMemory = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Directory " + this . options . path _trunk + "config/<br> permissions: <b>writable</b>" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkPI = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Directory " + this . options . path _trunk + "content/languages/<br> permissions: <b>writable</b>" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkDL = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "File " + this . options . path _trunk + "js/labels/<br> permissions: <b>writable</b>" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkDLJ = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "File " + this . options . path _trunk + "plugins/<br> permissions: <b>writable</b>" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkPL = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "File " + this . options . path _trunk + "xmlform/<br> permissions: <b>writable</b>" , className : "inst_td0" , colSpan : 2 } ) ,
this . checkXF = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
/* Database */
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>Database</b>" , className : "app_grid_title___gray title" , colSpan : 2 } ) ,
new DOM ( 'td' , { className : "app_grid_title___gray title" , colSpan : 2 } ) . append (
this . select _ao _db = new select ( { data : [
{ value : 1 , text : "Advanced options by default" } ,
{ value : 2 , text : "Change Advanced options" }
] ,
style : { width : "100%" , border : "1px solid #919B9C" } ,
properties : { onchange : function ( ) {
if ( this . select _ao _db . selected ( ) . value == 1 )
{
this . ed _advanced _options ( {
sta : "disabled" ,
act : 'usr' ,
def : true
} ) ;
this . ao _db _wf . passed ( ) . value = this . options . vdef . wf ;
this . ao _db _rb . passed ( ) . value = this . options . vdef . rb ;
this . ao _db _rp . passed ( ) . value = this . options . vdef . rp ;
this . ao _db _drop . checked = false ;
}
else
{
this . ed _advanced _options ( {
act : 'usr' ,
sta : "enabled"
} ) ;
this . ao _db _wf . focus ( ) ;
}
} . extend ( this ) }
} )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Database server Hostname" , className : "inst_td0" } , { width : "30%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) . append (
// this.databaseHostname =new DOM("input",{value:'localhost',type:"text",onkeyup:this.submit,className:"inputNormal"})
this . databaseHostname = new input ( { label : 'localhost' , properties : { onkeyup : this . submit } , style : { width : "100%" } } )
) ,
new DOM ( 'td' , { innerHTML : "Workflow Database:" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _db _wf = new input ( { label : this . options . vdef . wf , properties : { onkeyup : this . submit } , style : { width : "100%" } , maxlength : 16 } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Username" , className : "inst_td0" } , { width : "30%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) . append (
// this.databaseUsername =new DOM("input",{value:'root',type:"text",onkeyup:this.submit,className:"inputNormal"})
this . databaseUsername = new input ( { label : 'root' , properties : { onkeyup : this . submit } , style : { width : "100%" } } )
) ,
new DOM ( 'td' , { innerHTML : "Rbac Database:" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _db _rb = new input ( { label : this . options . vdef . rb , properties : { onkeyup : this . submit } , style : { width : "100%" } , maxlength : 16 } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Password" , className : "inst_td0" } , { width : "30%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) . append (
// this.databasePassword =new DOM("input",{type:"text",onkeyup:this.submit,className:"inputNormal"})
this . databasePassword = new input ( { properties : { type : 'password' , onkeyup : this . submit } , style : { width : "100%" } } )
) ,
new DOM ( 'td' , { innerHTML : "Report Database:" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _db _rp = new input ( { label : this . options . vdef . rp , properties : { onkeyup : this . submit } , style : { width : "100%" } , maxlength : 16 } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Database Access" , className : "inst_td0" } , { width : "30%" } ) ,
this . databaseGrant = new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) ,
new DOM ( 'td' , { innerHTML : "DROP DATABASE IF EXISTS" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td0" } , { width : "20%" , textAlign : 'left' } ) . append (
this . ao _db _drop = new input ( {
properties : { type : 'checkbox' , disabled : true , className : '' } , style : { border : "1px solid #666" }
} )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
this . databaseStatus = new DOM ( 'td' , { innerHTML : "<br>" , className : "tdNormal" , colSpan : 4 } , { height : 50 } )
) ;
/* Database End */
/* Directories Begin */
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>Processmaker Configuration</b>" , className : "app_grid_title___gray title" , colSpan : 2 } ) ,
new DOM ( 'td' , { className : "app_grid_title___gray title" , colSpan : 2 } ) . append (
this . select _ao _pm = new select ( { data : [
{ value : 1 , text : "Advanced options by default" } ,
{ value : 2 , text : "Change Advanced options" }
] ,
style : { width : "100%" , border : "1px solid #919B9C" } ,
properties : { onchange : function ( ) {
if ( this . select _ao _pm . selected ( ) . value == 1 )
{
this . ed _advanced _options ( {
act : 'pm' ,
sta : "disabled" ,
def : true
} ) ;
this . ao _admin . passed ( ) . value = "admin" ;
this . ao _admin _pass1 . passed ( ) . value = "admin" ;
this . ao _admin _pass2 . passed ( ) . value = "admin" ;
}
else
{
this . ed _advanced _options ( {
act : 'pm' ,
sta : "enabled"
} ) ;
this . ao _admin . focus ( ) ;
}
} . extend ( this ) }
} )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "Workflow Data Directory: " , className : "inst_td0" } , { width : "30%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) . append (
this . workflowData = new input ( { label : this . options . path _data , properties : { onkeyup : this . submit } , style : { width : "100%" } , maxlength : 200 } )
) ,
new DOM ( 'td' , { innerHTML : "Username (Default: admin):" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _admin = new input ( { label : 'admin' , properties : { onkeyup : this . submit } , style : { width : "100%" } } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "" , className : "inst_td0" } , { width : "30%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "30%" } ) . append (
this . compiled = new input ( { label : this . options . path _compiled , properties : { onkeyup : this . submit } , style : { width : "100%" , display : 'none' } , maxlength : 200 } )
) ,
new DOM ( 'td' , { innerHTML : "Username (Default: admin):" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _admin _pass1 = new input ( { label : 'admin' , properties : { onkeyup : this . submit , type : 'password' } , style : { width : "100%" } } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { className : "inst_td0" , colSpan : 2 } ) ,
new DOM ( 'td' , { innerHTML : "Re-type Password:" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td1" } , { width : "20%" } ) . append (
this . ao _admin _pass2 = new input ( { label : 'admin' , properties : { onkeyup : this . submit , type : 'password' } , style : { width : "100%" } } ) . passed ( ) . disable ( )
)
) ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>HeartBeat Configuration</b><br><i>Heartbeat is a anonymous statistics collector for ProcessMaker. It runs in the background and if you have internet enabled, it will periodically send anonymous information to ProcessMaker servers.<br />No sensitive or private information is collected.<br /><br /> The information collected will allow us to keep improving our software to offer everyone a better user experience</i>" , className : "app_grid_title___gray title" , colSpan : 4 } )
) ;
this . heartBeatTitle = tr ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
this . heartBeat =
new DOM ( 'td' , { innerHTML : "Enable HeartBeat" , className : "inst_td0" } , { width : "20%" } ) ,
new DOM ( 'td' , { className : "inst_td0" , colSpan : 2 } , { textAlign : 'left' } ) . append (
this . ao _hb _status = new input ( {
properties : { type : 'checkbox' , disabled : false , checked : true , className : '' } , style : { border : "1px solid #666" }
} )
)
) ;
this . heartBeatRow = tr ;
//alert(this.options.availableProcess);
//alert(this.options.availableProcess.length);
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>Available Processes (auto install)</b>" , className : "app_grid_title___gray title" , colSpan : 4 } )
) ;
this . availableProcessTitle = tr ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
this . availableProcess = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
this . availableProcessRow = tr ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
new DOM ( 'td' , { innerHTML : "<b>Available Plugins (auto install)</b>" , className : "app_grid_title___gray title" , colSpan : 4 } )
) ;
this . availablePluginsTitle = tr ;
var tr = this . table . insertRow ( - 1 ) ;
$ ( tr ) . append (
this . availablePlugins = new DOM ( 'td' , { innerHTML : 'Loading...' , className : "inst_td1" , colSpan : 2 } )
) ;
this . availablePluginsRow = tr ;
leimnud . dom . setStyle ( [ this . workflowData , this . compiled ] , {
textAlign : "left"
} ) ;
this . options . target . appendChild ( this . table ) ;
} ;
this . formData = function ( )
{
//alert(this.databaseExe.value.eplace("\\","/"))
return {
mysqlH : escape ( this . databaseHostname . value ) ,
mysqlU : escape ( this . databaseUsername . value ) ,
mysqlP : escape ( this . databasePassword . value ) ,
// port :this.port.value,
path _data : this . workflowData . value ,
path _compiled : this . compiled . value ,
ao _admin : escape ( this . ao _admin . value ) ,
ao _admin _pass1 : escape ( this . ao _admin _pass1 . value ) ,
ao _admin _pass2 : escape ( this . ao _admin _pass2 . value ) ,
ao _db _wf : this . ao _db _wf . value ,
ao _db _rb : this . ao _db _rb . value ,
ao _db _rp : this . ao _db _rp . value ,
ao _db : parseInt ( this . select _ao _db . selected ( ) . value ) ,
ao _pm : parseInt ( this . select _ao _pm . selected ( ) . value ) ,
ao _db _drop : this . ao _db _drop . checked ,
heartbeatEnabled : this . ao _hb _status . checked
} ;
} ;
this . check = function ( )
{
inst . loader . show ( ) ;
this . disabled ( true ) ;
this . ed _advanced _options ( { sta : 'disabled' , act : 'all' } ) ;
var r = new leimnud . module . rpc . xmlhttp ( {
url : this . options . server ,
method : "POST" ,
args : "action=check&data=" + this . formData ( ) . toJSONString ( )
} ) ;
r . callback = function ( rpc )
{
try
{
this . cstatus = rpc . xmlhttp . responseText . parseJSON ( ) ;
}
catch ( e )
{
this . cstatus = {
ao _db _wf : false ,
ao _db _rb : false ,
ao _db _rp : false
} ;
}
this . phpVersion . className = ( ! this . cstatus . phpVersion ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . phpVersion . innerHTML = ( ! this . cstatus . phpVersion ) ? "FAILED" : "PASSED" ;
this . mysqlVersion . className = ( ! this . cstatus . mysqlVersion ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . mysqlVersion . innerHTML = ( ! this . cstatus . mysqlVersion ) ? "FAILED" : "PASSED" ;
this . checkMemory . className = ( ! this . cstatus . checkMemory ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkMemory . innerHTML = ( ! this . cstatus . checkMemory ) ? "FAILED" : "PASSED" ;
// this.checkmqgpc.className = (!this.cstatus.checkmqgpc)?"inst_td1 tdFailed":"inst_td1 tdOk";
// this.checkmqgpc.innerHTML = (!this.cstatus.checkmqgpc)?"FAILED":"PASSED";
this . checkPI . className = ( ! this . cstatus . checkPI ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkPI . innerHTML = ( ! this . cstatus . checkPI ) ? "FAILED" : "PASSED" ;
this . checkDL . className = ( ! this . cstatus . checkDL ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkDL . innerHTML = ( ! this . cstatus . checkDL ) ? "FAILED" : "PASSED" ;
this . checkDLJ . className = ( ! this . cstatus . checkDLJ ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkDLJ . innerHTML = ( ! this . cstatus . checkDLJ ) ? "FAILED" : "PASSED" ;
this . checkPL . className = ( ! this . cstatus . checkPL ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkPL . innerHTML = ( ! this . cstatus . checkPL ) ? "FAILED" : "PASSED" ;
this . checkXF . className = ( ! this . cstatus . checkXF ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . checkXF . innerHTML = ( ! this . cstatus . checkXF ) ? "FAILED" : "PASSED" ;
this . databaseHostname [ ( ! this . cstatus . mysqlConnection ) ? "failed" : "passed" ] ( ) ;
this . databaseUsername [ ( ! this . cstatus . mysqlConnection ) ? "failed" : "passed" ] ( ) ;
this . databasePassword [ ( ! this . cstatus . mysqlConnection ) ? "failed" : "passed" ] ( ) ;
this . databaseGrant . className = ( ! this . cstatus . grantPriv && this . select _ao _db . selected ( ) . value == 1 ) ? "inst_td1 tdFailed" : "inst_td1 tdOk" ;
this . databaseGrant . innerHTML = ( ! this . cstatus . grantPriv ) ? "FAILED" : ( ( this . cstatus . grantPriv == 1 ) ? 'ALL PRIVILEGES' : 'USAGE' ) ;
this . databaseStatus . className = ( ! this . cstatus . grantPriv || ! this . cstatus . mysqlConnection ) ? "tdFailed" : "tdOk" ;
this . databaseStatus . innerHTML = this . cstatus . databaseMessage ;
this . workflowData [ ( ! this . cstatus . path _data ) ? "failed" : "passed" ] ( ) ;
this . compiled [ ( ! this . cstatus . path _compiled ) ? "failed" : "passed" ] ( ) ;
this . ao _db _wf [ ( ( ! this . cstatus . ao _db _wf [ 'status' ] ) ? "failed" : "passed" ) ] ( ) ;
this . ao _db _rb [ ( ( ! this . cstatus . ao _db _rb [ 'status' ] ) ? "failed" : "passed" ) ] ( ) ;
this . ao _db _rp [ ( ( ! this . cstatus . ao _db _rp [ 'status' ] ) ? "failed" : "passed" ) ] ( ) ;
this . ao _admin [ ( ! this . cstatus . ao _admin && this . select _ao _pm . selected ( ) . value == 2 ) ? "failed" : "passed" ] ( ) ;
this . ao _admin _pass1 [ ( ! this . cstatus . ao _admin _pass && this . select _ao _pm . selected ( ) . value == 2 ) ? "failed" : "passed" ] ( ) ;
this . ao _admin _pass2 [ ( ! this . cstatus . ao _admin _pass && this . select _ao _pm . selected ( ) . value == 2 ) ? "failed" : "passed" ] ( ) ;
if ( this . cstatus . ao _db _wf [ 'status' ] && this . cstatus . ao _db _rb [ 'status' ] && this . cstatus . ao _db _rp [ 'status' ] && this . cstatus . ao _admin && this . cstatus . ao _admin _pass && this . cstatus . checkMemory && this . cstatus . checkPI && this . cstatus . checkDL && this . cstatus . checkDLJ && this . cstatus . checkPL && this . cstatus . checkXF && this . cstatus . phpVersion && this . cstatus . mysqlVersion && this . cstatus . mysqlConnection && this . cstatus . grantPriv && this . cstatus . path _data && this . cstatus . path _compiled )
{
this . options . button0 . disabled = true ;
this . options . button1 . disabled = false ;
this . disabled ( true ) ;
}
else
{
this . options . button0 . disabled = false ;
this . options . button1 . disabled = true ;
this . disabled ( false ) ;
this . compiled . focus ( ) ;
this . ed _advanced _options ( { sta : ( ( this . select _ao _db . selected ( ) . value == 2 ) ? 'enabled' : 'disabled' ) , act : 'usr' } ) ;
this . ed _advanced _options ( { sta : ( ( this . select _ao _pm . selected ( ) . value == 2 ) ? 'enabled' : 'disabled' ) , act : 'pm' } ) ;
}
this . buttonFun ( this . options . button0 ) ;
this . buttonFun ( this . options . button1 ) ;
this . ao _db _wf . title = this . cstatus . ao _db _wf . message ;
this . ao _db _rb . title = this . cstatus . ao _db _rb . message ;
this . ao _db _rp . title = this . cstatus . ao _db _rp . message ;
this . ao _admin . title = ( this . cstatus . ao _admin ) ? 'Username invalid' : 'PASSED' ;
//*Autoinstall Process and Plugins. By JHL
// March 11th. 2009
// To enable the way of aoutoinstall process and/or plugins
// at same time of initial PM setup
if ( this . cstatus . availableProcess . length > 0 ) {
this . availableProcess . className = "inst_td1 tdOk" ;
this . availableProcess . innerHTML = "" ;
for ( i _process = 0 ; i _process < this . cstatus . availableProcess . length ; i _process ++ ) {
this . availableProcess . innerHTML += this . cstatus . availableProcess [ i _process ] + "<br />" ;
}
} else {
//Hide entire Group
this . availableProcessTitle . style . display = "none" ;
this . availableProcessRow . style . display = "none" ;
}
if ( this . cstatus . availablePlugins . length > 0 ) {
this . availablePlugins . className = "inst_td1 tdOk" ;
this . availablePlugins . innerHTML = "" ;
for ( i _plugin = 0 ; i _plugin < this . cstatus . availablePlugins . length ; i _plugin ++ ) {
this . availablePlugins . innerHTML += this . cstatus . availablePlugins [ i _plugin ] + "<br />" ;
}
} else {
//Hide entire Group
this . availablePluginsTitle . style . display = "none" ;
this . availablePluginsRow . style . display = "none" ;
}
//End Autoinstall
inst . loader . hide ( ) ;
} . extend ( this ) ;
r . make ( ) ;
} ;
this . reset = function ( )
{
this . options . button1 . disabled = true ;
this . buttonFun ( this . options . button1 ) ;
this . disabled ( false ) ;
} ;
this . disabled = function ( dis )
{
this . databaseHostname [ ( dis === true ) ? 'disable' : 'enable' ] ( ) ;
this . databaseUsername [ ( dis === true ) ? 'disable' : 'enable' ] ( ) ;
this . databasePassword [ ( dis === true ) ? 'disable' : 'enable' ] ( ) ;
this . workflowData [ ( dis === true ) ? 'disable' : 'enable' ] ( ) ;
this . compiled [ ( dis === true ) ? 'disable' : 'enable' ] ( ) ;
if ( this . compiled . disabled === false )
{
this . compiled . focus ( ) ;
}
this . options . button0 . disabled = dis ;
this . buttonFun ( this . options . button0 ) ;
} ;
this . ed _advanced _options = function ( options )
{
options = {
sta : "disabled" ,
act : "all" ,
def : false
} . concat ( options || { } ) ;
if ( options . act == 'pm' || options . act == "all" )
{
this . ao _admin [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
this . ao _admin _pass1 [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
this . ao _admin _pass2 [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
}
if ( options . act == 'usr' || options . act == "all" )
{
this . ao _db _wf [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
this . ao _db _rb [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
this . ao _db _rp [ ( options . sta == "disabled" ) ? 'disable' : 'enable' ] ( ) ;
this . ao _db _drop . disabled = ( options . sta == "disabled" ) ? true : false ;
}
} ;
this . submit = function ( evt )
{
var evt = ( window . event ) ? window . event : evt ;
var key = ( evt . which ) ? evt . which : evt . keyCode ;
if ( key == 13 )
{
this . check ( ) ;
}
return false ;
} ;
this . install = function ( )
{
this . values = this . formData ( ) ;
inst . clearContent ( ) ;
inst . loader . show ( ) ;
this . options . button2 . disabled = true ;
this . options . button1 . disabled = true ;
var r = new leimnud . module . rpc . xmlhttp ( {
url : this . options . server ,
method : "POST" ,
args : "action=install&data=" + this . values . toJSONString ( )
} ) ;
r . callback = this . installation ;
r . make ( ) ;
} ;
this . installation = function ( rpc )
{
/ * v a r r = n e w l e i m n u d . m o d u l e . r p c . x m l h t t p ( {
url : "/sysworkflow/en/green/tools/updateTranslation" ,
method : "GET"
} ) ;
r . callback = function ( rpc )
{ * /
inst . loader . hide ( ) ;
this . table = document . createElement ( "table" ) ;
this . table . className = "inst_table" ;
var tr = this . table . insertRow ( - 1 ) ;
var tdtitle = tr . insertCell ( 0 ) ;
tdtitle . innerHTML = "Directories" ;
tdtitle . className = "app_grid_title___gray title" ;
var tr = this . table . insertRow ( - 1 ) ;
var td0 = tr . insertCell ( 0 ) ;
td0 . innerHTML = "SUCCESS" ;
td0 . className = "tdOk" ;
var tr = this . table . insertRow ( - 1 ) ;
var tdtitle = tr . insertCell ( 0 ) ;
tdtitle . innerHTML = "New Workspace" ;
tdtitle . className = "app_grid_title___gray title" ;
var tr = this . table . insertRow ( - 1 ) ;
var td0 = tr . insertCell ( 0 ) ;
td0 . innerHTML = "SUCCESS" ;
td0 . className = "tdOk" ;
this . options . target . appendChild ( this . table ) ;
var tr = this . table . insertRow ( - 1 ) ;
var tdS = tr . insertCell ( 0 ) ;
tdS . colSpan = 2 ;
tdS . innerHTML = "<br><br>" ;
tdS . className = "tdNormal" ;
this . options . buttong = document . createElement ( "input" ) ;
this . options . buttong . type = "button" ;
this . options . buttong . value = "Finish Installation" ;
this . options . buttong . onmouseup = function ( )
{
window . location = "/sysworkflow/en/green/login/login" ;
} . extend ( this ) ;
tdS . appendChild ( this . options . buttong ) ;
this . buttonFun ( this . options . buttong ) ;
tdS . appendChild ( document . createElement ( "br" ) ) ;
tdS . appendChild ( document . createElement ( "br" ) ) ;
var tr = this . table . insertRow ( - 1 ) ;
var tdtitle = tr . insertCell ( 0 ) ;
tdtitle . innerHTML = "Installation Log" ;
tdtitle . className = "app_grid_title___gray title" ;
var tr = this . table . insertRow ( - 1 ) ;
var td0 = tr . insertCell ( 0 ) ;
var pre = document . createElement ( 'pre' ) ;
pre . style . overflow = 'scroll' ;
pre . style . width = ( this . options . target . clientWidth - 10 ) + "px" ;
pre . style . height = ( ( this . options . target . clientHeight - this . table . clientHeight ) - 15 ) + 'px' ;
pre . innerHTML = rpc . xmlhttp . responseText ;
td0 . appendChild ( pre ) ;
// }.extend(this);
// r.make();
} ;
this . buttonFun = function ( but )
{
if ( but . disabled == true )
{
but . className = "app_grid_title___gray button buttonDisabled" ;
but . onmouseover = function ( ) { this . className = "app_grid_title___gray button buttonDisabled" } ;
but . onmouseout = function ( ) { this . className = "app_grid_title___gray button buttonDisabled" } ;
but . onblur = function ( ) { this . className = "app_grid_title___gray button buttonDisabled" } ;
}
else
{
but . className = "app_grid_title___gray button" ;
but . onmouseover = function ( ) { this . className = "app_grid_title___gray button buttonHover" } ;
but . onmouseout = function ( ) { this . className = "app_grid_title___gray button" } ;
but . onblur = function ( ) { this . className = "app_grid_title___gray button" } ;
}
} ;
this . showPhpinfo = function ( )
{
var panel = new leimnud . module . panel ( ) ;
panel . options = {
title : "PHP info" ,
position : { center : true } ,
size : { w : 700 , h : document . body . clientHeight - 50 } ,
fx : { modal : true }
} ;
panel . make ( ) ;
var r = new leimnud . module . rpc . xmlhttp ( {
url : "install.php" ,
method : "POST" ,
args : "phpinfo=true"
} ) ;
r . callback = function ( rpc )
{
panel . addContent ( rpc . xmlhttp . responseText ) ;
} ;
r . make ( ) ;
} ;
this . expand ( this ) ;
}