Merged in bugfix/HOR-4618 (pull request #6502)
HOR-4618 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -1438,88 +1438,96 @@ function checkTree($uidOriginFolder, $uidNewFolder)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload documents
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
function uploadExternalDocument()
|
function uploadExternalDocument()
|
||||||
{
|
{
|
||||||
$response['action']=$_POST['action']. " - ".$_POST['option'];
|
$response = [];
|
||||||
$response['error']="error";
|
$response['action'] = $_POST['action'] . " - " . $_POST['option'];
|
||||||
$response['message']="error";
|
$response['error'] = "error";
|
||||||
$response['success']=false;
|
$response['message'] = "error";
|
||||||
|
$response['success'] = false;
|
||||||
$overwrite = (isset($_REQUEST['overwrite_files'])) ? $_REQUEST['overwrite_files'] : false;
|
$overwrite = (isset($_REQUEST['overwrite_files'])) ? $_REQUEST['overwrite_files'] : false;
|
||||||
if (isset($_POST["confirm"]) && $_POST["confirm"] == "true") {
|
if (isset($_POST["confirm"]) && $_POST["confirm"] == "true") {
|
||||||
if (isset($_FILES['uploadedFile'])) {
|
if (isset($_FILES['uploadedFile'])) {
|
||||||
$uploadedInstances=count($_FILES['uploadedFile']['name']);
|
$uploadedInstances = count($_FILES['uploadedFile']['name']);
|
||||||
$sw_error=false;
|
$sw_error = false;
|
||||||
$sw_error_exists=isset($_FILES['uploadedFile']['error']);
|
$sw_error_exists = isset($_FILES['uploadedFile']['error']);
|
||||||
$emptyInstances=0;
|
$emptyInstances = 0;
|
||||||
$quequeUpload=array();
|
$quequeUpload = [];
|
||||||
//overwrite files
|
//overwrite files
|
||||||
if ($overwrite) {
|
if ($overwrite) {
|
||||||
for ($i=0; $i<$uploadedInstances; $i++) {
|
for ($i = 0; $i < $uploadedInstances; $i++) {
|
||||||
overwriteFile($_REQUEST['dir'], stripslashes($_FILES['uploadedFile']['name'][$i]));
|
overwriteFile($_REQUEST['dir'], stripslashes($_FILES['uploadedFile']['name'][$i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// upload files & check for errors
|
// upload files & check for errors
|
||||||
for ($i=0; $i<$uploadedInstances; $i++) {
|
$errors = [];
|
||||||
|
for ($i = 0; $i < $uploadedInstances; $i++) {
|
||||||
$errors[$i] = null;
|
$errors[$i] = null;
|
||||||
$tmp = $_FILES['uploadedFile']['tmp_name'][$i];
|
$tmp = $_FILES['uploadedFile']['tmp_name'][$i];
|
||||||
$items[$i] = stripslashes($_FILES['uploadedFile']['name'][$i]);
|
$items[$i] = stripslashes($_FILES['uploadedFile']['name'][$i]);
|
||||||
if ($sw_error_exists) {
|
if ($sw_error_exists) {
|
||||||
$up_err = $_FILES['uploadedFile']['error'][$i];
|
$up_err = $_FILES['uploadedFile']['error'][$i];
|
||||||
} else {
|
} else {
|
||||||
$up_err=(file_exists($tmp)?0:4);
|
$up_err = (file_exists($tmp) ? 0 : 4);
|
||||||
}
|
}
|
||||||
if ($items[$i]=="" || $up_err==4) {
|
if ($items[$i] == "" || $up_err == 4) {
|
||||||
$emptyInstances++;
|
$emptyInstances++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($up_err==1 || $up_err==2) {
|
if ($up_err == 1 || $up_err == 2) {
|
||||||
$errors[$i]='miscfilesize';
|
$errors[$i] = 'miscfilesize';
|
||||||
$sw_error = true;
|
$sw_error = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($up_err==3) {
|
if ($up_err == 3) {
|
||||||
$errors[$i]='miscfilepart';
|
$errors[$i] = 'miscfilepart';
|
||||||
$sw_error=true;
|
$sw_error = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!@is_uploaded_file($tmp)) {
|
if (!@is_uploaded_file($tmp)) {
|
||||||
$errors[$i]='uploadfile';
|
$errors[$i] = 'uploadfile';
|
||||||
$sw_error=true;
|
$sw_error = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//The uplaoded files seems to be correct and ready to be uploaded. Add to the Queque
|
//The uplaoded files seems to be correct and ready to be uploaded. Add to the Queque
|
||||||
$fileInfo=array("tempName"=>$tmp,"fileName"=>$items[$i]);
|
$fileInfo = ["tempName" => $tmp, "fileName" => $items[$i]];
|
||||||
$quequeUpload[]=$fileInfo;
|
$quequeUpload[] = $fileInfo;
|
||||||
}
|
}
|
||||||
} elseif (isset($_POST['selitems'])) {
|
} elseif (isset($_POST['selitems'])) {
|
||||||
$response="";
|
$response['msg'] = "correct reload";
|
||||||
$response['msg']= "correct reload";
|
$response['success'] = true;
|
||||||
$response['success']=true;
|
|
||||||
if (isset($_REQUEST['option']) && isset($_REQUEST['copyMove'])) {
|
if (isset($_REQUEST['option']) && isset($_REQUEST['copyMove'])) {
|
||||||
if ($_REQUEST['option'] == 'directory' && $_REQUEST['copyMove'] == 'all') {
|
if ($_REQUEST['option'] == 'directory' && $_REQUEST['copyMove'] == 'all') {
|
||||||
$response['action'] = $_POST['action']. " - ".$_POST['option'];
|
$response['action'] = $_POST['action'] . " - " . $_POST['option'];
|
||||||
$response['error'] = "Complete";
|
$response['error'] = "Complete";
|
||||||
$response['message']= str_replace("Execute", "", $_POST['action']). " ". "Complete";
|
$response['message'] = str_replace("Execute", "", $_POST['action']) . " " . "Complete";
|
||||||
$response['success']= 'success';
|
$response['success'] = 'success';
|
||||||
$response['node'] = '';
|
$response['node'] = '';
|
||||||
$_POST ['node'] = "";
|
$_POST ['node'] = "";
|
||||||
$newFolderUid = checkTree($_REQUEST['dir'], ($_REQUEST['new_dir'] == 'root')? '/' : $_REQUEST['new_dir']);
|
$newFolderUid = checkTree(
|
||||||
|
$_REQUEST['dir'],
|
||||||
|
($_REQUEST['new_dir'] == 'root') ? '/' : $_REQUEST['new_dir']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$_POST['selitems'] = array();
|
$_POST['selitems'] = [];
|
||||||
} else {
|
} else {
|
||||||
$oAppDocument = new AppDocument();
|
$appDocument = new AppDocument();
|
||||||
if (isset($_POST['selitems']) && is_array($_POST['selitems'])) {
|
if (isset($_POST['selitems']) && is_array($_POST['selitems'])) {
|
||||||
foreach ($_POST['selitems'] as $docId) {
|
foreach ($_POST['selitems'] as $docId) {
|
||||||
$arrayDocId = explode('_', $docId);
|
$arrayDocId = explode('_', $docId);
|
||||||
$docInfo=$oAppDocument->load($arrayDocId[0]);
|
$docInfo = $appDocument->load($arrayDocId[0]);
|
||||||
$docInfo['FOLDER_UID'] = $_POST['new_dir'];
|
$docInfo['FOLDER_UID'] = $_POST['new_dir'];
|
||||||
$docInfo['APP_DOC_CREATE_DATE'] = date('Y-m-d H:i:s');
|
$docInfo['APP_DOC_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
$oAppDocument->update($docInfo);
|
$appDocument->update($docInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//G::pr($quequeUpload);
|
|
||||||
|
|
||||||
//Read. Instance Document classes
|
//Read. Instance Document classes
|
||||||
if (!empty($quequeUpload)) {
|
if (!empty($quequeUpload)) {
|
||||||
@@ -1535,148 +1543,144 @@ function uploadExternalDocument()
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$docUid=$_POST['docUid'];
|
$docUid = $_POST['docUid'];
|
||||||
$appDocUid=isset($_POST['APP_DOC_UID'])?$_POST['APP_DOC_UID']:"";
|
$appDocUid = isset($_POST['APP_DOC_UID']) ? $_POST['APP_DOC_UID'] : "";
|
||||||
$docVersion=isset($_POST['docVersion'])?$_POST['docVersion']:"";
|
$docVersion = isset($_POST['docVersion']) ? $_POST['docVersion'] : "";
|
||||||
$actionType=isset($_POST['actionType'])?$_POST['actionType']:"";
|
$actionType = isset($_POST['actionType']) ? $_POST['actionType'] : "";
|
||||||
$folderId=$_POST['dir']==""?"/":$_POST['dir'];
|
$folderId = $_POST['dir'] == "" ? "/" : $_POST['dir'];
|
||||||
$appId=$_POST['appId'];
|
$appId = $_POST['appId'];
|
||||||
$docType=isset($_POST['docType'])?$_GET['docType']:"INPUT";
|
$docType = isset($_POST['docType']) ? $_GET['docType'] : "INPUT";
|
||||||
//save info
|
//save info
|
||||||
|
|
||||||
$oInputDocument = new InputDocument();
|
$inputDocument = new InputDocument();
|
||||||
if ($docUid != -1) {
|
if ($docUid != -1) {
|
||||||
$aID = $oInputDocument->load($docUid);
|
$aID = $inputDocument->load($docUid);
|
||||||
} else {
|
} else {
|
||||||
$oFolder=new AppFolder();
|
$folder = new AppFolder();
|
||||||
$folderStructure=$oFolder->getFolderStructure($folderId);
|
$folderStructure = $folder->getFolderStructure($folderId);
|
||||||
$aID=array('INP_DOC_DESTINATION_PATH'=>$folderStructure['PATH']);
|
$aID = ['INP_DOC_DESTINATION_PATH' => $folderStructure['PATH']];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Get the Custom Folder ID (create if necessary)
|
//Get the Custom Folder ID (create if necessary)
|
||||||
$oFolder=new AppFolder();
|
$folder = new AppFolder();
|
||||||
if ($docUid!=-1) {
|
if ($docUid != -1) {
|
||||||
//krumo("jhl");
|
$folderId = $folder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $appId);
|
||||||
$folderId=$oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH'], $appId);
|
|
||||||
//Tags
|
//Tags
|
||||||
$fileTags=$oFolder->parseTags($aID['INP_DOC_TAGS'], $appId);
|
$fileTags = $folder->parseTags($aID['INP_DOC_TAGS'], $appId);
|
||||||
} else {
|
} else {
|
||||||
$folderId=$folderId;
|
$folderId = $folderId;
|
||||||
$fileTags="EXTERNAL";
|
$fileTags = "EXTERNAL";
|
||||||
}
|
}
|
||||||
foreach ($quequeUpload as $key => $fileObj) {
|
foreach ($quequeUpload as $key => $fileObj) {
|
||||||
$oAppDocument = new AppDocument();
|
$appDocument = new AppDocument();
|
||||||
switch ($actionType) {
|
switch ($actionType) {
|
||||||
case "R":
|
case "R":
|
||||||
//replace
|
//replace
|
||||||
$aFields = array(
|
$fields = [
|
||||||
'APP_DOC_UID' => $appDocUid,
|
'APP_DOC_UID' => $appDocUid,
|
||||||
'APP_UID' => $appId,
|
'APP_UID' => $appId,
|
||||||
'DOC_VERSION' => $docVersion,
|
'DOC_VERSION' => $docVersion,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => 1,
|
||||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||||
'DOC_UID' => $docUid,
|
'DOC_UID' => $docUid,
|
||||||
'APP_DOC_TYPE' => $docType,
|
'APP_DOC_TYPE' => $docType,
|
||||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
||||||
$_POST['form']['APP_DOC_COMMENT'] : '',
|
$_POST['form']['APP_DOC_COMMENT'] : '',
|
||||||
'APP_DOC_TITLE' => '',
|
'APP_DOC_TITLE' => '',
|
||||||
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
||||||
'FOLDER_UID' => $folderId,
|
'FOLDER_UID' => $folderId,
|
||||||
'APP_DOC_TAGS' => $fileTags
|
'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
];
|
||||||
$oAppDocument->update($aFields);
|
$appDocument->update($fields);
|
||||||
break;
|
break;
|
||||||
case "NV":
|
case "NV":
|
||||||
//New Version
|
//New Version
|
||||||
$aFields = array(
|
$fields = [
|
||||||
'APP_DOC_UID' => $appDocUid,
|
'APP_DOC_UID' => $appDocUid,
|
||||||
'APP_UID' => $appId,
|
'APP_UID' => $appId,
|
||||||
'DEL_INDEX' => 1,
|
'DEL_INDEX' => 1,
|
||||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||||
'DOC_UID' => $docUid,
|
'DOC_UID' => $docUid,
|
||||||
'APP_DOC_TYPE' => $docType,
|
'APP_DOC_TYPE' => $docType,
|
||||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
||||||
$_POST['form']['APP_DOC_COMMENT'] : '',
|
$_POST['form']['APP_DOC_COMMENT'] : '',
|
||||||
'APP_DOC_TITLE' => '',
|
'APP_DOC_TITLE' => '',
|
||||||
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
||||||
'FOLDER_UID' => $folderId,
|
'FOLDER_UID' => $folderId,
|
||||||
'APP_DOC_TAGS' => $fileTags
|
'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
];
|
||||||
$oAppDocument->create($aFields);
|
$appDocument->create($fields);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//New
|
//New
|
||||||
$aFields = array(
|
$fields = [
|
||||||
'APP_UID' => $appId,
|
'APP_UID' => $appId,
|
||||||
'DEL_INDEX' => isset($_SESSION['INDEX'])?$_SESSION['INDEX']:1,
|
'DEL_INDEX' => isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : 1,
|
||||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||||
'DOC_UID' => $docUid,
|
'DOC_UID' => $docUid,
|
||||||
'APP_DOC_TYPE' => $docType,
|
'APP_DOC_TYPE' => $docType,
|
||||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ?
|
||||||
$_POST['form']['APP_DOC_COMMENT'] : '',
|
$_POST['form']['APP_DOC_COMMENT'] : '',
|
||||||
'APP_DOC_TITLE' => '',
|
'APP_DOC_TITLE' => '',
|
||||||
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
'APP_DOC_FILENAME' => $fileObj['fileName'],
|
||||||
'FOLDER_UID' => $folderId,
|
'FOLDER_UID' => $folderId,
|
||||||
'APP_DOC_TAGS' => $fileTags
|
'APP_DOC_TAGS' => $fileTags
|
||||||
);
|
];
|
||||||
$oAppDocument->create($aFields);
|
$appDocument->create($fields);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
$appDocUid = $appDocument->getAppDocUid();
|
||||||
$iDocVersion = $oAppDocument->getDocVersion();
|
$docVersion = $appDocument->getDocVersion();
|
||||||
|
|
||||||
$info = pathinfo($oAppDocument->getAppDocFilename());
|
$info = pathinfo($appDocument->getAppDocFilename());
|
||||||
$ext = (isset($info['extension']) ? $info['extension'] : '');
|
$ext = (isset($info['extension']) ? $info['extension'] : '');
|
||||||
//save the file
|
//save the file
|
||||||
//if (!empty($_FILES['form'])) {
|
//if (!empty($_FILES['form'])) {
|
||||||
//if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
|
//if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
|
||||||
$sPathName = PATH_DOCUMENT . G::getPathFromUID($appId) . PATH_SEP;
|
$pathName = PATH_DOCUMENT . G::getPathFromUID($appId) . PATH_SEP;
|
||||||
$file = G::getPathFromFileUID($appId, $sAppDocUid);
|
$file = G::getPathFromFileUID($appId, $appDocUid);
|
||||||
$sPathName .= $file[0];
|
$pathName .= $file[0];
|
||||||
$sFileName = $file[1] . "_" . $iDocVersion . '.' . $ext;
|
$sFileName = $file[1] . "_" . $docVersion . '.' . $ext;
|
||||||
|
|
||||||
G::uploadFile($fileObj['tempName'], $sPathName, $sFileName); //upload
|
G::uploadFile($fileObj['tempName'], $pathName, $sFileName); //upload
|
||||||
|
|
||||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||||
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists('uploadDocumentData')) {
|
if ($pluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists('uploadDocumentData')) {
|
||||||
$oData['APP_UID'] = $appId;
|
$oData['APP_UID'] = $appId;
|
||||||
$documentData = new uploadDocumentData(
|
$documentData = new uploadDocumentData(
|
||||||
$appId,
|
$appId,
|
||||||
$_SESSION['USER_LOGGED'],
|
$_SESSION['USER_LOGGED'],
|
||||||
$sPathName . $sFileName,
|
$pathName . $sFileName,
|
||||||
$fileObj['fileName'],
|
$fileObj['fileName'],
|
||||||
$sAppDocUid
|
$appDocUid
|
||||||
);
|
);
|
||||||
//$oPluginRegistry->executeTriggers (PM_UPLOAD_DOCUMENT , $documentData);
|
|
||||||
//unlink ($sPathName . $sFileName);
|
|
||||||
}
|
}
|
||||||
//end plugin
|
//end plugin
|
||||||
if ($sw_error) {
|
if ($sw_error) {
|
||||||
// there were errors
|
// there were errors
|
||||||
$err_msg="";
|
$err_msg = "";
|
||||||
for ($i=0; $i<$uploadedInstances; $i++) {
|
for ($i = 0; $i < $uploadedInstances; $i++) {
|
||||||
if ($errors[$i]==null) {
|
if ($errors[$i] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$err_msg .= $items[$i]." : ".$errors[$i]."\n";
|
$err_msg .= $items[$i] . " : " . $errors[$i] . "\n";
|
||||||
}
|
}
|
||||||
$response['error']=$err_msg;
|
$response['error'] = $err_msg;
|
||||||
$response['message']=$err_msg;
|
$response['message'] = $err_msg;
|
||||||
$response['success']=false;
|
$response['success'] = false;
|
||||||
} elseif ($emptyInstances==$uploadedInstances) {
|
} elseif ($emptyInstances == $uploadedInstances) {
|
||||||
$response['error']= G::LoadTranslation('ID_UPLOAD_LEAST_FILE');
|
$response['error'] = G::LoadTranslation('ID_UPLOAD_LEAST_FILE');
|
||||||
$response['message']= G::LoadTranslation('ID_UPLOAD_LEAST_FILE');
|
$response['message'] = G::LoadTranslation('ID_UPLOAD_LEAST_FILE');
|
||||||
$response['success']=false;
|
$response['success'] = false;
|
||||||
} else {
|
} else {
|
||||||
$response['error']= G::LoadTranslation('ID_UPLOAD_COMPLETE');
|
$response['error'] = G::LoadTranslation('ID_UPLOAD_COMPLETE');
|
||||||
$response['message']="Upload complete";
|
$response['message'] = "Upload complete";
|
||||||
$response['success']=true;
|
$response['success'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,35 +24,38 @@ if (isset($_REQUEST['action']) && $_REQUEST['action'] == "verifySession") {
|
|||||||
print G::json_encode($response);
|
print G::json_encode($response);
|
||||||
die();
|
die();
|
||||||
} else {
|
} else {
|
||||||
|
//When the user has session we will to validate the permissions over other actions
|
||||||
/** Action: Reassign from openCase */
|
/** Action: Reassign from openCase */
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$proUid = $_SESSION['PROCESS'];
|
$proUid = isset($_SESSION['PROCESS']) ? $_SESSION['PROCESS'] : '';
|
||||||
$appUid = $_SESSION['APPLICATION'];
|
$appUid = isset($_SESSION['APPLICATION']) ? $_SESSION['APPLICATION'] : '';
|
||||||
$tasUid = $_SESSION['TASK'];
|
$tasUid = isset($_SESSION['TASK']) ? $_SESSION['TASK'] : '';
|
||||||
|
|
||||||
$response = new stdclass();
|
$response = new stdclass();
|
||||||
$cases = new BmCases();
|
$userAuthorization = [];
|
||||||
$userAuthorization = $cases->userAuthorization(
|
if (!empty($proUid) && !empty($appUid)) {
|
||||||
$RBAC->aUserInfo['USER_INFO']['USR_UID'],
|
$cases = new BmCases();
|
||||||
$proUid,
|
$userAuthorization = $cases->userAuthorization(
|
||||||
$appUid,
|
$RBAC->aUserInfo['USER_INFO']['USR_UID'],
|
||||||
['PM_REASSIGNCASE', 'PM_REASSIGNCASE_SUPERVISOR'],
|
$proUid,
|
||||||
['REASSIGN_MY_CASES' => ''],
|
$appUid,
|
||||||
true,
|
['PM_REASSIGNCASE', 'PM_REASSIGNCASE_SUPERVISOR'],
|
||||||
$tasUid
|
['REASSIGN_MY_CASES' => ''],
|
||||||
);
|
true,
|
||||||
|
$tasUid
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$userAuthorization['rolesPermissions']['PM_REASSIGNCASE'] ||
|
$userAuthorization['rolesPermissions']['PM_REASSIGNCASE'] ||
|
||||||
($userAuthorization['rolesPermissions']['PM_REASSIGNCASE_SUPERVISOR'] && $userAuthorization['supervisor']) ||
|
($userAuthorization['rolesPermissions']['PM_REASSIGNCASE_SUPERVISOR'] && $userAuthorization['supervisor']) ||
|
||||||
in_array($appUid, $userAuthorization['objectPermissions']['REASSIGN_MY_CASES'])
|
in_array($appUid, $userAuthorization['objectPermissions']['REASSIGN_MY_CASES'])
|
||||||
) {
|
) {
|
||||||
$response->reassigncase = true;
|
$response->reassigncase = true;
|
||||||
$response->message = '';
|
$response->message = '';
|
||||||
} else {
|
}
|
||||||
$response->reassigncase = false;
|
|
||||||
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
|
||||||
}
|
}
|
||||||
|
$response->reassigncase = false;
|
||||||
|
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
||||||
|
|
||||||
print G::json_encode($response);
|
print G::json_encode($response);
|
||||||
die();
|
die();
|
||||||
|
|||||||
Reference in New Issue
Block a user