diff --git a/.gitignore b/.gitignore index b951fad8a..976524a46 100755 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ workflow/public_html/build-log.html temp.txt update.sh workflow/public_html/translations/ + diff --git a/features/backend/admin_setup/calendar/negative_tests_calendar.feature b/features/backend/admin_setup/calendar/negative_tests_calendar.feature index 4c92af53c..2aa083afa 100644 --- a/features/backend/admin_setup/calendar/negative_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/negative_tests_calendar.feature @@ -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" \ No newline at end of file +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" \ No newline at end of file diff --git a/features/backend/admin_setup/departments/basic_sequence_department.feature b/features/backend/admin_setup/departments/basic_sequence_department.feature index 74d23488b..f7a02b42d 100644 --- a/features/backend/admin_setup/departments/basic_sequence_department.feature +++ b/features/backend/admin_setup/departments/basic_sequence_department.feature @@ -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 diff --git a/features/backend/admin_setup/pm_group/negative_tests_pm_group.feature b/features/backend/admin_setup/pm_group/negative_tests_pm_group.feature index 57f3abd48..0daa4ff0d 100644 --- a/features/backend/admin_setup/pm_group/negative_tests_pm_group.feature +++ b/features/backend/admin_setup/pm_group/negative_tests_pm_group.feature @@ -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 diff --git a/features/backend/admin_setup/pm_user/negative_tests_pm_user.feature b/features/backend/admin_setup/pm_user/negative_tests_pm_user.feature index 132051be6..de0c934a8 100644 --- a/features/backend/admin_setup/pm_user/negative_tests_pm_user.feature +++ b/features/backend/admin_setup/pm_user/negative_tests_pm_user.feature @@ -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" \ No newline at end of file +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" \ No newline at end of file diff --git a/features/backend/admin_setup/roles/negative_tests_roles.feature b/features/backend/admin_setup/roles/negative_tests_roles.feature index 1f43b8f76..a336b4f59 100644 --- a/features/backend/admin_setup/roles/negative_tests_roles.feature +++ b/features/backend/admin_setup/roles/negative_tests_roles.feature @@ -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" \ No newline at end of file +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" \ No newline at end of file diff --git a/workflow/engine/classes/model/UsersProperties.php b/workflow/engine/classes/model/UsersProperties.php index 0b17ce1f2..6ece46e96 100755 --- a/workflow/engine/classes/model/UsersProperties.php +++ b/workflow/engine/classes/model/UsersProperties.php @@ -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( '/[��\\!|"@�#$~%�&�\/()=\'?��*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0) { + if (preg_match_all( '/[��\\!|"@�#$~%�&�\/()=\'?��*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) { $aErrors[] = 'ID_PPP_SPECIAL_CHARACTER_REQUIRED'; } } diff --git a/workflow/engine/methods/cases/cases_Open.php b/workflow/engine/methods/cases/cases_Open.php index cfa30701a..47a0bb32c 100755 --- a/workflow/engine/methods/cases/cases_Open.php +++ b/workflow/engine/methods/cases/cases_Open.php @@ -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'); } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php b/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php index 2cbfff44f..20c3fd1b3 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php @@ -820,6 +820,10 @@ class CaseScheduler if (!isset($sSchUID)) { return; } + $event = \BpmnEventPeer::retrieveByPK($sSchUID); + if (is_object($event)) { + $event->delete(); + } $oCaseScheduler->remove($sSchUID); } catch (\Exception $e) { throw $e; diff --git a/workflow/engine/templates/authSources/authSourcesListNew.js b/workflow/engine/templates/authSources/authSourcesListNew.js index 2501319ea..a4e8be16c 100755 --- a/workflow/engine/templates/authSources/authSourcesListNew.js +++ b/workflow/engine/templates/authSources/authSourcesListNew.js @@ -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 : " ", - 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 : " ", + 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')); } -}); } \ No newline at end of file