File size: 8,207 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Ext.namespace("systemInfo");

systemInfo.application = {
    init: function ()
    {
        var loadMaskSystemInfo = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_CHECKING")});

        systemInfoProcessAjax = function (option)
        {
            var url = "";

            loadMaskSystemInfo.show();

            switch (option) {
                case "SYS":
                    url = "../InstallerModule/getSystemInfo";
                    break;
            }

            Ext.Ajax.request({
                url: url,
                method: "POST",

                success: function (response, opts)
                {
                    var dataResponse = eval("(" + response.responseText + ")"); //json

                    switch (option) {
                        case "SYS":
                            Ext.getCmp("php").setValue(fieldFormatValue(dataResponse.php.version, dataResponse.php.result));
                            Ext.getCmp("mysql").setValue(fieldFormatValue(dataResponse.mysql.version, dataResponse.mysql.result));
                            //Ext.getCmp("mssql").setValue(fieldFormatValue(dataResponse.mssql.version, dataResponse.mssql.result));
                            Ext.getCmp("curl").setValue(fieldFormatValue(dataResponse.curl.version, dataResponse.curl.result));
                            Ext.getCmp("openssl").setValue(fieldFormatValue(dataResponse.openssl.version, dataResponse.openssl.result));
                            Ext.getCmp("dom").setValue(fieldFormatValue(dataResponse.dom.version, dataResponse.dom.result));
                            Ext.getCmp("gd").setValue(fieldFormatValue(dataResponse.gd.version, dataResponse.gd.result));
                            Ext.getCmp("multibyte").setValue(fieldFormatValue(dataResponse.multibyte.version, dataResponse.multibyte.result));
                            Ext.getCmp("soap").setValue(fieldFormatValue(dataResponse.soap.version, dataResponse.soap.result));
                            Ext.getCmp("ldap").setValue(fieldFormatValue(dataResponse.ldap.version, dataResponse.ldap.result));
                            Ext.getCmp("memory").setValue(fieldFormatValue(dataResponse.memory.version, dataResponse.memory.result));
                            break;
                    }

                    loadMaskSystemInfo.hide();
                },
                failure: function (response, opts)
                {
                    loadMaskSystemInfo.hide();
                }
            });
        };

        fieldFormatValue = function (str, sw)
        {
            var img = "delete.png";
            var size = "width=\"15\" height=\"15\"";
            var color = "red";

            if (sw == true || sw == 1) {
                img = "dialog-ok-apply.png";
                size = "width=\"12\" height=\"12\"";
                color = "green";
            }

            return "<span style=\"color: " + color + ";\">" + str + "</span> <img src=\"/images/" + img + "\" " + size + " alt=\"\" />";
        };

        //Components
        var pnlWest = new Ext.Panel({
            id: "pnlWest",

            region: "fit",

            margins: {top: 10, right: 0, bottom: 10, left: 10},
            border: false,
            bodyStyle: "padding: 10px; font: 0.80em arial;",
            width: 250,
            html: _("ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION") +'<br><br>'+ _("ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION2") +'<br><br>'+ _("ID_PROCESSMAKER_REQUIREMENTS_OPENSSL_OPTIONAL") +'<br><br>'+ _("ID_PROCESSMAKER_REQUIREMENTS_LDAP_OPTIONAL")
        });

        var frmfsCenter = new Ext.form.FieldSet({
            id: "frmfsCenter",

            region: "fit",

            margins: {top: 10, right: 10, bottom: 10, left: 0},
            border: false,
            labelWidth: 200,
            width: 430,
            items: [
                {
                    xtype: "displayfield",
                    id: "php",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_PHP"),
                    value: eval("fieldFormatValue(" + SYSINFO_PHP + ");")
                },
                {
                    xtype: "displayfield",
                    id: "mysql",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MYSQL"),
                    value: eval("fieldFormatValue(" + SYSINFO_MYSQL + ");")
                },
                /*
                {
                    xtype: "displayfield",
                    id: "mssql",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MSSQL"),
                    value: eval("fieldFormatValue(" + SYSINFO_MSSQL + ");")
                },
                */
                {
                    xtype: "displayfield",
                    id: "curl",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_CURL"),
                    value: eval("fieldFormatValue(" + SYSINFO_CURL + ");")
                },
                {
                    xtype: "displayfield",
                    id: "openssl",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_OPENSSL"),
                    value: eval("fieldFormatValue(" + SYSINFO_OPENSSL + ");")
                },
                {
                    xtype: "displayfield",
                    id: "dom",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_DOMXML"),
                    value: eval("fieldFormatValue(" + SYSINFO_DOMXML + ");")
                },
                {
                    xtype: "displayfield",
                    id: "gd",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_GD"),
                    value: eval("fieldFormatValue(" + SYSINFO_GD + ");")
                },
                {
                    xtype: "displayfield",
                    id: "multibyte",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MULTIBYTESTRING"),
                    value: eval("fieldFormatValue(" + SYSINFO_MULTIBYTESTRING + ");")
                },
                {
                    xtype: "displayfield",
                    id: "soap",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_SOAP"),
                    value: eval("fieldFormatValue(" + SYSINFO_SOAP + ");")
                },
                {
                    xtype: "displayfield",
                    id: "mcrypt ",
                    fieldLabel: _("ID_MCRYPT_SUPPORT"),
                    value: eval("fieldFormatValue(" + SYSINFO_MCRYPT + ");")
                },
                {
                    xtype: "displayfield",
                    id: "ldap",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_LDAP"),
                    value: eval("fieldFormatValue(" + SYSINFO_LDAP + ");")
                },
                {
                    xtype: "displayfield",
                    id: "memory",
                    fieldLabel: _("ID_PROCESSMAKER_REQUIREMENTS_MEMORYLIMIT"),
                    value: eval("fieldFormatValue(" + SYSINFO_MEMORYLIMIT + ");")
                },
                {
                    xtype: "displayfield",
                    fieldLabel: ""
                },
                new Ext.Button({
                    text: _("ID_CHECK_AGAIN"),
                    handler: function () {
                        systemInfoProcessAjax("SYS");
                    }
                })
            ]
        });

       var pnlMain = new Ext.Panel({
            id: "pnlMain",

            layout: "table",
            autoScroll: true,
            border: false,
            title: _("ID_PROCESSMAKER_REQUIREMENTS_CHECK"),
            layoutConfig: {
                columns: 2
            },
            items:[{
                width: 250,
                bodyBorder: false,
                layout: 'form',
                items: pnlWest
            }, {
                width: 430,

                layout: 'form',
                items: frmfsCenter
            }]

        });

        //Load all panels
        var viewport = new Ext.Viewport({
            layout: "fit",
            autoScroll: true,
            items: [pnlMain]
        });
    }
}

Ext.onReady(systemInfo.application.init, systemInfo.application);