Merge remote branch 'upstream/master'

This commit is contained in:
Marco Antonio Nina
2014-04-03 08:47:31 -04:00
90 changed files with 1341 additions and 691 deletions

View File

@@ -1,33 +1,68 @@
@ProcessMakerMichelangelo @RestAPI @ProcessMakerMichelangelo @RestAPI
Feature: Cases Actions - the features in this script are (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase and routeCase) Feature: Cases Actions - the features in this script are (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase, routeCase, cancelCase, pauseCase, unpauseCase, executeTrigger, DELETE Case)
Requirements: Requirements:
a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point" a workspace with 57 cases distributed in the processes "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection", "Derivation rules - sequential"
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
Scenario: Returns information about a given case of the list Inbox #Listado de casos
Given I request "cases/48177942153275bfa28bd04070312685" Scenario: Returns a list of the cases for the logged in user (Inbox)
Given I request "cases"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the "app_uid" property equals "48177942153275bfa28bd04070312685" And the response has 14 records
And the "app_number" property equals 16
And the "app_name" property equals "#16"
And the "app_status" property equals "TO_DO"
And the "app_init_usr_uid" property equals "00000000000000000000000000000001"
And the "app_init_usr_username" property equals "Administrator"
And the "pro_uid" property equals "99209594750ec27ea338927000421575"
And the "pro_name" property equals "Derivation rules - sequential"
And the "app_create_date" property equals "2014-03-17 16:32:58"
And the "app_update_date" property equals "2014-03-17 16:33:01"
Scenario: Returns the current task for a given case of the list Inbox
Given I request "cases/48177942153275bfa28bd04070312685/current-task" Scenario: Returns a list of the cases for the logged in user (Draft)
Given I request "cases/draft"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 15 records
Scenario: Returns a list of the cases for the logged in user (Participated)
Given I request "cases/participated"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 30 records
Scenario: Returns a list of the cases for the logged in user (Unassigned)
Given I request "cases/unassigned"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records
Scenario: Returns a list of the cases for the logged in user (Paused)
Given I request "cases/paused"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records
Scenario: Returns information about a given case of the list Inbox of process "Derivation rules - Parallel"
Given I request "cases/220090038533b0c40688174019225585"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "app_uid" property equals "220090038533b0c40688174019225585"
And the "app_number" property equals 137
And the "app_name" property equals "#137"
And the "app_status" property equals "TO_DO"
Scenario: Returns the current task for a given case of the list Inbox, case 167 of process "derivation rules - sequencial"
Given I request "cases/356811158533b13641ef789000630231/current-task"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "object"
And the "tas_uid" property equals "73641967750ec281cf015d9009265327" And the "tas_uid" property equals "73641967750ec281cf015d9009265327"
And the "tas_title" property equals "Cyclical" And the "tas_title" property equals "Cyclical"
And the "del_index" property equals "2" And the "del_index" property equals "2"
@@ -37,8 +72,8 @@ Scenario Outline: Create a new case in workspace with process "Derivation rules
Given POST this data: Given POST this data:
""" """
{ {
"pro_uid": "99209594750ec27ea338927000421575", "pro_uid": "<pro_uid>",
"tas_uid": "68707275350ec281ada1c95068712556", "tas_uid": "<tas_uid>",
"variables": [{"name": "admin", "lastname":"admin"}] "variables": [{"name": "admin", "lastname":"admin"}]
} }
""" """
@@ -51,8 +86,9 @@ Scenario Outline: Create a new case in workspace with process "Derivation rules
And store "caseNumber" in session array as variable "caseNumber_<case_number>" And store "caseNumber" in session array as variable "caseNumber_<case_number>"
Examples: Examples:
| case_number | | Description | case_number | pro_uid | tas_uid |
| 1 | | Create case 16 in draft | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 |
| Create case 17 in draft | 2 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 |
Scenario Outline: Create a new case Impersonate in workspace with process "Derivation rules - sequential" Scenario Outline: Create a new case Impersonate in workspace with process "Derivation rules - sequential"
@@ -60,7 +96,7 @@ Scenario Outline: Create a new case Impersonate in workspace with process "Deriv
""" """
{ {
"pro_uid": "99209594750ec27ea338927000421575", "pro_uid": "99209594750ec27ea338927000421575",
"usr_uid": "24166330352d56730cdd525035621101", "usr_uid": "<usr_uid>",
"tas_uid": "68707275350ec281ada1c95068712556", "tas_uid": "68707275350ec281ada1c95068712556",
"variables": [{"name": "pruebaQA", "amount":"10400"}] "variables": [{"name": "pruebaQA", "amount":"10400"}]
} }
@@ -74,8 +110,9 @@ Scenario Outline: Create a new case Impersonate in workspace with process "Deriv
And store "caseNumber" in session array as variable "caseNumber_<case_number>" And store "caseNumber" in session array as variable "caseNumber_<case_number>"
Examples: Examples:
| case_number | | Description | case_number | usr_uid |
| 1 | | Create new case 18 with user chris | 3 | 24166330352d56730cdd525035621101 |
| Create new case 18 with user adam | 4 | 44811996752d567110634a1013636964 |
Scenario: Returns a list of the cases for the logged in user (Draft) Scenario: Returns a list of the cases for the logged in user (Draft)
@@ -83,36 +120,204 @@ Scenario: Returns a list of the cases for the logged in user (Draft)
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "array" And the type is "array"
And the response has 2 records And the response has 18 records
Scenario: Reassigns a case to a different user Scenario Outline: Reassigns a case to a different user, from user "administrator" to user "aaron"
Given PUT this data: Given PUT this data:
""" """
{ {
"usr_uid_source": "62625000752d5672d6661e6072881167", "usr_uid_source": "00000000000000000000000000000001",
"usr_uid_target": "24166330352d56730cdd525035621101", "usr_uid_target": "51049032352d56710347233042615067",
} }
""" """
And that I want to update a resource with the key "case_number" stored in session array And I request "case/<case_number>/reassign-case"
And I request "case/{uid}/reassign-case"
Then the response status code should be 200 Then the response status code should be 200
And the content type is "application/json" And the content type is "application/json"
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Reassig case 1, created in this script | 1 |
Scenario: Autoderivate a case to the next task in the process Scenario: Route a case to the next task in the process
Given PUT this data: Given PUT this data:
""" """
{ {
"case_uid": "78ef3ca7905019270643749052af5bd7", "case_uid": "<case_number>",
"del_index": "1" "del_index": "1"
} }
""" """
And that I want to update a resource with the key "" stored in session array And I request "cases/<case_number>/route-case"
And I request "case/{uid}/route-case"
Then the response status code should be 200 Then the response status code should be 200
And the content type is "application/json" And the content type is "application/json"
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Derivate case 2 to inbox of Administrator, created in this script | 2 |
Scenario: Cancel a case
Given PUT this data:
"""
{
}
"""
And I request "cases/<app_uid>/cancel"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Cancel case 3, created in this script | 3 |
Scenario: Pause a case
Given PUT this data:
"""
{
"unpaused_date": "2016-12-12"
}
"""
And I request "cases/<app_uid>/pause"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Pause case 4, created in this script | 4 |
Scenario: Unpause a case
Given PUT this data:
"""
{
}
"""
And I request "cases/<app_uid>/unpause"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Unpause case 4, created in this script | 4 |
Scenario: Executes a ProcessMaker trigger for a case
Given PUT this data:
"""
{
}
"""
And I request "cases/<app_uid>/execute-trigger/{tri_uid}"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| | |
Scenario: Delete a case
Given PUT this data:
"""
{
}
"""
And I request "cases/<app_uid>"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| Delete a case 1, created in this script | 1 |
| Delete a case 2, created in this script | 2 |
| Delete a case 3, created in this script | 3 |
| Delete a case 4, created in this script | 4 |
#Listado de casos
Scenario: Returns a list of the cases for the logged in user (Inbox)
Given I request "cases"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 14 records
Scenario: Returns a list of the cases for the logged in user (Draft)
Given I request "cases/draft"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 15 records
Scenario: Returns a list of the cases for the logged in user (Participated)
Given I request "cases/participated"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 30 records
Scenario: Returns a list of the cases for the logged in user (Unassigned)
Given I request "cases/unassigned"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records
Scenario: Returns a list of the cases for the logged in user (Paused)
Given I request "cases/paused"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records

View File

@@ -6,6 +6,48 @@ Requirements:
Background: Background:
Given that I have a valid access_token Given that I have a valid access_token
#Listado de casos
Scenario: Returns a list of the cases for the logged in user (Inbox)
Given I request "cases"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 14 records
Scenario: Returns a list of the cases for the logged in user (Draft)
Given I request "cases/draft"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 15 records
Scenario: Returns a list of the cases for the logged in user (Participated)
Given I request "cases/participated"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 30 records
Scenario: Returns a list of the cases for the logged in user (Unassigned)
Given I request "cases/unassigned"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records
Scenario: Returns a list of the cases for the logged in user (Paused)
Given I request "cases/paused"
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 12 records
Scenario: Returns information about a given case of the list Inbox Scenario: Returns information about a given case of the list Inbox
Given I request "cases/48177942153275bfa28bd04070312685" Given I request "cases/48177942153275bfa28bd04070312685"
Then the response status code should be 200 Then the response status code should be 200

View File

@@ -59,21 +59,21 @@ Scenario: Returns a list of the cases for the logged in user (Advanced-Search)
#Scenarios para filtros y paginacion de las listas #Scenarios para filtros y paginacion en listas
Scenario Outline: Get paging of list inbox Scenario Outline: Get paging of list inbox
Given I request "cases/paged?Start=<start>&limit=<limit>" Given I request "cases/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 14 | 200 | | lowercase in Limit | 1 | a | 14 | 200 |
| uppercase in Limit | 1 | A | 14 | 200 | | uppercase in Limit | 1 | A | 14 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -104,7 +104,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -119,7 +119,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -134,7 +134,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -149,7 +149,7 @@ Scenario Outline: Get order type of Search of number the process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -167,18 +167,18 @@ Scenario: Returns a list of the cases for the logged in user (Draft)
Scenario Outline: Get paging of list Draft Scenario Outline: Get paging of list Draft
Given I request "cases/draft/paged?Start=<start>&limit=<limit>" Given I request "cases/draft/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 15 | 200 | | lowercase in Limit | 1 | a | 15 | 200 |
| uppercase in Limit | 1 | A | 15 | 200 | | uppercase in Limit | 1 | A | 15 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -209,7 +209,7 @@ Scenario Outline: Get order type of Descending and Ascending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -225,7 +225,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -240,7 +240,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -255,7 +255,7 @@ Scenario Outline: Get order type of Search of the process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -272,18 +272,18 @@ Scenario: Returns a list of the cases for the logged in user (Participated)
And the response has 30 records And the response has 30 records
Scenario Outline: Get paging of list Participated Scenario Outline: Get paging of list Participated
Given I request "cases/participated/paged?Start=<start>&limit=<limit>" Given I request "cases/participated/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 30 | 200 | | lowercase in Limit | 1 | a | 30 | 200 |
| uppercase in Limit | 1 | A | 30 | 200 | | uppercase in Limit | 1 | A | 30 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -314,7 +314,7 @@ Scenario Outline: Get order type of Descending an Descending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -330,7 +330,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -345,7 +345,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -361,7 +361,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -379,18 +379,18 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned)
Scenario Outline: Get paging of list Unassigned Scenario Outline: Get paging of list Unassigned
Given I request "cases/Unassigned/paged?Start=<start>&limit=<limit>" Given I request "cases/Unassigned/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 12 | 200 | | lowercase in Limit | 1 | a | 12 | 200 |
| uppercase in Limit | 1 | A | 12 | 200 | | uppercase in Limit | 1 | A | 12 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -421,7 +421,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -436,7 +436,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -451,7 +451,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -466,7 +466,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -485,18 +485,18 @@ Scenario: Returns a list of the cases for the logged in user (Paused)
Scenario Outline: Get paging of list Paused Scenario Outline: Get paging of list Paused
Given I request "cases/paused/paged?Start=<start>&limit=<limit>" Given I request "cases/paused/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 12 | 200 | | lowercase in Limit | 1 | a | 12 | 200 |
| uppercase in Limit | 1 | A | 12 | 200 | | uppercase in Limit | 1 | A | 12 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -527,7 +527,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -542,7 +542,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -557,7 +557,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -572,7 +572,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -590,18 +590,18 @@ Scenario: Returns a list of the cases for the logged in user (Advanced Search)
Scenario Outline: Get paging of list Advanced Search Scenario Outline: Get paging of list Advanced Search
Given I request "cases/advanced-search/paged?Start=<start>&limit=<limit>" Given I request "cases/advanced-search/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code> Then the response status code should be <http_code>
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
| test_description | start | limit | records | http_code | | test_description | start | limit | records | http_code |
| lowercase in Start | a | 1 | 1 | 200 | | lowercase in start | a | 1 | 1 | 200 |
| uppercase in Start | A | 1 | 1 | 200 | | uppercase in start | A | 1 | 1 | 200 |
| lowercase in Limit | 1 | a | 30 | 200 | | lowercase in Limit | 1 | a | 30 | 200 |
| uppercase in Limit | 1 | A | 30 | 200 | | uppercase in Limit | 1 | A | 30 | 200 |
| limit=3 | 1 | 3 | 3 | 200 | | limit=3 | 1 | 3 | 3 | 200 |
@@ -632,7 +632,7 @@ Scenario Outline: Get order type of Descending and Acending
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -647,7 +647,7 @@ Scenario Outline: Get order type of Process Category
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -663,7 +663,7 @@ Scenario Outline: Get order type of Process
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -679,7 +679,7 @@ Scenario Outline: Get order type of Search
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -694,7 +694,7 @@ Scenario Outline: Get order for Status
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -711,7 +711,7 @@ Scenario Outline: Get order for User
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:
@@ -728,7 +728,7 @@ Scenario Outline: Get order for date
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the content type is "application/json" And the content type is "application/json"
And the type is "array" And the type is "array"
And the response has <records> records in property "data" And the response has <records> records
Examples: Examples:

View File

@@ -9,38 +9,38 @@ Scenario: Returns a list of the cases for the logged in user (Inbox)
Given I request "cases" Given I request "cases"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"
Scenario: Returns a list of the cases for the logged in user (Draft) Scenario: Returns a list of the cases for the logged in user (Draft)
Given I request "cases/draft" Given I request "cases/draft"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"
Scenario: Returns a list of the cases for the logged in user (Participated) Scenario: Returns a list of the cases for the logged in user (Participated)
Given I request "cases/participated" Given I request "cases/participated"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"
Scenario: Returns a list of the cases for the logged in user (Unassigned) Scenario: Returns a list of the cases for the logged in user (Unassigned)
Given I request "cases/unassigned" Given I request "cases/unassigned"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"
Scenario: Returns a list of the cases for the logged in user (Paused) Scenario: Returns a list of the cases for the logged in user (Paused)
Given I request "cases/paused" Given I request "cases/paused"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"
Scenario: Returns a list of the cases for the logged in user (Advanced Search) Scenario: Returns a list of the cases for the logged in user (Advanced Search)
Given I request "cases/advanced-search" Given I request "cases/advanced-search"
Then the response status code should be 400 Then the response status code should be 400
And the response has 4 records And the response has 4 records
And the response status message should have the following text "<records>" And the response status message should have the following text "Records"

View File

@@ -2,11 +2,14 @@
namespace Maveriks; namespace Maveriks;
use Maveriks\Util; use Maveriks\Util;
use ProcessMaker\Services;
class WebApplication class WebApplication
{ {
protected $rootDir = ""; protected $rootDir = "";
protected $workflowDir = ""; protected $workflowDir = "";
protected $workspaceDir = "";
protected $workspaceCacheDir = "";
protected $requestUri = ""; protected $requestUri = "";
protected $responseMultipart = array(); protected $responseMultipart = array();
@@ -79,12 +82,12 @@ class WebApplication
$this->loadEnvironment($request["workspace"]); $this->loadEnvironment($request["workspace"]);
Util\Logger::log("API::Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]); Util\Logger::log("API::Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]);
if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtoupper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTYPART') { if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtoupper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTIPART') {
$this->multipart($request["uri"], $request["version"]); $this->multipart($request["uri"], $request["version"]);
} else { } else {
$this->dispatchApiRequest($request["uri"], $request["version"]); $this->dispatchApiRequest($request["uri"], $request["version"]);
} }
Util\Logger::log("API::End Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]); Util\Logger::log("API::End Dispatch");
break; break;
} }
} }
@@ -141,29 +144,43 @@ class WebApplication
*/ */
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
require_once $this->rootDir . "framework/src/Maveriks/Extension/Restler/UploadFormat.php";
// $servicesDir contains directory where Services Classes are allocated // $servicesDir contains directory where Services Classes are allocated
$servicesDir = $this->workflowDir . 'engine' . DS . 'src' . DS . 'Services' . DS; $servicesDir = $this->workflowDir . 'engine' . DS . 'src' . DS . 'ProcessMaker' . DS . 'Services' . DS;
// $apiDir - contains directory to scan classes and add them to Restler // $apiDir - contains directory to scan classes and add them to Restler
$apiDir = $servicesDir . 'Api' . DS; $apiDir = $servicesDir . 'Api' . DS;
// $apiIniFile - contains file name of api ini configuration // $apiIniFile - contains file name of api ini configuration
$apiIniFile = $servicesDir . DS . 'api.ini'; $apiIniFile = $servicesDir . DS . 'api.ini';
// $authenticationClass - contains the class name that validate the authentication for Restler // $authenticationClass - contains the class name that validate the authentication for Restler
$authenticationClass = 'Services\\Api\\OAuth2\\Server'; $authenticationClass = 'ProcessMaker\\Services\\OAuth2\\Server';
// $pmOauthClientId - contains PM Local OAuth Id (Web Designer) // $pmOauthClientId - contains PM Local OAuth Id (Web Designer)
$pmOauthClientId = 'x-pm-local-client'; $pmOauthClientId = 'x-pm-local-client';
/* /*
* Load Api ini file for Rest Service * Load Api ini file for Rest Service
*/ */
$apiIniConf = array(); $config = array();
if (file_exists($apiIniFile)) { if (file_exists($apiIniFile)) {
$apiIniConf = Util\Common::parseIniFile($apiIniFile); $cachedConfig = $this->workspaceCacheDir . "api-config.php";
// verify if config cache file exists, is array and the last modification date is the same when cache was created.
if (! file_exists($cachedConfig) || ! is_array($config = include($cachedConfig)) || $config["_chk"] != filemtime($apiIniFile)) {
$config = Util\Common::parseIniFile($apiIniFile);
$config["_chk"] = filemtime($apiIniFile);
if (! is_dir(dirname($cachedConfig))) {
Util\Common::mk_dir(dirname($cachedConfig));
}
file_put_contents($cachedConfig, "<?php return " . var_export($config, true).";");
Util\Logger::log("Configuration cache was loaded and cached to: $cachedConfig");
} else {
Util\Logger::log("Loading Api Configuration from: $cachedConfig");
}
} }
// Setting current workspace to Api class // Setting current workspace to Api class
\ProcessMaker\Services\Api::setWorkspace(SYS_SYS); Services\Api::setWorkspace(SYS_SYS);
// TODO remove this setting on the future, it is not needed, but if it is not present is throwing a warning
//\Luracast\Restler\Format\HtmlFormat::$viewPath = $servicesDir . 'oauth2/views';
// create a new Restler instance // create a new Restler instance
//$rest = new \Luracast\Restler\Restler(); //$rest = new \Luracast\Restler\Restler();
@@ -179,20 +196,13 @@ class WebApplication
// Setting database connection source // Setting database connection source
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, ''); list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port"; $port = empty($port) ? '' : ";port=$port";
\Services\Api\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port); Services\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
// Setting default OAuth Client id, for local PM Web Designer // Setting default OAuth Client id, for local PM Web Designer
\Services\Api\OAuth2\Server::setPmClientId($pmOauthClientId); Services\OAuth2\Server::setPmClientId($pmOauthClientId);
require_once $this->workflowDir . "engine/src/Extension/Restler/UploadFormat.php";
//require_once PATH_CORE
//$rest->setSupportedFormats('JsonFormat', 'XmlFormat', 'UploadFormat');
//$rest->setOverridingFormats('UploadFormat', 'JsonFormat', 'XmlFormat', 'HtmlFormat');
$rest->setOverridingFormats('JsonFormat', 'UploadFormat'); $rest->setOverridingFormats('JsonFormat', 'UploadFormat');
// Override $_SERVER['REQUEST_URI'] to Restler handles the current url correctly
$isPluginRequest = strpos($uri, '/plugin-') !== false ? true : false; $isPluginRequest = strpos($uri, '/plugin-') !== false ? true : false;
if ($isPluginRequest) { if ($isPluginRequest) {
@@ -204,6 +214,7 @@ class WebApplication
$uri = str_replace('/plugin-'.$pluginName, '', $uri); $uri = str_replace('/plugin-'.$pluginName, '', $uri);
} }
// Override $_SERVER['REQUEST_URI'] to Restler handles the modified url
$_SERVER['REQUEST_URI'] = $uri; $_SERVER['REQUEST_URI'] = $uri;
if (! $isPluginRequest) { // if it is not a request for a plugin endpoint if (! $isPluginRequest) { // if it is not a request for a plugin endpoint
@@ -212,19 +223,18 @@ class WebApplication
foreach ($classesList as $classFile) { foreach ($classesList as $classFile) {
if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') { if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') {
$namespace = '\\Services\\' . str_replace( $namespace = '\\ProcessMaker\\Services\\' . str_replace(
DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,
'\\', '\\',
str_replace('.php', '', str_replace($servicesDir, '', $classFile)) str_replace('.php', '', str_replace($servicesDir, '', $classFile))
); );
//var_dump($namespace);
$rest->addAPIClass($namespace); $rest->addAPIClass($namespace);
} }
} }
// adding aliases for Restler // adding aliases for Restler
if (array_key_exists('alias', $apiIniConf)) { if (array_key_exists('alias', $config)) {
foreach ($apiIniConf['alias'] as $alias => $aliasData) { foreach ($config['alias'] as $alias => $aliasData) {
if (is_array($aliasData)) { if (is_array($aliasData)) {
foreach ($aliasData as $label => $namespace) { foreach ($aliasData as $label => $namespace) {
$namespace = '\\' . ltrim($namespace, '\\'); $namespace = '\\' . ltrim($namespace, '\\');
@@ -379,7 +389,10 @@ class WebApplication
require_once (PATH_DB . SYS_SYS . "/db.php"); require_once (PATH_DB . SYS_SYS . "/db.php");
// defining constant for workspace shared directory // defining constant for workspace shared directory
define("PATH_WORKSPACE", PATH_DB . SYS_SYS . PATH_SEP); $this->workspaceDir = PATH_DB . SYS_SYS . PATH_SEP;
$this->workspaceCacheDir = PATH_DB . SYS_SYS . PATH_SEP . "cache" . PATH_SEP;
define("PATH_WORKSPACE", $this->workspaceDir);
// including workspace shared classes -> particularlly for pmTables // including workspace shared classes -> particularlly for pmTables
set_include_path(get_include_path() . PATH_SEPARATOR . PATH_WORKSPACE); set_include_path(get_include_path() . PATH_SEPARATOR . PATH_WORKSPACE);

View File

@@ -78,16 +78,16 @@ class Designer extends Controller
protected function getClientCredentials() protected function getClientCredentials()
{ {
$oauthQuery = new Services\Api\OAuth2\PmPdo($this->getDsn()); $oauthQuery = new ProcessMaker\Services\OAuth2\PmPdo($this->getDsn());
return $oauthQuery->getClientDetails($this->clientId); return $oauthQuery->getClientDetails($this->clientId);
} }
protected function getAuthorizationCode($client) protected function getAuthorizationCode($client)
{ {
\Services\Api\OAuth2\Server::setDatabaseSource($this->getDsn()); \ProcessMaker\Services\OAuth2\Server::setDatabaseSource($this->getDsn());
\Services\Api\OAuth2\Server::setPmClientId($client['CLIENT_ID']); \ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']);
$oauthServer = new \Services\Api\OAuth2\Server(); $oauthServer = new \ProcessMaker\Services\OAuth2\Server();
$userId = $_SESSION['USER_LOGGED']; $userId = $_SESSION['USER_LOGGED'];
$authorize = true; $authorize = true;
$_GET = array_merge($_GET, array( $_GET = array_merge($_GET, array(

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class Calendar class Calendar
{ {
@@ -267,13 +267,13 @@ class Calendar
unset($arrayData["CAL_UID"]); unset($arrayData["CAL_UID"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
$this->throwExceptionIfExistsName($arrayData["CAL_NAME"], $this->arrayFieldNameForException["calendarName"]); $this->throwExceptionIfExistsName($arrayData["CAL_NAME"], $this->arrayFieldNameForException["calendarName"]);
if (!(count($arrayData["CAL_WORK_DAYS"]) >= 3)) { if (isset($arrayData["CAL_WORK_DAYS"]) && count($arrayData["CAL_WORK_DAYS"]) < 3) {
throw (new \Exception(\G::LoadTranslation("ID_MOST_AT_LEAST_3_DAY"))); throw (new \Exception(\G::LoadTranslation("ID_MOST_AT_LEAST_3_DAY")));
} }
@@ -294,6 +294,10 @@ class Calendar
if (isset($arrayData["CAL_WORK_HOUR"])) { if (isset($arrayData["CAL_WORK_HOUR"])) {
foreach ($arrayData["CAL_WORK_HOUR"] as $value) { foreach ($arrayData["CAL_WORK_HOUR"] as $value) {
if ($value["DAY"] != "ALL" && !in_array($value["DAY"], $arrayData["CAL_WORK_DAYS"])) {
throw (new \Exception(str_replace(array("{0}", "{1}"), array($this->arrayWorkHourFieldNameForException["day"], $this->arrayFieldNameForException["calendarWorkDays"]), "Value specified for \"{0}\" does not exists in \"{1}\"")));
}
$arrayCalendarWorkHour[] = array( $arrayCalendarWorkHour[] = array(
"CALENDAR_BUSINESS_DAY" => $this->workDaysReplaceData($value["DAY"]), "CALENDAR_BUSINESS_DAY" => $this->workDaysReplaceData($value["DAY"]),
"CALENDAR_BUSINESS_START" => $value["HOUR_START"], "CALENDAR_BUSINESS_START" => $value["HOUR_START"],
@@ -346,6 +350,136 @@ class Calendar
} }
} }
/**
* Update Calendar
*
* @param string $calendarUid Unique id of Calendar
* @param array $arrayData Data
*
* return array Return data of the Calendar updated
*/
public function update($calendarUid, $arrayData)
{
try {
$arrayData = \G::array_change_key_case2($arrayData, CASE_UPPER);
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$this->throwExceptionIfNotExistsCalendar($calendarUid, $this->arrayFieldNameForException["calendarUid"]);
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
if (isset($arrayData["CAL_NAME"])) {
$this->throwExceptionIfExistsName($arrayData["CAL_NAME"], $this->arrayFieldNameForException["calendarName"], $calendarUid);
}
if (isset($arrayData["CAL_WORK_DAYS"]) && count($arrayData["CAL_WORK_DAYS"]) < 3) {
throw (new \Exception(\G::LoadTranslation("ID_MOST_AT_LEAST_3_DAY")));
}
if (isset($arrayData["CAL_WORK_HOUR"])) {
foreach ($arrayData["CAL_WORK_HOUR"] as $value) {
$process->throwExceptionIfDataNotMetFieldDefinition($value, $this->arrayWorkHourFieldDefinition, $this->arrayWorkHourFieldNameForException, true);
}
}
if (isset($arrayData["CAL_HOLIDAY"])) {
foreach ($arrayData["CAL_HOLIDAY"] as $value) {
$process->throwExceptionIfDataNotMetFieldDefinition($value, $this->arrayHolidayFieldDefinition, $this->arrayHolidayFieldNameForException, true);
}
}
//Set variables
$arrayCalendarData = \G::array_change_key_case2($this->getCalendar($calendarUid), CASE_UPPER);
$calendarWorkDays = (isset($arrayData["CAL_WORK_DAYS"]))? $arrayData["CAL_WORK_DAYS"] : $arrayCalendarData["CAL_WORK_DAYS"];
$arrayCalendarWorkHour = array();
$arrayAux = (isset($arrayData["CAL_WORK_HOUR"]))? $arrayData["CAL_WORK_HOUR"] : $arrayCalendarData["CAL_WORK_HOUR"];
foreach ($arrayAux as $value) {
if (isset($arrayData["CAL_WORK_HOUR"]) && $value["DAY"] != "ALL" && !in_array($value["DAY"], $calendarWorkDays)) {
throw (new \Exception(str_replace(array("{0}", "{1}"), array($this->arrayWorkHourFieldNameForException["day"], $this->arrayFieldNameForException["calendarWorkDays"]), "Value specified for \"{0}\" does not exists in \"{1}\"")));
}
$arrayCalendarWorkHour[] = array(
"CALENDAR_BUSINESS_DAY" => $this->workDaysReplaceData($value["DAY"]),
"CALENDAR_BUSINESS_START" => $value["HOUR_START"],
"CALENDAR_BUSINESS_END" => $value["HOUR_END"]
);
}
$arrayCalendarHoliday = array();
$arrayAux = (isset($arrayData["CAL_HOLIDAY"]))? $arrayData["CAL_HOLIDAY"] : $arrayCalendarData["CAL_HOLIDAY"];
foreach ($arrayAux as $value) {
$arrayCalendarHoliday[] = array(
"CALENDAR_HOLIDAY_NAME" => $value["NAME"],
"CALENDAR_HOLIDAY_START" => $value["DATE_START"],
"CALENDAR_HOLIDAY_END" => $value["DATE_END"]
);
}
$arrayDataAux = array();
$arrayDataAux["CALENDAR_UID"] = $calendarUid;
$arrayDataAux["CALENDAR_NAME"] = (isset($arrayData["CAL_NAME"]))? $arrayData["CAL_NAME"] : $arrayCalendarData["CAL_NAME"];
$arrayDataAux["CALENDAR_DESCRIPTION"] = (isset($arrayData["CAL_DESCRIPTION"]))? $arrayData["CAL_DESCRIPTION"] : $arrayCalendarData["CAL_DESCRIPTION"];
$arrayDataAux["CALENDAR_WORK_DAYS"] = explode("|", $this->workDaysReplaceData(implode("|", $calendarWorkDays)));
$arrayDataAux["CALENDAR_STATUS"] = (isset($arrayData["CAL_STATUS"]))? $arrayData["CAL_STATUS"] : $arrayCalendarData["CAL_STATUS"];
$arrayDataAux["BUSINESS_DAY"] = $arrayCalendarWorkHour;
$arrayDataAux["HOLIDAY"] = $arrayCalendarHoliday;
//Update
$calendarDefinition = new \CalendarDefinition();
$calendarDefinition->saveCalendarInfo($arrayDataAux);
//Return
if (!$this->formatFieldNameInUppercase) {
$arrayData = \G::array_change_key_case2($arrayData, CASE_LOWER);
}
return $arrayData;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Delete Calendar
*
* @param string $calendarUid Unique id of Calendar
*
* return void
*/
public function delete($calendarUid)
{
try {
//Verify data
$calendarDefinition = new \CalendarDefinition();
$this->throwExceptionIfNotExistsCalendar($calendarUid, $this->arrayFieldNameForException["calendarUid"]);
$arrayAux = $calendarDefinition->getAllCounterByCalendar("USER");
$nU = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0;
$arrayAux = $calendarDefinition->getAllCounterByCalendar("TASK");
$nT = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0;
$arrayAux = $calendarDefinition->getAllCounterByCalendar("PROCESS");
$nP = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0;
if ($nU + $nT + $nP > 0) {
throw (new \Exception(\G::LoadTranslation("ID_MSG_CANNOT_DELETE_CALENDAR")));
}
//Delete
$calendarDefinition->deleteCalendar($calendarUid);
} catch (\Exception $e) {
throw $e;
}
}
/** /**
* Get criteria for Calendar * Get criteria for Calendar
* *
@@ -442,7 +576,7 @@ class Calendar
$arrayCalendar = array(); $arrayCalendar = array();
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
@@ -245,7 +245,7 @@ class CaseScheduler
public function addCaseScheduler($sProcessUID, $aData, $userUID) public function addCaseScheduler($sProcessUID, $aData, $userUID)
{ {
try { try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$aData['sch_repeat_stop_if_running'] = '0'; $aData['sch_repeat_stop_if_running'] = '0';
$aData['case_sh_plugin_uid'] = null; $aData['case_sh_plugin_uid'] = null;
$aData = array_change_key_case($aData, CASE_UPPER); $aData = array_change_key_case($aData, CASE_UPPER);
@@ -530,7 +530,7 @@ class CaseScheduler
public function updateCaseScheduler($sProcessUID, $aData, $userUID, $sSchUID = '') public function updateCaseScheduler($sProcessUID, $aData, $userUID, $sSchUID = '')
{ {
try { try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$aData = array_change_key_case($aData, CASE_UPPER); $aData = array_change_key_case($aData, CASE_UPPER);
if (empty( $aData )) { if (empty( $aData )) {
die( 'The information sended is empty!' ); die( 'The information sended is empty!' );
@@ -827,7 +827,7 @@ class CaseScheduler
public function deleteCaseScheduler($sSchUID) public function deleteCaseScheduler($sSchUID)
{ {
try { try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$oCaseScheduler = new \CaseScheduler(); $oCaseScheduler = new \CaseScheduler();
if (!isset($sSchUID)) { if (!isset($sSchUID)) {
return; return;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class CaseTracker class CaseTracker
{ {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class CaseTrackerObject class CaseTrackerObject
{ {
@@ -81,7 +81,7 @@ class CaseTrackerObject
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_UID_OBJ")), "The \"{0}\" attribute is not defined"))); throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_UID_OBJ")), "The \"{0}\" attribute is not defined")));
} }
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$msg = $step->existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]); $msg = $step->existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]);
@@ -156,7 +156,7 @@ class CaseTrackerObject
} }
if (isset($arrayData["CTO_TYPE_OBJ"]) && isset($arrayData["CTO_UID_OBJ"])) { if (isset($arrayData["CTO_TYPE_OBJ"]) && isset($arrayData["CTO_UID_OBJ"])) {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$msg = $step->existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]); $msg = $step->existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \UsersPeer; use \UsersPeer;
@@ -61,7 +61,7 @@ class Cases
if ($start != 0) { if ($start != 0) {
$start--; $start--;
} }
if ($limit == 'config' || (abs((int)$limit)) == 0) { if ((abs((int)$limit)) == 0) {
G::LoadClass("configuration"); G::LoadClass("configuration");
$conf = new \Configurations(); $conf = new \Configurations();
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', ''); $generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel\Cases; namespace ProcessMaker\BusinessModel\Cases;
class InputDocument class InputDocument
{ {
@@ -21,7 +21,7 @@ class InputDocument
$fields = $oCase->loadCase( $sApplicationUID ); $fields = $oCase->loadCase( $sApplicationUID );
$sProcessUID = $fields['PRO_UID']; $sProcessUID = $fields['PRO_UID'];
$sTaskUID = ''; $sTaskUID = '';
$oCaseRest = new \BusinessModel\Cases(); $oCaseRest = new \ProcessMaker\BusinessModel\Cases();
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID); $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID);
$result = array (); $result = array ();
global $_DBArray; global $_DBArray;
@@ -65,7 +65,7 @@ class InputDocument
$fields = $oCase->loadCase( $sApplicationUID ); $fields = $oCase->loadCase( $sApplicationUID );
$sProcessUID = $fields['PRO_UID']; $sProcessUID = $fields['PRO_UID'];
$sTaskUID = ''; $sTaskUID = '';
$oCaseRest = new \BusinessModel\Cases(); $oCaseRest = new \ProcessMaker\BusinessModel\Cases();
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID );
$result = array (); $result = array ();
global $_DBArray; global $_DBArray;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel\Cases; namespace ProcessMaker\BusinessModel\Cases;
class OutputDocument class OutputDocument
{ {
@@ -19,7 +19,7 @@ class OutputDocument
$fields = $oCase->loadCase( $applicationUid ); $fields = $oCase->loadCase( $applicationUid );
$sProcessUID = $fields['PRO_UID']; $sProcessUID = $fields['PRO_UID'];
$sTaskUID = ''; $sTaskUID = '';
$oCriteria = new \BusinessModel\Cases(); $oCriteria = new \ProcessMaker\BusinessModel\Cases();
$oCriteria->getAllGeneratedDocumentsCriteria( $sProcessUID, $applicationUid, $sTaskUID, $userUid); $oCriteria->getAllGeneratedDocumentsCriteria( $sProcessUID, $applicationUid, $sTaskUID, $userUid);
$result = array (); $result = array ();
global $_DBArray; global $_DBArray;
@@ -63,7 +63,7 @@ class OutputDocument
$fields = $oCase->loadCase( $sApplicationUID ); $fields = $oCase->loadCase( $sApplicationUID );
$sProcessUID = $fields['PRO_UID']; $sProcessUID = $fields['PRO_UID'];
$sTaskUID = ''; $sTaskUID = '';
$oCaseRest = new \BusinessModel\Cases(); $oCaseRest = new \ProcessMaker\BusinessModel\Cases();
$oCaseRest->getAllGeneratedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); $oCaseRest->getAllGeneratedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID );
$result = array (); $result = array ();
global $_DBArray; global $_DBArray;
@@ -498,11 +498,11 @@ class OutputDocument
); );
} }
$g_media->set_security($GLOBALS['g_config']['pdfSecurity']); $g_media->set_security($GLOBALS['g_config']['pdfSecurity']);
require_once (HTML2PS_DIR . 'pdf.fpdf.encryption.php'); require_once(HTML2PS_DIR . 'pdf.fpdf.encryption.php');
} }
$pipeline = new \Pipeline(); $pipeline = new \Pipeline();
if (extension_loaded('curl')) { if (extension_loaded('curl')) {
require_once (HTML2PS_DIR . 'fetcher.url.curl.class.php'); require_once(HTML2PS_DIR . 'fetcher.url.curl.class.php');
$pipeline->fetchers = array(new \FetcherURLCurl()); $pipeline->fetchers = array(new \FetcherURLCurl());
if (isset($proxy)) { if (isset($proxy)) {
if ($proxy != '') { if ($proxy != '') {
@@ -510,7 +510,7 @@ class OutputDocument
} }
} }
} else { } else {
require_once (HTML2PS_DIR . 'fetcher.url.class.php'); require_once(HTML2PS_DIR . 'fetcher.url.class.php');
$pipeline->fetchers[] = new \FetcherURL(); $pipeline->fetchers[] = new \FetcherURL();
} }
$pipeline->data_filters[] = new \DataFilterDoctype(); $pipeline->data_filters[] = new \DataFilterDoctype();

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \DbSource; use \DbSource;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \UsersPeer; use \UsersPeer;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class DynaForm class DynaForm
{ {
@@ -358,7 +358,7 @@ class DynaForm
unset($arrayData["PMTABLE"]); unset($arrayData["PMTABLE"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
@@ -412,7 +412,7 @@ class DynaForm
$processUid = $arrayDynaFormData["PRO_UID"]; $processUid = $arrayDynaFormData["PRO_UID"];
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
@@ -505,7 +505,7 @@ class DynaForm
unset($arrayData["PMTABLE"]); unset($arrayData["PMTABLE"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
@@ -708,7 +708,7 @@ class DynaForm
unset($arrayData["COPY_IMPORT"]); unset($arrayData["COPY_IMPORT"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
/** /**
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class Group class Group
{ {
@@ -189,7 +189,7 @@ class Group
unset($arrayData["GRP_UID"]); unset($arrayData["GRP_UID"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
@@ -227,7 +227,7 @@ class Group
$arrayData = array_change_key_case($arrayData, CASE_UPPER); $arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); $this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
@@ -459,7 +459,7 @@ class Group
$arrayGroup = array(); $arrayGroup = array();
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
@@ -671,7 +671,7 @@ class Group
$arrayUser = array(); $arrayUser = array();
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); $this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel\Group; namespace ProcessMaker\BusinessModel\Group;
class User class User
{ {
@@ -144,8 +144,8 @@ class User
unset($arrayData["GRP_UID"]); unset($arrayData["GRP_UID"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); $group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
@@ -185,8 +185,8 @@ class User
{ {
try { try {
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); $group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class InputDocument class InputDocument
{ {
@@ -209,7 +209,7 @@ class InputDocument
unset($arrayData["INP_DOC_UID"]); unset($arrayData["INP_DOC_UID"]);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
@@ -278,7 +278,7 @@ class InputDocument
$processUid = $arrayInputDocumentData["PRO_UID"]; $processUid = $arrayInputDocumentData["PRO_UID"];
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
@@ -239,7 +239,7 @@ class OutputDocument
} }
} }
try { try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
$aData = array_change_key_case($aData, CASE_UPPER); $aData = array_change_key_case($aData, CASE_UPPER);
$aData['PRO_UID'] = $sProcessUID; $aData['PRO_UID'] = $sProcessUID;
//Verify data //Verify data
@@ -350,9 +350,9 @@ class OutputDocument
public function deleteOutputDocument($sProcessUID, $sOutputDocumentUID) public function deleteOutputDocument($sProcessUID, $sOutputDocumentUID)
{ {
try { try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "ObjectPermission.php"); require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "ObjectPermission.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php"); require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php");
\G::LoadClass( 'processMap' ); \G::LoadClass( 'processMap' );
$oOutputDocument = new \OutputDocument(); $oOutputDocument = new \OutputDocument();
$fields = $oOutputDocument->load( $sOutputDocumentUID ); $fields = $oOutputDocument->load( $sOutputDocumentUID );

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use G; use G;
use Criteria; use Criteria;
@@ -520,7 +520,7 @@ class Process
} }
if (isset($arrayData["PRO_CALENDAR"]) && $arrayData["PRO_CALENDAR"] . "" != "") { if (isset($arrayData["PRO_CALENDAR"]) && $arrayData["PRO_CALENDAR"] . "" != "") {
$calendar = new \BusinessModel\Calendar(); $calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->throwExceptionIfNotExistsCalendar($arrayData["PRO_CALENDAR"], $this->arrayFieldNameForException["processCalendar"]); $calendar->throwExceptionIfNotExistsCalendar($arrayData["PRO_CALENDAR"], $this->arrayFieldNameForException["processCalendar"]);
} }
@@ -530,7 +530,7 @@ class Process
} }
if (isset($arrayData["PRO_SUMMARY_DYNAFORM"]) && $arrayData["PRO_SUMMARY_DYNAFORM"] . "" != "") { if (isset($arrayData["PRO_SUMMARY_DYNAFORM"]) && $arrayData["PRO_SUMMARY_DYNAFORM"] . "" != "") {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["PRO_SUMMARY_DYNAFORM"], $processUid, $this->arrayFieldNameForException["processSummaryDynaform"]); $dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["PRO_SUMMARY_DYNAFORM"], $processUid, $this->arrayFieldNameForException["processSummaryDynaform"]);
} }
@@ -539,7 +539,7 @@ class Process
$this->throwExceptionIfNotExistsRoutingScreenTemplate($processUid, $arrayData["PRO_DERIVATION_SCREEN_TPL"], $this->arrayFieldNameForException["processDerivationScreenTpl"]); $this->throwExceptionIfNotExistsRoutingScreenTemplate($processUid, $arrayData["PRO_DERIVATION_SCREEN_TPL"], $this->arrayFieldNameForException["processDerivationScreenTpl"]);
} }
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
if (isset($arrayData["PRO_TRI_DELETED"]) && $arrayData["PRO_TRI_DELETED"] . "" != "") { if (isset($arrayData["PRO_TRI_DELETED"]) && $arrayData["PRO_TRI_DELETED"] . "" != "") {
$trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_DELETED"], $processUid, $this->arrayFieldNameForException["processTriDeleted"]); $trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_DELETED"], $processUid, $this->arrayFieldNameForException["processTriDeleted"]);
@@ -826,7 +826,7 @@ class Process
$arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID_OLD"] = $uidAux; $arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID_OLD"] = $uidAux;
//Update task properties //Update task properties
$task2 = new \BusinessModel\Task(); $task2 = new \ProcessMaker\BusinessModel\Task();
$arrayResult = $task2->updateProperties($taskUid, $processUid, $arrayData); $arrayResult = $task2->updateProperties($taskUid, $processUid, $arrayData);
@@ -842,7 +842,7 @@ class Process
$result = $task->update($arrayData); $result = $task->update($arrayData);
//Update task properties //Update task properties
$task2 = new \BusinessModel\Task(); $task2 = new \ProcessMaker\BusinessModel\Task();
$arrayResult = $task2->updateProperties($arrayData["TAS_UID"], $processUid, $arrayData); $arrayResult = $task2->updateProperties($arrayData["TAS_UID"], $processUid, $arrayData);
break; break;
@@ -1390,7 +1390,7 @@ class Process
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
//Get data //Get data
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $dynaForm->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$dynaForm->setArrayFieldNameForException($this->arrayFieldNameForException); $dynaForm->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -1431,7 +1431,7 @@ class Process
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
//Get data //Get data
$inputDocument = new \BusinessModel\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $inputDocument->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$inputDocument->setArrayFieldNameForException($this->arrayFieldNameForException); $inputDocument->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -1470,7 +1470,7 @@ class Process
//Verify data //Verify data
//Get data //Get data
$webEntry = new \BusinessModel\WebEntry(); $webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $webEntry->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$webEntry->setArrayFieldNameForException($this->arrayFieldNameForException); $webEntry->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -1575,7 +1575,7 @@ class Process
break; break;
case "GRIDVARS": case "GRIDVARS":
//Verify data //Verify data
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->throwExceptionIfNotExistsDynaForm($gridUid, $processUid, $this->arrayFieldNameForException["gridUid"]); $dynaForm->throwExceptionIfNotExistsDynaForm($gridUid, $processUid, $this->arrayFieldNameForException["gridUid"]);
$dynaForm->throwExceptionIfNotIsGridDynaForm($gridUid, $this->arrayFieldNameForException["gridUid"]); $dynaForm->throwExceptionIfNotIsGridDynaForm($gridUid, $this->arrayFieldNameForException["gridUid"]);
@@ -1622,7 +1622,7 @@ class Process
//Get data //Get data
\G::LoadClass("triggerLibrary"); \G::LoadClass("triggerLibrary");
$triggerWizard = new \BusinessModel\TriggerWizard(); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class ProcessCategory class ProcessCategory
{ {
@@ -96,7 +96,6 @@ class ProcessCategory
{ {
try { try {
$criteria = new \Criteria("workflow"); $criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_UID); $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_UID);
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_PARENT); $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_PARENT);
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_NAME); $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_NAME);
@@ -146,7 +145,7 @@ class ProcessCategory
$arrayProcessCategory = array(); $arrayProcessCategory = array();
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
@@ -232,5 +231,172 @@ class ProcessCategory
throw $e; throw $e;
} }
} }
}
/**
* Get a Process Category
*
* @param string $cat_uid Category Id
*
* return array Return an object with the Process Category
*/
public function getCategory($cat_uid)
{
try {
$oProcessCategory = '';
$process = new \Process();
$oTotalProcessesByCategory = $process->getAllProcessesByCategory();
$criteria = $this->getAProcessCategoryCriteria($cat_uid);
$criteriaCount = clone $criteria;
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn("COUNT(" . \ProcessCategoryPeer::CATEGORY_UID . ") AS NUM_REC");
$rsCriteriaCount = \ProcessCategoryPeer::doSelectRS($criteriaCount);
$rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteriaCount->next();
$rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$row["CATEGORY_TOTAL_PROCESSES"] = (isset($oTotalProcessesByCategory[$row["CATEGORY_UID"]]))? $oTotalProcessesByCategory[$row["CATEGORY_UID"]] : 0;
$oProcessCategory = $this->getProcessCategoryDataFromRecord($row);
}
//Return
if ($oProcessCategory != '') {
return $oProcessCategory;
} else {
throw (new \Exception( 'The Category with cat_uid: '.$cat_uid.' doesn\'t exist!'));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Post Process Category
*
* @param string $cat_name Name of Category
*
* return array
*/
public function addCategory($cat_name)
{
try {
require_once 'classes/model/ProcessCategory.php';
$catName = trim( $cat_name );
if ($this->existsName( $cat_name )) {
throw (new \Exception( 'cat_name. Duplicate Process Category name'));
}
$catUid = \G::GenerateUniqueID();
$pcat = new \ProcessCategory();
$pcat->setNew( true );
$pcat->setCategoryUid( $catUid );
$pcat->setCategoryName( $catName );
$pcat->save();
$oProcessCategory = array_change_key_case($this->getCategory( $catUid ), CASE_LOWER);
//Return
return $oProcessCategory;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Put Process Category
*
* @param string $cat_uid Category id
* @param string $cat_name Category Name
*
* return array
*/
public function updateCategory($cat_uid, $cat_name)
{
try {
require_once 'classes/model/ProcessCategory.php';
$catUID = $cat_uid;
$catName = trim( $cat_name );
if ($this->existsName( $cat_name )) {
throw (new \Exception( 'cat_name. Duplicate Process Category name'));
}
$pcat = new \ProcessCategory();
$pcat->setNew( false );
$pcat->setCategoryUid( $catUID );
$pcat->setCategoryName( $catName );
$pcat->save();
$oProcessCategory = array_change_key_case($this->getCategory( $cat_uid ), CASE_LOWER);
//Return
return $oProcessCategory;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Delete Process Category
*
* @param string $cat_uid Category id
*
* return array
*/
public function deleteCategory($cat_uid)
{
try {
require_once 'classes/model/ProcessCategory.php';
$criteria = $this->getAProcessCategoryCriteria($cat_uid);
$rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
if ($row) {
$cat = new \ProcessCategory();
$cat->setCategoryUid( $cat_uid );
$cat->delete();
} else {
throw (new \Exception( 'The Category with cat_uid: '.$cat_uid.' doesn\'t exist!'));
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get criteria for Process Category
*
* return object
*/
public function getAProcessCategoryCriteria($cat_uid)
{
try {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_UID);
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_PARENT);
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_NAME);
$criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_ICON);
$criteria->add(\ProcessCategoryPeer::CATEGORY_UID, $cat_uid);
return $criteria;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Checks if the name exists
*
* @param string $name Name
*
* return bool Return true if the name exists, false otherwise
*/
public function existsName($name)
{
try {
$criteria = new \Criteria("workflow");
$criteria->add(\ProcessCategoryPeer::CATEGORY_NAME, $name, \Criteria::EQUAL);
$rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
return $rsCriteria->getRow();
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \Cases; use \Cases;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class Step class Step
{ {
@@ -498,7 +498,7 @@ class Step
try { try {
$arrayStep = array(); $arrayStep = array();
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $step->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$step->setArrayParamException($this->arrayParamException); $step->setArrayParamException($this->arrayParamException);
@@ -650,7 +650,7 @@ class Step
} }
//Get data //Get data
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$flagStepAssignTask = 0; $flagStepAssignTask = 0;
@@ -765,8 +765,8 @@ class Step
} }
//Get data //Get data
$bmTrigger = new \BusinessModel\Trigger(); $bmTrigger = new \ProcessMaker\BusinessModel\Trigger();
$bmStepTrigger = new \BusinessModel\Step\Trigger(); $bmStepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$stepTrigger = new \StepTrigger(); $stepTrigger = new \StepTrigger();

View File

@@ -1,7 +1,7 @@
<?php <?php
namespace BusinessModel\Step; namespace ProcessMaker\BusinessModel\Step;
use \BusinessModel\Step; use \ProcessMaker\BusinessModel\Step;
class Trigger class Trigger
{ {
@@ -330,7 +330,7 @@ class Trigger
} }
//Get data //Get data
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$criteria = $trigger->getTriggerCriteria(); $criteria = $trigger->getTriggerCriteria();
@@ -373,7 +373,7 @@ class Trigger
* @return void * @return void
*/ */
public function moveStepTriggers($tasUid, $stepUid, $triUid, $type, $newPos) { public function moveStepTriggers($tasUid, $stepUid, $triUid, $type, $newPos) {
$stepTrigger = new \BusinessModel\Step(); $stepTrigger = new \ProcessMaker\BusinessModel\Step();
$tempStep = $stepUid; $tempStep = $stepUid;
$typeCompare = $type; $typeCompare = $type;
if ($tempStep == '-1' || $tempStep == '-2') { if ($tempStep == '-1' || $tempStep == '-2') {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \SubProcessPeer; use \SubProcessPeer;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \AdditionalTables; use \AdditionalTables;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
use \ProcessMaker\Util; use \ProcessMaker\Util;
@@ -636,7 +636,7 @@ class Task
try { try {
$arrayStep = array(); $arrayStep = array();
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $step->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$step->setArrayParamException($this->arrayParamException); $step->setArrayParamException($this->arrayParamException);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class Trigger class Trigger
{ {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class TriggerWizard class TriggerWizard
{ {
@@ -165,7 +165,7 @@ class TriggerWizard
//Verify data //Verify data
$this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $libraryFieldNameForException, $methodFieldNameForException); $this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $libraryFieldNameForException, $methodFieldNameForException);
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $triggerUidFieldNameForException); $trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $triggerUidFieldNameForException);
@@ -303,7 +303,7 @@ class TriggerWizard
array("paramDefinition" => $arrayMethodOutputParam, "paramData" => (isset($arrayParamData["output"]))? $arrayParamData["output"] : array()) array("paramDefinition" => $arrayMethodOutputParam, "paramData" => (isset($arrayParamData["output"]))? $arrayParamData["output"] : array())
); );
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
foreach ($arrayVerify as $key1 => $value1) { foreach ($arrayVerify as $key1 => $value1) {
if (count($value1["paramDefinition"]) > 0) { if (count($value1["paramDefinition"]) > 0) {
@@ -491,7 +491,7 @@ class TriggerWizard
//Verify data //Verify data
$this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]); $this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]);
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $this->arrayFieldNameForException["triggerUid"]); $trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $this->arrayFieldNameForException["triggerUid"]);
@@ -671,8 +671,8 @@ class TriggerWizard
$arrayData = array_change_key_case($arrayData, CASE_UPPER); $arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]); $this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]);
@@ -745,8 +745,8 @@ class TriggerWizard
$processUid = $arrayTriggerData["PRO_UID"]; $processUid = $arrayTriggerData["PRO_UID"];
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
use \G; use \G;
class User class User

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
/** /**
* Validator fields * Validator fields

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace BusinessModel; namespace ProcessMaker\BusinessModel;
class WebEntry class WebEntry
{ {
@@ -149,7 +149,7 @@ class WebEntry
$arrayData = array(); $arrayData = array();
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
@@ -158,7 +158,7 @@ class WebEntry
} }
if ($dynaFormUid != "") { if ($dynaFormUid != "") {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->throwExceptionIfNotExistsDynaForm($dynaFormUid, $processUid, $this->arrayFieldNameForException["dynaFormUid"]); $dynaForm->throwExceptionIfNotExistsDynaForm($dynaFormUid, $processUid, $this->arrayFieldNameForException["dynaFormUid"]);
} }
@@ -170,7 +170,7 @@ class WebEntry
$task = new \Task(); $task = new \Task();
$dynaForm = new \Dynaform(); $dynaForm = new \Dynaform();
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$arrayDirFile = scandir($webEntryPath); //Ascending Order $arrayDirFile = scandir($webEntryPath); //Ascending Order
@@ -277,13 +277,13 @@ class WebEntry
$arrayData = array_change_key_case($arrayData, CASE_UPPER); $arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Verify data //Verify data
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
$projectUser = new \BusinessModel\ProjectUser(); $projectUser = new \ProcessMaker\BusinessModel\ProjectUser();
if ($arrayData["METHOD"] == "WS") { if ($arrayData["METHOD"] == "WS") {
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayUserFieldDefinition, $this->arrayFieldNameForException, true); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayUserFieldDefinition, $this->arrayFieldNameForException, true);
@@ -297,7 +297,7 @@ class WebEntry
$process->throwExceptionIfNotExistsTask($processUid, $arrayData["TAS_UID"], $this->arrayFieldNameForException["taskUid"]); $process->throwExceptionIfNotExistsTask($processUid, $arrayData["TAS_UID"], $this->arrayFieldNameForException["taskUid"]);
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["DYN_UID"], $processUid, $this->arrayFieldNameForException["dynaFormUid"]); $dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["DYN_UID"], $processUid, $this->arrayFieldNameForException["dynaFormUid"]);
@@ -327,7 +327,7 @@ class WebEntry
$arrayDynaFormData = $dynaForm->Load($arrayData["DYN_UID"]); $arrayDynaFormData = $dynaForm->Load($arrayData["DYN_UID"]);
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
if (!$step->existsRecord($arrayData["TAS_UID"], "DYNAFORM", $arrayData["DYN_UID"])) { if (!$step->existsRecord($arrayData["TAS_UID"], "DYNAFORM", $arrayData["DYN_UID"])) {
throw (new \Exception(str_replace(array("{0}", "{1}"), array($arrayDynaFormData["DYN_TITLE"], $arrayTaskData["TAS_TITLE"]), "The DynaForm \"{0}\" isn't assigned to the task \"{1}\""))); throw (new \Exception(str_replace(array("{0}", "{1}"), array($arrayDynaFormData["DYN_TITLE"], $arrayTaskData["TAS_TITLE"]), "The DynaForm \"{0}\" isn't assigned to the task \"{1}\"")));

View File

@@ -39,7 +39,7 @@ abstract class Api
public function getUserId() public function getUserId()
{ {
return \Services\Api\OAuth2\Server::getUserId(); return \ProcessMaker\Services\OAuth2\Server::getUserId();
} }
} }

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class Calendar extends Api
public function index($filter = null, $start = null, $limit = null) public function index($filter = null, $start = null, $limit = null)
{ {
try { try {
$calendar = new \BusinessModel\Calendar(); $calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $calendar->getCalendars(array("filter" => $filter), null, null, $start, $limit); $response = $calendar->getCalendars(array("filter" => $filter), null, null, $start, $limit);
@@ -38,7 +38,7 @@ class Calendar extends Api
public function doGet($cal_uid) public function doGet($cal_uid)
{ {
try { try {
$calendar = new \BusinessModel\Calendar(); $calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $calendar->getCalendar($cal_uid); $response = $calendar->getCalendar($cal_uid);
@@ -59,7 +59,7 @@ class Calendar extends Api
public function doPost($request_data) public function doPost($request_data)
{ {
try { try {
$calendar = new \BusinessModel\Calendar(); $calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$arrayData = $calendar->create($request_data); $arrayData = $calendar->create($request_data);
@@ -71,5 +71,40 @@ class Calendar extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }
} }
/**
* @url PUT /:cal_uid
*
* @param string $cal_uid {@min 32}{@max 32}
* @param array $request_data
*/
public function doPut($cal_uid, $request_data)
{
try {
$calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$arrayData = $calendar->update($cal_uid, $request_data);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url DELETE /:cal_uid
*
* @param string $cal_uid {@min 32}{@max 32}
*/
public function doDelete($cal_uid)
{
try {
$calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$calendar->delete($cal_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
} }

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -34,7 +34,7 @@ class Cases extends Api
*/ */
public function doGetCasesListToDo( public function doGetCasesListToDo(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -54,7 +54,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -81,7 +81,7 @@ class Cases extends Api
*/ */
public function doGetCasesListToDoPaged( public function doGetCasesListToDoPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -101,7 +101,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -128,7 +128,7 @@ class Cases extends Api
*/ */
public function doGetCasesListDraft( public function doGetCasesListDraft(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -148,7 +148,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -175,7 +175,7 @@ class Cases extends Api
*/ */
public function doGetCasesListDraftPaged( public function doGetCasesListDraftPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -195,7 +195,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -222,7 +222,7 @@ class Cases extends Api
*/ */
public function doGetCasesListParticipated( public function doGetCasesListParticipated(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -242,7 +242,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -269,7 +269,7 @@ class Cases extends Api
*/ */
public function doGetCasesListParticipatedPaged( public function doGetCasesListParticipatedPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -289,7 +289,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -316,7 +316,7 @@ class Cases extends Api
*/ */
public function doGetCasesListUnassigned( public function doGetCasesListUnassigned(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -336,7 +336,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -363,7 +363,7 @@ class Cases extends Api
*/ */
public function doGetCasesListUnassignedPaged( public function doGetCasesListUnassignedPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -383,7 +383,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -410,7 +410,7 @@ class Cases extends Api
*/ */
public function doGetCasesListPaused( public function doGetCasesListPaused(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -430,7 +430,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -457,7 +457,7 @@ class Cases extends Api
*/ */
public function doGetCasesListPausedPaged( public function doGetCasesListPausedPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -477,7 +477,7 @@ class Cases extends Api
$dataList['category'] = $cat_uid; $dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid; $dataList['process'] = $pro_uid;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -508,7 +508,7 @@ class Cases extends Api
*/ */
public function doGetCasesListAdvancedSearch( public function doGetCasesListAdvancedSearch(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -536,7 +536,7 @@ class Cases extends Api
$dataList['dateFrom'] = $date_from; $dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to; $dataList['dateTo'] = $date_to;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -567,7 +567,7 @@ class Cases extends Api
*/ */
public function doGetCasesListAdvancedSearchPaged( public function doGetCasesListAdvancedSearchPaged(
$start = 0, $start = 0,
$limit = 'config', $limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER', $sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC', $dir = 'DESC',
$cat_uid = '', $cat_uid = '',
@@ -595,7 +595,7 @@ class Cases extends Api
$dataList['dateFrom'] = $date_from; $dataList['dateFrom'] = $date_from;
$dataList['dateTo'] = $date_to; $dataList['dateTo'] = $date_to;
$dataList['search'] = $search; $dataList['search'] = $search;
$oCases = new \BusinessModel\Cases(); $oCases = new \ProcessMaker\BusinessModel\Cases();
$response = $oCases->getList($dataList); $response = $oCases->getList($dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -612,7 +612,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$oData = $cases->getCaseInfo($app_uid, $userUid); $oData = $cases->getCaseInfo($app_uid, $userUid);
return $oData; return $oData;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -629,7 +629,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$oData = $cases->getTaskCase($app_uid, $userUid); $oData = $cases->getTaskCase($app_uid, $userUid);
return $oData; return $oData;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -649,7 +649,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$oData = $cases->addCase($pro_uid, $tas_uid, $userUid, $variables); $oData = $cases->addCase($pro_uid, $tas_uid, $userUid, $variables);
return $oData; return $oData;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -669,7 +669,7 @@ class Cases extends Api
public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null) public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null)
{ {
try { try {
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$oData = $cases->addCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables); $oData = $cases->addCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables);
return $oData; return $oData;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -689,7 +689,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->updateReassignCase($app_uid, $userUid, $del_index, $usr_uid_source, $usr_uid_target); $cases->updateReassignCase($app_uid, $userUid, $del_index, $usr_uid_source, $usr_uid_target);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -706,7 +706,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->updateRouteCase($app_uid, $userUid, $del_index); $cases->updateRouteCase($app_uid, $userUid, $del_index);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -727,7 +727,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->putCancelCase($cas_uid, $userUid); $cases->putCancelCase($cas_uid, $userUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -749,7 +749,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
if ($unpaused_date == null) { if ($unpaused_date == null) {
$cases->putPauseCase($cas_uid, $userUid); $cases->putPauseCase($cas_uid, $userUid);
} else { } else {
@@ -774,7 +774,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->putUnpauseCase($cas_uid, $userUid); $cases->putUnpauseCase($cas_uid, $userUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -796,7 +796,7 @@ class Cases extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->putExecuteTriggerCase($cas_uid, $tri_uid, $userUid); $cases->putExecuteTriggerCase($cas_uid, $tri_uid, $userUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -816,7 +816,7 @@ class Cases extends Api
public function doDeleteCase($cas_uid) public function doDeleteCase($cas_uid)
{ {
try { try {
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->deleteCase($cas_uid); $cases->deleteCase($cas_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -836,7 +836,7 @@ class Cases extends Api
public function doGetCaseVariables($app_uid) public function doGetCaseVariables($app_uid)
{ {
try { try {
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$response = $cases->getCaseVariables($app_uid); $response = $cases->getCaseVariables($app_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -858,7 +858,7 @@ class Cases extends Api
public function doPutCaseVariables($app_uid, $request_data) public function doPutCaseVariables($app_uid, $request_data)
{ {
try { try {
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$cases->setCaseVariables($app_uid, $request_data); $cases->setCaseVariables($app_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -908,7 +908,7 @@ class Cases extends Api
$dataList['search'] = $search; $dataList['search'] = $search;
$usr_uid = $this->getUserId(); $usr_uid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList); $response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -957,7 +957,7 @@ class Cases extends Api
$dataList['search'] = $search; $dataList['search'] = $search;
$usr_uid = $this->getUserId(); $usr_uid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList); $response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -981,7 +981,7 @@ class Cases extends Api
{ {
try { try {
$usr_uid = $this->getUserId(); $usr_uid = $this->getUserId();
$cases = new \BusinessModel\Cases(); $cases = new \ProcessMaker\BusinessModel\Cases();
$send_mail = ($send_mail == 0) ? false : true; $send_mail = ($send_mail == 0) ? false : true;
$cases->saveCaseNote($app_uid, $usr_uid, $note_content, $send_mail); $cases->saveCaseNote($app_uid, $usr_uid, $note_content, $send_mail);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Cases; namespace ProcessMaker\Services\Api\Cases;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class InputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$inputDocument = new \BusinessModel\Cases\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
$response = $inputDocument->getCasesInputDocuments($app_uid, $userUid); $response = $inputDocument->getCasesInputDocuments($app_uid, $userUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -38,7 +38,7 @@ class InputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$inputDocument = new \BusinessModel\Cases\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
$response = $inputDocument->getCasesInputDocument($app_uid, $userUid, $inp_doc_uid); $response = $inputDocument->getCasesInputDocument($app_uid, $userUid, $inp_doc_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -55,7 +55,7 @@ class InputDocument extends Api
public function doDeleteInputDocument($app_uid, $inp_doc_uid) public function doDeleteInputDocument($app_uid, $inp_doc_uid)
{ {
try { try {
$inputDocument = new \BusinessModel\Cases\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
$inputDocument->removeInputDocument($inp_doc_uid); $inputDocument->removeInputDocument($inp_doc_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -73,7 +73,7 @@ class InputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$inputDocument = new \BusinessModel\Cases\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
$response = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid); $response = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Cases; namespace ProcessMaker\Services\Api\Cases;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class OutputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$outputDocument = new \BusinessModel\Cases\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
$response = $outputDocument->getCasesOutputDocuments($app_uid, $userUid); $response = $outputDocument->getCasesOutputDocuments($app_uid, $userUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -38,7 +38,7 @@ class OutputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$outputDocument = new \BusinessModel\Cases\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
$response = $outputDocument->getCasesOutputDocument($app_uid, $userUid, $app_doc_uid); $response = $outputDocument->getCasesOutputDocument($app_uid, $userUid, $app_doc_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -55,7 +55,7 @@ class OutputDocument extends Api
public function doDeleteOutputDocument($app_uid, $app_doc_uid) public function doDeleteOutputDocument($app_uid, $app_doc_uid)
{ {
try { try {
$outputDocument = new \BusinessModel\Cases\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
$outputDocument->removeOutputDocument($app_doc_uid); $outputDocument->removeOutputDocument($app_doc_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -71,7 +71,7 @@ class OutputDocument extends Api
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$outputDocument = new \BusinessModel\Cases\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
$response = $outputDocument->addCasesOutputDocument($app_uid, $out_doc_uid, $userUid); $response = $outputDocument->addCasesOutputDocument($app_uid, $out_doc_uid, $userUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -27,7 +27,7 @@ class Department extends Api
public function doGetDepartments() public function doGetDepartments()
{ {
try { try {
$oDepartment = new \BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->getDepartments(); $response = $oDepartment->getDepartments();
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -49,7 +49,7 @@ class Department extends Api
public function doGetDepartment($dep_uid) public function doGetDepartment($dep_uid)
{ {
try { try {
$oDepartment = new \BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->getDepartment($dep_uid); $response = $oDepartment->getDepartment($dep_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -73,7 +73,7 @@ class Department extends Api
public function doPost($request_data, $dep_title) public function doPost($request_data, $dep_title)
{ {
try { try {
$oDepartment = new \BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->saveDepartment($request_data); $response = $oDepartment->saveDepartment($request_data);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -98,7 +98,7 @@ class Department extends Api
{ {
try { try {
$request_data['dep_uid'] = $dep_uid; $request_data['dep_uid'] = $dep_uid;
$oDepartment = new \BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->saveDepartment($request_data, false); $response = $oDepartment->saveDepartment($request_data, false);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -120,7 +120,7 @@ class Department extends Api
public function doDelete($dep_uid) public function doDelete($dep_uid)
{ {
try { try {
$oDepartment = new \BusinessModel\Department(); $oDepartment = new \ProcessMaker\BusinessModel\Department();
$oDepartment->deleteDepartment($dep_uid); $oDepartment->deleteDepartment($dep_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -17,7 +17,7 @@ class Group extends Api
public function index($filter = null, $start = null, $limit = null) public function index($filter = null, $start = null, $limit = null)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$response = $group->getGroups(array("filter" => $filter), null, null, $start, $limit); $response = $group->getGroups(array("filter" => $filter), null, null, $start, $limit);
@@ -36,7 +36,7 @@ class Group extends Api
public function doGet($grp_uid) public function doGet($grp_uid)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$response = $group->getGroup($grp_uid); $response = $group->getGroup($grp_uid);
@@ -57,7 +57,7 @@ class Group extends Api
public function doPost($request_data) public function doPost($request_data)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$arrayData = $group->create($request_data); $arrayData = $group->create($request_data);
@@ -79,7 +79,7 @@ class Group extends Api
public function doPut($grp_uid, $request_data) public function doPut($grp_uid, $request_data)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$arrayData = $group->update($grp_uid, $request_data); $arrayData = $group->update($grp_uid, $request_data);
@@ -96,7 +96,7 @@ class Group extends Api
public function doDelete($grp_uid) public function doDelete($grp_uid)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$group->delete($grp_uid); $group->delete($grp_uid);
@@ -113,7 +113,7 @@ class Group extends Api
public function doGetUsers($grp_uid, $filter = null, $start = null, $limit = null) public function doGetUsers($grp_uid, $filter = null, $start = null, $limit = null)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$response = $group->getUsers("USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit); $response = $group->getUsers("USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit);
@@ -132,7 +132,7 @@ class Group extends Api
public function doGetAvailableUsers($grp_uid, $filter = null, $start = null, $limit = null) public function doGetAvailableUsers($grp_uid, $filter = null, $start = null, $limit = null)
{ {
try { try {
$group = new \BusinessModel\Group(); $group = new \ProcessMaker\BusinessModel\Group();
$group->setFormatFieldNameInUppercase(false); $group->setFormatFieldNameInUppercase(false);
$response = $group->getUsers("AVAILABLE-USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit); $response = $group->getUsers("AVAILABLE-USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Group; namespace ProcessMaker\Services\Api\Group;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class User extends Api
public function doPostUser($grp_uid, $request_data) public function doPostUser($grp_uid, $request_data)
{ {
try { try {
$groupUser = new \BusinessModel\Group\User(); $groupUser = new \ProcessMaker\BusinessModel\Group\User();
$groupUser->setFormatFieldNameInUppercase(false); $groupUser->setFormatFieldNameInUppercase(false);
$arrayData = $groupUser->create($grp_uid, $request_data); $arrayData = $groupUser->create($grp_uid, $request_data);
@@ -40,7 +40,7 @@ class User extends Api
public function doDeleteUser($grp_uid, $usr_uid) public function doDeleteUser($grp_uid, $usr_uid)
{ {
try { try {
$groupUser = new \BusinessModel\Group\User(); $groupUser = new \ProcessMaker\BusinessModel\Group\User();
$groupUser->setFormatFieldNameInUppercase(false); $groupUser->setFormatFieldNameInUppercase(false);
$groupUser->delete($grp_uid, $usr_uid); $groupUser->delete($grp_uid, $usr_uid);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class Pmtable extends Api
public function doGetPmTables() public function doGetPmTables()
{ {
try { try {
$oPmTable = new \BusinessModel\Table(); $oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTables(); $response = $oPmTable->getTables();
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -42,7 +42,7 @@ class Pmtable extends Api
public function doGetPmTable($pmt_uid) public function doGetPmTable($pmt_uid)
{ {
try { try {
$oPmTable = new \BusinessModel\Table(); $oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTable($pmt_uid); $response = $oPmTable->getTable($pmt_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -62,7 +62,7 @@ class Pmtable extends Api
public function doGetPmTableData($pmt_uid) public function doGetPmTableData($pmt_uid)
{ {
try { try {
$oPmTable = new \BusinessModel\Table(); $oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->getTableData($pmt_uid); $response = $oPmTable->getTableData($pmt_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -88,7 +88,7 @@ class Pmtable extends Api
$pmt_tab_dsc = '' $pmt_tab_dsc = ''
) { ) {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->saveTable($request_data); $response = $oReportTable->saveTable($request_data);
if (isset($response['pro_uid'])) { if (isset($response['pro_uid'])) {
unset($response['pro_uid']); unset($response['pro_uid']);
@@ -118,7 +118,7 @@ class Pmtable extends Api
$pmt_rows = '' $pmt_rows = ''
) { ) {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->saveTableData($pmt_uid, $request_data); $response = $oReportTable->saveTableData($pmt_uid, $request_data);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -145,7 +145,7 @@ class Pmtable extends Api
) { ) {
try { try {
$request_data['pmt_uid'] = $pmt_uid; $request_data['pmt_uid'] = $pmt_uid;
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->updateTable($request_data); $response = $oReportTable->updateTable($request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -170,7 +170,7 @@ class Pmtable extends Api
$pmt_rows = '' $pmt_rows = ''
) { ) {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->updateTableData($pmt_uid, $request_data); $response = $oReportTable->updateTableData($pmt_uid, $request_data);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -191,7 +191,7 @@ class Pmtable extends Api
public function doDeletePmTable($pmt_uid) public function doDeletePmTable($pmt_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->deleteTable($pmt_uid); $response = $oReportTable->deleteTable($pmt_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -226,7 +226,7 @@ class Pmtable extends Api
if ($key3 != '') { if ($key3 != '') {
$rows[$key3] = $value3; $rows[$key3] = $value3;
} }
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->deleteTableData($pmt_uid, $rows); $response = $oReportTable->deleteTableData($pmt_uid, $rows);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -27,7 +27,7 @@ class Process extends Api
$arrayFilterData["category"] = $proCategory; $arrayFilterData["category"] = $proCategory;
} }
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$data = $process->loadAllProcess($arrayFilterData, $start, $limit); $data = $process->loadAllProcess($arrayFilterData, $start, $limit);
// Composing Response // Composing Response
@@ -48,7 +48,7 @@ class Process extends Api
$response = array(); $response = array();
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$data = $process->loadProcess($processUid); $data = $process->loadProcess($processUid);
@@ -68,7 +68,7 @@ class Process extends Api
defined('SYS_LANG') || define("SYS_LANG", $request_data["lang"]); defined('SYS_LANG') || define("SYS_LANG", $request_data["lang"]);
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$userUid = $this->getUserId(); $userUid = $this->getUserId();
return $process->createProcess($userUid, $request_data); return $process->createProcess($userUid, $request_data);
@@ -83,7 +83,7 @@ class Process extends Api
$response = array(); $response = array();
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$data = $process->updateProcess($processUid, $userUid, $request_data); $data = $process->updateProcess($processUid, $userUid, $request_data);
@@ -104,7 +104,7 @@ class Process extends Api
$response = array(); $response = array();
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$result = $process->deleteProcess($processUid, (($checkCases && $checkCases == 1)? true : false)); $result = $process->deleteProcess($processUid, (($checkCases && $checkCases == 1)? true : false));
@@ -128,7 +128,7 @@ class Process extends Api
try { try {
$task1 = new \Task(); $task1 = new \Task();
$task2 = new \BusinessModel\Task(); $task2 = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task1->load($activityUid); $arrayData = $task1->load($activityUid);
@@ -206,7 +206,7 @@ class Process extends Api
$response = array(); $response = array();
try { try {
$task2 = new \BusinessModel\Task(); $task2 = new \ProcessMaker\BusinessModel\Task();
$arrayData = array( $arrayData = array(
"_extended" => array( "_extended" => array(
@@ -242,7 +242,7 @@ class Process extends Api
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$data = $task->getStepsList($activityUid, $processUid, false, $start, $limit); $data = $task->getStepsList($activityUid, $processUid, false, $start, $limit);

View File

@@ -0,0 +1,105 @@
<?php
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
*
* @protected
*/
class ProcessCategory extends Api
{
private $formatFieldNameInUppercase = false;
/**
* @url GET
*/
public function doGetCategories($filter = null, $start = null, $limit = null)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$processCategory->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $processCategory->getCategories(array("filter" => $filter), null, null, $start, $limit);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url GET /:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
*/
public function doGetCategory($cat_uid)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$processCategory->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $processCategory->getCategory($cat_uid);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url POST
*
* @param string $cat_name
*
*/
public function doPostCategory($cat_name)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$response = $processCategory->addCategory($cat_name);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url PUT /:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
* @param string $cat_name
*
*/
public function doPutCategory($cat_uid, $cat_name)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$response = $processCategory->updateCategory($cat_uid, $cat_name);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @url DELETE /:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
*
*/
public function doDeleteCategory($cat_uid)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$processCategory->deleteCategory($cat_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use Luracast\Restler\RestException; use Luracast\Restler\RestException;
use ProcessMaker\Services\Api; use ProcessMaker\Services\Api;
@@ -104,7 +104,7 @@ class Project extends Api
public function doGetProcess($prj_uid) public function doGetProcess($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -125,7 +125,7 @@ class Project extends Api
public function doPutProcess($prj_uid, $request_data) public function doPutProcess($prj_uid, $request_data)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -143,7 +143,7 @@ class Project extends Api
public function doGetDynaForms($prj_uid) public function doGetDynaForms($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -163,7 +163,7 @@ class Project extends Api
public function doGetInputDocuments($prj_uid) public function doGetInputDocuments($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -183,7 +183,7 @@ class Project extends Api
public function doGetWebEntries($prj_uid) public function doGetWebEntries($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -203,7 +203,7 @@ class Project extends Api
public function doGetVariables($prj_uid) public function doGetVariables($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -225,7 +225,7 @@ class Project extends Api
public function doGetGridVariables($prj_uid, $grid_uid = "") public function doGetGridVariables($prj_uid, $grid_uid = "")
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -245,7 +245,7 @@ class Project extends Api
public function doGetTriggerWizards($prj_uid) public function doGetTriggerWizards($prj_uid)
{ {
try { try {
$process = new \BusinessModel\Process(); $process = new \ProcessMaker\BusinessModel\Process();
$process->setFormatFieldNameInUppercase(false); $process->setFormatFieldNameInUppercase(false);
$process->setArrayFieldNameForException(array("processUid" => "prj_uid", "libraryName" => "lib_name", "methodName" => "fn_name")); $process->setArrayFieldNameForException(array("processUid" => "prj_uid", "libraryName" => "lib_name", "methodName" => "fn_name"));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -44,7 +44,7 @@ class Activity extends Api
if ($filter == '' || $filter == 'properties') { if ($filter == '' || $filter == 'properties') {
// PROPERTIES // PROPERTIES
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$properties = $task->getProperties($prj_uid, $act_uid, true, false); $properties = $task->getProperties($prj_uid, $act_uid, true, false);
foreach ($properties as $key => $value) { foreach ($properties as $key => $value) {
if (in_array($key, $hiddenFields)) { if (in_array($key, $hiddenFields)) {
@@ -77,7 +77,7 @@ class Activity extends Api
if (isset($request_data['properties']['tas_start'])) { if (isset($request_data['properties']['tas_start'])) {
unset($request_data['properties']['tas_start']); unset($request_data['properties']['tas_start']);
} }
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$properties = $task->updateProperties($prj_uid, $act_uid, $request_data); $properties = $task->updateProperties($prj_uid, $act_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
@@ -99,7 +99,7 @@ class Activity extends Api
public function doDeleteProjectActivity($prj_uid, $act_uid) public function doDeleteProjectActivity($prj_uid, $act_uid)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->deleteTask($prj_uid, $act_uid); $task->deleteTask($prj_uid, $act_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
@@ -115,7 +115,7 @@ class Activity extends Api
public function doGetActivitySteps($act_uid, $prj_uid) public function doGetActivitySteps($act_uid, $prj_uid)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->setFormatFieldNameInUppercase(false); $task->setFormatFieldNameInUppercase(false);
$task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid")); $task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid"));
@@ -135,7 +135,7 @@ class Activity extends Api
public function doGetActivityAvailableSteps($act_uid, $prj_uid) public function doGetActivityAvailableSteps($act_uid, $prj_uid)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->setFormatFieldNameInUppercase(false); $task->setFormatFieldNameInUppercase(false);
$task->setArrayParamException(array("taskUid" => "act_uid")); $task->setArrayParamException(array("taskUid" => "act_uid"));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project\Activity; namespace ProcessMaker\Services\Api\Project\Activity;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAssignees($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAssignees($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -52,7 +52,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAvailableAssignee($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAvailableAssignee($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -75,7 +75,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$objectData = $task->getTaskAssignee($prjUid, $actUid, $aasUid); $objectData = $task->getTaskAssignee($prjUid, $actUid, $aasUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -99,7 +99,7 @@ class Assignee extends Api
public function doPostActivityAssignee($prjUid, $actUid, $aas_uid, $aas_type) public function doPostActivityAssignee($prjUid, $actUid, $aas_uid, $aas_type)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type); $task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response
@@ -118,7 +118,7 @@ class Assignee extends Api
public function doDeleteActivityAssignee($prjUid, $actUid, $aasUid) public function doDeleteActivityAssignee($prjUid, $actUid, $aasUid)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->removeTaskAssignee($prjUid, $actUid, $aasUid); $task->removeTaskAssignee($prjUid, $actUid, $aasUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response
@@ -141,7 +141,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAdhocAssignees($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAdhocAssignees($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -167,7 +167,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAvailableAdhocAssignee($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAvailableAdhocAssignee($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -190,7 +190,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$objectData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid); $objectData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -214,7 +214,7 @@ class Assignee extends Api
public function doPostActivityAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type) public function doPostActivityAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type); $task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response
@@ -233,7 +233,7 @@ class Assignee extends Api
public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $adaUid) public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $adaUid)
{ {
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid); $task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response
@@ -256,7 +256,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -282,7 +282,7 @@ class Assignee extends Api
{ {
$response = array(); $response = array();
try { try {
$task = new \BusinessModel\Task(); $task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->getTaskAdhocAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type); $arrayData = $task->getTaskAdhocAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type);
//Response //Response
$response = $arrayData; $response = $arrayData;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project\Activity; namespace ProcessMaker\Services\Api\Project\Activity;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -21,7 +21,7 @@ class Step extends Api
public function doGetActivityStep($step_uid, $act_uid, $prj_uid) public function doGetActivityStep($step_uid, $act_uid, $prj_uid)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -58,7 +58,7 @@ class Step extends Api
$step_mode = "EDIT" $step_mode = "EDIT"
) { ) {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -97,7 +97,7 @@ class Step extends Api
$step_mode = "EDIT" $step_mode = "EDIT"
) { ) {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -117,7 +117,7 @@ class Step extends Api
public function doDeleteActivityStep($step_uid, $act_uid, $prj_uid) public function doDeleteActivityStep($step_uid, $act_uid, $prj_uid)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -137,7 +137,7 @@ class Step extends Api
public function doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid) public function doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -160,7 +160,7 @@ class Step extends Api
public function doGetActivityStepAvailableTriggers($step_uid, $act_uid, $prj_uid, $type) public function doGetActivityStepAvailableTriggers($step_uid, $act_uid, $prj_uid, $type)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -183,7 +183,7 @@ class Step extends Api
public function doGetActivityStepAssignTaskTriggers($act_uid, $prj_uid) public function doGetActivityStepAssignTaskTriggers($act_uid, $prj_uid)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
@@ -205,7 +205,7 @@ class Step extends Api
public function doGetActivityStepAssignTaskAvailableTriggers($act_uid, $prj_uid, $type) public function doGetActivityStepAssignTaskAvailableTriggers($act_uid, $prj_uid, $type)
{ {
try { try {
$step = new \BusinessModel\Step(); $step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase(false); $step->setFormatFieldNameInUppercase(false);
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project\Activity\Step; namespace ProcessMaker\Services\Api\Project\Activity\Step;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -23,7 +23,7 @@ class Trigger extends Api
public function doGetActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type) public function doGetActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type)
{ {
try { try {
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$response = $stepTrigger->getTrigger($stepUid, strtoupper($type), $activityUid, $triggerUid); $response = $stepTrigger->getTrigger($stepUid, strtoupper($type), $activityUid, $triggerUid);
@@ -48,7 +48,7 @@ class Trigger extends Api
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$arrayData = $stepTrigger->create($stepUid, $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data); $arrayData = $stepTrigger->create($stepUid, $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -70,7 +70,7 @@ class Trigger extends Api
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$arrayData = $stepTrigger->update($stepUid, $request_data["st_type"], $activityUid, $triggerUid, $request_data); $arrayData = $stepTrigger->update($stepUid, $request_data["st_type"], $activityUid, $triggerUid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -90,7 +90,7 @@ class Trigger extends Api
public function doDeleteActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type) public function doDeleteActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type)
{ {
try { try {
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$stepTrigger->delete($stepUid, strtoupper($type), $activityUid, $triggerUid); $stepTrigger->delete($stepUid, strtoupper($type), $activityUid, $triggerUid);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -111,7 +111,7 @@ class Trigger extends Api
public function doGetActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type) public function doGetActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type)
{ {
try { try {
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$response = $stepTrigger->getTrigger("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid); $response = $stepTrigger->getTrigger("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid);
@@ -135,7 +135,7 @@ class Trigger extends Api
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$arrayData = $stepTrigger->create("", $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data); $arrayData = $stepTrigger->create("", $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -156,7 +156,7 @@ class Trigger extends Api
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$arrayData = $stepTrigger->update("", $request_data["st_type"], $activityUid, $triggerUid, $request_data); $arrayData = $stepTrigger->update("", $request_data["st_type"], $activityUid, $triggerUid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -175,7 +175,7 @@ class Trigger extends Api
public function doDeleteActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type) public function doDeleteActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type)
{ {
try { try {
$stepTrigger = new \BusinessModel\Step\Trigger(); $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$stepTrigger->delete("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid); $stepTrigger->delete("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class CaseScheduler extends Api
public function doGetProjectCaseSchedulers($prjUid) public function doGetProjectCaseSchedulers($prjUid)
{ {
try { try {
$caseScheduler = new \BusinessModel\CaseScheduler(); $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$arrayData = $caseScheduler->getCaseSchedulers($prjUid); $arrayData = $caseScheduler->getCaseSchedulers($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -39,7 +39,7 @@ class CaseScheduler extends Api
public function doGetProjectCaseScheduler($prjUid, $caseSchedulerUid) public function doGetProjectCaseScheduler($prjUid, $caseSchedulerUid)
{ {
try { try {
$caseScheduler = new \BusinessModel\CaseScheduler(); $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$objectData = $caseScheduler->getCaseScheduler($prjUid, $caseSchedulerUid); $objectData = $caseScheduler->getCaseScheduler($prjUid, $caseSchedulerUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -63,7 +63,7 @@ class CaseScheduler extends Api
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$request_data = (array)($request_data); $request_data = (array)($request_data);
$caseScheduler = new \BusinessModel\CaseScheduler(); $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$objectData = $caseScheduler->addCaseScheduler($prjUid, $request_data, $userUid); $objectData = $caseScheduler->addCaseScheduler($prjUid, $request_data, $userUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -87,7 +87,7 @@ class CaseScheduler extends Api
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$request_data = (array)($request_data); $request_data = (array)($request_data);
$caseScheduler = new \BusinessModel\CaseScheduler(); $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$objectData = $caseScheduler->updateCaseScheduler($prjUid, $request_data, $userUid, $schUid); $objectData = $caseScheduler->updateCaseScheduler($prjUid, $request_data, $userUid, $schUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -107,7 +107,7 @@ class CaseScheduler extends Api
public function doDeleteProjectCaseScheduler($prjUid, $schUid) public function doDeleteProjectCaseScheduler($prjUid, $schUid)
{ {
try { try {
$caseScheduler = new \BusinessModel\CaseScheduler(); $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$caseScheduler->deleteCaseScheduler($schUid); $caseScheduler->deleteCaseScheduler($schUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class CaseTracker extends Api
public function doGetCaseTrackerProperty($prj_uid) public function doGetCaseTrackerProperty($prj_uid)
{ {
try { try {
$caseTracker = new \BusinessModel\CaseTracker(); $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker();
$response = $caseTracker->getCaseTracker($prj_uid); $response = $caseTracker->getCaseTracker($prj_uid);
@@ -46,7 +46,7 @@ class CaseTracker extends Api
$message_history = 0 $message_history = 0
) { ) {
try { try {
$caseTracker = new \BusinessModel\CaseTracker(); $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker();
$arrayData = $caseTracker->update($prj_uid, $request_data); $arrayData = $caseTracker->update($prj_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -62,7 +62,7 @@ class CaseTracker extends Api
public function doGetCaseTrackerObjects($prj_uid) public function doGetCaseTrackerObjects($prj_uid)
{ {
try { try {
$caseTracker = new \BusinessModel\CaseTracker(); $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker();
$response = $caseTracker->getCaseTrackerObjects($prj_uid); $response = $caseTracker->getCaseTrackerObjects($prj_uid);
@@ -80,7 +80,7 @@ class CaseTracker extends Api
public function doGetCaseTrackerAvailableObjects($prj_uid) public function doGetCaseTrackerAvailableObjects($prj_uid)
{ {
try { try {
$caseTracker = new \BusinessModel\CaseTracker(); $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker();
$response = $caseTracker->getAvailableCaseTrackerObjects($prj_uid); $response = $caseTracker->getAvailableCaseTrackerObjects($prj_uid);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class CaseTrackerObject extends Api
public function doGetCaseTrackerObject($cto_uid, $prj_uid) public function doGetCaseTrackerObject($cto_uid, $prj_uid)
{ {
try { try {
$caseTrackerObject = new \BusinessModel\CaseTrackerObject(); $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject();
$response = $caseTrackerObject->getCaseTrackerObject($cto_uid); $response = $caseTrackerObject->getCaseTrackerObject($cto_uid);
@@ -51,7 +51,7 @@ class CaseTrackerObject extends Api
$cto_position = 1 $cto_position = 1
) { ) {
try { try {
$caseTrackerObject = new \BusinessModel\CaseTrackerObject(); $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject();
$arrayData = $caseTrackerObject->create($prj_uid, $request_data); $arrayData = $caseTrackerObject->create($prj_uid, $request_data);
@@ -84,7 +84,7 @@ class CaseTrackerObject extends Api
$cto_position = 1 $cto_position = 1
) { ) {
try { try {
$caseTrackerObject = new \BusinessModel\CaseTrackerObject(); $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject();
$arrayData = $caseTrackerObject->update($cto_uid, $request_data); $arrayData = $caseTrackerObject->update($cto_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -101,7 +101,7 @@ class CaseTrackerObject extends Api
public function doDeleteCaseTrackerObject($cto_uid, $prj_uid) public function doDeleteCaseTrackerObject($cto_uid, $prj_uid)
{ {
try { try {
$caseTrackerObject = new \BusinessModel\CaseTrackerObject(); $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject();
$caseTrackerObject->delete($cto_uid); $caseTrackerObject->delete($cto_uid);
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class DataBaseConnection extends Api
public function doGetDataBaseConnections($prj_uid) public function doGetDataBaseConnections($prj_uid)
{ {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->getDataBaseConnections($prj_uid); $response = $oDBConnection->getDataBaseConnections($prj_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -46,7 +46,7 @@ class DataBaseConnection extends Api
public function doGetDataBaseConnection($prj_uid, $dbs_uid) public function doGetDataBaseConnection($prj_uid, $dbs_uid)
{ {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->getDataBaseConnection($prj_uid, $dbs_uid); $response = $oDBConnection->getDataBaseConnection($prj_uid, $dbs_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -86,7 +86,7 @@ class DataBaseConnection extends Api
$dbs_description = '' $dbs_description = ''
) { ) {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$request_data['pro_uid'] = $prj_uid; $request_data['pro_uid'] = $prj_uid;
$response = $oDBConnection->testConnection($request_data, true); $response = $oDBConnection->testConnection($request_data, true);
return $response; return $response;
@@ -128,7 +128,7 @@ class DataBaseConnection extends Api
$dbs_description = '' $dbs_description = ''
) { ) {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data, true); $response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data, true);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -171,7 +171,7 @@ class DataBaseConnection extends Api
) { ) {
try { try {
$request_data['dbs_uid'] = $dbs_uid; $request_data['dbs_uid'] = $dbs_uid;
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data); $response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -191,7 +191,7 @@ class DataBaseConnection extends Api
public function doDeleteDataBaseConnection($prj_uid, $dbs_uid) public function doDeleteDataBaseConnection($prj_uid, $dbs_uid)
{ {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->deleteDataBaseConnection($prj_uid, $dbs_uid); $response = $oDBConnection->deleteDataBaseConnection($prj_uid, $dbs_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class DynaForm extends Api
public function doGetDynaForm($dyn_uid, $prj_uid) public function doGetDynaForm($dyn_uid, $prj_uid)
{ {
try { try {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->setFormatFieldNameInUppercase(false);
$response = $dynaForm->getDynaForm($dyn_uid); $response = $dynaForm->getDynaForm($dyn_uid);
@@ -42,7 +42,7 @@ class DynaForm extends Api
public function doPostDynaForm($prj_uid, $request_data) public function doPostDynaForm($prj_uid, $request_data)
{ {
try { try {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->setFormatFieldNameInUppercase(false);
$dynaForm->setArrayFieldNameForException(array("processUid" => "prj_uid")); $dynaForm->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -66,7 +66,7 @@ class DynaForm extends Api
public function doPutDynaForm($dyn_uid, $prj_uid, $request_data) public function doPutDynaForm($dyn_uid, $prj_uid, $request_data)
{ {
try { try {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->setFormatFieldNameInUppercase(false);
$arrayData = $dynaForm->update($dyn_uid, $request_data); $arrayData = $dynaForm->update($dyn_uid, $request_data);
@@ -84,7 +84,7 @@ class DynaForm extends Api
public function doDeleteDynaForm($dyn_uid, $prj_uid) public function doDeleteDynaForm($dyn_uid, $prj_uid)
{ {
try { try {
$dynaForm = new \BusinessModel\DynaForm(); $dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->setFormatFieldNameInUppercase(false);
$dynaForm->delete($dyn_uid); $dynaForm->delete($dyn_uid);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -32,7 +32,7 @@ class Event extends Api
$hiddenFields = array('pro_uid', 'evn_action_parameters', $hiddenFields = array('pro_uid', 'evn_action_parameters',
'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts' 'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts'
); );
$event = new \BusinessModel\Event(); $event = new \ProcessMaker\BusinessModel\Event();
$response = $event->getEvents($prj_uid, $filter); $response = $event->getEvents($prj_uid, $filter);
foreach ($response as &$eventData) { foreach ($response as &$eventData) {
foreach ($eventData as $key => $value) { foreach ($eventData as $key => $value) {
@@ -65,7 +65,7 @@ class Event extends Api
$hiddenFields = array('pro_uid', 'evn_action_parameters', $hiddenFields = array('pro_uid', 'evn_action_parameters',
'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts' 'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts'
); );
$event = new \BusinessModel\Event(); $event = new \ProcessMaker\BusinessModel\Event();
$response = $event->getEvents($prj_uid, '', $evn_uid); $response = $event->getEvents($prj_uid, '', $evn_uid);
foreach ($response as $key => $eventData) { foreach ($response as $key => $eventData) {
if (in_array($key, $hiddenFields)) { if (in_array($key, $hiddenFields)) {
@@ -125,7 +125,7 @@ class Event extends Api
$hiddenFields = array('pro_uid', 'evn_action_parameters', $hiddenFields = array('pro_uid', 'evn_action_parameters',
'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts' 'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts'
); );
$event = new \BusinessModel\Event(); $event = new \ProcessMaker\BusinessModel\Event();
$response = $event->saveEvents($prj_uid, $request_data, true); $response = $event->saveEvents($prj_uid, $request_data, true);
foreach ($response as $key => $eventData) { foreach ($response as $key => $eventData) {
if (in_array($key, $hiddenFields)) { if (in_array($key, $hiddenFields)) {
@@ -193,7 +193,7 @@ class Event extends Api
'evn_max_attempts' 'evn_max_attempts'
); );
$request_data['evn_uid'] = $evn_uid; $request_data['evn_uid'] = $evn_uid;
$event = new \BusinessModel\Event(); $event = new \ProcessMaker\BusinessModel\Event();
$event->saveEvents($prj_uid, $request_data); $event->saveEvents($prj_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -216,7 +216,7 @@ class Event extends Api
public function doDeleteEvent($prj_uid, $evn_uid) public function doDeleteEvent($prj_uid, $evn_uid)
{ {
try { try {
$event = new \BusinessModel\Event(); $event = new \ProcessMaker\BusinessModel\Event();
$response = $event->deleteEvent($prj_uid, $evn_uid); $response = $event->deleteEvent($prj_uid, $evn_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class FilesManager extends Api
public function doGetProcessFilesManager($prj_uid, $path = '') public function doGetProcessFilesManager($prj_uid, $path = '')
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
if ($path != '') { if ($path != '') {
$arrayData = $filesManager->getProcessFilesManagerPath($prj_uid, $path); $arrayData = $filesManager->getProcessFilesManagerPath($prj_uid, $path);
} else { } else {
@@ -48,7 +48,7 @@ class FilesManager extends Api
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$request_data = (array)($request_data); $request_data = (array)($request_data);
$request_data = array_merge(array('prf_content' => $prf_content ), $request_data); $request_data = array_merge(array('prf_content' => $prf_content ), $request_data);
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$arrayData = $filesManager->addProcessFilesManager($prj_uid, $userUid, $request_data); $arrayData = $filesManager->addProcessFilesManager($prj_uid, $userUid, $request_data);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -68,7 +68,7 @@ class FilesManager extends Api
public function doPostProcessFilesManagerUpload($prj_uid, $prf_uid) public function doPostProcessFilesManagerUpload($prj_uid, $prf_uid)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$sData = $filesManager->uploadProcessFilesManager($prj_uid, $prf_uid); $sData = $filesManager->uploadProcessFilesManager($prj_uid, $prf_uid);
//Response //Response
$response = $sData; $response = $sData;
@@ -90,7 +90,7 @@ class FilesManager extends Api
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$request_data = (array)($request_data); $request_data = (array)($request_data);
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$arrayData = $filesManager->updateProcessFilesManager($prj_uid, $userUid, $request_data, $prf_uid); $arrayData = $filesManager->updateProcessFilesManager($prj_uid, $userUid, $request_data, $prf_uid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -110,7 +110,7 @@ class FilesManager extends Api
public function doDeleteProcessFilesManager($prj_uid, $prf_uid) public function doDeleteProcessFilesManager($prj_uid, $prf_uid)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$filesManager->deleteProcessFilesManager($prj_uid, $prf_uid); $filesManager->deleteProcessFilesManager($prj_uid, $prf_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response
@@ -127,7 +127,7 @@ class FilesManager extends Api
public function doGetProcessFilesManagerDownload($prj_uid, $prf_uid) public function doGetProcessFilesManagerDownload($prj_uid, $prf_uid)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$filesManager->downloadProcessFilesManager($prj_uid, $prf_uid); $filesManager->downloadProcessFilesManager($prj_uid, $prf_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response
@@ -144,7 +144,7 @@ class FilesManager extends Api
public function doDeleteFolderProcessFilesManager($prj_uid, $path) public function doDeleteFolderProcessFilesManager($prj_uid, $path)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$filesManager->deleteFolderProcessFilesManager($prj_uid, $path); $filesManager->deleteFolderProcessFilesManager($prj_uid, $path);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response
@@ -162,7 +162,7 @@ class FilesManager extends Api
public function doGetProcessFileManager($prj_uid, $prf_uid) public function doGetProcessFileManager($prj_uid, $prf_uid)
{ {
try { try {
$filesManager = new \BusinessModel\FilesManager(); $filesManager = new \ProcessMaker\BusinessModel\FilesManager();
$response = $filesManager->getProcessFileManager($prj_uid, $prf_uid); $response = $filesManager->getProcessFileManager($prj_uid, $prf_uid);
//response //response
return $response; return $response;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class InputDocument extends Api
public function doGetInputDocument($inp_doc_uid, $prj_uid) public function doGetInputDocument($inp_doc_uid, $prj_uid)
{ {
try { try {
$inputDocument = new \BusinessModel\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setFormatFieldNameInUppercase(false);
$inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -43,7 +43,7 @@ class InputDocument extends Api
public function doPostInputDocument($prj_uid, $request_data) public function doPostInputDocument($prj_uid, $request_data)
{ {
try { try {
$inputDocument = new \BusinessModel\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setFormatFieldNameInUppercase(false);
$inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -67,7 +67,7 @@ class InputDocument extends Api
public function doPutInputDocument($inp_doc_uid, $prj_uid, $request_data) public function doPutInputDocument($inp_doc_uid, $prj_uid, $request_data)
{ {
try { try {
$inputDocument = new \BusinessModel\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setFormatFieldNameInUppercase(false);
$inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -86,7 +86,7 @@ class InputDocument extends Api
public function doDeleteInputDocument($inp_doc_uid, $prj_uid) public function doDeleteInputDocument($inp_doc_uid, $prj_uid)
{ {
try { try {
$inputDocument = new \BusinessModel\InputDocument(); $inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setFormatFieldNameInUppercase(false);
$inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid"));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class OutputDocuments extends Api
public function doGetProjectOutputDocuments($prjUid) public function doGetProjectOutputDocuments($prjUid)
{ {
try { try {
$outputDocument = new \BusinessModel\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$arrayData = $outputDocument->getOutputDocuments($prjUid); $arrayData = $outputDocument->getOutputDocuments($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -39,7 +39,7 @@ class OutputDocuments extends Api
public function doGetProjectOutputDocument($prjUid, $outputDocumentUid) public function doGetProjectOutputDocument($prjUid, $outputDocumentUid)
{ {
try { try {
$outputDocument = new \BusinessModel\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$objectData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid); $objectData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -62,7 +62,7 @@ class OutputDocuments extends Api
{ {
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$outputDocument = new \BusinessModel\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$arrayData = $outputDocument->addOutputDocument($prjUid, $request_data); $arrayData = $outputDocument->addOutputDocument($prjUid, $request_data);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -85,7 +85,7 @@ class OutputDocuments extends Api
{ {
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$outputDocument = new \BusinessModel\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid, 0); $arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid, 0);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response
@@ -102,7 +102,7 @@ class OutputDocuments extends Api
public function doDeleteProjectOutputDocument($prjUid, $outputDocumentUid) public function doDeleteProjectOutputDocument($prjUid, $outputDocumentUid)
{ {
try { try {
$outputDocument = new \BusinessModel\OutputDocument(); $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid); $outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//Response //Response

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -28,7 +28,7 @@ class ProcessPermissions extends Api
public function doGetProcessPermissions($prj_uid) public function doGetProcessPermissions($prj_uid)
{ {
try { try {
$processPermissions = new \BusinessModel\ProcessPermissions(); $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->getProcessPermissions($prj_uid); $response = $processPermissions->getProcessPermissions($prj_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -51,7 +51,7 @@ class ProcessPermissions extends Api
public function doGetProcessPermission($prj_uid, $ob_uid) public function doGetProcessPermission($prj_uid, $ob_uid)
{ {
try { try {
$processPermissions = new \BusinessModel\ProcessPermissions(); $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->getProcessPermissions($prj_uid, $ob_uid); $response = $processPermissions->getProcessPermissions($prj_uid, $ob_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -104,7 +104,7 @@ class ProcessPermissions extends Api
'object_type', 'object', 'participated', 'action' 'object_type', 'object', 'participated', 'action'
); );
$request_data['pro_uid'] = $prj_uid; $request_data['pro_uid'] = $prj_uid;
$processPermissions = new \BusinessModel\ProcessPermissions(); $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->saveProcessPermission($request_data); $response = $processPermissions->saveProcessPermission($request_data);
foreach ($response as $key => $eventData) { foreach ($response as $key => $eventData) {
if (in_array($key, $hiddenFields)) { if (in_array($key, $hiddenFields)) {
@@ -160,7 +160,7 @@ class ProcessPermissions extends Api
) { ) {
try { try {
$request_data['pro_uid'] = $prj_uid; $request_data['pro_uid'] = $prj_uid;
$processPermissions = new \BusinessModel\ProcessPermissions(); $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->saveProcessPermission($request_data, $ob_uid); $response = $processPermissions->saveProcessPermission($request_data, $ob_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -183,7 +183,7 @@ class ProcessPermissions extends Api
public function doDeleteProcessPermission($prj_uid, $ob_uid) public function doDeleteProcessPermission($prj_uid, $ob_uid)
{ {
try { try {
$processPermissions = new \BusinessModel\ProcessPermissions(); $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->deleteProcessPermission($ob_uid, $prj_uid); $response = $processPermissions->deleteProcessPermission($ob_uid, $prj_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisors($prjUid) public function doGetProcessSupervisors($prjUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getProcessSupervisors($prjUid); $arrayData = $supervisor->getProcessSupervisors($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -39,7 +39,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisor($prjUid, $puUid) public function doGetProcessSupervisor($prjUid, $puUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->getProcessSupervisor($prjUid, $puUid); $objectData = $supervisor->getProcessSupervisor($prjUid, $puUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -59,7 +59,7 @@ class ProcessSupervisors extends Api
public function doGetAvailableSupervisors($prjUid, $obj_type = '') public function doGetAvailableSupervisors($prjUid, $obj_type = '')
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getAvailableProcessSupervisors($obj_type, $prjUid); $arrayData = $supervisor->getAvailableProcessSupervisors($obj_type, $prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -79,7 +79,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisorDynaforms($prjUid) public function doGetProcessSupervisorDynaforms($prjUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getProcessSupervisorDynaforms($prjUid); $arrayData = $supervisor->getProcessSupervisorDynaforms($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -99,7 +99,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisorDynaform($prjUid, $pudUid) public function doGetProcessSupervisorDynaform($prjUid, $pudUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->getProcessSupervisorDynaform($prjUid, $pudUid); $objectData = $supervisor->getProcessSupervisorDynaform($prjUid, $pudUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -118,7 +118,7 @@ class ProcessSupervisors extends Api
public function doGetAvailableProcessSupervisorDynaform($prjUid) public function doGetAvailableProcessSupervisorDynaform($prjUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getAvailableProcessSupervisorDynaform($prjUid); $arrayData = $supervisor->getAvailableProcessSupervisorDynaform($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -137,7 +137,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisorInputDocuments($prjUid) public function doGetProcessSupervisorInputDocuments($prjUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getProcessSupervisorInputDocuments($prjUid); $arrayData = $supervisor->getProcessSupervisorInputDocuments($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -157,7 +157,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisorInputDocument($prjUid, $puiUid) public function doGetProcessSupervisorInputDocument($prjUid, $puiUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->getProcessSupervisorInputDocument($prjUid, $puiUid); $objectData = $supervisor->getProcessSupervisorInputDocument($prjUid, $puiUid);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -176,7 +176,7 @@ class ProcessSupervisors extends Api
public function doGetAvailableProcessSupervisorInputDocument($prjUid) public function doGetAvailableProcessSupervisorInputDocument($prjUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->getAvailableProcessSupervisorInputDocument($prjUid); $arrayData = $supervisor->getAvailableProcessSupervisorInputDocument($prjUid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -199,7 +199,7 @@ class ProcessSupervisors extends Api
public function doPostProcessSupervisor($prjUid, $usr_uid, $pu_type) public function doPostProcessSupervisor($prjUid, $usr_uid, $pu_type)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->addProcessSupervisor($prjUid, $usr_uid, $pu_type); $objectData = $supervisor->addProcessSupervisor($prjUid, $usr_uid, $pu_type);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -222,7 +222,7 @@ class ProcessSupervisors extends Api
public function doPostProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position=null) public function doPostProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position=null)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->addProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position); $objectData = $supervisor->addProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -245,7 +245,7 @@ class ProcessSupervisors extends Api
public function doPostProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position=null) public function doPostProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position=null)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->addProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position); $objectData = $supervisor->addProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -266,7 +266,7 @@ class ProcessSupervisors extends Api
public function doDeleteSupervisor($prjUid, $puUid) public function doDeleteSupervisor($prjUid, $puUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$supervisor->removeProcessSupervisor($prjUid, $puUid); $supervisor->removeProcessSupervisor($prjUid, $puUid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response
@@ -284,7 +284,7 @@ class ProcessSupervisors extends Api
public function doDeleteDynaformSupervisor($prjUid, $pudUid) public function doDeleteDynaformSupervisor($prjUid, $pudUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$supervisor->removeDynaformSupervisor($prjUid, $pudUid); $supervisor->removeDynaformSupervisor($prjUid, $pudUid);
ob_end_clean(); ob_end_clean();
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -303,7 +303,7 @@ class ProcessSupervisors extends Api
public function doDeleteInputDocumentSupervisor($prjUid, $puiUid) public function doDeleteInputDocumentSupervisor($prjUid, $puiUid)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$supervisor->removeInputDocumentSupervisor($prjUid, $puiUid); $supervisor->removeInputDocumentSupervisor($prjUid, $puiUid);
ob_end_clean(); ob_end_clean();
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -324,7 +324,7 @@ class ProcessSupervisors extends Api
public function doPutProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position = null) public function doPutProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position = null)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->updateProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position); $objectData = $supervisor->updateProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position);
//Response //Response
$response = $objectData; $response = $objectData;
@@ -347,7 +347,7 @@ class ProcessSupervisors extends Api
public function doPutProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position = null) public function doPutProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position = null)
{ {
try { try {
$supervisor = new \BusinessModel\ProcessSupervisor(); $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$objectData = $supervisor->updateProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position); $objectData = $supervisor->updateProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position);
//Response //Response
$response = $objectData; $response = $objectData;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class ProjectUsers extends Api
public function doGetProjectUsers($prj_uid) public function doGetProjectUsers($prj_uid)
{ {
try { try {
$users = new \BusinessModel\ProjectUser(); $users = new \ProcessMaker\BusinessModel\ProjectUser();
$arrayData = $users->getProjectUsers($prj_uid); $arrayData = $users->getProjectUsers($prj_uid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -38,7 +38,7 @@ class ProjectUsers extends Api
public function doGetProjectStartingTasks($prj_uid) public function doGetProjectStartingTasks($prj_uid)
{ {
try { try {
$startingTasks = new \BusinessModel\ProjectUser(); $startingTasks = new \ProcessMaker\BusinessModel\ProjectUser();
$arrayData = $startingTasks->getProjectStartingTasks($prj_uid); $arrayData = $startingTasks->getProjectStartingTasks($prj_uid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -58,7 +58,7 @@ class ProjectUsers extends Api
public function doGetProjectStartingTaskUsers($prj_uid, $usr_uid) public function doGetProjectStartingTaskUsers($prj_uid, $usr_uid)
{ {
try { try {
$startingTasks = new \BusinessModel\ProjectUser(); $startingTasks = new \ProcessMaker\BusinessModel\ProjectUser();
$arrayData = $startingTasks->getProjectStartingTaskUsers($prj_uid, $usr_uid); $arrayData = $startingTasks->getProjectStartingTaskUsers($prj_uid, $usr_uid);
//Response //Response
$response = $arrayData; $response = $arrayData;
@@ -80,7 +80,7 @@ class ProjectUsers extends Api
{ {
try { try {
$request_data = (array)($request_data); $request_data = (array)($request_data);
$user = new \BusinessModel\ProjectUser(); $user = new \ProcessMaker\BusinessModel\ProjectUser();
$objectData = $user->postProjectWsUserCanStartTask($prj_uid, $act_uid, $request_data); $objectData = $user->postProjectWsUserCanStartTask($prj_uid, $act_uid, $request_data);
//Response //Response
$response = $objectData; $response = $objectData;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class ReportTable extends Api
public function doGetReportTables($prj_uid) public function doGetReportTables($prj_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->getTables($prj_uid, true); $response = $oReportTable->getTables($prj_uid, true);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -46,7 +46,7 @@ class ReportTable extends Api
public function doGetReportTable($prj_uid, $rep_uid) public function doGetReportTable($prj_uid, $rep_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->getTable($rep_uid, $prj_uid, true); $response = $oReportTable->getTable($rep_uid, $prj_uid, true);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -66,7 +66,7 @@ class ReportTable extends Api
public function doGetPopulateReportTable($prj_uid, $rep_uid) public function doGetPopulateReportTable($prj_uid, $rep_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->generateDataReport($prj_uid, $rep_uid); $response = $oReportTable->generateDataReport($prj_uid, $rep_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -86,7 +86,7 @@ class ReportTable extends Api
public function doGetReportTableData($prj_uid, $rep_uid) public function doGetReportTableData($prj_uid, $rep_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->getTableData($rep_uid, $prj_uid, true); $response = $oReportTable->getTableData($rep_uid, $prj_uid, true);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -121,7 +121,7 @@ class ReportTable extends Api
$rep_tab_grid = '' $rep_tab_grid = ''
) { ) {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->saveTable($request_data, $prj_uid, true); $response = $oReportTable->saveTable($request_data, $prj_uid, true);
if (isset($response['pro_uid'])) { if (isset($response['pro_uid'])) {
unset($response['pro_uid']); unset($response['pro_uid']);
@@ -153,7 +153,7 @@ class ReportTable extends Api
) { ) {
try { try {
$request_data['rep_uid'] = $rep_uid; $request_data['rep_uid'] = $rep_uid;
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->updateTable($request_data, $prj_uid, true); $response = $oReportTable->updateTable($request_data, $prj_uid, true);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -173,7 +173,7 @@ class ReportTable extends Api
public function doDeleteReportTable($prj_uid, $rep_uid) public function doDeleteReportTable($prj_uid, $rep_uid)
{ {
try { try {
$oReportTable = new \BusinessModel\Table(); $oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->deleteTable($rep_uid, $prj_uid, true); $response = $oReportTable->deleteTable($rep_uid, $prj_uid, true);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -29,7 +29,7 @@ class Subprocess extends Api
{ {
try { try {
$hiddenFields = array('spr_uid', 'spr_pro_parent', 'spr_tas_parent'); $hiddenFields = array('spr_uid', 'spr_pro_parent', 'spr_tas_parent');
$oSubProcess = new \BusinessModel\Subprocess(); $oSubProcess = new \ProcessMaker\BusinessModel\Subprocess();
$response = $oSubProcess->getSubprocesss($prj_uid, $tas_uid); $response = $oSubProcess->getSubprocesss($prj_uid, $tas_uid);
foreach ($response as $key => $value) { foreach ($response as $key => $value) {
if (in_array($key, $hiddenFields)) { if (in_array($key, $hiddenFields)) {
@@ -57,7 +57,7 @@ class Subprocess extends Api
public function doPutSubprocess($prj_uid, $tas_uid, $request_data) public function doPutSubprocess($prj_uid, $tas_uid, $request_data)
{ {
try { try {
$oSubProcess = new \BusinessModel\Subprocess(); $oSubProcess = new \ProcessMaker\BusinessModel\Subprocess();
$oSubProcess->putSubprocesss($prj_uid, $tas_uid, $request_data); $oSubProcess->putSubprocesss($prj_uid, $tas_uid, $request_data);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class Trigger extends Api
public function doGetTriggers($projectUid) public function doGetTriggers($projectUid)
{ {
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$response = $trigger->getTriggers($projectUid); $response = $trigger->getTriggers($projectUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -46,7 +46,7 @@ class Trigger extends Api
public function doGetTrigger($projectUid, $triggerUid) public function doGetTrigger($projectUid, $triggerUid)
{ {
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$response = $trigger->getDataTrigger($triggerUid); $response = $trigger->getDataTrigger($triggerUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -73,7 +73,7 @@ class Trigger extends Api
public function doPostTrigger($projectUid, $request_data, $tri_title, $tri_description = '', $tri_type = 'SCRIPT', $tri_webbot = '', $tri_param = '') public function doPostTrigger($projectUid, $request_data, $tri_title, $tri_description = '', $tri_type = 'SCRIPT', $tri_webbot = '', $tri_param = '')
{ {
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$response = $trigger->saveTrigger($projectUid, $request_data, true); $response = $trigger->saveTrigger($projectUid, $request_data, true);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -101,7 +101,7 @@ class Trigger extends Api
{ {
try { try {
$request_data['tri_uid'] = $triggerUid; $request_data['tri_uid'] = $triggerUid;
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$trigger->saveTrigger($projectUid, $request_data, false, $triggerUid); $trigger->saveTrigger($projectUid, $request_data, false, $triggerUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -121,7 +121,7 @@ class Trigger extends Api
public function doDeleteTrigger($projectUid, $triggerUid) public function doDeleteTrigger($projectUid, $triggerUid)
{ {
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \ProcessMaker\BusinessModel\Trigger();
$response = $trigger->deleteTrigger($triggerUid); $response = $trigger->deleteTrigger($triggerUid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -30,7 +30,7 @@ class TriggerWizard extends Api
public function doGetTriggerWizard($prj_uid, $lib_name, $fn_name = "") public function doGetTriggerWizard($prj_uid, $lib_name, $fn_name = "")
{ {
try { try {
$triggerWizard = new \BusinessModel\TriggerWizard(); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -53,7 +53,7 @@ class TriggerWizard extends Api
public function doGetTriggerWizardTrigger($prj_uid, $lib_name, $fn_name, $tri_uid) public function doGetTriggerWizardTrigger($prj_uid, $lib_name, $fn_name, $tri_uid)
{ {
try { try {
$triggerWizard = new \BusinessModel\TriggerWizard(); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -78,7 +78,7 @@ class TriggerWizard extends Api
public function doPostTriggerWizard($prj_uid, $lib_name, $fn_name, $request_data) public function doPostTriggerWizard($prj_uid, $lib_name, $fn_name, $request_data)
{ {
try { try {
$triggerWizard = new \BusinessModel\TriggerWizard(); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);
@@ -104,7 +104,7 @@ class TriggerWizard extends Api
public function doPutTriggerWizard($prj_uid, $lib_name, $fn_name, $tri_uid, $request_data) public function doPutTriggerWizard($prj_uid, $lib_name, $fn_name, $tri_uid, $request_data)
{ {
try { try {
$triggerWizard = new \BusinessModel\TriggerWizard(); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException);

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker\Project; namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -21,7 +21,7 @@ class WebEntry extends Api
public function doGetWebEntry($dyn_uid, $tas_uid, $prj_uid) public function doGetWebEntry($dyn_uid, $tas_uid, $prj_uid)
{ {
try { try {
$webEntry = new \BusinessModel\WebEntry(); $webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->setFormatFieldNameInUppercase(false); $webEntry->setFormatFieldNameInUppercase(false);
$webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -44,7 +44,7 @@ class WebEntry extends Api
public function doPostWebEntry($prj_uid, $request_data) public function doPostWebEntry($prj_uid, $request_data)
{ {
try { try {
$webEntry = new \BusinessModel\WebEntry(); $webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->setFormatFieldNameInUppercase(false); $webEntry->setFormatFieldNameInUppercase(false);
$webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid"));
@@ -68,7 +68,7 @@ class WebEntry extends Api
public function doDeleteWebEntry($dyn_uid, $tas_uid, $prj_uid) public function doDeleteWebEntry($dyn_uid, $tas_uid, $prj_uid)
{ {
try { try {
$webEntry = new \BusinessModel\WebEntry(); $webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->setFormatFieldNameInUppercase(false); $webEntry->setFormatFieldNameInUppercase(false);
$webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid"));

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class System extends Api
public function doGetDataBaseEngines() public function doGetDataBaseEngines()
{ {
try { try {
$oDBConnection = new \BusinessModel\DataBaseConnection(); $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->getDbEngines(); $response = $oDBConnection->getDbEngines();
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
class Type class Type
{ {

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\ProcessMaker; namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api; use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException; use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class User extends Api
public function doGetUsers($filter = '', $start = null, $limit = null) public function doGetUsers($filter = '', $start = null, $limit = null)
{ {
try { try {
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$response = $user->getUsers($filter, $start, $limit); $response = $user->getUsers($filter, $start, $limit);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -36,7 +36,7 @@ class User extends Api
public function doGetUser($usr_uid) public function doGetUser($usr_uid)
{ {
try { try {
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$response = $user->getUser($usr_uid); $response = $user->getUser($usr_uid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -54,7 +54,7 @@ class User extends Api
public function doPostUser($request_data) public function doPostUser($request_data)
{ {
try { try {
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$arrayData = $user->create($request_data); $arrayData = $user->create($request_data);
$response = $arrayData; $response = $arrayData;
return $response; return $response;
@@ -73,7 +73,7 @@ class User extends Api
{ {
try { try {
$userLoggedUid = $this->getUserId(); $userLoggedUid = $this->getUserId();
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$arrayData = $user->update($usr_uid, $request_data, $userLoggedUid); $arrayData = $user->update($usr_uid, $request_data, $userLoggedUid);
$response = $arrayData; $response = $arrayData;
return $response; return $response;
@@ -90,7 +90,7 @@ class User extends Api
public function doDeleteUser($usr_uid) public function doDeleteUser($usr_uid)
{ {
try { try {
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$user->delete($usr_uid); $user->delete($usr_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -105,7 +105,7 @@ class User extends Api
public function doPostUserImageUpload($usr_uid) public function doPostUserImageUpload($usr_uid)
{ {
try { try {
$user = new \BusinessModel\User(); $user = new \ProcessMaker\BusinessModel\User();
$user->uploadImage($usr_uid); $user->uploadImage($usr_uid);
} catch (\Exception $e) { } catch (\Exception $e) {
//response //response

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace Services\Api\OAuth2; namespace ProcessMaker\Services\OAuth2;
/** /**
* Simple PmPDO storage for all storage types * Simple PmPDO storage for all storage types

View File

@@ -1,5 +1,5 @@
<?php <?php
namespace Services\Api\OAuth2; namespace ProcessMaker\Services\OAuth2;
use Luracast\Restler\iAuthenticate; use Luracast\Restler\iAuthenticate;

View File

@@ -0,0 +1,74 @@
;
; API Rest Configuration File
;
debug = 1
[api]
version = 1.0
vendor = "ProcessMaker - Michelangelo (Enterprise)"
[alias: test]
test2 = "ProcessMaker\Services\Api\Test2"
test3 = "ProcessMaker\Services\Api\Test3"
[alias: project]
activity = "ProcessMaker\Services\Api\Project\Activity"
step = "ProcessMaker\Services\Api\Project\Activity\Step"
assignee = "ProcessMaker\Services\Api\Project\Activity\Assignee"
trigger = "ProcessMaker\Services\Api\Project\Activity\Step\Trigger"
project = "ProcessMaker\Services\Api\Project"
trigger2 = "ProcessMaker\Services\Api\Project\Trigger"
event = "ProcessMaker\Services\Api\Project\Event"
dynaform = "ProcessMaker\Services\Api\Project\DynaForm"
input-document = "ProcessMaker\Services\Api\Project\InputDocument"
output-documents = "ProcessMaker\Services\Api\Project\OutputDocuments"
supervisors = "ProcessMaker\Services\Api\Project\ProcessSupervisors"
process-permissions = "ProcessMaker\Services\Api\Project\ProcessPermissions"
case-scheduler = "ProcessMaker\Services\Api\Project\CaseScheduler"
case-tracker = "ProcessMaker\Services\Api\Project\CaseTracker"
case-tracker-object = "ProcessMaker\Services\Api\Project\CaseTrackerObject"
project-users = "ProcessMaker\Services\Api\Project\ProjectUsers"
web-entry = "ProcessMaker\Services\Api\Project\WebEntry"
data-base-connections = "ProcessMaker\Services\Api\Project\DataBaseConnection"
files-manager = "ProcessMaker\Services\Api\Project\FilesManager"
report-Table = "ProcessMaker\Services\Api\Project\ReportTable"
sub-process= "ProcessMaker\Services\Api\Project\SubProcess"
trigger-wizard = "ProcessMaker\Services\Api\Project\TriggerWizard"
category = "ProcessMaker\Services\Api\ProcessCategory"
[alias: projects]
project = "ProcessMaker\Services\Api\Project"
[alias: group]
group = "ProcessMaker\Services\Api\Group"
user = "ProcessMaker\Services\Api\Group\User"
[alias: groups]
group = "ProcessMaker\Services\Api\Group"
[alias: user]
user = "ProcessMaker\Services\Api\User"
[alias: users]
user = "ProcessMaker\Services\Api\User"
[alias: calendar]
calendar = "ProcessMaker\Services\Api\Calendar"
[alias: calendars]
calendar = "ProcessMaker\Services\Api\Calendar"
[alias: case]
case = "ProcessMaker\Services\Api\Case"
[alias: cases]
case = "ProcessMaker\Services\Api\Case"
input-document = "ProcessMaker\Services\Api\Cases\InputDocument"
output-document = "ProcessMaker\Services\Api\Cases\OutputDocument"
[alias: category]
category = "ProcessMaker\Services\Api\ProcessCategory"
[alias: categories]
category = "ProcessMaker\Services\Api\ProcessCategory"

View File

@@ -1,33 +0,0 @@
<?php
namespace Services\Api\ProcessMaker;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
*
* @protected
*/
class ProcessCategory extends Api
{
private $formatFieldNameInUppercase = false;
/**
* @url GET /categories
*/
public function doGetCategories($filter = null, $start = null, $limit = null)
{
try {
$processCategory = new \BusinessModel\ProcessCategory();
$processCategory->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $processCategory->getCategories(array("filter" => $filter), null, null, $start, $limit);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}

View File

@@ -1,68 +0,0 @@
;
; API Rest Configuration File
;
debug = 1
[api]
version = 1.0
vendor = "ProcessMaker - Michelangelo (Enterprise)"
[alias: test]
test2 = "Services\Api\ProcessMaker\Test2"
test3 = "Services\Api\ProcessMaker\Test3"
[alias: project]
activity = "Services\Api\ProcessMaker\Project\Activity"
step = "Services\Api\ProcessMaker\Project\Activity\Step"
assignee = "Services\Api\ProcessMaker\Project\Activity\Assignee"
trigger = "Services\Api\ProcessMaker\Project\Activity\Step\Trigger"
project = "Services\Api\ProcessMaker\Project"
trigger2 = "Services\Api\ProcessMaker\Project\Trigger"
event = "Services\Api\ProcessMaker\Project\Event"
dynaform = "Services\Api\ProcessMaker\Project\DynaForm"
input-document = "Services\Api\ProcessMaker\Project\InputDocument"
output-documents = "Services\Api\ProcessMaker\Project\OutputDocuments"
supervisors = "Services\Api\ProcessMaker\Project\ProcessSupervisors"
process-permissions = "Services\Api\ProcessMaker\Project\ProcessPermissions"
case-scheduler = "Services\Api\ProcessMaker\Project\CaseScheduler"
case-tracker = "Services\Api\ProcessMaker\Project\CaseTracker"
case-tracker-object = "Services\Api\ProcessMaker\Project\CaseTrackerObject"
project-users = "Services\Api\ProcessMaker\Project\ProjectUsers"
web-entry = "Services\Api\ProcessMaker\Project\WebEntry"
data-base-connections = "Services\Api\ProcessMaker\Project\DataBaseConnection"
files-manager = "Services\Api\ProcessMaker\Project\FilesManager"
report-Table = "Services\Api\ProcessMaker\Project\ReportTable"
sub-process= "Services\Api\ProcessMaker\Project\SubProcess"
trigger-wizard = "Services\Api\ProcessMaker\Project\TriggerWizard"
category = "Services\Api\ProcessMaker\ProcessCategory"
[alias: projects]
project = "Services\Api\ProcessMaker\Project"
[alias: group]
group = "Services\Api\ProcessMaker\Group"
user = "Services\Api\ProcessMaker\Group\User"
[alias: groups]
group = "Services\Api\ProcessMaker\Group"
[alias: user]
user = "Services\Api\ProcessMaker\User"
[alias: users]
user = "Services\Api\ProcessMaker\User"
[alias: calendar]
calendar = "Services\Api\ProcessMaker\Calendar"
[alias: calendars]
calendar = "Services\Api\ProcessMaker\Calendar"
[alias: case]
case = "Services\Api\ProcessMaker\Case"
[alias: cases]
case = "Services\Api\ProcessMaker\Case"
input-document = "Services\Api\ProcessMaker\Cases\InputDocument"
output-document = "Services\Api\ProcessMaker\Cases\OutputDocument"

View File

@@ -14,7 +14,7 @@ class CalendarTest extends \PHPUnit_Framework_TestCase
{ {
public function testGetCalendars() public function testGetCalendars()
{ {
$calendar = new \BusinessModel\Calendar(); $calendar = new \ProcessMaker\BusinessModel\Calendar();
$arrayCalendar = $calendar->getCalendars(); $arrayCalendar = $calendar->getCalendars();

View File

@@ -45,7 +45,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
$idCaseDraft = PMFNewCase($proUid, $usrUid, $tasUid, array()); $idCaseDraft = PMFNewCase($proUid, $usrUid, $tasUid, array());
$this->idCaseDraft = $idCaseDraft; $this->idCaseDraft = $idCaseDraft;
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001')); $listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
$this->nowCountTodo = $listToDo['total']; $this->nowCountTodo = $listToDo['total'];
@@ -59,7 +59,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
* *
@@ -74,7 +74,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
* *
@@ -89,7 +89,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
* *
@@ -104,7 +104,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
* *
@@ -119,7 +119,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in third field the function * Test error for type in third field the function
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
* *
@@ -134,7 +134,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test for cancel case * Test for cancel case
* *
* @covers \BusinessModel\Cases::putCancelCase * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -142,7 +142,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
public function testPutCancelCase() public function testPutCancelCase()
{ {
$this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001'); $this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001');
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
$listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft')); $listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
$this->assertNotEquals($this->nowCountDraft, $listDraft['total']); $this->assertNotEquals($this->nowCountDraft, $listDraft['total']);
} }
@@ -150,7 +150,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
* *
@@ -165,7 +165,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
* *
@@ -180,7 +180,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
* *
@@ -195,7 +195,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
* *
@@ -210,7 +210,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in third field the function * Test error for type in third field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
* *
@@ -225,7 +225,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in fourth field the function * Test error for type in fourth field the function
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'.
* *
@@ -240,7 +240,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test for cancel case * Test for cancel case
* *
* @covers \BusinessModel\Cases::putPauseCase * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -248,7 +248,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
public function testPutPauseCase() public function testPutPauseCase()
{ {
$this->oCases->putPauseCase($this->idCaseToDo, '00000000000000000000000000000001'); $this->oCases->putPauseCase($this->idCaseToDo, '00000000000000000000000000000001');
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused')); $listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
$this->assertNotEquals($this->nowCountPaused, $listPaused['total']); $this->assertNotEquals($this->nowCountPaused, $listPaused['total']);
} }
@@ -256,7 +256,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
* *
@@ -271,7 +271,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
* *
@@ -286,7 +286,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
* *
@@ -301,7 +301,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
* *
@@ -316,7 +316,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in third field the function * Test error for type in third field the function
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
* *
@@ -331,7 +331,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test for cancel case * Test for cancel case
* *
* @covers \BusinessModel\Cases::putUnpauseCase * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -339,7 +339,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
public function testPutUnpauseCase() public function testPutUnpauseCase()
{ {
$this->oCases->putUnpauseCase($this->idCaseToDo, '00000000000000000000000000000001'); $this->oCases->putUnpauseCase($this->idCaseToDo, '00000000000000000000000000000001');
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused')); $listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
$this->assertEquals($this->nowCountPaused, $listPaused['total']); $this->assertEquals($this->nowCountPaused, $listPaused['total']);
} }
@@ -347,7 +347,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::deleteCase * @covers \ProcessMaker\BusinessModel\Cases::deleteCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
* *
@@ -362,7 +362,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::deleteCase * @covers \ProcessMaker\BusinessModel\Cases::deleteCase
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
* *
@@ -377,7 +377,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
/** /**
* Test for cancel case * Test for cancel case
* *
* @covers \BusinessModel\Cases::deleteCase * @covers \ProcessMaker\BusinessModel\Cases::deleteCase
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -385,7 +385,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
public function testDeleteCase() public function testDeleteCase()
{ {
$this->oCases->deleteCase($this->idCaseToDo); $this->oCases->deleteCase($this->idCaseToDo);
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001')); $listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
$this->assertNotEquals($this->nowCountTodo, $listToDo['total']); $this->assertNotEquals($this->nowCountTodo, $listToDo['total']);
} }

View File

@@ -28,14 +28,14 @@ class CasesTest extends \PHPUnit_Framework_TestCase
*/ */
public function setUp() public function setUp()
{ {
$this->oCases = new \BusinessModel\Cases(); $this->oCases = new \ProcessMaker\BusinessModel\Cases();
return true; return true;
} }
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$dataList' it must be an array. * @expectedExceptionMessage Invalid value for '$dataList' it must be an array.
* *
@@ -50,7 +50,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for empty userId in array * Test error for empty userId in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with userId: '' does not exist. * @expectedExceptionMessage The user with userId: '' does not exist.
* *
@@ -65,7 +65,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for not exists userId in array * Test error for not exists userId in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with userId: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The user with userId: 'IdDoesNotExists' does not exist.
* *
@@ -80,7 +80,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $action in array * Test error for incorrect value $action in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The value for $action is incorrect. * @expectedExceptionMessage The value for $action is incorrect.
* *
@@ -95,7 +95,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $process in array * Test error for incorrect value $process in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The process with $pro_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The process with $pro_uid: 'IdDoesNotExists' does not exist.
* *
@@ -113,7 +113,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $process in array * Test error for incorrect value $process in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The category with $cat_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The category with $cat_uid: 'IdDoesNotExists' does not exist.
* *
@@ -131,7 +131,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $process in array * Test error for incorrect value $process in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
* *
@@ -149,7 +149,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $process in array * Test error for incorrect value $process in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'.
* *
@@ -167,7 +167,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for incorrect value $process in array * Test error for incorrect value $process in array
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'.
* *
@@ -185,7 +185,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list to do not paged * Test get list to do not paged
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -208,7 +208,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list to do * Test get list to do
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -231,7 +231,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list draft not paged * Test get list draft not paged
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -254,7 +254,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list draft * Test get list draft
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -277,7 +277,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list participated not paged * Test get list participated not paged
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -300,7 +300,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list participated * Test get list participated
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -323,7 +323,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list unassigned not paged * Test get list unassigned not paged
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -346,7 +346,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list unassigned * Test get list unassigned
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -369,7 +369,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list search not paged * Test get list search not paged
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -396,7 +396,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get list search * Test get list search
* *
* @covers \BusinessModel\Cases::getList * @covers \ProcessMaker\BusinessModel\Cases::getList
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -423,7 +423,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test add Case * Test add Case
* *
* @covers \BusinessModel\Cases::addCase * @covers \ProcessMaker\BusinessModel\Cases::addCase
* *
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
*/ */
@@ -438,7 +438,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get Task Case * Test get Task Case
* *
* @covers \BusinessModel\Cases::getTaskCase * @covers \ProcessMaker\BusinessModel\Cases::getTaskCase
* @depends testAddCase * @depends testAddCase
* @param array $aResponse * @param array $aResponse
* *
@@ -453,7 +453,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get Case Info * Test get Case Info
* *
* @covers \BusinessModel\Cases::getCaseInfo * @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
* @depends testAddCase * @depends testAddCase
* @param array $aResponse * @param array $aResponse
* *
@@ -468,7 +468,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test put reassign case * Test put reassign case
* *
* @covers \BusinessModel\Cases::getCaseInfo * @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
* @depends testAddCase * @depends testAddCase
* @param array $aResponse * @param array $aResponse
* *
@@ -483,7 +483,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test add Case to test route case * Test add Case to test route case
* *
* @covers \BusinessModel\Cases::addCase * @covers \ProcessMaker\BusinessModel\Cases::addCase
* *
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
*/ */
@@ -498,7 +498,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test put route case * Test put route case
* *
* @covers \BusinessModel\Cases::updateRouteCase * @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase
* @depends testAddCaseRouteCase * @depends testAddCaseRouteCase
* @param array $aResponseRouteCase * @param array $aResponseRouteCase
* *
@@ -513,7 +513,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test add Case impersonate * Test add Case impersonate
* *
* @covers \BusinessModel\Cases::addCaseImpersonate * @covers \ProcessMaker\BusinessModel\Cases::addCaseImpersonate
* *
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
*/ */

View File

@@ -28,14 +28,14 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
*/ */
public function setUp() public function setUp()
{ {
$this->oDepartment = new \BusinessModel\Department(); $this->oDepartment = new \ProcessMaker\BusinessModel\Department();
return true; return true;
} }
/** /**
* Test error for type in first field the function * Test error for type in first field the function
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$dep_data' it must be an array. * @expectedExceptionMessage Invalid value for '$dep_data' it must be an array.
* *
@@ -50,7 +50,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for type in second field the function * Test error for type in second field the function
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Invalid value for '$create' it must be a boolean. * @expectedExceptionMessage Invalid value for '$create' it must be a boolean.
* *
@@ -65,7 +65,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for empty array in first field the function * Test error for empty array in first field the function
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The field '$dep_data' is empty. * @expectedExceptionMessage The field '$dep_data' is empty.
* *
@@ -80,7 +80,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for create department with nonexistent dep_parent * Test error for create department with nonexistent dep_parent
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The departament with dep_parent: 'testUidDepartment' does not exist. * @expectedExceptionMessage The departament with dep_parent: 'testUidDepartment' does not exist.
* *
@@ -96,7 +96,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for create department with nonexistent dep_manager * Test error for create department with nonexistent dep_manager
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The user with dep_manager: 'testUidUser' does not exist. * @expectedExceptionMessage The user with dep_manager: 'testUidUser' does not exist.
* *
@@ -112,7 +112,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for create department with incorrect dep_status * Test error for create department with incorrect dep_status
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The departament with dep_status: 'SUPER ACTIVO' is incorrect. * @expectedExceptionMessage The departament with dep_status: 'SUPER ACTIVO' is incorrect.
* *
@@ -128,7 +128,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for create department untitled * Test error for create department untitled
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The field dep_title is required. * @expectedExceptionMessage The field dep_title is required.
* *
@@ -144,7 +144,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Save department parent * Save department parent
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @return array * @return array
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
@@ -169,7 +169,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* *
* @depends testCreateDepartmentParent * @depends testCreateDepartmentParent
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
* *
@@ -185,7 +185,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
/** /**
* Test error for create department untitled * Test error for create department untitled
* *
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The departament with dep_uid: 'testUidDepartment' does not exist. * @expectedExceptionMessage The departament with dep_uid: 'testUidDepartment' does not exist.
* *
@@ -203,7 +203,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* *
* @depends testCreateDepartmentParent * @depends testCreateDepartmentParent
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @return array * @return array
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
@@ -235,7 +235,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* @depends testCreateDepartmentChild * @depends testCreateDepartmentChild
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @param array $child_data, Data for child department * @param array $child_data, Data for child department
* @covers \BusinessModel\Department::saveDepartment * @covers \ProcessMaker\BusinessModel\Department::saveDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
* @return array * @return array
@@ -259,7 +259,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* @depends testCreateDepartmentChild * @depends testCreateDepartmentChild
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @param array $child_data, Data for child department * @param array $child_data, Data for child department
* @covers \BusinessModel\Department::getDepartments * @covers \ProcessMaker\BusinessModel\Department::getDepartments
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -290,7 +290,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* *
* @depends testCreateDepartmentParent * @depends testCreateDepartmentParent
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @covers \BusinessModel\Department::getDepartment * @covers \ProcessMaker\BusinessModel\Department::getDepartment
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
@@ -319,7 +319,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* @depends testCreateDepartmentChild * @depends testCreateDepartmentChild
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @param array $child_data, Data for child department * @param array $child_data, Data for child department
* @covers \BusinessModel\Department::deleteDepartment * @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
* @expectedException Exception * @expectedException Exception
* @expectedExceptionMessage Can not delete the department, it has a children department. * @expectedExceptionMessage Can not delete the department, it has a children department.
* *
@@ -338,7 +338,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase
* @depends testCreateDepartmentChild * @depends testCreateDepartmentChild
* @param array $dep_data, Data for parent department * @param array $dep_data, Data for parent department
* @param array $child_data, Data for child department * @param array $child_data, Data for child department
* @covers \BusinessModel\Department::deleteDepartment * @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com> * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia

View File

@@ -27,7 +27,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
*/ */
public function setUp() public function setUp()
{ {
$this->oInputDocument = new \BusinessModel\Cases\InputDocument(); $this->oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
} }
/** /**
@@ -57,7 +57,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get InputDocuments * Test get InputDocuments
* *
* @covers \BusinessModel\Cases\InputDocument::getCasesInputDocuments * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments
* @depends testAddInputDocument * @depends testAddInputDocument
* @param array $aResponse * @param array $aResponse
* *
@@ -72,7 +72,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get InputDocument * Test get InputDocument
* *
* @covers \BusinessModel\Cases\InputDocument::getCasesInputDocument * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
* @depends testAddInputDocument * @depends testAddInputDocument
* @param array $aResponse * @param array $aResponse
* *
@@ -87,7 +87,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test remove InputDocument * Test remove InputDocument
* *
* @covers \BusinessModel\Cases\InputDocument::removeInputDocument * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument
* @depends testAddInputDocument * @depends testAddInputDocument
* @param array $aResponse * @param array $aResponse
* *

View File

@@ -27,13 +27,13 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
*/ */
public function setUp() public function setUp()
{ {
$this->oOutputDocument = new \BusinessModel\Cases\OutputDocument(); $this->oOutputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
} }
/** /**
* Test add OutputDocument * Test add OutputDocument
* *
* @covers \BusinessModel\Cases\OutputDocument::addCasesOutputDocument * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::addCasesOutputDocument
* *
* @copyright Colosa - Bolivia * @copyright Colosa - Bolivia
*/ */
@@ -56,7 +56,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get OutputDocuments * Test get OutputDocuments
* *
* @covers \BusinessModel\Cases\OutputDocument::getCasesOutputDocuments * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments
* @depends testAddCasesOutputDocument * @depends testAddCasesOutputDocument
* @param array $aResponse * @param array $aResponse
* *
@@ -71,7 +71,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test get OutputDocument * Test get OutputDocument
* *
* @covers \BusinessModel\Cases\OutputDocument::getCasesOutputDocument * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
* @depends testAddCasesOutputDocument * @depends testAddCasesOutputDocument
* @param array $aResponse * @param array $aResponse
* *
@@ -86,7 +86,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
/** /**
* Test remove OutputDocument * Test remove OutputDocument
* *
* @covers \BusinessModel\Cases\OutputDocument::removeOutputDocument * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument
* @depends testAddCasesOutputDocument * @depends testAddCasesOutputDocument
* @param array $aResponse * @param array $aResponse
* *

View File

@@ -48,7 +48,7 @@ class ProcessCategoryTest extends \PHPUnit_Framework_TestCase
public function testGetCategories() public function testGetCategories()
{ {
$processCategory = new \BusinessModel\ProcessCategory(); $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$arrayProcessCategory = $processCategory->getCategories(); $arrayProcessCategory = $processCategory->getCategories();

View File

@@ -1,23 +0,0 @@
<?php
$accesstoken = "e79057f4276661bedb6154eed3834f6cbd738853";
$headr = array();
$inp_doc_uid = '68671480353319e5e1dee74089764900';
$tas_uid = '19582733053319e304cfa76025663570';
$app_doc_comment = 'desde script php';
$headr[] = 'Authorization: Bearer '.$accesstoken;
$file = "/home/wendy/uploadfiles/test1.html";
$url = "http://wendy.pmos.colosa.net/api/1.0/wendy/cases/64654381053382b8bb4c415067063003/input-document";
$ch = curl_init();
$a = array('form'=>'@'.$file, 'inp_doc_uid'=>$inp_doc_uid, 'tas_uid' =>$tas_uid, 'app_doc_comment' =>$app_doc_comment);
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 "<h3>response var_dump</h3>";
var_dump($postResult);
print "<textarea cols='50' rows='10'>".$postResult."</textarea>";