fix: [Logs] Event history missing proposal entries and deletions

Signed-off-by: iglocska <andras.iklody@gmail.com>
pull/4627/head
iglocska 2019-05-13 15:57:00 +02:00
parent 5c43284099
commit 62f026ff8c
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 11 additions and 1 deletions

View File

@ -159,6 +159,8 @@ class LogsController extends AppController
'eventid' => $id,
'includeAllTags' => 1,
'sgReferenceOnly' => 1,
'deleted' => 1,
'deleted_proposals' => 1
));
$conditions = array(
'OR' => array(

View File

@ -1934,6 +1934,14 @@ class Event extends AppModel
${'conditions' . $softDeletable . 's'}['AND'][$softDeletable . '.deleted LIKE'] = 0;
}
}
$proposal_conditions = array('OR' => array('ShadowAttribute.deleted' => 0));
if (isset($options['deleted_proposals'])) {
if ($isSiteAdmin) {
$proposal_conditions = array('OR' => array('ShadowAttribute.deleted' => 1));
} else {
$proposal_conditions['OR'][] = array('(SELECT events.org_id FROM events WHERE events.id = ShadowAttribute.event_id)' => $user['org_id']);
}
}
if ($options['idList'] && !$options['tags']) {
$conditions['AND'][] = array('Event.id' => $options['idList']);
}
@ -1995,7 +2003,7 @@ class Event extends AppModel
),
'ShadowAttribute' => array(
'fields' => $fieldsShadowAtt,
'conditions' => array('deleted' => 0),
'conditions' => $proposal_conditions,
'Org' => array('fields' => $fieldsOrg),
'order' => false
),