BUG 6947 I add validation to delete inputs with permission
I add validation to delete inputs with permission
This commit is contained in:
@@ -3277,6 +3277,12 @@ class Cases
|
||||
*/
|
||||
public function getInputDocumentsCriteria($sApplicationUID, $iDelegation, $sDocumentUID, $sAppDocuUID = '')
|
||||
{
|
||||
$deletePermission = $this->getAllObjectsFrom($_SESSION['PROCESS'],
|
||||
$sApplicationUID,
|
||||
$_SESSION['TASK'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$ACTION = 'DELETE');
|
||||
|
||||
try {
|
||||
$listing = false;
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
@@ -3325,6 +3331,7 @@ class Cases
|
||||
'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'],
|
||||
'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX']
|
||||
);
|
||||
|
||||
if ($aFields['APP_DOC_FILENAME'] != '') {
|
||||
$aFields['TITLE'] = $aFields['APP_DOC_FILENAME'];
|
||||
} else {
|
||||
@@ -3333,10 +3340,10 @@ class Cases
|
||||
$aFields['POSITION'] = isset($_SESSION['STEP_POSITION']) ? $_SESSION['STEP_POSITION'] : 1;
|
||||
$aFields['CONFIRM'] = G::LoadTranslation('ID_CONFIRM_DELETE_INPUT_AND_HISTORY');
|
||||
|
||||
//if (in_array($aRow['APP_DOC_UID'], $aDelete['INPUT_DOCUMENTS'])) {
|
||||
// $aFields['ID_DELETE'] = G::LoadTranslation('ID_DELETE');
|
||||
//}
|
||||
$aFields['ID_DELETE'] = '';
|
||||
if (in_array($aRow['APP_DOC_UID'], $deletePermission['INPUT_DOCUMENTS'])) {
|
||||
$aFields['ID_DELETE'] = G::LoadTranslation('ID_DELETE');
|
||||
}
|
||||
|
||||
$aFields['REPLACE_LABEL'] = "";
|
||||
if (($aRow['DOC_VERSION'] == $lastVersion) || ($sAppDocuUID != "")) {
|
||||
|
||||
@@ -274,13 +274,6 @@
|
||||
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT_BEFORE , array('USR_UID'=>$_SESSION['USER_LOGGED']) );
|
||||
}
|
||||
//END: If there is a Break Step registered from Plugin
|
||||
$deletePermission = $oCase->getAllObjectsFrom($_SESSION['PROCESS'],
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['TASK'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$ACTION = 'DELETE');
|
||||
$permissionsInput = implode(',',$deletePermission['INPUT_DOCUMENTS']);
|
||||
$Fields['permissionsInput'] = $permissionsInput;
|
||||
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['UID']), array_merge(array('DOC_UID'=>$_GET['UID']),$Fields));//$aFields
|
||||
|
||||
//call plugin
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<!-- START BLOCK : headBlock -->
|
||||
<input style="display: none;" type="text" id="permissionsInput" value="{permissionsInput}" />
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr><td>
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="pagedTableDefault">
|
||||
@@ -182,28 +181,5 @@ function toggleMasterDetailGroup(tablename,groupName,imgicon){
|
||||
}
|
||||
}
|
||||
document.getElementById('mainlabel').innerHTML = documentName;
|
||||
var inputIds = document.getElementById('permissionsInput').value.split(',');
|
||||
var hiddenA = new Array();
|
||||
var elementsA = document.getElementsByTagName('a');
|
||||
|
||||
for (i=0; i<elementsA.length; i++) {
|
||||
if (typeof(elementsA[i]) != 'undefined') {
|
||||
if (elementsA[i].href.indexOf('cases_DeleteDocument')!=-1) {
|
||||
//elementsA[i].parentNode.removeChild(elementsA[i]);
|
||||
elementsA[i].style.display = 'none';
|
||||
hiddenA.push(elementsA[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<hiddenA.length; i++) {
|
||||
if (typeof(hiddenA[i]) != 'undefined') {
|
||||
for (f=0; f<inputIds.length; f++) {
|
||||
if (inputIds[f] != '' && hiddenA[i].href.indexOf(inputIds[f])!=-1) {
|
||||
hiddenA[i].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- END IGNORE -->
|
||||
|
||||
Reference in New Issue
Block a user