From 02a0c21bedc100eced5269eb654398d19a573e8f Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 20 Feb 2013 10:11:03 -0400 Subject: [PATCH 1/5] BUG 10435 I added option to view history Upgrades SOLVED I added option to view history Upgrades --- workflow/engine/bin/tasks/cliUpgrade.php | 26 +++++++++++++++++++++++ workflow/engine/controllers/main.php | 11 ++++++++++ workflow/engine/templates/setup/dbInfo.js | 4 ++++ 3 files changed, 41 insertions(+) diff --git a/workflow/engine/bin/tasks/cliUpgrade.php b/workflow/engine/bin/tasks/cliUpgrade.php index 567f6153b..92cbeb6d8 100755 --- a/workflow/engine/bin/tasks/cliUpgrade.php +++ b/workflow/engine/bin/tasks/cliUpgrade.php @@ -125,6 +125,32 @@ function run_upgrade($command, $args) } else { CLI::logging("Upgrade successful\n"); } + + // SAVE Upgrades/Patches + $arrayPatch = glob(PATH_TRUNK . 'patch-*'); + + if (count($arrayPatch)) { + foreach ($arrayPatch as $value) { + if (file_exists($value)) { + // copy content the patch + $names = pathinfo($value); + $nameFile = $names['basename']; + + $fichero = file_get_contents($value); + $fichero = eregi_replace("[\n|\r|\n\r]", ' ', $fichero); + CLI::logging($fichero . ' installed (' . $nameFile . ')', PATH_DATA . 'log/upgrades.log'); + + // move file of patch + $newFile = PATH_DATA . $nameFile; + G::rm_dir($newFile); + copy($value, $newFile); + G::rm_dir($value); + } + } + } else { + CLI::logging('ProcessMaker ' . System::getVersion(). ' installed', PATH_DATA . 'log/upgrades.log'); + } + //setting flag to false $flag = G::isPMUnderUpdating(0); } diff --git a/workflow/engine/controllers/main.php b/workflow/engine/controllers/main.php index 4ae78856f..088757416 100644 --- a/workflow/engine/controllers/main.php +++ b/workflow/engine/controllers/main.php @@ -85,6 +85,10 @@ class Main extends Controller $this->render(); } + function screamFileUpgrades () { + G::streamFile( PATH_DATA . 'log/upgrades.log', true ); + } + function getSystemInfo () { $this->setResponseType( 'json' ); @@ -735,6 +739,13 @@ class Main extends Controller $ee = class_exists( 'pmLicenseManager' ) ? " - Enterprise Edition" : ''; $properties[] = array ('ProcessMaker Ver.',System::getVersion() . $ee,$pmSection ); + + if (file_exists(PATH_DATA. 'log/upgrades.log')) { + $properties[] = array ('Upgrades/Patches', 'View log' ,$pmSection); + } else { + $properties[] = array ('Upgrades/Patches', 'Never upgraded' ,$pmSection); + } + $properties[] = array ('Operating System',$redhat,$sysSection ); $properties[] = array ('Time Zone',(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection diff --git a/workflow/engine/templates/setup/dbInfo.js b/workflow/engine/templates/setup/dbInfo.js index 7c72eac02..2ecc512f5 100644 --- a/workflow/engine/templates/setup/dbInfo.js +++ b/workflow/engine/templates/setup/dbInfo.js @@ -29,3 +29,7 @@ dbInfo.application = { Ext.onReady(dbInfo.application.init, dbInfo.application); + +function showUpgradedLogs() { + window.location = '../../uxmodern/main/screamFileUpgrades.php'; +} From 6c1ebd521359a0f5418f7af1082a86581248618e Mon Sep 17 00:00:00 2001 From: jennylee Date: Wed, 20 Feb 2013 15:52:32 -0400 Subject: [PATCH 2/5] BUG 10856 When import a Process with 'Derivation Screen', it does not have set the template html to show. When import a Process with 'Derivation Screen', it does not have set the template html to show at the end of a case. Solved. --- workflow/engine/classes/model/Process.php | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index e766a1874..e8c7ec785 100755 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -467,6 +467,7 @@ class Process extends BaseProcess $this->setProTriReassigned( isset( $aData['PRO_TRI_REASSIGNED'] ) ? $aData['PRO_TRI_REASSIGNED'] : '' ); $this->setProShowDelegate( $aData['PRO_SHOW_DELEGATE'] ); $this->setProShowDynaform( $aData['PRO_SHOW_DYNAFORM'] ); + $this->setProDerivationScreenTpl($aData['PRO_DERIVATION_SCREEN_TPL']); // validate if the category exists $criteria = new Criteria( 'workflow' ); From e80c97fb4e79a4fa213e0bf6d571da8fe79ccaf6 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 20 Feb 2013 17:33:13 -0400 Subject: [PATCH 3/5] BUG 10435 I added option to view history Upgrades SOLVED I added option to view history Upgrades --- workflow/engine/bin/tasks/cliUpgrade.php | 8 ++-- workflow/engine/controllers/main.php | 48 +++++++++++------------ workflow/engine/templates/setup/dbInfo.js | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/workflow/engine/bin/tasks/cliUpgrade.php b/workflow/engine/bin/tasks/cliUpgrade.php index 92cbeb6d8..25f66a87f 100755 --- a/workflow/engine/bin/tasks/cliUpgrade.php +++ b/workflow/engine/bin/tasks/cliUpgrade.php @@ -129,16 +129,16 @@ function run_upgrade($command, $args) // SAVE Upgrades/Patches $arrayPatch = glob(PATH_TRUNK . 'patch-*'); - if (count($arrayPatch)) { + if ($arrayPatch) { foreach ($arrayPatch as $value) { if (file_exists($value)) { // copy content the patch $names = pathinfo($value); $nameFile = $names['basename']; - $fichero = file_get_contents($value); - $fichero = eregi_replace("[\n|\r|\n\r]", ' ', $fichero); - CLI::logging($fichero . ' installed (' . $nameFile . ')', PATH_DATA . 'log/upgrades.log'); + $contentFile = file_get_contents($value); + $contentFile = preg_replace("[\n|\r|\n\r]", '', $contentFile); + CLI::logging($contentFile . ' installed (' . $nameFile . ')', PATH_DATA . 'log/upgrades.log'); // move file of patch $newFile = PATH_DATA . $nameFile; diff --git a/workflow/engine/controllers/main.php b/workflow/engine/controllers/main.php index 088757416..74336bd7e 100644 --- a/workflow/engine/controllers/main.php +++ b/workflow/engine/controllers/main.php @@ -732,8 +732,8 @@ class Main extends Controller } } - $sysSection = G::loadTranslation( 'ID_SYSTEM_INFO' ); - $pmSection = 'ProcessMaker Information'; + $sysSection = G::loadTranslation('ID_SYSTEM_INFO' ); + $pmSection = G::LoadTranslation('ID_PROCESS_INFORMATION'); $properties = array (); $ee = class_exists( 'pmLicenseManager' ) ? " - Enterprise Edition" : ''; @@ -741,55 +741,55 @@ class Main extends Controller ); if (file_exists(PATH_DATA. 'log/upgrades.log')) { - $properties[] = array ('Upgrades/Patches', 'View log' ,$pmSection); + $properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), '' . G::LoadTranslation( 'ID_UPGRADE_VIEW_LOG') . '' ,$pmSection); } else { - $properties[] = array ('Upgrades/Patches', 'Never upgraded' ,$pmSection); + $properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation( 'ID_UPGRADE_NEVER_UPGRADE') ,$pmSection); } - $properties[] = array ('Operating System',$redhat,$sysSection + $properties[] = array (G::LoadTranslation('ID_OPERATING_SYSTEM') ,$redhat,$sysSection ); - $properties[] = array ('Time Zone',(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection + $properties[] = array (G::LoadTranslation('ID_TIME_ZONE') ,(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection ); - $properties[] = array ('Web Server',getenv( 'SERVER_SOFTWARE' ),$sysSection + $properties[] = array (G::LoadTranslation('ID_WEB_SERVER') ,getenv( 'SERVER_SOFTWARE' ),$sysSection ); - $properties[] = array ('Server Name',getenv( 'SERVER_NAME' ),$pmSection + $properties[] = array (G::LoadTranslation('ID_SERVER_NAME') ,getenv( 'SERVER_NAME' ),$pmSection ); - $properties[] = array ('Server IP Address',$this->lookup( $ip ),$sysSection + $properties[] = array (G::LoadTranslation('ID_SERVER_IP') ,$this->lookup( $ip ),$sysSection ); - $properties[] = array ('PHP Version',phpversion(),$sysSection + $properties[] = array (G::LoadTranslation('ID_PHP_VERSION') ,phpversion(),$sysSection ); if (defined( "DB_HOST" )) { - $properties[] = array ('Data Base',$dbNetView->dbName( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')',$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE') ,$dbNetView->dbName( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')',$pmSection ); - $properties[] = array ('Data Base Server',DB_HOST,$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,DB_HOST,$pmSection ); - $properties[] = array ('Data Base Name',DB_NAME,$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,DB_NAME,$pmSection ); - $properties[] = array ('Available DB Engines',$availdb,$sysSection + $properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,$availdb,$sysSection ); } else { - $properties[] = array ('Data Base',"Not defined",$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE') ,"Not defined",$pmSection ); - $properties[] = array ('Data Base Server',"Not defined",$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,"Not defined",$pmSection ); - $properties[] = array ('Data Base Name',"Not defined",$pmSection + $properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,"Not defined",$pmSection ); - $properties[] = array ('Available DB Engines',"Not defined",$sysSection + $properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,"Not defined",$sysSection ); } - $properties[] = array ('Workspace',defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection + $properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection ); - $properties[] = array ('Server Protocol',getenv( 'SERVER_PROTOCOL' ),$sysSection + $properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection ); - $properties[] = array ('Server Port',getenv( 'SERVER_PORT' ),$sysSection + $properties[] = array ( G::LoadTranslation('ID_SERVER_PORT') ,getenv( 'SERVER_PORT' ),$properties ); - //$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection); - $properties[] = array ('Server Addr.',getenv( 'SERVER_ADDR' ),$sysSection + //$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection); + $properties[] = array ( G::LoadTranslation('ID_SERVER_NAME') , getenv( 'SERVER_ADDR' ),$sysSection ); - $properties[] = array ('User\'s Browser',getenv( 'HTTP_USER_AGENT' ),$sysSection + $properties[] = array ( G::LoadTranslation('ID_USER_BROWSER') , getenv( 'HTTP_USER_AGENT' ),$sysSection ); return $properties; diff --git a/workflow/engine/templates/setup/dbInfo.js b/workflow/engine/templates/setup/dbInfo.js index 2ecc512f5..5c04e15fd 100644 --- a/workflow/engine/templates/setup/dbInfo.js +++ b/workflow/engine/templates/setup/dbInfo.js @@ -31,5 +31,5 @@ Ext.onReady(dbInfo.application.init, dbInfo.application); function showUpgradedLogs() { - window.location = '../../uxmodern/main/screamFileUpgrades.php'; + window.location = '../../uxmodern/main/screamFileUpgrades'; } From edf31dc64b482c8d31fc6281b2121dca42f37049 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Thu, 21 Feb 2013 10:31:45 -0400 Subject: [PATCH 4/5] BUG 10435 I added option to view history Upgrades SOLVED I added option to view history Upgrades --- workflow/engine/controllers/main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/controllers/main.php b/workflow/engine/controllers/main.php index 74336bd7e..f04cf1c97 100644 --- a/workflow/engine/controllers/main.php +++ b/workflow/engine/controllers/main.php @@ -784,7 +784,7 @@ class Main extends Controller $properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection ); - $properties[] = array ( G::LoadTranslation('ID_SERVER_PORT') ,getenv( 'SERVER_PORT' ),$properties + $properties[] = array ( G::LoadTranslation('ID_SERVER_PORT') ,getenv( 'SERVER_PORT' ),$sysSection ); //$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection); $properties[] = array ( G::LoadTranslation('ID_SERVER_NAME') , getenv( 'SERVER_ADDR' ),$sysSection From 61abf4a9d931037729d32221c8938bdc12e7a9c6 Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Thu, 21 Feb 2013 10:51:32 -0400 Subject: [PATCH 5/5] BUG 7228 PM does not have a valid country code for Taiwan SOLVED - Change the query to get the country by name --- workflow/engine/classes/model/IsoCountry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/classes/model/IsoCountry.php b/workflow/engine/classes/model/IsoCountry.php index 2adfe5b78..f0ce15076 100755 --- a/workflow/engine/classes/model/IsoCountry.php +++ b/workflow/engine/classes/model/IsoCountry.php @@ -57,7 +57,7 @@ class IsoCountry extends BaseIsoCountry $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(IsoCountryPeer::IC_UID); $oCriteria->addSelectColumn(IsoCountryPeer::IC_NAME); - $oCriteria->add(IsoCountryPeer::IC_NAME, $IC_NAME); + $oCriteria->add(IsoCountryPeer::IC_NAME, $IC_NAME . '%', Criteria::LIKE); $oDataset = IsoCountryPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next();