Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -260,5 +260,4 @@ Scenario Outline: Delete of the cases created in this script.
|
||||
| 7 |
|
||||
| 8 |
|
||||
| 9 |
|
||||
| 10 |
|
||||
|
||||
| 10 |
|
||||
@@ -14,7 +14,7 @@ Scenario: List of case notes for this case
|
||||
And the type is "array"
|
||||
|
||||
|
||||
Scenario Outline: Create a new case note for specified case
|
||||
Scenario: Create a new case note for specified case
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,11 +13,34 @@ Scenario: Returns a list of the uploaded documents for a given case
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the response has 5 records
|
||||
|
||||
Scenario Outline: Post metadata and then upload documents for a given case
|
||||
Given POST upload an input document "<document_file>" to "cases/<case_uid>/input-document"
|
||||
"""
|
||||
{
|
||||
|
||||
"inp_doc_uid": "<inp_doc_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"app_doc_comment": "<app_doc_comment>"
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And store "app_doc_uid" in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
|
||||
Examples:
|
||||
| app_doc_uid_number | document_file | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
|
||||
| 1 | /home/wendy/uploadfiles/test1.html | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| 2 | /home/wendy/uploadfiles/random.jpg | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| 3 | /home/wendy/uploadfiles/test.pm | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| 4 | /home/wendy/uploadfiles/test.txt | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
|
||||
Scenario Outline: Returns an uploaded documents for a given case
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-document/<input-document>"
|
||||
Given I request "cases/<case_uid>/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
@@ -31,39 +54,16 @@ Scenario Outline: Returns an uploaded documents for a given case
|
||||
And the "app_doc_index" property equals "<app_doc_index>"
|
||||
And the "app_doc_link" property equals "<app_doc_link>"
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | input-document | app_doc_uid | app_doc_filename | doc_uid | app_doc_version | app_doc_create_date | app_doc_create_user | app_doc_type | app_doc_index | app_doc_link |
|
||||
| Get Input "Desert.jpg" | 6075490825331a1c5eebff9015468244 | 6075490825331a1c5eebff9015468244 | Desert.jpg | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:33:25 | , Administrator (admin) | INPUT | 1 | cases/cases_ShowDocument?a=6075490825331a1c5eebff9015468244&v=1 |
|
||||
| Get Input "Screenshot Case Archive.docx" | 3770386635331a1f49c78e8070071944 | 3770386635331a1f49c78e8070071944 | Screenshot Case Archive.docx | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:34:12 | , Administrator (admin) | INPUT | 2 | cases/cases_ShowDocument?a=3770386635331a1f49c78e8070071944&v=1 |
|
||||
| Get Input "alert_message.html" | 6382509235331a235b27a82003894796 | 6382509235331a235b27a82003894796 | alert_message.htm | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:17 | , Administrator (admin) | INPUT | 4 | cases/cases_ShowDocument?a=6382509235331a235b27a82003894796&v=1 |
|
||||
| Get Input "actionsByEmail-2.5.0.28.tar" | 3548449385331a24a34d273018695729 | 3548449385331a24a34d273018695729 | actionsByEmail-2.5.0.28.tar | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:38 | , Administrator (admin) | INPUT | 5 | cases/cases_ShowDocument?a=3548449385331a24a34d273018695729&v=1 |
|
||||
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |
|
||||
|
||||
|
||||
Scenario Outline: Post metadata and then upload documents for a given case
|
||||
Given POST upload an input document "<document_file>" to "cases/<case_uid>/input-document"
|
||||
"""
|
||||
{
|
||||
|
||||
"inp_doc_uid": "<inp_doc_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"app_doc_comment": "<app_doc_comment>"
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And store "app_doc_uid" in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
|
||||
Examples:
|
||||
| app_doc_uid_number | document_file | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
|
||||
| 1 | /home/wendy/uploadfiles/test1.html | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| test_description | app_doc_uid_number | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
|
||||
| Get Input "Desert.jpg" | 1 | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| Get Input "Screenshot Case Archive.docx" | 2 | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| Get Input "alert_message.html" | 3 | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
| Get Input "actionsByEmail-2.5.0.28.tar" | 4 | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Delete an uploaded or generated document from a case.
|
||||
Given that I want to delete a resource with the key "app_doc_uid_<app_doc_uid_number>" stored in session array
|
||||
And I request "cases/64654381053382b8bb4c415067063003/input-document/"
|
||||
@@ -74,4 +74,7 @@ Scenario Outline: Delete an uploaded or generated document from a case.
|
||||
|
||||
Examples:
|
||||
| app_doc_uid_number |
|
||||
| 1 |
|
||||
| 1 |
|
||||
| 2 |
|
||||
| 3 |
|
||||
| 4 |
|
||||
@@ -0,0 +1,19 @@
|
||||
Scenario Outline: Pull information of an inexistent input document. should return an error
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-document/<input-document>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And the "app_doc_uid" property equals "<app_doc_uid>"
|
||||
And the "app_doc_filename" property equals "<app_doc_filename>"
|
||||
And the "doc_uid" property equals "<doc_uid>"
|
||||
And the "app_doc_version" property equals "<app_doc_version>"
|
||||
And the "app_doc_create_date" property equals "<app_doc_create_date>"
|
||||
And the "app_doc_create_user" property equals "<app_doc_create_user>"
|
||||
And the "app_doc_type" property equals "<app_doc_type>"
|
||||
And the "app_doc_index" property equals "<app_doc_index>"
|
||||
And the "app_doc_link" property equals "<app_doc_link>"
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | input-document | app_doc_uid | app_doc_filename | doc_uid | app_doc_version | app_doc_create_date | app_doc_create_user | app_doc_type | app_doc_index | app_doc_link |
|
||||
| Get Input "Desert.jpg" | 6075490825331a1c5eebff9015468244 | 6075490825331a1c5eebff9015468244 | Desert.jpg | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:33:25 | , Administrator (admin) | INPUT | 1 | cases/cases_ShowDocument?a=6075490825331a1c5eebff9015468244&v=1 |
|
||||
@@ -1118,10 +1118,20 @@ class RestContext extends BehatContext
|
||||
/**
|
||||
* @Then /^the response has (\d+) records$/
|
||||
* @Then /^the response has (\d+) record$/
|
||||
* @Then /^the response has (\d+) records in property "([^"]*)"$/
|
||||
* @Then /^the response has (\d+) record in property "([^"]*)"$/
|
||||
*/
|
||||
public function theResponseHasRecords($quantityOfRecords)
|
||||
public function theResponseHasRecords($quantityOfRecords, $responseProperty="")
|
||||
{
|
||||
$data = $this->_data;
|
||||
if($responseProperty!=""){
|
||||
if(!isset($this->_data->$responseProperty)){
|
||||
throw new Exception("the Response data doesn't have a property named: $responseProperty\n\n" );
|
||||
}
|
||||
$data = $this->_data->$responseProperty;
|
||||
}else{
|
||||
$data = $this->_data;
|
||||
}
|
||||
|
||||
if (!is_array($data)) {
|
||||
if ($quantityOfRecords == 0) {
|
||||
//if we expect 0 records and the response in fact is not an array, just return as a valid test
|
||||
|
||||
65
workflow/engine/bin/tasks/cliMafe.php
Normal file
65
workflow/engine/bin/tasks/cliMafe.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* cliMafe.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* @package workflow-engine-bin-tasks
|
||||
*/
|
||||
G::LoadClass("system");
|
||||
G::LoadClass("wsTools");
|
||||
|
||||
|
||||
CLI::taskName('mafe-translation');
|
||||
CLI::taskDescription(<<<EOT
|
||||
Creates labels of mafe for the database
|
||||
|
||||
EOT
|
||||
);
|
||||
|
||||
CLI::taskArg('workspace', true, true);
|
||||
CLI::taskOpt("lang", "languaje", "l:","lang=");
|
||||
CLI::taskRun('run_create_translation');
|
||||
|
||||
function run_create_translation($args, $opts)
|
||||
{
|
||||
$rootDir = realpath(__DIR__."/../../../../");
|
||||
$app = new Maveriks\WebApplication();
|
||||
$app->setRootDir($rootDir);
|
||||
$loadConstants = false;
|
||||
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
|
||||
|
||||
$translation = new Translation();
|
||||
CLI::logging("Updating labels Mafe ...\n");
|
||||
foreach ($workspaces as $workspace) {
|
||||
try {
|
||||
echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n";
|
||||
$app->loadEnvironment($workspace->name, $loadConstants);
|
||||
$translation->generateTransaltionMafe($lang);
|
||||
} catch (Exception $e) {
|
||||
echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
CLI::logging("Create successful\n");
|
||||
|
||||
}
|
||||
@@ -573,5 +573,18 @@ class Translation extends BaseTranslation
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function generateTransaltionMafe ($lang='en')
|
||||
{
|
||||
if (!file_exists(PATH_TRUNK .'vendor/colosa/MichelangeloFE/' . 'labels.php')) {
|
||||
throw new Exception( 'labels.php not exist in MAFE ');
|
||||
}
|
||||
|
||||
include PATH_TRUNK .'vendor/colosa/MichelangeloFE/' . 'labels.php';
|
||||
|
||||
foreach ($labels as $key => $row) {
|
||||
$this->addTranslation ('LABEL', 'ID_MAFE_'.MD5($row), $lang, $row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,10 +112,10 @@
|
||||
<a href="#" class="mafe-menu-databaseconnections"></a>
|
||||
<a href="#" class="btn_create mafe-menu-databaseconnections-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<!--<li>
|
||||
<a href="#" class="mefe-menu-casescheduler"></a>
|
||||
<a href="#" class="btn_create mafe-menu-casescheduler-create"><span></span></a>
|
||||
</li>
|
||||
</li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -12,8 +12,12 @@ $a = array('form'=>'@'.$file, 'inp_doc_uid'=>$inp_doc_uid, 'tas_uid' =>$tas_uid,
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $a);
|
||||
print "<h3>post</h3>";
|
||||
print_r($a);
|
||||
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);
|
||||
print_r($postResult);
|
||||
print "<h3>response var_dump</h3>";
|
||||
var_dump($postResult);
|
||||
print "<textarea cols='50' rows='10'>".$postResult."</textarea>";
|
||||
Reference in New Issue
Block a user