diff --git a/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature b/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature index 28e58a537..7028ec2e6 100644 --- a/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature +++ b/features/backend/projects/trigger_wizard/main_tests_trigger_wizards.feature @@ -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/" 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//" And the content type is "application/json" @@ -119,14 +119,14 @@ Scenario Outline: Create new Trigger: createDWS "tri_type": "", "tri_params": { "input": { - + "sharepointServer": "", "auth": "", "name": "", "users": "", "title": "", "documents": "" - + }, "output": { "tri_answer": "" @@ -189,14 +189,14 @@ Scenario Outline: Create new Trigger: createDWS "tri_type": "", "tri_params": { "input": { - + "sharepointServer": "", "auth": "", "name": "", "users": "", "title": "", "documents": "" - + }, "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" And I request "project/14414793652a5d718b65590036026581/trigger-wizard//" @@ -228,12 +228,12 @@ Scenario Outline: Create new Trigger: createDWS And that "tri_type" is set to "" 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" 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" diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 1add547a5..36ec128d5 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -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'; } } diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index 18e060ba3..2bd1fe45c 100755 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -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; diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php index 2add33162..9c4c92d0d 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php @@ -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") diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Process.php b/workflow/engine/src/ProcessMaker/BusinessModel/Process.php index 53ff54710..7d8fb1d39 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Process.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Process.php @@ -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; diff --git a/workflow/engine/src/ProcessMaker/Project/Bpmn.php b/workflow/engine/src/ProcessMaker/Project/Bpmn.php index bdd42e96a..7741912d4 100644 --- a/workflow/engine/src/ProcessMaker/Project/Bpmn.php +++ b/workflow/engine/src/ProcessMaker/Project/Bpmn.php @@ -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); diff --git a/workflow/engine/src/ProcessMaker/Project/Workflow.php b/workflow/engine/src/ProcessMaker/Project/Workflow.php index fa3727e55..09ac3ad99 100644 --- a/workflow/engine/src/ProcessMaker/Project/Workflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Workflow.php @@ -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; diff --git a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php index 35dd69c51..d555944dd 100644 --- a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php +++ b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php @@ -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