From 8a5d44a8c7909d572d2309e114d1e379d1e28fd9 Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 29 Jun 2015 11:27:34 -0400 Subject: [PATCH 1/2] 0017676: Change warning message in the output of the "processmaker workspace-restore" command.SOLVED al realizar el comando ./processmaker workspace-restore daba un mensaje que no era lo suficientemente claro se soluciono haciendo el cambio del texto en el archivo class.wsTools.php y corrigiendo con backslash para el uso de variables --- workflow/engine/classes/class.wsTools.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 1b10c32d3..0fd712208 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1564,9 +1564,11 @@ class workspaceTools $version = explode('-', $version); $versionPresent = ( isset($version[0])) ? $version[0] : ''; CLI::logging(CLI::warning(" - Note.- If you try to execute a restore from a generated backup on a recent version of Processmaker - than version you are using currently to restore it, it may be occur errors on the restore process, - it shouldn't be restaured generated backups on later versions than version when the restore is executed") . "\n"); + Warning: A workspace from a newer version of ProcessMaker can NOT be restored in an older version of + ProcessMaker. For example, restoring from v.3.0 to v.2.5 will not work. However, it may be possible + to restore a workspace from an older version to an newer version of ProcessMaker, although error + messages may be displayed during the restore process. Make sure to run the \"processmaker cacheview-repair\" + and \"processmaker migrate-new-cases-lists\" commands after restoring a workspace.") . "\n"); foreach ($metaFiles as $metaFile) { $metadata = G::json_decode(file_get_contents($metaFile)); From 552aadef47097ec8992cd285c0ca1965f0cbccf3 Mon Sep 17 00:00:00 2001 From: ricardo Date: Tue, 30 Jun 2015 16:13:30 -0400 Subject: [PATCH 2/2] 0017667: The command "processmaker help OPTION" shows PHP warnings if the option doesn't exist SOLVED al ejecutar el comando processmaker help con una opcion que no existia daba un error que no era entendible para el usuario se soluciono agregando un array que jala todas las opciones y una condicion que al dar cualquier opcion que no este listada dira que no existe --- workflow/engine/classes/class.cli.php | 40 ++++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/workflow/engine/classes/class.cli.php b/workflow/engine/classes/class.cli.php index 21b0c7077..b26865a09 100755 --- a/workflow/engine/classes/class.cli.php +++ b/workflow/engine/classes/class.cli.php @@ -150,17 +150,36 @@ class CLI $tasks = join( "\n", $tasks ); echo $tasks . "\n\n"; } else { - $valid_args = array (); - foreach (self::$tasks[$taskName]['args'] as $arg => $data) { - $arg = strtoupper( $arg ); - if ($data['multiple']) { - $arg = "$arg..."; - } - if ($data['optional']) { - $arg = "[$arg]"; - } - $valid_args[] = $arg; + $options = array(); + $tasks = array(); + ksort( self::$tasks ); + foreach (self::$tasks as $name => $data) { + $description = explode( "\n", $data['description'] ); + $options[] = "$name"; } + if (!in_array($taskName, $options)) { + echo "\nThe task does not exist \n"; + echo "Use one of the following tasks:\n"; + $tasks = array (); + ksort( self::$tasks ); + foreach (self::$tasks as $name => $data) { + $description = explode( "\n", $data['description'] ); + $tasks[] = " $name"; + } + $tasks = join( "\n", $tasks ); + echo $tasks . "\n\n"; + } else{ + $valid_args = array (); + foreach (self::$tasks[$taskName]['args'] as $arg => $data) { + $arg = strtoupper( $arg ); + if ($data['multiple']) { + $arg = "$arg..."; + } + if ($data['optional']) { + $arg = "[$arg]"; + } + $valid_args[] = $arg; + } $valid_args = join( " ", $valid_args ); $description = explode( "\n", self::$tasks[$taskName]['description'] ); $taskDescription = trim( array_shift( $description ) ); @@ -195,6 +214,7 @@ EOT; } echo $message . "\n"; } + } } /**