Commit 66ce90ee authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

fix(17942) : add search on archiveId archiverArchiveId and originatorArchiveId with only one field

parent 1117f5ae
Pipeline #17614 failed with stages
in 34 seconds
......@@ -85,6 +85,12 @@ trait archiveAccessTrait
$checkAccess = true,
$maxResults = null
) {
if(is_null($originatorArchiveId)) {
$originatorArchiveId = $archiverArchiveId;
}
// var_dump($originatorArchiveId);
// var_dump($archiverArchiveId);
// exit;
$accountController = \laabs::newController('auth/userAccount');
$accountController->isAuthorized('user');
......@@ -1035,6 +1041,11 @@ trait archiveAccessTrait
$queryParts['archiverArchiveId'] = "archiverArchiveId= :archiverArchiveId";
$queryParams['archiverArchiveId'] = $args['archiverArchiveId'];
}
if (!empty($args['originatorArchiveId']) && !empty($args['archiverArchiveId']) && $args['originatorArchiveId'] == $args['archiverArchiveId']) {
$queryParts['originatorArchiveId'] = "(archiveId= :archiveId OR originatorArchiveId= :originatorArchiveId OR archiverArchiveId= :archiverArchiveId)";
$queryParams['archiveId'] = $args['originatorArchiveId'];
unset($queryParts['archiverArchiveId']);
}
if (!empty($args['originatingDate'])) {
if (!empty($args['originatingDate'][0]) && is_string($args['originatingDate'][0])) {
$args['originatingDate'][0] = \laabs::newDate($args['originatingDate'][0]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment