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

This commit is contained in:
Daniel Rojas
2014-06-20 09:17:45 -04:00
13 changed files with 653 additions and 441 deletions

1
.gitignore vendored
View File

@@ -36,3 +36,4 @@ workflow/public_html/build-log.html
temp.txt
update.sh
workflow/public_html/translations/

View File

@@ -166,8 +166,8 @@ Scenario: Create a new Calendars (with work days less than 3)
#Scenario: Delete Calendar when it is assigned to a project "Test Process"
# Given that I want to delete a "Calendar"
# And I request "calendar/14606161052f50839307899033145440"
# Then the response status code should be 400
# And the response status message should have the following text "cannot be deleted"
Scenario: Delete Calendar when it is assigned to a project "Test Process"
Given that I want to delete a "Calendar"
And I request "calendar/14606161052f50839307899033145440"
Then the response status code should be 400
And the response status message should have the following text "cannot be deleted"

View File

@@ -38,7 +38,7 @@ Background:
Then the response status code should be 200
And the response charset is "UTF-8"
And the type is "array"
And the response has 7 record
And the response has 6 record
Scenario: Create a new department in the workspace

View File

@@ -68,7 +68,7 @@ Feature: PM Group Negative Tests
And the response status message should have the following text "already assigned"
# Scenario: Delete a pm_group when have asigned user (negative tests) "Credit Supervisors"
# Scenario: Delete a pm_group when have asigned user and this is assigned to a task (negative tests) "Credit Supervisors"
# Given that I want to delete a "Group"
# And I request "group/53254668952d56744764b08079100881"
# Then the response status code should be 400

View File

@@ -74,8 +74,8 @@ Feature: PM User Main Tests
| Create with User exist | Peter | Vanko | peter | colosaqatest@gmail.com | | | | | | | | | 2016-02-15 | | ACTIVE | PROCESSMAKER_OPERATOR | sample | sample | 400 | string | exists |
# Scenario: Delete a pm_user when have asigned cases (negative tests) "amy"
# Given that I want to delete a "User"
# And I request "user/25286582752d56713231082039265791"
# Then the response status code should be 400
# And the response status message should have the following text "cannot be deleted"
Scenario: Delete a pm_user when have asigned cases (negative tests) "amy with 4 cases"
Given that I want to delete a "User"
And I request "user/25286582752d56713231082039265791"
Then the response status code should be 400
And the response status message should have the following text "cannot be deleted"

View File

@@ -67,8 +67,8 @@ Scenario Outline: Assign Permission "PM_DASHBOARD" to Role (NEGATIVE TESTS)
| Create rol without per_uid | 00000000000000000000000000000004 | | 400 | per_uid |
# Scenario: Delete a role when have asigned users (negative tests) "PROCESSMAKER_OPERATOR"
# Given that I want to delete a "Role"
# And I request "role/00000000000000000000000000000003"
# Then the response status code should be 400
# And the response status message should have the following text "cannot be deleted"
Scenario: Delete a role when have asigned users (negative tests) "PROCESSMAKER_OPERATOR"
Given that I want to delete a "Role"
And I request "role/00000000000000000000000000000003"
Then the response status code should be 400
And the response status message should have the following text "cannot be deleted"

View File

@@ -156,17 +156,17 @@ class UsersProperties extends BaseUsersProperties
$aErrors[] = 'ID_PPP_MAXIMUM_LENGTH';
}
if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) {
if (preg_match_all( '/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0) {
if (preg_match_all( '/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
$aErrors[] = 'ID_PPP_NUMERICAL_CHARACTER_REQUIRED';
}
}
if (PPP_UPPERCASE_CHARACTER_REQUIRED == 1) {
if (preg_match_all( '/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0) {
if (preg_match_all( '/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
$aErrors[] = 'ID_PPP_UPPERCASE_CHARACTER_REQUIRED';
}
}
if (PPP_SPECIAL_CHARACTER_REQUIRED == 1) {
if (preg_match_all( '/[<5B><>\\!|"@<40>#$~%<25>&<26>\/()=\'?<3F><>*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0) {
if (preg_match_all( '/[<5B><>\\!|"@<40>#$~%<25>&<26>\/()=\'?<3F><>*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
$aErrors[] = 'ID_PPP_SPECIAL_CHARACTER_REQUIRED';
}
}

View File

@@ -90,6 +90,7 @@ try {
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['TASK'] = - 1;
$_SESSION['STEP_POSITION'] = 0;
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
exit();
@@ -208,10 +209,12 @@ try {
break;
default: //APP_STATUS <> DRAFT and TO_DO
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex != "" ? $iDelIndex : $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
$_SESSION['INDEX'] = $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['TASK'] = - 1;
$_SESSION['STEP_POSITION'] = 0;
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX']);
$_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
}

View File

@@ -337,8 +337,6 @@ class Role
public function update($roleUid, array $arrayData)
{
try {
$arrayDataBackup = $arrayData;
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$validator = new \ProcessMaker\BusinessModel\Validator();
@@ -347,6 +345,7 @@ class Role
//Set data
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
$arrayDataBackup = $arrayData;
$arrayRoleData = $this->getRole($roleUid);

View File

@@ -5,13 +5,29 @@ use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
* ProcessCategory Api Controller
*
* @protected
*/
class ProcessCategory extends Api
{
private $formatFieldNameInUppercase = false;
private $category;
/**
* Constructor of the class
*
* return void
*/
public function __construct()
{
try {
$this->category = new \ProcessMaker\BusinessModel\ProcessCategory();
$this->category->setFormatFieldNameInUppercase(false);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url GET /categories
@@ -19,87 +35,76 @@ class ProcessCategory extends Api
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);
$response = $this->category->getCategories(array("filter" => $filter), null, null, $start, $limit);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url GET /category/:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
* @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);
$response = $this->category->getCategory($cat_uid);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url POST /category
*
* @param string $cat_name
* @param array $request_data
*
* @status 201
*/
public function doPostCategory($cat_name)
public function doPostCategory(array $request_data)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$response = $processCategory->addCategory($cat_name);
$arrayData = $this->category->create($request_data);
$response = $arrayData;
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url PUT /category/:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
* @param string $cat_name
*
* @param string $cat_uid {@min 32}{@max 32}
* @param array $request_data
*/
public function doPutCategory($cat_uid, $cat_name)
public function doPutCategory($cat_uid, array $request_data)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$response = $processCategory->updateCategory($cat_uid, $cat_name);
return $response;
$arrayData = $this->category->update($cat_uid, $request_data);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* @url DELETE /category/:cat_uid
*
* @param string $cat_uid {@min 32}{@max 32}
*
* @param string $cat_uid {@min 32}{@max 32}
*/
public function doDeleteCategory($cat_uid)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$processCategory->deleteCategory($cat_uid);
$this->category->delete($cat_uid);
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}

View File

@@ -93,36 +93,38 @@ var cboxAuthSourse = new Ext.form.ComboBox({
else
window.location = 'authSources_New?AUTH_SOURCE_PROVIDER='+formAuthSourceOptoins.getForm().findField('AUTH_SOURCE_PROVIDER').getValue();
return false;*/
formAuthSourceOptoins.getForm().submit({
waitTitle : "&nbsp;",
url: '../adminProxy/testingOption',
params: {
action : 'test',
optionAuthS: formAuthSourceOptoins.getForm().findField('AUTH_SOURCE_PROVIDER').getValue()
},
method: 'POST',
waitMsg : _('ID_LOADING_GRID'),
timeout : 500,
success: function(f,a){
resp = Ext.util.JSON.decode(a.response.responseText);
// alert(resp.optionAuthS);return false;
// alert(resp.sUID);return false;
if (resp.success){
if(resp.optionAuthS=='ldap')
// window.location = 'authSources_kindof?sUID='+resp.sUID+'&sprovider='+resp.optionAuthS;
window.location = 'authSources_kindof?sprovider='+resp.optionAuthS;
else
window.location = 'authSources_New?AUTH_SOURCE_PROVIDER='+resp.optionAuthS;
}
if (formAuthSourceOptoins.getForm().findField('AUTH_SOURCE_PROVIDER').getValue() != '') {
formAuthSourceOptoins.getForm().submit({
waitTitle : "&nbsp;",
url: '../adminProxy/testingOption',
params: {
action : 'test',
optionAuthS: formAuthSourceOptoins.getForm().findField('AUTH_SOURCE_PROVIDER').getValue()
},
method: 'POST',
waitMsg : _('ID_LOADING_GRID'),
timeout : 500,
success: function(f,a){
resp = Ext.util.JSON.decode(a.response.responseText);
if (resp.success) {
if (resp.optionAuthS=='ldap') {
window.location = 'authSources_kindof?sprovider='+resp.optionAuthS;
} else {
window.location = 'authSources_New?AUTH_SOURCE_PROVIDER='+resp.optionAuthS;
}
}
},
failure: function(f,a){
if (a.failureType === Ext.form.Action.CONNECT_FAILURE){
Ext.Msg.alert( _('ID_FAILURE'), _('ID_SERVER_REPORTED')+':'+a.response.status+' '+a.response.statusText);
}
if (a.failureType === Ext.form.Action.SERVER_INVALID){
Ext.Msg.alert( _('ID_WARNING'), _('ID_YOU_HAVE_ERROR'));
}
},
failure: function(f,a){
if (a.failureType === Ext.form.Action.CONNECT_FAILURE){
Ext.Msg.alert( _('ID_FAILURE'), _('ID_SERVER_REPORTED')+':'+a.response.status+' '+a.response.statusText);
}
if (a.failureType === Ext.form.Action.SERVER_INVALID){
Ext.Msg.alert( _('ID_WARNING'), _('ID_YOU_HAVE_ERROR'));
}
}
});
} else {
Ext.Msg.alert( _('ID_FAILURE'), _('ID_CHOOSE_PROVIDER'));
}
});
}