Merge remote-tracking branch 'upstream/3.1' into HOR-1602

This commit is contained in:
dheeyi william
2016-08-13 11:17:07 -04:00
15 changed files with 2885 additions and 2554 deletions

90
composer.lock generated
View File

@@ -328,7 +328,7 @@
"Monolog\\": "src/Monolog"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -368,7 +368,7 @@
"Psr\\Log\\": ""
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -611,16 +611,16 @@
},
{
"name": "symfony/config",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "0926e69411eba491803dbafb9f1f233e2ced58d0"
"reference": "4275ef5b59f18959df0eee3991e9ca0cc208ffd4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/0926e69411eba491803dbafb9f1f233e2ced58d0",
"reference": "0926e69411eba491803dbafb9f1f233e2ced58d0",
"url": "https://api.github.com/repos/symfony/config/zipball/4275ef5b59f18959df0eee3991e9ca0cc208ffd4",
"reference": "4275ef5b59f18959df0eee3991e9ca0cc208ffd4",
"shasum": ""
},
"require": {
@@ -644,7 +644,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -660,20 +660,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:31:50"
"time": "2016-07-26 08:02:44"
},
{
"name": "symfony/console",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "c392a6ec72f2122748032c2ad6870420561ffcfa"
"reference": "36e62335caca8a6e909c5c5bac4a8128149911c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/c392a6ec72f2122748032c2ad6870420561ffcfa",
"reference": "c392a6ec72f2122748032c2ad6870420561ffcfa",
"url": "https://api.github.com/repos/symfony/console/zipball/36e62335caca8a6e909c5c5bac4a8128149911c9",
"reference": "36e62335caca8a6e909c5c5bac4a8128149911c9",
"shasum": ""
},
"require": {
@@ -704,7 +704,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -720,20 +720,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 07:02:14"
"time": "2016-07-30 07:20:35"
},
{
"name": "symfony/dependency-injection",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "2dd85de8216079d1360b2b14988cd5cdbbb49063"
"reference": "f2b5a00d176f6a201dc430375c0ef37706ea3d12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2dd85de8216079d1360b2b14988cd5cdbbb49063",
"reference": "2dd85de8216079d1360b2b14988cd5cdbbb49063",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f2b5a00d176f6a201dc430375c0ef37706ea3d12",
"reference": "f2b5a00d176f6a201dc430375c0ef37706ea3d12",
"shasum": ""
},
"require": {
@@ -745,7 +745,7 @@
"require-dev": {
"symfony/config": "~2.2|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/yaml": "~2.1|~3.0.0"
"symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7"
},
"suggest": {
"symfony/config": "",
@@ -767,7 +767,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -783,20 +783,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:31:50"
"time": "2016-07-30 07:20:35"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9"
"reference": "889983a79a043dfda68f38c38b6dba092dd49cd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
"reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8",
"reference": "889983a79a043dfda68f38c38b6dba092dd49cd8",
"shasum": ""
},
"require": {
@@ -827,7 +827,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -843,20 +843,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:29:29"
"time": "2016-07-28 16:56:28"
},
{
"name": "symfony/filesystem",
"version": "v3.0.8",
"version": "v3.0.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "a108b1d603ccb52addb5da9b14a3ba259f8b3db0"
"reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/a108b1d603ccb52addb5da9b14a3ba259f8b3db0",
"reference": "a108b1d603ccb52addb5da9b14a3ba259f8b3db0",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/b2da5009d9bacbd91d83486aa1f44c793a8c380d",
"reference": "b2da5009d9bacbd91d83486aa1f44c793a8c380d",
"shasum": ""
},
"require": {
@@ -876,7 +876,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -892,7 +892,7 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:40:00"
"time": "2016-07-20 05:43:46"
},
{
"name": "symfony/finder",
@@ -1005,16 +1005,16 @@
},
{
"name": "symfony/translation",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "00334ef0b9317e5d7c7641a2b56671a1df23b7a0"
"reference": "32b0c824da6df065f43b0c458dc505940e98a7f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/00334ef0b9317e5d7c7641a2b56671a1df23b7a0",
"reference": "00334ef0b9317e5d7c7641a2b56671a1df23b7a0",
"url": "https://api.github.com/repos/symfony/translation/zipball/32b0c824da6df065f43b0c458dc505940e98a7f1",
"reference": "32b0c824da6df065f43b0c458dc505940e98a7f1",
"shasum": ""
},
"require": {
@@ -1049,7 +1049,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1065,20 +1065,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:29:29"
"time": "2016-07-30 07:20:35"
},
{
"name": "symfony/yaml",
"version": "v2.8.8",
"version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8"
"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8",
"reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8",
"url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d",
"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d",
"shasum": ""
},
"require": {
@@ -1098,7 +1098,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1114,7 +1114,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-06-29 05:29:29"
"time": "2016-07-17 09:06:15"
}
],
"aliases": [],

View File

@@ -678,6 +678,7 @@ class pmDynaform
var sysLang = \"" . SYS_LANG . "\";
var isRTL = \"" . $this->isRTL . "\";
var pathRTLCss = \"" . $this->pathRTLCss . "\";
var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";
$(window).load(function ()
{
var data = jsondata;
@@ -736,6 +737,7 @@ class pmDynaform
"var sysLang = '" . SYS_LANG . "';\n" .
"var isRTL = " . $this->isRTL . ";\n" .
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";\n" .
"$(window).load(function () {\n" .
" var data = jsondata;\n" .
" window.dynaform = new PMDynaform.core.Project({\n" .
@@ -811,6 +813,7 @@ class pmDynaform
"var sysLang = '" . SYS_LANG . "';\n" .
"var isRTL = " . $this->isRTL . ";\n" .
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/cases_Step.js'></script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
@@ -866,6 +869,7 @@ class pmDynaform
var sysLang = \"" . SYS_LANG . "\";
var isRTL = \"" . $this->isRTL . "\";
var pathRTLCss = \"" . $this->pathRTLCss . "\";
var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";
</script>
<script type=\"text/javascript\" src=\"/jscore/cases/core/pmDynaform.js\"></script>
@@ -908,6 +912,7 @@ class pmDynaform
"var sysLang = '" . SYS_LANG . "';\n" .
"var isRTL = " . $this->isRTL . ";\n" .
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
@@ -948,6 +953,7 @@ class pmDynaform
"var sysLang = '" . SYS_LANG . "';\n" .
"var isRTL = " . $this->isRTL . ";\n" .
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
@@ -1007,6 +1013,7 @@ class pmDynaform
"var sysLang = '" . SYS_LANG . "';\n" .
"var isRTL = " . $this->isRTL . ";\n" .
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "null") . ";\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .

View File

@@ -2878,10 +2878,6 @@ class wsBase
*/
$oCriteria = new Criteria( 'workflow' );
$aConditions = array ();
// $aConditions[] = array(AppDelegationPeer::USR_UID, TaskUserPeer::USR_UID);
// $aConditions[] = array(AppDelegationPeer::TAS_UID, TaskUserPeer::TAS_UID);
// $oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
//$oCriteria->addJoin(AppDelegationPeer::USR_UID, TaskUserPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
$oCriteria->add( AppDelegationPeer::USR_UID, $userIdSource );
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $delIndex );

View File

@@ -738,6 +738,20 @@ class AppDelegation extends BaseAppDelegation
return $data['TAS_UID'];
}
public function getCurrentUsers($appUid, $index)
{
$oCriteria = new Criteria();
$oCriteria->addSelectColumn( AppDelegationPeer::USR_UID );
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $index );
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oRuleSet->next();
$data = $oRuleSet->getRow();
return $data;
}
/**
* Verify if the current case is already routed.
*

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ProcessMaker (Branch 3.1)\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2016-07-29 18:36:34\n"
"PO-Revision-Date: 2016-08-12 23:48:36\n"
"Last-Translator: \n"
"Language-Team: Colosa Developers Team <developers@colosa.com>\n"
"MIME-Version: 1.0\n"
@@ -27599,6 +27599,54 @@ msgstr "Expand all"
msgid "Collapse all"
msgstr "Collapse all"
# TRANSLATION
# LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
#: LABEL/ID_SCRIPT_TASK_ACTIVITY_ALREADY_REGISTERED
msgid "The Script-Task with {0}: \"{1}\" already registered"
msgstr "The Script-Task with {0}: \"{1}\" already registered"
# TRANSLATION
# LABEL/ID_CASE_CANCELLED_PARALLEL
#: LABEL/ID_CASE_CANCELLED_PARALLEL
msgid "To cancel a case, no parallel threads must be active. Only cases with one active thread can be canceled."
msgstr "To cancel a case, no parallel threads must be active. Only cases with one active thread can be canceled."
# TRANSLATION
# LABEL/ID_REASSIGNMENT_ERROR
#: LABEL/ID_REASSIGNMENT_ERROR
msgid "The case was already derivated to other person. Try to open again the case to reassign."
msgstr "The case was already derivated to other person. Try to open again the case to reassign."
# TRANSLATION
# LABEL/ID_REASSIGNMENT_PAUSED_ERROR
#: LABEL/ID_REASSIGNMENT_PAUSED_ERROR
msgid "The case is paused and can't be reasigned."
msgstr "The case is paused and can't be reasigned."
# TRANSLATION
# LABEL/ID_MAFE_1de162d73f017a9243ce0c939064a014
#: LABEL/ID_MAFE_1de162d73f017a9243ce0c939064a014
msgid "Enable gallery"
msgstr "Enable gallery"
# TRANSLATION
# LABEL/ID_MAFE_4e357e7345689cff230335282b201a11
#: LABEL/ID_MAFE_4e357e7345689cff230335282b201a11
msgid "Enable camera"
msgstr "Enable camera"
# TRANSLATION
# LABEL/ID_MAFE_5582ead0a9ee86a54da29c20caee6f57
#: LABEL/ID_MAFE_5582ead0a9ee86a54da29c20caee6f57
msgid "Force user login"
msgstr "Force user login"
# TRANSLATION
# LABEL/ID_MAFE_f82e519e2e82239be5f49d78b24ea228
#: LABEL/ID_MAFE_f82e519e2e82239be5f49d78b24ea228
msgid "Supported Controls: Multiple File."
msgstr "Supported Controls: Multiple File."
# additionalTables/additionalTablesData.xml?ADD_TAB_NAME
# additionalTables/additionalTablesData.xml
#: text - ADD_TAB_NAME
@@ -37140,8 +37188,8 @@ msgstr "Cancel"
# login/licenseExpired.xml?thetitle
# login/licenseExpired.xml
#: title - thetitle
msgid "Your license has expired or the System does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgstr "Your license has expired or the System does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgid "Your license has expired or the system does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgstr "Your license has expired or the system does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
# login/licenseExpired.xml?licenseFile
# login/licenseExpired.xml
@@ -37158,8 +37206,8 @@ msgstr "Update License"
# login/licenseExpiredpm3.xml?thetitle
# login/licenseExpiredpm3.xml
#: title - thetitle
msgid "[login/licenseExpiredpm3.xml?thetitle] Your license has expired or the System does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgstr "Your license has expired or the System does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgid "[login/licenseExpiredpm3.xml?thetitle] Your license has expired or the system does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
msgstr "Your license has expired or the system does not have a license. To use the ProcessMaker Enterprise Edition upload a valid license"
# login/licenseExpiredpm3.xml?licenseFile
# login/licenseExpiredpm3.xml

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -70,6 +70,7 @@ $(window).load(function () {
var data = jsondata;
window.dynaform = new PMDynaform.core.Project({
data: data,
delIndex: delIndex,
onBeforePrintHandler : function () {
var nodeClone = $(".pmdynaform-container").clone();
nodeClone.addClass("printing-form");

View File

@@ -194,8 +194,10 @@ class Ajax
$options[] = Array('text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase');
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
}
}
break;
case 'TO_DO':
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
@@ -211,8 +213,10 @@ class Ajax
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
}
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_SUPERVISOR') == 1) {
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
}
}
break;
case 'CANCELLED':
$options[] = Array('text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase');
@@ -597,10 +601,31 @@ class Ajax
$user = new Users();
$app = new Application();
$result = new stdclass();
$oAppDel = new AppDelegation();
$TO_USR_UID = $_POST['USR_UID'];
try {
//Current users of OPEN DEL_INDEX thread
if(isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])){
$aCurUser = $oAppDel->getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
}
$flagReassign = true;
if(!empty($aCurUser)){
foreach ($aCurUser as $key => $value) {
if($value === $TO_USR_UID){
$flagReassign = false;
}
}
} else {
//DEL_INDEX is CLOSED
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
}
//If the currentUser is diferent to nextUser, create the thread
if($flagReassign){
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
}
$caseData = $app->load($_SESSION['APPLICATION']);
$userData = $user->load($TO_USR_UID);

View File

@@ -28,8 +28,7 @@ foreach ($items as $item) {
$dataUids = explode( "|", $item );
$appSelectedUids[] = $dataUids[0];
}
// var_dump($aData);
//var_dump($appSelectedUids);
$casesReassignedCount = 0;
$serverResponse = array ();
G::LoadClass( 'case' );
@@ -37,6 +36,7 @@ $oCases = new Cases();
require_once ('classes/model/Task.php');
require_once ('classes/model/AppCacheView.php');
$oAppCacheView = new AppCacheView();
$oAppDel = new AppDelegation();
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria(null);
if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
$oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
@@ -47,9 +47,7 @@ if (empty( $aData )) {
echo G::json_encode( $serverResponse );
die();
}
// $params = array ();
// $sql = BasePeer::createSelectSql($oCasesReassignList, $params);
// var_dump($sql);
if (is_array( $aData )) {
$currentCasesReassigned = 0;
require_once ("classes/model/AppNotes.php");
@@ -61,8 +59,26 @@ if (is_array( $aData )) {
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$row = $rs->getRow();
//$aCase = $oCases->loadCaseInCurrentDelegation( $data->APP_UID );
//Current users of OPEN DEL_INDEX thread
$aCurUser = $oAppDel->getCurrentUsers($row['APP_UID'], $row['DEL_INDEX']);
$flagReassign = true;
if(!empty($aCurUser)){
foreach ($aCurUser as $key => $value) {
if($value === $data->APP_REASSIGN_USER_UID){
$flagReassign = false;
}
}
} else {
//DEL_INDEX is CLOSED
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
}
//If the currentUser is diferent to nextUser, create the thread
if($flagReassign){
$oCases->reassignCase( $row['APP_UID'], $row['DEL_INDEX'], ($row['USR_UID'] != '' ? $row['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
}
$currentCasesReassigned ++;
$casesReassignedCount ++;
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
@@ -86,11 +102,28 @@ if (is_array( $aData )) {
while (is_array( $row )) {
$APP_UID = $row['APP_UID'];
$aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
//Current users of OPEN DEL_INDEX thread
$aCurUser = $oAppDel->getCurrentUsers($APP_UID, $aCase['DEL_INDEX']);
$flagReassign = true;
if(!empty($aCurUser)){
foreach ($aCurUser as $key => $value) {
if($value === $aData->APP_REASSIGN_USER_UID){
$flagReassign = false;
}
}
} else {
//DEL_INDEX is CLOSED
throw new Exception(G::LoadTranslation('ID_REASSIGNMENT_ERROR'));
}
//If the currentUser is diferent to nextUser, create the thread
if($flagReassign){
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
}
$currentCasesReassigned ++;
$casesReassignedCount ++;
// var_dump($aCase);
// echo ("<br>");
$rs->next();
$row = $rs->getRow();
}

View File

@@ -19,8 +19,8 @@ class Calendar
private $arrayWorkHourFieldDefinition = array(
"DAY" => array("type" => "int", "required" => true, "empty" => false, "defaultValues" => array(0, 1, 2, 3, 4, 5, 6, 7), "fieldNameAux" => "day"),
"HOUR_START" => array("type" => "hour", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "hourStart"),
"HOUR_END" => array("type" => "hour", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "hourEnd")
'HOUR_START' => array('type' => 'hour', 'required' => true, 'empty' => false, 'defaultValues' => array(), 'fieldNameAux' => 'hourStart', 'regexp' => '/^(?:[0-1]\d|2[0-3])\:[0-5]\d$/'),
'HOUR_END' => array('type' => 'hour', 'required' => true, 'empty' => false, 'defaultValues' => array(), 'fieldNameAux' => 'hourEnd', 'regexp' => '/^(?:[0-1]\d|2[0-3])\:[0-5]\d$/')
);
private $arrayHolidayFieldDefinition = array(
@@ -751,4 +751,3 @@ class Calendar
}
}
}

View File

@@ -2951,9 +2951,33 @@ class Cases
$fields = $appDelegation->load($val['APP_UID'], $val['DEL_INDEX']);
$usrUid = $fields['USR_UID'];
}
//Will be not able reassign a case when is paused
$flagReassign = true;
if (!\AppDelay::isPaused($val['APP_UID'], $val['INDEX'])) {
$dataResponse['cases'][$key]['result'] = 0;
$dataResponse['cases'][$key]['status'] = \G::LoadTranslation('ID_REASSIGNMENT_PAUSED_ERROR');
$flagReassign = false;
}
//Current users of OPEN DEL_INDEX thread
$aCurUser = $oAppDel->getCurrentUsers($val['APP_UID'], $val['INDEX']);
if(!empty($aCurUser)){
foreach ($aCurUser as $key => $value) {
if($value === $data['usr_uid_target']){
$flagReassign = false;
$result = 1;
}
}
}else {
//DEL_INDEX is CLOSED
$dataResponse['cases'][$key]['result'] = 0;
$dataResponse['cases'][$key]['status'] = \G::LoadTranslation('ID_REASSIGNMENT_ERROR');
}
if($flagReassign) {
$reassigned = $oCases->reassignCase($val['APP_UID'], $val['DEL_INDEX'], $usrUid, $data['usr_uid_target']);
$result = $reassigned ? 1 : 0 ;
}
$dataResponse['cases'][$key]['result'] = $result;
$dataResponse['cases'][$key]['status'] = 'SUCCESS';
}
@@ -2962,5 +2986,25 @@ class Cases
return G::json_encode($dataResponse);
}
/**
* if case already routed
*
* @param type $app_uid
* @param type $del_index
* @param type $usr_uid
* @throws type
*/
public function caseAlreadyRouted($app_uid, $del_index, $usr_uid = '')
{
$c = new \Criteria('workflow');
$c->add(\AppDelegationPeer::APP_UID, $app_uid);
$c->add(\AppDelegationPeer::DEL_INDEX, $del_index);
if (!empty($usr_uid)) {
$c->add(\AppDelegationPeer::USR_UID, $usr_uid);
}
$c->add(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL);
return !(boolean) \AppDelegationPeer::doCount($c);
}
}

View File

@@ -228,7 +228,13 @@ class Process
}
break;
case "hour":
if (!preg_match('/^' . $regexpTime . '$/', $fieldValue)) {
$regexpTime = '/^' . $regexpTime . '$/';
if (array_key_exists('regexp', $arrayFieldDefinition[$fieldName])) {
$regexpTime = $arrayFieldDefinition[$fieldName]['regexp'];
}
if (!preg_match($regexpTime, $fieldValue)) {
throw new \Exception(\G::LoadTranslation('ID_INVALID_VALUE', [$fieldNameAux]));
}
break;
@@ -1834,4 +1840,3 @@ class Process
}
}

View File

@@ -1544,8 +1544,16 @@ class Light extends Api
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '', $del_index = 0)
{
try {
if ($del_index === null) {
throw (new \Exception(G::LoadTranslation('ID_CAN_NOT_BE_NULL', array('del_index')), Api::STAT_APP_EXCEPTION));
}
$usr_uid = $this->getUserId();
$cases = new \ProcessMaker\BusinessModel\Cases();
if ($del_index > 0) {
if ($cases->caseAlreadyRouted($app_uid, $del_index, $usr_uid)) {
throw (new \Exception(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), Api::STAT_APP_EXCEPTION));
}
}
$request_data = \ProcessMaker\Util\DateTime::convertDataToUtc($request_data);
$cases->setCaseVariables($app_uid, $request_data, $dyn_uid, $usr_uid, $del_index);
} catch (\Exception $e) {

View File

@@ -238,7 +238,7 @@ class Assignee extends Api
public function doGetActivityAssigneesAll($prjUid, $actUid, $filter = null, $start = null, $limit = null, $type = null)
{
try {
$arrayData = $this->task->getTaskAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type);
$response = $this->task->getTaskAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type);
return $response;
} catch (\Exception $e) {