From d50cd2a2e1ae9e27b3d823b974ebd104cfae92de Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Tue, 25 Feb 2014 09:17:11 -0400 Subject: [PATCH 1/5] Se mejora BEHAT FILESMANAGER. --- .../basic_sequence_files_manager.feature | 2 +- features/bootstrap/RestContext.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/features/backend/files_manager/basic_sequence_files_manager.feature b/features/backend/files_manager/basic_sequence_files_manager.feature index 68d5d7ffb..06088e786 100644 --- a/features/backend/files_manager/basic_sequence_files_manager.feature +++ b/features/backend/files_manager/basic_sequence_files_manager.feature @@ -86,7 +86,7 @@ Feature: Files Manager Resources #Para que funcione este test, debe existir el archivo que se quiere subir Scenario: Post files - Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "project/1265557095225ff5c688f46031700471/file-manager" and updload "project/1265557095225ff5c688f46031700471/file-manager/upload" + Given POST I want to upload the file "/home/daniel/test.txt" to path "public". Url to create prf_uid "project/1265557095225ff5c688f46031700471/file-manager" and updload "project/1265557095225ff5c688f46031700471/file-manager" Scenario: Delete file Given that I want to delete a "public/test.txt" diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index e6e26edca..5e577044d 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -1329,18 +1329,22 @@ class RestContext extends BehatContext $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$postUrl); curl_setopt($ch, CURLOPT_HTTPHEADER,$headr); - curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_filename'=>$sfile, "prf_path" => $path, "prf_content" => "")); + curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_filename'=>$sfile, "prf_path" => $path, "prf_content" => NULL)); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch); curl_close($ch); - $aResult = explode(",",$postResult); - $aFileUid = explode(":",$aResult[0]); - $prfUid = trim(str_replace('"','',$aFileUid[1])); + $postResult = (array)json_decode($postResult); + if (sizeof($postResult) > 2) { + $prfUid = $postResult["prf_uid"]; + } else { + var_dump($postResult["error"]); + } + $url = $url.$prfUid."/upload"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_HTTPHEADER,$headr); - curl_setopt($ch, CURLOPT_POSTFIELDS, array('my_file'=>'@'.$prfFile, 'prf_uid' => $prfUid)); + curl_setopt($ch, CURLOPT_POSTFIELDS, array('prf_file'=>'@'.$prfFile)); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch); From 8b91cb3ccf4c0259c77144ac9a0398cbe8268316 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Tue, 25 Feb 2014 09:29:08 -0400 Subject: [PATCH 2/5] Se mejora BEHAT PROCESSSUPERVISOR. --- .../backend/process_supervisor/main_tests_supervisor.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/backend/process_supervisor/main_tests_supervisor.feature b/features/backend/process_supervisor/main_tests_supervisor.feature index 1a1c5d767..ec7f35260 100644 --- a/features/backend/process_supervisor/main_tests_supervisor.feature +++ b/features/backend/process_supervisor/main_tests_supervisor.feature @@ -209,7 +209,7 @@ Requirements: Given POST this data: """ { - "dyn_uid": "<92562207752ceef36c7d874048012431>" + "dyn_uid": "92562207752ceef36c7d874048012431" } """ And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform" From 0a5f7e23827ddde96e946dff542c00e3c64c97c2 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Tue, 25 Feb 2014 09:50:33 -0400 Subject: [PATCH 3/5] Se mejora PROCESSSUPERVISOR. --- workflow/engine/src/BusinessModel/FilesManager.php | 3 ++- .../src/Services/Api/ProcessMaker/Project/FilesManager.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/engine/src/BusinessModel/FilesManager.php b/workflow/engine/src/BusinessModel/FilesManager.php index f6fa3c22b..c9d4d9879 100644 --- a/workflow/engine/src/BusinessModel/FilesManager.php +++ b/workflow/engine/src/BusinessModel/FilesManager.php @@ -336,7 +336,8 @@ class FilesManager 'prf_type' => $oProcessFiles->getPrfType(), 'prf_editable' => $sEditable, 'prf_create_date' => $oProcessFiles->getPrfCreateDate(), - 'prf_update_date' => $oProcessFiles->getPrfUpdateDate()); + 'prf_update_date' => $oProcessFiles->getPrfUpdateDate(), + 'prf_content' => $content); return $oProcessFile; } catch (Exception $e) { throw $e; diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php index ce9e674ea..7feb40af8 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php @@ -143,7 +143,10 @@ class ProcessFilesManagerStructure * @var string {@from body} */ public $prf_path; - + + /** + * @var string {@from body} + */ public $prf_content; } From 28da2096944190ae1331cefb287dd030eb0a6575 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Feb 2014 11:54:56 -0500 Subject: [PATCH 4/5] working in the build-vendor --- build-vendor.php | 40 ++++++++++++++----- workflow/engine/templates/designer/index.html | 6 ++- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/build-vendor.php b/build-vendor.php index 2337ca922..5c6d2ee16 100644 --- a/build-vendor.php +++ b/build-vendor.php @@ -32,7 +32,6 @@ if (in_array('--no-ansi', $argv)) { $vendorDir = dirname(__FILE__) . DS . 'vendor'; - if (! is_dir($vendorDir )) { echo "Vendor directory is missing!" . PHP_EOL; exit(); @@ -43,16 +42,38 @@ $projects = array( 'colosa/pmUI' ); +out("build-vendor.php", 'purple'); + +out("generating files for ", 'purple', false); +out( $debug ? 'debug' : 'production', 'success', false); +out(" mode", 'purple'); + foreach ($projects as $project) { echo PHP_EOL; out("=> Building project: ", 'info', false); echo $project.' '.PHP_EOL; chdir($vendorDir.DS.$project); - if ($debug) - echo `rake pmBuildDebug`; - else - echo `rake pmBuild`; - out("Completed!", 'success'); + if ($debug) { + exec ('rake pmBuildDebug', $output, $exitCode ); + } else { + exec ('rake pmBuild', $output, $exitCode ); + } + + if ($exitCode) { + out("$project executed with errors!", 'error'); + foreach ($output as $line) { + print "$line\n"; + } + echo PHP_EOL; + die; + } else { + foreach ($output as $line) { + print "$line\n"; + } + out("$project completed", 'success'); + echo PHP_EOL; + } + } echo PHP_EOL; @@ -70,8 +91,9 @@ function out($text, $color = null, $newLine = true) { $styles = array( 'success' => "\033[0;35;32m%s\033[0m", - 'error' => "\033[0;35;31m%s\033[0m", - 'info' => "\033[1;33;34m%s\033[0m" + 'error' => "\033[0;35;31m%s\033[0m", + 'purple' => "\033[0;35;35m%s\033[0m", + 'info' => "\033[1;33;34m%s\033[0m" ); $format = '%s'; @@ -85,4 +107,4 @@ function out($text, $color = null, $newLine = true) } printf($format, $text); -} \ No newline at end of file +} diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index f015a67eb..e97d84e43 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -69,12 +69,14 @@ - + + + From b11d8afbe39d33bcd9f2cf241b00ad053c48e50e Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Tue, 25 Feb 2014 13:04:36 -0400 Subject: [PATCH 5/5] Fix incorrect object declaration, PHP 5.4.x compatibility --- workflow/engine/methods/dynaforms/fields_Ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/methods/dynaforms/fields_Ajax.php b/workflow/engine/methods/dynaforms/fields_Ajax.php index 3f268f8d1..10ea47d8c 100755 --- a/workflow/engine/methods/dynaforms/fields_Ajax.php +++ b/workflow/engine/methods/dynaforms/fields_Ajax.php @@ -88,7 +88,7 @@ $r = 0; foreach ($dependentFields as $d) { $sendContent[$r] = new stdclass(); $sendContent[$r]->name = $d; - $sendContent[$r]->content = null; + $sendContent[$r]->content = new stdclass(); foreach ($G_FORM->fields[$d] as $attribute => $value) { switch ($attribute) { case 'type': @@ -108,7 +108,7 @@ function toJSArray ($array) { $result = array (); foreach ($array as $k => $v) { - $o = null; + $o = new stdclass(); $o->key = $k; $o->value = $v; $result[] = $o;