diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 338607e0a..3a7ee9dd5 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -122,7 +122,7 @@ class adminProxy extends HttpProxyController $this->url = "/sys" . SYS_SYS . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart; $this->message = 'Saved Successfully'; $msg = ""; - if($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') { + if ($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') { $msg = " Host -> ".$httpData->proxy_host." Port -> ".$httpData->proxy_port." User -> ".$httpData->proxy_user; } @@ -178,7 +178,7 @@ class adminProxy extends HttpProxyController $httpData=array_unique((array)$httpData); $message = ''; $oldName = isset($_POST['oldName'])? $_POST['oldName']:''; - + switch ($_POST['action']){ case 'calendarName': require_once ('classes/model/CalendarDefinition.php'); @@ -1356,5 +1356,133 @@ class adminProxy extends HttpProxyController return $result; } + + public function generateInfoSupport () + { + require_once (PATH_CONTROLLERS . "installer.php"); + $params = array (); + + $oServerConf = &serverConf::getSingleton(); + $pluginRegistry = &PMPluginRegistry::getSingleton(); + $licenseManager = &pmLicenseManager::getSingleton(); + + //License Information: + $activeLicense = $licenseManager->getActiveLicense(); + $params['license'] = $licenseManager; + + //Operative System version (Linux, Windows) + try { + $os = ''; + if (file_exists( '/etc/redhat-release' )) { + $fnewsize = filesize( '/etc/redhat-release' ); + $fp = fopen( '/etc/redhat-release', 'r' ); + $os = trim( fread( $fp, $fnewsize ) ); + fclose( $fp ); + } + $os .= " (" . PHP_OS . ")"; + } catch (Exception $e) { + } + $params['system'] = $os; + + //On premise or cloud + $licInfo = $oServerConf->getProperty( 'LICENSE_INFO' ); + $params['licenseType'] = isset($licInfo[SYS_SYS]) ? isset($licInfo[SYS_SYS]['TYPE'])? $licInfo[SYS_SYS]['TYPE'] : '' : ''; + + //ProcessMaker Version + $params['pmVersion'] = System::getVersion(); + if (file_exists(PATH_DATA. 'log/upgrades.log')) { + $params['pmUpgrade'] = file_get_contents(PATH_DATA. 'log/upgrades.log', 'r'); + } else { + $params['pmUpgrade'] = G::LoadTranslation('ID_UPGRADE_NEVER_UPGRADE'); + } + + //Database server Version (MySQL version) + $installer = new Installer(); + $systemInfo = $installer->getSystemInfo(); + $params['dbVersion'] = mysql_get_server_info();//$systemInfo->mysql->version; + + //PHP Version + $params['php'] = $systemInfo->php->version; + + //Apache - IIS Version + $params['apache'] = apache_get_version(); + + //Installed Plugins (license info?) + $arrayAddon = array (); + + if (file_exists( PATH_DATA_SITE . "ee" )) { + $arrayAddon = unserialize( trim( file_get_contents( PATH_DATA_SITE . "ee" ) ) ); + } + + $plugins = array(); + foreach ($arrayAddon as $addon) { + $sFileName = substr( $addon["sFilename"], 0, strpos( $addon["sFilename"], "-" ) ); + + if (file_exists( PATH_PLUGINS . $sFileName . ".php" )) { + $plugin = array(); + $addonDetails = $pluginRegistry->getPluginDetails( $sFileName . ".php" ); + $plugin['name'] = $addonDetails->sNamespace; + $plugin['description'] = $addonDetails->sDescription; + $plugin['version'] = $addonDetails->iVersion; + $plugin['enable'] = $addonDetails->enabled; + $plugins[] = $plugin; + } + } + $params['plugins'] = $plugins; + + //Number of Users registered in PM. Including LDAP users and PM users. + require_once ("classes/model/RbacUsers.php"); + $criteria = new Criteria( "rbac" ); + $criteria->addSelectColumn( RbacUsersPeer::USR_AUTH_TYPE ); + $criteria->addSelectColumn( "COUNT(USERS.USR_UID) AS USERS_NUMBER" ); + $criteria->add( RbacUsersPeer::USR_UID, null, Criteria::ISNOTNULL ); + $criteria->addGroupByColumn(RbacUsersPeer::USR_AUTH_TYPE); + $rs = RbacUsersPeer::doSelectRS( $criteria ); + $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $users = array('local' => 0); + while ($rs->next()) { + $row = $rs->getRow(); + if ($row['USR_AUTH_TYPE'] == '' || $row['USR_AUTH_TYPE'] == 'MYSQL') { + $users['local'] = (int)$users['local'] + (int)$row['USERS_NUMBER']; + } else { + $users['USR_AUTH_TYPE'] = $row['USERS_NUMBER']; + } + } + + $params["users"] =$users; + + //Number of cases. + $oSequences = new Sequences(); + $maxNumber = $oSequences->getSequeceNumber("APP_NUMBER"); + $params["cases"] = $maxNumber - 1; + + //Number of active processes. + $criteria = new Criteria( "workflow" ); + $criteria->addSelectColumn( "COUNT(PROCESS.PRO_UID) AS NUMBER_PROCESS" ); + $criteria->add( ProcessPeer::PRO_STATUS, 'ACTIVE', Criteria::NOT_EQUAL); + $rs = UsersPeer::doSelectRS( $criteria ); + $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $rs->next(); + $row = $rs->getRow(); + $params["process active"] = $row["NUMBER_PROCESS"]; + + $criteria = new Criteria( "workflow" ); + $criteria->addSelectColumn( "COUNT(PROCESS.PRO_UID) AS NUMBER_PROCESS" ); + $criteria->add( ProcessPeer::PRO_STATUS, 'INACTIVE', Criteria::NOT_EQUAL); + $rs = UsersPeer::doSelectRS( $criteria ); + $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $rs->next(); + $row = $rs->getRow(); + $params["process inactive"] = $row["NUMBER_PROCESS"]; + + + //Country/city (Timezone) + $params["Timezone"] = (defined('TIME_ZONE') && TIME_ZONE != "Unknown") ? TIME_ZONE : date_default_timezone_get(); + + $support = PATH_DATA_SITE . 'support.txt'; + file_put_contents($support, serialize($params)); + G::streamFile($support, true); + G::rm_dir($support); + } } diff --git a/workflow/engine/templates/enterprise/addonsStore.js b/workflow/engine/templates/enterprise/addonsStore.js index 0a3bc7713..f45fd2a1a 100644 --- a/workflow/engine/templates/enterprise/addonsStore.js +++ b/workflow/engine/templates/enterprise/addonsStore.js @@ -458,6 +458,14 @@ Ext.onReady(function() { }); } + var enterpriseFileSupport = function () { + var myMask = new Ext.LoadMask(Ext.getBody(), {msg: _('ID_PROCESSING')}); + myMask.show(); + //window.location = '../../uxmodern/main/generateInfoSupport'; + window.location = '../adminProxy/generateInfoSupport', + myMask.hide(); + }; + function enterpriseProcessAjax(option) { switch (option) { @@ -1006,50 +1014,76 @@ Ext.onReady(function() { ] }); - var pnlSetup = new Ext.FormPanel({ - frame: true, - height: 178, - bodyStyle: "padding: 5px 5px 5px 5px;", - disabled: !licensed, + var pnlSetup = new Ext.FormPanel({ + frame: true, + height: 160, + disabled: !licensed, - items: [ - { - layout: "column", - items: [ - { - columnWidth: 0.80, - xtype: "container", - items: [ - { - xtype: "checkbox", - id: "chkEeInternetConnection", - name: "chkEeInternetConnection", - checked: (INTERNET_CONNECTION == 1)? true : false, - boxLabel: _('ID_CHECK_UPDATES') - } - ] - }, - { - columnWidth: 0.20, - xtype: "button", - id: "btnEeSetup", - text: _('ID_SAVE'), - handler: function () { - enterpriseProcessAjax("SETUP"); - } - } - ] - } - ] - }); + items: [ + { + layout: "column", + items: [ + { + columnWidth: 0.80, + xtype: "container", + items: [ + { + xtype: "checkbox", + id: "chkEeInternetConnection", + name: "chkEeInternetConnection", + checked: (INTERNET_CONNECTION == 1)? true : false, + boxLabel: _('ID_CHECK_UPDATES') + } + ] + }, + { + columnWidth: 0.20, + xtype: "button", + id: "btnEeSetup", + text: _('ID_SAVE'), + handler: function () { + enterpriseProcessAjax("SETUP"); + } + } + ] + } + ] + }); + + var pnlSupport = new Ext.FormPanel({ + frame: true, + height: 160, + disabled: !licensed, - var pnlSystem = new Ext.Container({ - //autoEl: "div", - //width: 550, - anchor: "right 50%", - //items: [pnlUpgrade, pnlSetup] - items: [ pnlSetup] - }); + items: [ + { + layout: "column", + items: [ + { + columnWidth: 0.80, + xtype: "container", + items: [ + { + xtype:'label', + text: _('ID_GENERATE_INFO_SUPPORT'), + name: 'lblGenerateInfoSupport', + labelStyle: 'font-weight:bold;', + } + ] + }, + { + columnWidth: 0.20, + xtype: "button", + id: "btnGenerate", + text: _('ID_GENERATE'), + handler: function () { + enterpriseFileSupport(); + } + } + ] + } + ] + }); var licensePanel = new Ext.FormPanel( { frame: true, @@ -1695,27 +1729,6 @@ Ext.onReady(function() { } }); - - - var topBox = new Ext.Panel({ - id:'main-panel-hbox', - baseCls:'x-plain', - layout:'hbox', - flex: 0, - //defaultMargins: "5", - //autoHeight: true, - layoutConfig: { - align : 'stretchmax', - pack : 'start' - }, - defaults: { - frame:true, - flex: 1, - height: 182 - }, - items:[licensePanel, pnlSystem] - }); - var tabEnterprise = new Ext.TabPanel({ activeTab: 0, height: 370, @@ -1739,6 +1752,9 @@ Ext.onReady(function() { },{ title: _('ID_SETUP_WEBSERVICES'), items : pnlSetup + },{ + title: _('ID_SUPPORT'), + items : pnlSupport } ] });