Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Daniel Rojas
2014-06-23 13:05:32 -04:00
8 changed files with 41 additions and 30 deletions

View File

@@ -7,8 +7,8 @@ Feature: Group
Background:
Given that I have a valid access_token
Scenario Outline: Get the Trigger Wizard List when there are exactly 6 library
Scenario Outline: Get the Trigger Wizard List when there are exactly 6 library
And I request "project/14414793652a5d718b65590036026581/trigger-wizards"
And the content type is "application/json"
Then the response status code should be 200
@@ -22,13 +22,13 @@ Feature: Group
Examples:
| i | lib_name | lib_title | lib_class_name |
| 0 | pmFunctions | ProcessMaker Functions | class.pmFunctions.php |
| 1 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php |
| 2 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
| 3 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
| 4 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php |
| 5 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php |
| 1 | pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
| 2 | pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
| 3 | pmTrAlfresco | Alfresco DM Triggers v. 0.1 | class.pmTrAlfresco.pmFunctions.php |
| 4 | pmTrSharepoint | Sharepoint DWS Triggers v. 0.1 | class.pmTrSharepoint.pmFunctions.php |
| 5 | pmZimbra | Zimbra Triggers v. 0.1 | class.pmZimbra.pmFunctions.php |
Scenario Outline: Get a single Library
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>"
And the content type is "application/json"
@@ -48,7 +48,7 @@ Feature: Group
| pmTalend | Talend ETL Integration | class.pmTalend.pmFunctions.php |
| pmSugar | Sugar CRM Triggers | class.pmSugar.pmFunctions.php |
Scenario Outline: Get a single Function of the Library
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
And the content type is "application/json"
@@ -119,14 +119,14 @@ Scenario Outline: Create new Trigger: createDWS
"tri_type": "<tri_type>",
"tri_params": {
"input": {
"sharepointServer": "<tri_params.input.sharepointServer>",
"auth": "<tri_params.input.auth>",
"name": "<tri_params.input.name>",
"users": "<tri_params.input.users>",
"title": "<tri_params.input.title>",
"documents": "<tri_params.input.documents>"
},
"output": {
"tri_answer": "<tri_params.output.tri_answer>"
@@ -189,14 +189,14 @@ Scenario Outline: Create new Trigger: createDWS
"tri_type": "<tri_type>",
"tri_params": {
"input": {
"sharepointServer": "<tri_params.input.sharepointServer>",
"auth": "<tri_params.input.auth>",
"name": "<tri_params.input.name>",
"users": "<tri_params.input.users>",
"title": "<tri_params.input.title>",
"documents": "<tri_params.input.documents>"
},
"output": {
"tri_answer": "<tri_params.output.tri_answer>"
@@ -210,12 +210,12 @@ Scenario Outline: Create new Trigger: createDWS
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
Examples:
| i | lib_name | fn_name | tri_title | tri_description | tri_type | tri_params.input.sharepointServer | tri_params.input.auth | tri_params.input.name | tri_params.input.users | tri_params.input.title | tri_params.input.documents | tri_params.output.tri_answer |
| 1 | pmTrSharepoint | createDWS | Sharepoint 1 - Modified | | SCRIPT | @@SERVER_URL | username:password | Test DWS | @@users | Test DWS | /files/test.doc | $respuesta |
Scenario Outline: Get a Trigger that was created with the wizard
Given that I want to get a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
And I request "project/14414793652a5d718b65590036026581/trigger-wizard/<lib_name>/<fn_name>"
@@ -228,12 +228,12 @@ Scenario Outline: Create new Trigger: createDWS
And that "tri_type" is set to "<tri_type>"
Examples:
| i | lib_name | fn_name | tri_title | tri_description | tri_type |
| 0 | pmFunctions | PMFAddAttachmentToArray | My trigger... | ... | SCRIPT |
| 1 | pmTrSharepoint | createDWS | Test DWS | | SCRIPT |
Scenario Outline: Delete a trigger of a project
Given that I want to delete a resource with the key "tri_uid" stored in session array as variable "tri_uid<i>"
And I request "project/14414793652a5d718b65590036026581/trigger"
@@ -248,7 +248,7 @@ Scenario Outline: Create new Trigger: createDWS
| 1 |
| 2 |
Scenario: Get a List of triggers of a project
And I request "project/14414793652a5d718b65590036026581/triggers"
And the content type is "application/json"

View File

@@ -1057,9 +1057,13 @@ class Bootstrap
if ($skinName == "classic") {
$configurationFile = Bootstrap::ExpandPath("skinEngine") . 'base' . PATH_SEP . 'config.xml';
} else {
$configurationFile = PATH_CUSTOM_SKINS . $skinName . PATH_SEP . 'config.xml';
$configurationFile = "";
if (!is_file($configurationFile)) {
if (defined("PATH_CUSTOM_SKINS")) {
$configurationFile = PATH_CUSTOM_SKINS . $skinName . PATH_SEP . 'config.xml';
}
if (! is_file($configurationFile)) {
$configurationFile = Bootstrap::ExpandPath("skinEngine") . $skinName . PATH_SEP . 'config.xml';
}
}

View File

@@ -569,17 +569,20 @@ class Process extends BaseProcess
public static function existsByProTitle ($PRO_TITLE)
{
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( 'COUNT(*) AS PROCESS' );
$oCriteria = new Criteria("workflow");
$oCriteria->addSelectColumn("COUNT(" . ContentPeer::CON_ID . ") AS NUM_REC");
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
$oCriteria->add( ContentPeer::CON_VALUE, $PRO_TITLE );
$oDataset = ContentPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
return $aRow['PROCESS'] ? true : false;
return ((int)($aRow["NUM_REC"]) > 0)? true : false;
}
public function getAllProcessesCount ()
@@ -760,7 +763,7 @@ class Process extends BaseProcess
$aProcesses[] = $process;
}
$memcache = & PMmemcached::getSingleton( SYS_SYS );
if (isset($memcache) && $memcache->enabled == 1 ) {
return $aProcesses;
@@ -893,7 +896,7 @@ class Process extends BaseProcess
$r = $memcache->delete( $memkeyTotal );
}
}
public function orderMemcache($dataMemcache, $start, $limit)
{
if ($this->dir=='ASC') {
@@ -911,7 +914,7 @@ class Process extends BaseProcess
public function ordProcessAsc ($a, $b)
{
if (($this->sort) == '') {
$this->sort = 'PRO_TITLE';
$this->sort = 'PRO_TITLE';
}
if (strtolower($a[$this->sort]) > strtolower($b[$this->sort])) {
return 1;

View File

@@ -10,7 +10,7 @@ class InputDocument
"INP_DOC_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "inputDocumentDescription"),
"INP_DOC_FORM_NEEDED" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("VIRTUAL", "REAL", "VREAL"), "fieldNameAux" => "inputDocumentFormNeeded"),
"INP_DOC_ORIGINAL" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("ORIGINAL", "COPY", "COPYLEGAL"), "fieldNameAux" => "inputDocumentOriginal"),
"INP_DOC_PUBLISHED" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("PRIVATE"), "fieldNameAux" => "inputDocumentPublished"),
"INP_DOC_PUBLISHED" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("PRIVATE", "PUBLIC"), "fieldNameAux" => "inputDocumentPublished"),
"INP_DOC_VERSIONING" => array("type" => "int", "required" => false, "empty" => false, "defaultValues" => array(0, 1), "fieldNameAux" => "inputDocumentVersioning"),
"INP_DOC_DESTINATION_PATH" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "inputDocumentDestinationPath"),
"INP_DOC_TAGS" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "inputDocumentTags")

View File

@@ -1603,6 +1603,8 @@ class Process
$triggerLibrary = \triggerLibrary::getSingleton();
$library = $triggerLibrary->getRegisteredClasses();
ksort($library);
foreach ($library as $key => $value) {
$libraryName = (preg_match("/^class\.?(.*)\.pmFunctions\.php$/", $key, $arrayMatch))? ((isset($arrayMatch[1]) && $arrayMatch[1] != "")? $arrayMatch[1] : "pmFunctions") : $key;

View File

@@ -105,6 +105,8 @@ class Bpmn extends Handler
// setting defaults
$data['PRJ_UID'] = array_key_exists('PRJ_UID', $data) ? $data['PRJ_UID'] : Common::generateUID();
unset($data["PRJ_UPDATE_DATE"]);
self::log("Create Project with data: ", $data);
$this->project = new Project();
$this->project->fromArray($data, BasePeer::TYPE_FIELDNAME);

View File

@@ -44,7 +44,7 @@ class Workflow extends Handler
$process = new Process();
$processData = $process->load($proUid);
} catch (\Exception $e) {
throw new Exception\ProjectNotFound($me, $proUid);
throw $e;
}
$me->process = $processData;

View File

@@ -199,7 +199,7 @@ class Server implements iAuthenticate
$request = \OAuth2\Request::createFromGlobals();
$allowed = $this->server->verifyResourceRequest($request);
$token = $this->server->getAccessTokenData($request);
self::$userId = $token['user_id'];
// Session handling to prevent session lose in other places like, home, admin, etc
// when user is using the new designer that have not session because it is using only the API