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'; +}