diff --git a/data/maarchRM/conf/configuration.ini.default b/data/maarchRM/conf/configuration.ini.default index f32e665dd678878a65b237ca3ba944b4d7da4157..a0a149628c37eaadd389651751329a18656a4aac 100755 --- a/data/maarchRM/conf/configuration.ini.default +++ b/data/maarchRM/conf/configuration.ini.default @@ -5,7 +5,7 @@ @include menu.ini ; Default max result in search screens -maxResults = 200 +maxResults = 500 ; Public archive mode publicArchives = false @@ -859,4 +859,4 @@ trace = 1 ; tsaUrl=http://time.certum.pl ; The path to openssl, if not in PHP path -; pathToOpenSSL="C:\Program Files\OpenSSL-Win64\bin\openssl" \ No newline at end of file +; pathToOpenSSL="C:\Program Files\OpenSSL-Win64\bin\openssl" diff --git a/src/bundle/audit/Controller/event.php b/src/bundle/audit/Controller/event.php index a81033e6ca829d78aa809fefea764ef17b64994a..e9ed83f708c37f7044f3baa88e6e48e16ad78f3c 100755 --- a/src/bundle/audit/Controller/event.php +++ b/src/bundle/audit/Controller/event.php @@ -206,19 +206,90 @@ class event /** * Get result of search form - * @param timestamp $toDate + * * @param timestamp $fromDate + * @param timestamp $toDate * @param string $event * @param string $accountId * @param string $status - * @param string $term Term to search + * @param string $term Term to search + * @param integer $maxResults Max results to display * * @return audit/event[] Array of audit/event object */ - public function search($toDate = null, $fromDate = null, $event = null, $accountId = null, $status = null, $term = null) + public function search($fromDate = null, $toDate = null, $event = null, $accountId = null, $status = null, $term = null, $maxResults = null) + { + list($queryString, $queryParams) = $this->queryBuilder($fromDate, $toDate, $event, $accountId, $status, $term); + + $events = $this->sdoFactory->find("audit/event", $queryString, $queryParams, ">eventDate", 0, $maxResults); + + $userAccountController = \laabs::newController('auth/userAccount'); + $users = $userAccountController->index(); + foreach ($users as $i => $user) { + $users[(string) $user->accountId] = $user; + unset($users[$i]); + } + + $serviceAccountController = \laabs::newController('auth/serviceAccount'); + $services = $serviceAccountController->index(); + foreach ($services as $i => $service) { + $services[(string) $service->accountId] = $service; + unset($services[$i]); + } + + foreach ($events as $i => $event) { + if (isset($event->accountId) && isset($users[(string) $event->accountId])) { + $event->accountName = $users[(string) $event->accountId]->accountName; + } elseif (isset($event->accountId) && isset($services[(string) $event->accountId])) { + $event->accountName = $services[(string) $event->accountId]->accountName; + } else { + $event->accountName = "__system__"; + } + + $event->origin = strtok($event->path, LAABS_URI_SEPARATOR); + $event->typeCode = strtok(LAABS_URI_SEPARATOR); + } + + return $events; + } + + /** + * Get count result of search form + * + * @param timestamp $fromDate + * @param timestamp $toDate + * @param string $event + * @param string $accountId + * @param string $status + * @param string $term Term to search + * + * @return integer Count of max results from query + */ + public function count($fromDate = null, $toDate = null, $event = null, $accountId = null, $status = null, $term = null) { - $queryParts = array(); - $queryParams = array(); + list($queryString, $queryParams) = $this->queryBuilder($fromDate, $toDate, $event, $accountId, $status, $term); + + $count = $this->sdoFactory->count("audit/event", $queryString, $queryParams, ">eventDate"); + + return $count; + } + + /** + * Build query + * + * @param timestamp $fromDate + * @param timestamp $toDate + * @param string $event + * @param string $accountId + * @param string $status + * @param string $term Term to search + * @param string $wording Wording to search + */ + private function queryBuilder($fromDate = null, $toDate = null, $event = null, $accountId = null, $status = null, $term = null, $wording = null) + { + $queryParts = []; + $queryParams = []; + if ($fromDate) { $queryParams['fromDate'] = $fromDate; $queryParts['fromDate'] = "eventDate >= :fromDate"; @@ -249,58 +320,21 @@ class event $queryParts['instanceName'] = "instanceName = '".\laabs::getInstanceName()."'"; } - $queryString = implode(' AND ', $queryParts ); - //$length = \laabs::getRequestMaxCount(); - $length = 400; - $events = $this->sdoFactory->find("audit/event", $queryString, $queryParams, ">eventDate", 0, $length); + $queryString = implode(' AND ', $queryParts); - $userAccountController = \laabs::newController('auth/userAccount'); - $users = $userAccountController->index(); - foreach ($users as $i => $user) { - $users[(string) $user->accountId] = $user; - unset($users[$i]); - } - - $serviceAccountController = \laabs::newController('auth/serviceAccount'); - $services = $serviceAccountController->index(); - foreach ($services as $i => $service) { - $services[(string) $service->accountId] = $service; - unset($services[$i]); - } - - foreach ($events as $i => $event) { - if (isset($event->accountId) && isset($users[(string) $event->accountId])) { - $event->accountName = $users[(string) $event->accountId]->accountName; - } elseif (isset($event->accountId) && isset($services[(string) $event->accountId])) { - $event->accountName = $services[(string) $event->accountId]->accountName; - } else { - $event->accountName = "__system__"; - } - - $event->origin = strtok($event->path, LAABS_URI_SEPARATOR); - $event->typeCode = strtok(LAABS_URI_SEPARATOR); - } - - /*if (count($events) >= $length) { - $count = $this->sdoFactory->count("audit/event", $queryString, $queryParams); - - \laabs::setResponseCode(206); - \laabs::setResponseCount($count); - }*/ - - return $events; + return [$queryString, $queryParams]; } - + /** * Get event * @param string $eventId - * + * * @return audit/event Object */ public function getEvent($eventId) { $event = $this->sdoFactory->read("audit/event", $eventId); - + return $event; } } diff --git a/src/bundle/audit/eventInterface.php b/src/bundle/audit/eventInterface.php index ce8372801ef49466bc936fa57a4739d639766f4a..282fbe7268d78b7bd0923a206cf0bc14a9a06b16 100755 --- a/src/bundle/audit/eventInterface.php +++ b/src/bundle/audit/eventInterface.php @@ -39,16 +39,32 @@ interface eventInterface /** * Get search form for entries - * @param string $eventType Type of event + * * @param timestamp $fromDate Start date * @param timestamp $toDate End date - * @param string $accountId Id of account * @param string $event Variables + * @param string $accountId Id of account + * @param string $status * @param string $term Term to search + * @param integer $maxResults Max results to display * * @action audit/event/search */ - public function readSearch($eventType = null, $fromDate = null, $toDate = null, $accountId = null, $event = null, $status = null, $term = null); + public function readSearch($fromDate = null, $toDate = null, $event = null, $accountId = null, $status = null, $term = null, $maxResults = null); + + /** + * Get count search for entries + * + * @param timestamp $fromDate Start date + * @param timestamp $toDate End date + * @param string $event Variables + * @param string $accountId Id of account + * @param string $status + * @param string $term Term to search + * + * @action audit/event/count + */ + public function readCount($fromDate = null, $toDate = null, $event = null, $accountId = null, $status = null, $term = null); /** * Get search form for entries diff --git a/src/bundle/lifeCycle/Controller/journal.php b/src/bundle/lifeCycle/Controller/journal.php index 63cb9ea87c0fe95a7390f1de7396ed1ae76129a3..b74d5857dac99c28e0429938e0104ce92e4302cf 100755 --- a/src/bundle/lifeCycle/Controller/journal.php +++ b/src/bundle/lifeCycle/Controller/journal.php @@ -309,6 +309,71 @@ class journal /** * Search a journal event + * + * @param string $eventType The type of the event + * @param string $objectClass The object class + * @param string $objectId The identifier of the object + * @param timestamp $minDate The minimum date of the event + * @param timestamp $maxDate The maximum date of the event + * @param string $org An org reg number on one of the event header or info + * @param string $sortBy The event sorting request + * @param integer $maxResults The number of result + * + * @throws \Exception + * + * @return object[] The result of the request + */ + public function searchEvent( + $eventType = null, + $objectClass = null, + $objectId = null, + $minDate = null, + $maxDate = null, + $org = null, + $sortBy = ">timestamp", + $maxResults = null + ) { + list($queryParams, $queryString) = $this->queryBuilder($eventType, $objectClass, $objectId, $minDate, $maxDate, $org); + + $events = $this->sdoFactory->find( + 'lifeCycle/event', + $queryString, + $queryParams, + $sortBy, + null, + $maxResults + ); + + $userAccountController = \laabs::newController('auth/userAccount'); + $users = $userAccountController->index(); + foreach ($users as $i => $user) { + $users[(string) $user->accountId] = $user; + unset($users[$i]); + } + + $serviceAccountController = \laabs::newController('auth/serviceAccount'); + $services = $serviceAccountController->index(); + foreach ($services as $i => $service) { + $services[(string) $service->accountId] = $service; + unset($services[$i]); + } + + foreach ($events as $i => $event) { + if (isset($event->accountId) && isset($users[(string) $event->accountId])) { + $event->accountName = $users[(string) $event->accountId]->accountName; + } elseif (isset($event->accountId) && isset($services[(string) $event->accountId])) { + $event->accountName = $services[(string) $event->accountId]->accountName; + } else { + $event->accountName = "__system__"; + } + } + + return $events; + } + + /** + * Count journal events + * * @param string $eventType The type of the event * @param string $objectClass The object class * @param string $objectId The identifier of the object @@ -316,24 +381,50 @@ class journal * @param timestamp $maxDate The maximum date of the event * @param string $org An org reg number on one of the event header or info * @param string $sortBy The event sorting request - * @param int $numberOfResult The number of result * * @throws \Exception * - * @return object[] The result of the request + * @return integer Count results of request */ - public function searchEvent( + public function searchCount( $eventType = null, $objectClass = null, $objectId = null, $minDate = null, $maxDate = null, - $org = null, - $sortBy = ">timestamp", - $numberOfResult = null + $org = null ) { - $query = array(); - $queryParams = array(); + list($queryParams, $queryString) = $this->queryBuilder($eventType, $objectClass, $objectId, $minDate, $maxDate, $org); + + $count = $this->sdoFactory->count( + 'lifeCycle/event', + $queryString, + $queryParams + ); + + return $count; + } + + /** + * Build a search sql query + * + * @param string $eventType The type of the event + * @param string $objectClass The object class + * @param string $objectId The identifier of the object + * @param timestamp $minDate The minimum date of the event + * @param timestamp $maxDate The maximum date of the event + * @param string $org An org reg number on one of the event header or info + */ + protected function queryBuilder( + $eventType = null, + $objectClass = null, + $objectId = null, + $minDate = null, + $maxDate = null, + $org = null + ) { + $query = []; + $queryParams = []; if ($this->separateInstance) { $queryParams['instanceName'] = \laabs::getInstanceName(); @@ -479,44 +570,7 @@ class journal $queryString = implode(' AND ', $query); - if (!$numberOfResult) { - $numberOfResult = \laabs::configuration('presentation.maarchRM')['maxResults']; - } - - $events = $this->sdoFactory->find( - 'lifeCycle/event', - $queryString, - $queryParams, - $sortBy, - null, - $numberOfResult - ); - - $userAccountController = \laabs::newController('auth/userAccount'); - $users = $userAccountController->index(); - foreach ($users as $i => $user) { - $users[(string) $user->accountId] = $user; - unset($users[$i]); - } - - $serviceAccountController = \laabs::newController('auth/serviceAccount'); - $services = $serviceAccountController->index(); - foreach ($services as $i => $service) { - $services[(string) $service->accountId] = $service; - unset($services[$i]); - } - - foreach ($events as $i => $event) { - if (isset($event->accountId) && isset($users[(string) $event->accountId])) { - $event->accountName = $users[(string) $event->accountId]->accountName; - } elseif (isset($event->accountId) && isset($services[(string) $event->accountId])) { - $event->accountName = $services[(string) $event->accountId]->accountName; - } else { - $event->accountName = "__system__"; - } - } - - return $events; + return [$queryParams, $queryString]; } /** diff --git a/src/bundle/lifeCycle/eventInterface.php b/src/bundle/lifeCycle/eventInterface.php index 36788c205cd7ab86c214f2659b32d2dc162fcfc2..d6aca1cf60d46332fcb9c9797601b37b9808dc0a 100755 --- a/src/bundle/lifeCycle/eventInterface.php +++ b/src/bundle/lifeCycle/eventInterface.php @@ -31,11 +31,11 @@ interface eventInterface * Search a journal event * @param string $eventType The type of the event * @param string $objectClass The class of the object - * @param string $objectId The identifier of the object (event.objectId) OR on eventInfo (archive.originatorArchiveId, archivalProfile.reference, message.reference) - * @param timestamp $minDate The minimum date of the event - * @param timestamp $maxDate The maximum date of the event - * @param string $org The org or org unit on event (event.orgRegNumber, event.orgUnitRegNumber) OR on eventInfo (archive.archiverOrgRegNumber, archive.originatorOrgRegNumber, message.senderOrgRegNumber, message.recipientOrgRegNumber) - * + * @param string $objectId The identifier of the object (event.objectId) OR on eventInfo (archive.originatorArchiveId, archivalProfile.reference, message.reference) + * @param timestamp $minDate The minimum date of the event + * @param timestamp $maxDate The maximum date of the event + * @param string $org The org or org unit on event (event.orgRegNumber, event.orgUnitRegNumber) OR on eventInfo (archive.archiverOrgRegNumber, archive.originatorOrgRegNumber, message.senderOrgRegNumber, message.recipientOrgRegNumber) + * @param integer $maxResults Limit numbr of results to return * * @action lifeCycle/journal/searchEvent */ @@ -45,7 +45,30 @@ interface eventInterface $objectId = false, $minDate = false, $maxDate = false, - $org = false + $org = false, + $maxResults = null + ); + + /** + * Count a journal event + * + * @param string $eventType The type of the event + * @param string $objectClass The class of the object + * @param string $objectId The identifier of the object (event.objectId) OR on eventInfo (archive.originatorArchiveId, archivalProfile.reference, message.reference) + * @param timestamp $minDate The minimum date of the event + * @param timestamp $maxDate The maximum date of the event + * @param string $org The org or org unit on event (event.orgRegNumber, event.orgUnitRegNumber) OR on eventInfo (archive.archiverOrgRegNumber, archive.originatorOrgRegNumber, message.senderOrgRegNumber, message.recipientOrgRegNumber) + * @param integer $maxResults Limit numbr of results to return + * + * @action lifeCycle/journal/searchCount + */ + public function readCount( + $eventType = null, + $objectClass = null, + $objectId = null, + $minDate = null, + $maxDate = null, + $org = null ); /** diff --git a/src/bundle/recordsManagement/Controller/archiveAccessTrait.php b/src/bundle/recordsManagement/Controller/archiveAccessTrait.php index 32e30a906ea48383b2bf653a064d22e5f0869fe9..1f7dd6ac7065a9afb4f5991919ff2e6ab8832afd 100755 --- a/src/bundle/recordsManagement/Controller/archiveAccessTrait.php +++ b/src/bundle/recordsManagement/Controller/archiveAccessTrait.php @@ -29,30 +29,32 @@ trait archiveAccessTrait { /** * Search archives by profile / dates / agreement - * @param string $archiveId - * @param string $profileReference - * @param string $status - * @param string $archiveName - * @param string $agreementReference - * @param string $archiveExpired - * @param string $finalDisposition - * @param string $originatorOrgRegNumber - * @param string $originatorOwnerOrgId - * @param string $originatorArchiveId - * @param array $originatingDate - * @param string $filePlanPosition - * @param bool $hasParent - * @param string $description - * @param string $text - * @param bool $partialRetentionRule - * @param string $retentionRuleCode - * @param string $depositStartDate - * @param string $depositEndDate - * @param string $originatingStartDate - * @param string $originatingEndDate - * @param string $archiverArchiveId - * @param string $processingStatus - * @param bool $checkAccess + * + * @param string $archiveId + * @param string $profileReference + * @param string $status + * @param string $archiveName + * @param string $agreementReference + * @param string $archiveExpired + * @param string $finalDisposition + * @param string $originatorOrgRegNumber + * @param string $originatorOwnerOrgId + * @param string $originatorArchiveId + * @param array $originatingDate + * @param string $filePlanPosition + * @param bool $hasParent + * @param string $description + * @param string $text + * @param bool $partialRetentionRule + * @param string $retentionRuleCode + * @param string $depositStartDate + * @param string $depositEndDate + * @param string $originatingStartDate + * @param string $originatingEndDate + * @param string $archiverArchiveId + * @param string $processingStatus + * @param bool $checkAccess + * @param integer $maxResults * * @return recordsManagement/archive[] Array of recordsManagement/archive object */ @@ -80,13 +82,163 @@ trait archiveAccessTrait $originatingEndDate = null, $archiverArchiveId = null, $processingStatus = null, - $checkAccess = true + $checkAccess = true, + $maxResults = null ) { $accountController = \laabs::newController('auth/userAccount'); $accountController->isAuthorized('user'); $archives = []; + list($searchClasses, $archiveArgs) = $this->getClassesAndArchiveArgsForSearch( + $archiveId, + $profileReference, + $status, + $archiveName, + $agreementReference, + $archiveExpired, + $finalDisposition, + $originatorOrgRegNumber, + $originatorOwnerOrgId, + $originatorArchiveId, + $originatingDate, + $filePlanPosition, + $hasParent, + $partialRetentionRule, + $retentionRuleCode, + $depositStartDate, + $depositEndDate, + $originatingStartDate, + $originatingEndDate, + $archiverArchiveId, + $processingStatus + ); + + foreach ($searchClasses as $descriptionClass => $descriptionController) { + $archives = array_merge($archives, $descriptionController->search($description, $text, $archiveArgs, $checkAccess, $maxResults)); + } + + return $archives; + } + + /** + * Count archives by profile / dates / agreement + * + * @param string $archiveId + * @param string $profileReference + * @param string $status + * @param string $archiveName + * @param string $agreementReference + * @param string $archiveExpired + * @param string $finalDisposition + * @param string $originatorOrgRegNumber + * @param string $originatorOwnerOrgId + * @param string $originatorArchiveId + * @param array $originatingDate + * @param string $filePlanPosition + * @param bool $hasParent + * @param string $description + * @param string $text + * @param bool $partialRetentionRule + * @param string $retentionRuleCode + * @param string $depositStartDate + * @param string $depositEndDate + * @param string $originatingStartDate + * @param string $originatingEndDate + * @param string $archiverArchiveId + * @param string $processingStatus + * @param bool $checkAccess + * @param integer $maxResults + * + * @return integer $count Count of archives from search + */ + public function count( + $archiveId = null, + $profileReference = null, + $status = null, + $archiveName = null, + $agreementReference = null, + $archiveExpired = null, + $finalDisposition = null, + $originatorOrgRegNumber = null, + $originatorOwnerOrgId = null, + $originatorArchiveId = null, + $originatingDate = null, + $filePlanPosition = null, + $hasParent = null, + $description = null, + $text = null, + $partialRetentionRule = null, + $retentionRuleCode = null, + $depositStartDate = null, + $depositEndDate = null, + $originatingStartDate = null, + $originatingEndDate = null, + $archiverArchiveId = null, + $processingStatus = null, + $checkAccess = true, + $maxResults = null + ) { + $accountController = \laabs::newController('auth/userAccount'); + $accountController->isAuthorized('user'); + + $archives = []; + + list($searchClasses, $archiveArgs) = $this->getClassesAndArchiveArgsForSearch( + $archiveId, + $profileReference, + $status, + $archiveName, + $agreementReference, + $archiveExpired, + $finalDisposition, + $originatorOrgRegNumber, + $originatorOwnerOrgId, + $originatorArchiveId, + $originatingDate, + $filePlanPosition, + $hasParent, + $partialRetentionRule, + $retentionRuleCode, + $depositStartDate, + $depositEndDate, + $originatingStartDate, + $originatingEndDate, + $archiverArchiveId, + $processingStatus + ); + + $count = 0; + foreach ($searchClasses as $descriptionClass => $descriptionController) { + $count += $descriptionController->count($description, $text, $archiveArgs, $checkAccess, $maxResults); + } + + return $count; + } + + protected function getClassesAndArchiveArgsForSearch( + $archiveId = null, + $profileReference = null, + $status = null, + $archiveName = null, + $agreementReference = null, + $archiveExpired = null, + $finalDisposition = null, + $originatorOrgRegNumber = null, + $originatorOwnerOrgId = null, + $originatorArchiveId = null, + $originatingDate = null, + $filePlanPosition = null, + $hasParent = null, + $partialRetentionRule = null, + $retentionRuleCode = null, + $depositStartDate = null, + $depositEndDate = null, + $originatingStartDate = null, + $originatingEndDate = null, + $archiverArchiveId = null, + $processingStatus = null + ) { $archiveArgs = [ 'archiveId' => $archiveId, 'profileReference' => $profileReference, @@ -121,7 +273,7 @@ trait archiveAccessTrait $descriptionSchemeController = \laabs::newController('recordsManagement/descriptionScheme'); foreach ($descriptionSchemeController->index() as $name => $descriptionScheme) { - if (isset($descriptionScheme->search) && !empty($descriptionScheme->search)) { + if (isset($descriptionScheme->search)) { $searchClasses[$name] = $this->useDescriptionController($descriptionScheme->search); } } @@ -133,11 +285,8 @@ trait archiveAccessTrait $searchClasses['recordsManagement/description'] = $this->useDescriptionController('recordsManagement/description'); } } - foreach ($searchClasses as $descriptionClass => $descriptionController) { - $archives = array_merge($archives, $descriptionController->search($description, $text, $archiveArgs, $checkAccess)); - } - return $archives; + return [$searchClasses, $archiveArgs]; } /** @@ -273,8 +422,8 @@ trait archiveAccessTrait } if ($partialRetentionRule) { - $queryParts['partialRetentionRule'] = "(retentionDuration=NULL - OR retentionStartDate=NULL + $queryParts['partialRetentionRule'] = "(retentionDuration=NULL + OR retentionStartDate=NULL OR retentionRuleCode=NULL)"; } @@ -319,8 +468,31 @@ trait archiveAccessTrait */ public function index($originatorOrgRegNumber, $filePlanPosition = null, $archiveUnit = false) { - $queryParts = array(); - $queryParams = array(); + list($queryString, $queryParams) = $this->getQueryStringAndParams($originatorOrgRegNumber, $filePlanPosition, $archiveUnit); + + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + $archives = $this->sdoFactory->find( + 'recordsManagement/archive', + $queryString, + $queryParams, + false, + false, + $maxResults + ); + + foreach ($archives as $archive) { + if (!empty($archive->disposalDate) && $archive->disposalDate <= \laabs::newDate()) { + $archive->disposable = true; + } + } + + return $archives; + } + + protected function getQueryStringAndParams($originatorOrgRegNumber, $filePlanPosition = null, $archiveUnit = false) + { + $queryParts = []; + $queryParams = []; $currentDate = \laabs::newDate(); $currentDateString = $currentDate->format('Y-m-d'); @@ -353,31 +525,33 @@ trait archiveAccessTrait if ($accessRuleAssert) { $queryParts[] = $accessRuleAssert; } - + $queryString = \laabs\implode(' AND ', $queryParts); - $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; - $archives = $this->sdoFactory->find( - 'recordsManagement/archive', - $queryString, - $queryParams, - false, - false, - $maxResults - ); - foreach ($archives as $archive) { - if (!empty($archive->disposalDate) && $archive->disposalDate <= \laabs::newDate()) { - $archive->disposable = true; - } - } + return [$queryString, $queryParams]; + } - return $archives; + /** + * Get archives count + * + * @param string $originatorOrgRegNumber The organization registration number + * @param string $filePlanPosition The file plan position + * @param boolean $archiveUnit List the archive unit + * + * @return integer $count + */ + public function countList($originatorOrgRegNumber, $filePlanPosition = null, $archiveUnit = false) + { + list($queryString, $queryParams) = $this->getQueryStringAndParams($originatorOrgRegNumber, $filePlanPosition, $archiveUnit); + $count = $this->sdoFactory->count('recordsManagement/archive', $queryString, $queryParams); + + return $count; } /** * Get archive metadata * @param string $archiveId The archive identifier - * + * * @return recordsManagement/archive The archive metadata */ public function getMetadata($archiveId, $checkAccess = true) diff --git a/src/bundle/recordsManagement/Controller/description.php b/src/bundle/recordsManagement/Controller/description.php index 3b5913eb07e96efdc0c653a08acd1186afc4af7a..6b40769f6be1cb03d6df99f651475b81b72cb393 100755 --- a/src/bundle/recordsManagement/Controller/description.php +++ b/src/bundle/recordsManagement/Controller/description.php @@ -130,11 +130,31 @@ class description implements \bundle\recordsManagement\Controller\archiveDescrip * @param string $text The search args on text * @param array $archiveArgs The search args on archive std properties * @param bool $checkAccess Use access control. If not, called MUST control access before or after retrieving data + * @param integer $maxResults Max results to display * * @return array The result of the research */ - public function search($description = null, $text = null, array $archiveArgs = [], $checkAccess = true) + public function search($description = null, $text = null, array $archiveArgs = [], $checkAccess = true, $maxResults = null) { + list($queryString, $queryParams) = $this->getQueryStringAndParams($description, $text, $archiveArgs, $checkAccess); + + $archiveUnits = $this->sdoFactory->find('recordsManagement/archiveUnit', $queryString, $queryParams, false, false, $maxResults); + + foreach ($archiveUnits as $archiveUnit) { + if (!empty($archiveUnit->description)) { + $archiveUnit->descriptionObject = json_decode($archiveUnit->description); + } + } + + return $archiveUnits; + } + + protected function getQueryStringAndParams( + $description = null, + $text = null, + array $archiveArgs = [], + $checkAccess = true + ) { $queryParams = []; $queryParts = ['(description!=null and text!=null)']; @@ -191,7 +211,7 @@ class description implements \bundle\recordsManagement\Controller\archiveDescrip // If at least one TS token, add search expression if (!empty($tsQueryTokens)) { $tsVectorExpression = "to_tsvector('french'::regconfig, ".$textPropertyExpr.")"; - $textQueryParts[] = $tsVectorExpression." @@ plainto_tsquery('".implode (' ', $tsQueryTokens)."')"; + $textQueryParts[] = $tsVectorExpression." @@ plainto_tsquery('". implode(' ', $tsQueryTokens)."')"; } if (!empty($textQueryParts)) { @@ -203,22 +223,34 @@ class description implements \bundle\recordsManagement\Controller\archiveDescrip $queryString = \laabs\implode(' and ', $queryParts); - $archiveUnits = $this->sdoFactory->find('recordsManagement/archiveUnit', $queryString, $queryParams); + return [$queryString, $queryParams]; + } - foreach ($archiveUnits as $archiveUnit) { - if (!empty($archiveUnit->description)) { - $archiveUnit->descriptionObject = json_decode($archiveUnit->description); - } - } + /** + * Count the description objects + * + * @param string $description The search args on description object + * @param string $text The search args on text + * @param array $archiveArgs The search args on archive std properties + * @param bool $checkAccess Use access control. If not, called MUST control access before or after retrieving data + * + * @return integer $count Research count + */ + public function count($description = null, $text = null, array $archiveArgs = [], $checkAccess = true) + { + list($queryString, $queryParams) = $this->getQueryStringAndParams($description, $text, $archiveArgs, $checkAccess); - return $archiveUnits; + $count = $this->sdoFactory->count('recordsManagement/archiveUnit', $queryString, $queryParams); + + return $count; } + /** * Update the description * @param mixed $description The description object * @param string $archiveId The archive identifier - * + * * @return bool The result of the operation */ public function update($archive) diff --git a/src/bundle/recordsManagement/Controller/log.php b/src/bundle/recordsManagement/Controller/log.php index e580e25c58391cdb6e5d43eaac9d7b2872a6f988..a75ef70d6d67b27473429df0e3de3fd37f6574e1 100755 --- a/src/bundle/recordsManagement/Controller/log.php +++ b/src/bundle/recordsManagement/Controller/log.php @@ -53,14 +53,15 @@ class log implements archiveDescriptionInterface /** * Get a search result - * @param string $archiveId The archive identifier - * @param string $type The type - * @param date $fromDate The date - * @param date $toDate The date - * @param string $processName The process name - * @param string $processId The process identifier - * @param string $sortBy The process identifier - * @param int $numberOfResult The process identifier + * + * @param string $archiveId The archive identifier + * @param string $type The type + * @param date $fromDate The date + * @param date $toDate The date + * @param string $processName The process name + * @param string $processId The process identifier + * @param string $sortBy The process identifier + * @param integer $maxResults The process identifier * * @return array Array of logs */ @@ -72,12 +73,44 @@ class log implements archiveDescriptionInterface $processName = null, $processId = null, $sortBy = ">fromDate", - $numberOfResult = null + $maxResults = null ) { - $queryParts = array(); - $queryParams = array(); + list($queryParams, $queryString) = $this->queryBuilder($archiveId, $type, $fromDate, $toDate, $processName, $processId); + + $logs = $this->sdoFactory->find( + "recordsManagement/log", + $queryString, + $queryParams, + $sortBy, + 0, + $maxResults + ); + + return $logs; + } - //$queryParts[] = $this->auth->getUserAccessRule('recordsManagement/log'); + /** + * Create query for search + * + * @param string $archiveId The archive identifier + * @param string $type The type + * @param date $fromDate The date + * @param date $toDate The date + * @param string $processName The process name + * @param string $processId The process identifier + * + * @return + */ + protected function queryBuilder( + $archiveId = null, + $type = null, + $fromDate = null, + $toDate = null, + $processName = null, + $processId = null + ) { + $queryParts = []; + $queryParams = []; if ($archiveId) { $queryParams['archiveId'] = $archiveId; @@ -113,31 +146,52 @@ class log implements archiveDescriptionInterface $queryString = implode(' AND ', $queryParts); - if (!$numberOfResult) { - $numberOfResult = \laabs::configuration('presentation.maarchRM')['maxResults']; - } + return [$queryParams, $queryString]; + } - $logs = $this->sdoFactory->find( + /** + * Count search results + * + * @param string $archiveId The archive identifier + * @param string $type The type + * @param date $fromDate The date + * @param date $toDate The date + * @param string $processName The process name + * @param string $processId The process identifier + * + * @return integer + */ + public function countFind( + $archiveId = null, + $type = null, + $fromDate = null, + $toDate = null, + $processName = null, + $processId = null + ) { + list($queryParams, $queryString) = $this->queryBuilder($archiveId, $type, $fromDate, $toDate, $processName, $processId); + + $count = $this->sdoFactory->count( "recordsManagement/log", $queryString, - $queryParams, - $sortBy, - 0, - $numberOfResult + $queryParams ); - return $logs; + return $count; } /** * Search the description objects - * @param string $description The search args on description object - * @param string $text The search args on text - * @param array $args The search args on archive std properties + * + * @param string $description The search args on description object + * @param string $text The search args on text + * @param array $args The search args on archive std properties + * @param bool $checkAccess Use access control. If not, called MUST control access before or after retrieving data + * @param integer $maxResults Max results to display * * @return object Array of description objects */ - public function search($description = null, $text = null, array $args = []) + public function search($description = null, $text = null, array $args = [], $checkAccess = null, $maxResults = null) { $queryParams = $queryParts = []; $queryString = ""; @@ -172,8 +226,8 @@ class log implements archiveDescriptionInterface $archives = []; $sortBy = ">fromDate"; - $numberOfResult = \laabs::configuration('presentation.maarchRM')['maxResults']; - $logs = $this->sdoFactory->find("recordsManagement/log", $queryString, [], $sortBy, 0, $numberOfResult); + + $logs = $this->sdoFactory->find("recordsManagement/log", $queryString, [], $sortBy, 0, $maxResults); foreach ($logs as $log) { try { @@ -187,6 +241,19 @@ class log implements archiveDescriptionInterface return $archives; } + /** + * Count log objects + * @param string $description The search args on description object + * @param string $text The search args on text + * @param array $args The search args on archive std properties + * + * @return object Array of description objects + */ + public function count($description = null, $text = null, array $args = [], $checkAccess = null, $maxResults = null) + { + return count($this->search($description, $text, $args, $checkAccess, $maxResults = null)); + } + /** * Retrieve a journal by evenement date * @param string $type The journal type diff --git a/src/bundle/recordsManagement/archivesInterface.php b/src/bundle/recordsManagement/archivesInterface.php index 88c4c235ab4313a121bbd4c90a2a169850b5a10a..7b1e029762e83bd0ced10fa884831eb3874e4a1c 100755 --- a/src/bundle/recordsManagement/archivesInterface.php +++ b/src/bundle/recordsManagement/archivesInterface.php @@ -32,28 +32,30 @@ interface archivesInterface */ /** * Search archives by profile / dates / agreement - * @param string $archiveId - * @param string $profileReference - * @param string $status - * @param string $archiveName - * @param string $agreementReference - * @param string $archiveExpired - * @param string $finalDisposition - * @param string $originatorOrgRegNumber - * @param string $originatorOwnerOrgId - * @param string $originatorArchiveId - * @param array $originatingDate - * @param string $filePlanPosition - * @param bool $hasParent - * @param string $description - * @param string $text - * @param bool $partialRetentionRule - * @param string $retentionRuleCode - * @param string $depositStartDate - * @param string $depositEndDate - * @param string $originatingStartDate - * @param string $originatingEndDate - * @param string $archiverArchiveId + * + * @param string $archiveId + * @param string $profileReference + * @param string $status + * @param string $archiveName + * @param string $agreementReference + * @param string $archiveExpired + * @param string $finalDisposition + * @param string $originatorOrgRegNumber + * @param string $originatorOwnerOrgId + * @param string $originatorArchiveId + * @param array $originatingDate + * @param string $filePlanPosition + * @param bool $hasParent + * @param string $description + * @param string $text + * @param bool $partialRetentionRule + * @param string $retentionRuleCode + * @param string $depositStartDate + * @param string $depositEndDate + * @param string $originatingStartDate + * @param string $originatingEndDate + * @param string $archiverArchiveId + * @param integer $maxResults * * @action recordsManagement/archive/search * @@ -80,7 +82,64 @@ interface archivesInterface $depositEndDate = null, $originatingStartDate = null, $originatingEndDate = null, - $archiverArchiveId = null + $archiverArchiveId = null, + $maxResults = null + ); + + /** + * Count archives by profile / dates / agreement + * + * @param string $archiveId + * @param string $profileReference + * @param string $status + * @param string $archiveName + * @param string $agreementReference + * @param string $archiveExpired + * @param string $finalDisposition + * @param string $originatorOrgRegNumber + * @param string $originatorOwnerOrgId + * @param string $originatorArchiveId + * @param array $originatingDate + * @param string $filePlanPosition + * @param bool $hasParent + * @param string $description + * @param string $text + * @param bool $partialRetentionRule + * @param string $retentionRuleCode + * @param string $depositStartDate + * @param string $depositEndDate + * @param string $originatingStartDate + * @param string $originatingEndDate + * @param string $archiverArchiveId + * @param integer $maxResults + * + * @action recordsManagement/archive/count + * + */ + public function readCount( + $archiveId = null, + $profileReference = null, + $status = null, + $archiveName = null, + $agreementReference = null, + $archiveExpired = null, + $finalDisposition = null, + $originatorOrgRegNumber = null, + $originatorOwnerOrgId = null, + $originatorArchiveId = null, + $originatingDate = null, + $filePlanPosition = null, + $hasParent = null, + $description = null, + $text = null, + $partialRetentionRule = null, + $retentionRuleCode = null, + $depositStartDate = null, + $depositEndDate = null, + $originatingStartDate = null, + $originatingEndDate = null, + $archiverArchiveId = null, + $maxResults = null ); /** @@ -144,6 +203,17 @@ interface archivesInterface */ public function readList($originatorOrgRegNumber, $filePlanPosition = null, $archiveUnit = false); + /** + * Get archives Count without limit + * + * @param string $originatorOrgRegNumber The organization registration number + * @param string $filePlanPosition The file plan position + * @param boolean $archiveUnit List the archive unit + * + * @action recordsManagement/archive/countList + */ + public function readCountList($originatorOrgRegNumber, $filePlanPosition = null, $archiveUnit = false); + /* MODIFY ARCHIVES */ diff --git a/src/bundle/recordsManagement/logInterface.php b/src/bundle/recordsManagement/logInterface.php index d3636dba32ba87c7463569dd04960537293a7481..8e598104e09a8fd3017e8e19fd7cae63a2f350f2 100755 --- a/src/bundle/recordsManagement/logInterface.php +++ b/src/bundle/recordsManagement/logInterface.php @@ -25,15 +25,16 @@ interface logInterface { /** * Get a search result - * @param string $archiveId The archive identifier - * @param string $type The type - * @param date $fromDate The date - * @param date $toDate The date - * @param string $processName The process name - * @param string $processId The process identifier - * @param string $sortBy The process identifier - * @param int $numberOfResult The process identifier - + * + * @param string $archiveId The archive identifier + * @param string $type The type + * @param date $fromDate The date + * @param date $toDate The date + * @param string $processName The process name + * @param string $processId The process identifier + * @param string $sortBy The process identifier + * @param integer $maxResults Max number of results to return + * * @action recordsManagement/log/find */ public function readFind( @@ -44,7 +45,28 @@ interface logInterface $processName = null, $processId = null, $sortBy = ">fromDate", - $numberOfResult = null + $maxResults = null + ); + + /** + * Count search results + * + * @param string $archiveId The archive identifier + * @param string $type The type + * @param date $fromDate The date + * @param date $toDate The date + * @param string $processName The process name + * @param string $processId The process identifier + + * @action recordsManagement/log/countFind + */ + public function countFind( + $archiveId = null, + $type = null, + $fromDate = null, + $toDate = null, + $processName = null, + $processId = null ); /** diff --git a/src/presentation/maarchRM/Presenter/audit/event.php b/src/presentation/maarchRM/Presenter/audit/event.php index 7493df34716a38fce706a79a86483fb66967fed0..dca6e9971fe02ef671f48152ea48909909303be3 100755 --- a/src/presentation/maarchRM/Presenter/audit/event.php +++ b/src/presentation/maarchRM/Presenter/audit/event.php @@ -108,31 +108,30 @@ class event $event->label = $translator->getText($event->path, false, "audit/messages"); $events[] = $event; } - + + $maxResults = null; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults'])) { + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + } + $this->view->addContentFile("audit/search.html"); $this->view->setSource("events", $events); + $this->view->setSource("maxResults", $maxResults); $this->view->translate(); $this->view->merge(); - $this->view->addScriptSrc( -<<view->saveHtml(); } /** * Get result * - * @param Array $events Array of audit/event object + * @param array $events Array of audit/event object + * @param integer $totalResults Max number of total results from query * * @return string view */ - public function search($events) + public function search($events, $totalResults) { $this->view->addContentFile("audit/result.html"); @@ -142,7 +141,15 @@ EOD } else { $multipleInstance = false; } - + + $hasReachMaxResults = false; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults']) + && $totalResults >= \laabs::configuration('presentation.maarchRM')['maxResults']) { + $hasReachMaxResults = true; + } + + $this->view->setSource('hasReachMaxResults', $hasReachMaxResults); + $this->view->setSource('totalResults', $totalResults); $this->view->setSource('multipleInstance', $multipleInstance); $this->view->setSource("events", $events); $this->view->merge(); diff --git a/src/presentation/maarchRM/Presenter/lifeCycle/journal.php b/src/presentation/maarchRM/Presenter/lifeCycle/journal.php index f0a43b75300d6f2a85f33885b1fbb0a6c738e11e..5e46281fdc4017b63c11de2d721ff8cba43c95a1 100755 --- a/src/presentation/maarchRM/Presenter/lifeCycle/journal.php +++ b/src/presentation/maarchRM/Presenter/lifeCycle/journal.php @@ -30,7 +30,7 @@ class journal use \presentation\maarchRM\Presenter\exceptions\exceptionTrait; public $view; - + private $sdoFactory; private $eventsFormat; @@ -55,7 +55,7 @@ class journal $this->view = $view; $this->sdoFactory = $sdoFactory; $this->eventsFormat = $eventsFormat; - + $this->json = $json; $this->json->status = true; @@ -75,7 +75,7 @@ class journal $eventTypes = \laabs::callService('lifeCycle/event/readEventtypelist'); $this->view->translator->setCatalog("lifeCycle/messages"); - + $eventDomains = []; foreach ($eventTypes as $eventType) { $bundle = strtok($eventType, '/'); @@ -139,7 +139,13 @@ class journal }); } + $maxResults = null; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults'])) { + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + } + $this->view->setSource("eventType", $eventDomains); + $this->view->setSource("maxResults", $maxResults); $this->view->merge(); $this->view->translate(); @@ -160,7 +166,7 @@ class journal $this->view->setSource('journals', $journals); $this->view->merge(); - + $dataTable = $this->view->getElementsByClass("dataTable")->item(0)->plugin['dataTable']; $dataTable->setPaginationType("full_numbers"); $dataTable->setUnsortableColumns(2); @@ -198,11 +204,13 @@ class journal /** * Show the result of the event search - * @param array $events The list of events + * + * @param array $events The list of events + * @param integer $totalResults Max number of results returned from query without limit * * @return string */ - public function searchEvent($events) + public function searchEvent($events, $totalResults) { $this->view->addContentFile("lifeCycle/searchResult.html"); @@ -213,6 +221,14 @@ class journal $multipleInstance = false; } + $hasReachMaxResults = false; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults']) + && $totalResults >= \laabs::configuration('presentation.maarchRM')['maxResults']) { + $hasReachMaxResults = true; + } + + $this->view->setSource('hasReachMaxResults', $hasReachMaxResults); + $this->view->setSource('totalResults', $totalResults); $this->view->setSource('multipleInstance', $multipleInstance); $this->view->setSource('events', $events); $this->view->merge(); @@ -230,7 +246,7 @@ class journal } return $this->view->saveHtml(); } - + //JSON /** * Serializer JSON for create method @@ -270,7 +286,7 @@ class journal $eventObject->accountDisplayName = $user->displayName.' ('.$user->accountName.')'; $this->translator->setCatalog('lifeCycle/messages'); - + $eventObject->description = $this->translator->getText($event->description); $eventObject->objectClass = $this->translator->getText($event->objectClass); $eventObject->eventType = $this->translator->getText($event->eventType); @@ -278,22 +294,22 @@ class journal // check event type to add button "download certificate" $hasCertificatePrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "journal/certificate"); $eventsToCertificate = ['recordsManagement/deposit', 'recordsManagement/integrityCheck', 'recordsManagement/destruction']; - + if ($hasCertificatePrivilege && in_array($event->eventType, $eventsToCertificate)) { $eventObject->hasCertificate = true; } - + $this->json->load($eventObject); $this->json->formatDateTimes(); return $this->json->save(); } - + /** * Exception * @param lifeCycle/Exception/journalException $journalException - * + * * @return string */ public function journalException($journalException) diff --git a/src/presentation/maarchRM/Presenter/recordsManagement/archive.php b/src/presentation/maarchRM/Presenter/recordsManagement/archive.php index a8e646ef19fde7771b6f928fed6d8f61ba71ccc3..39238d48c8671337436523fc6193f808b3574d54 100755 --- a/src/presentation/maarchRM/Presenter/recordsManagement/archive.php +++ b/src/presentation/maarchRM/Presenter/recordsManagement/archive.php @@ -94,6 +94,12 @@ class archive $deleteDescription = (bool) \laabs::configuration("recordsManagement")['deleteDescription']; } + $maxResults = null; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults'])) { + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + } + + $this->view->setSource("maxResults", $maxResults); $this->view->setSource("retentionRules", $retentionRules); $this->view->setSource("emptyRole", $emptyRole); $this->view->setSource("profiles", $profiles); @@ -112,11 +118,12 @@ class archive /** * get archives with information - * @param array $archives Array of archive object + * @param array $archives Array of archive object + * @param integer $count Count of archive object without limit * * @return string */ - public function search($archives) + public function search($archives, $count) { $this->view->addContentFile("recordsManagement/archive/resultList.html"); @@ -198,6 +205,12 @@ class archive } } + $hasReachMaxResults = false; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults']) + && count($archives) >= \laabs::configuration('presentation.maarchRM')['maxResults']) { + $hasReachMaxResults = true; + } + $dataTable = $this->view->getElementsByClass("dataTable")->item(0)->plugin['dataTable']; $dataTable->setPaginationType("full_numbers"); @@ -233,6 +246,9 @@ class archive $this->readPrivilegesOnArchives(); + $this->view->setSource('hasReachMaxResults', $hasReachMaxResults); + $this->view->setSource('maxResults', \laabs::configuration('presentation.maarchRM')['maxResults']); + $this->view->setSource('totalResultsWithoutLimit', $count); $this->view->setSource("accessRules", $accessRules); $this->view->setSource("retentionRules", $retentionRules); $this->view->setSource('archive', $archives); diff --git a/src/presentation/maarchRM/Presenter/recordsManagement/log.php b/src/presentation/maarchRM/Presenter/recordsManagement/log.php index df1e0cfda9da71d48b505fdbd9f9f762854180bf..97843874b054ad57134e92d791ad4c12e19787e7 100755 --- a/src/presentation/maarchRM/Presenter/recordsManagement/log.php +++ b/src/presentation/maarchRM/Presenter/recordsManagement/log.php @@ -54,16 +54,26 @@ class log $this->view->addContentFile('recordsManagement/log/searchForm.html'); $this->view->translate(); + $maxResults = null; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults'])) { + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + } + $this->view->setSource("maxResults", $maxResults); + $this->view->translate(); + $this->view->merge(); + return $this->view->saveHtml(); } /** * Show result log search - * @param array $logs The arry of object + * + * @param array $logs The arry of object + * @param integer $totalResults Max number of total results from query * * @return string */ - public function find($logs) + public function find($logs, $totalResults) { $this->view->addContentFile('recordsManagement/log/result.html'); $this->view->translate(); @@ -79,6 +89,14 @@ class log $log->resId = \laabs::callService('recordsManagement/archives/readArchivecontents_archive_', (string) $log->archiveId)->digitalResources[0]->resId; } + $hasReachMaxResults = false; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults']) + && $totalResults >= \laabs::configuration('presentation.maarchRM')['maxResults']) { + $hasReachMaxResults = true; + } + + $this->view->setSource('hasReachMaxResults', $hasReachMaxResults); + $this->view->setSource('totalResults', $totalResults); $this->view->setSource("logs", $logs); $this->view->merge(); diff --git a/src/presentation/maarchRM/Presenter/recordsManagement/welcome.php b/src/presentation/maarchRM/Presenter/recordsManagement/welcome.php index 1afb9d3830774aa46b3d3fd4176e590c5578f6a1..157a13ecfe5e8cdd0bed797b9287e045a13574f2 100755 --- a/src/presentation/maarchRM/Presenter/recordsManagement/welcome.php +++ b/src/presentation/maarchRM/Presenter/recordsManagement/welcome.php @@ -112,11 +112,17 @@ class welcome $depositPrivilege = \laabs::callService('auth/userAccount/readHasprivilege', "archiveDeposit/deposit"); + $maxResults = null; + if (isset(\laabs::configuration('presentation.maarchRM')['maxResults'])) { + $maxResults = \laabs::configuration('presentation.maarchRM')['maxResults']; + } + $this->view->setSource("userArchivalProfiles", $this->userArchivalProfiles); $this->view->setSource("depositPrivilege", $depositPrivilege); $this->view->setSource("syncImportPrivilege", $syncImportPrivilege); $this->view->setSource("asyncImportPrivilege", $asyncImportPrivilege); $this->view->setSource("filePlanPrivileges", $filePlanPrivileges); + $this->view->setSource("maxResults", $maxResults); $this->view->setSource('retentionRules', $retentionRules); $this->view->setSource('user', $user); @@ -184,11 +190,13 @@ class welcome /** * Show a folder content - * @param array $archives + * + * @param array $archives + * @param integer $count Archives count without limit * * @return string */ - public function folderContents($archives) + public function folderContents($archives, $count) { $organizations = \laabs::callService('organization/organization/readIndex'); $orgsName = []; @@ -212,6 +220,7 @@ class welcome } $this->json->archives = $archives; + $this->json->countWithoutLimit = $count; return $this->json->save(); } diff --git a/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po b/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po index ea8384386b977447adc1f6506cc99c68ca2a258d..63b37f3048178bd04f05ba898dfe22c6adf94fd9 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po +++ b/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po @@ -1941,3 +1941,6 @@ msgstr "Import du référentiel de champ de description" msgid "recordsManagement/retentionRule/createImport" msgstr "Import du référentiel de règle de conservation" + +msgid "result(s) on" +msgstr "résultat(s) sur" diff --git a/src/presentation/maarchRM/Resources/locale/fr/lifeCycle/messages.po b/src/presentation/maarchRM/Resources/locale/fr/lifeCycle/messages.po index d1f1af05dbe160ce706de1616cd62f7fabc54bfe..79a4a69989e55e02ad920eedcc364f967baaba90 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/lifeCycle/messages.po +++ b/src/presentation/maarchRM/Resources/locale/fr/lifeCycle/messages.po @@ -753,6 +753,8 @@ msgid "certificateName" msgstr "Attestation de destruction" msgctxt "recordsManagement/destruction" - msgid "Organization" -msgstr "Organisation" \ No newline at end of file +msgstr "Organisation" + +msgid "result(s) on" +msgstr "résultat(s) sur" diff --git a/src/presentation/maarchRM/Resources/locale/fr/messages.po b/src/presentation/maarchRM/Resources/locale/fr/messages.po index d8a4627c53970e8dab80f693272308022974ddc8..e07d55ea5d2354a6edca81683776a568901fff65 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/messages.po +++ b/src/presentation/maarchRM/Resources/locale/fr/messages.po @@ -612,4 +612,7 @@ msgid "Resource size is null" msgstr "La taille de la ressource est nulle" msgid "Attempt to access without a valid token" -msgstr "Une erreur est survenue. Si le problème persiste, veuillez recharger la page." \ No newline at end of file +msgstr "Une erreur est survenue. Si le problème persiste, veuillez recharger la page." + +msgid "Your query returns too much results, only first results are displayed." +msgstr "Le nombre de résultats retournés est trop important. Veuillez affiner votre recherche." diff --git a/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/log.po b/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/log.po index cbb4002a4ca921d09f76dd06d5aabc8a2e8fb957..79cccbd2b805e02386042857baa9f388ee38b6be 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/log.po +++ b/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/log.po @@ -65,3 +65,5 @@ msgstr "La vérification d'intégrité du journal a échoué." msgid "The journal is integrity is valid." msgstr "Le journal est intègre." +msgid "result(s) on" +msgstr "résultat(s) sur" diff --git a/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/messages.po b/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/messages.po index a3262b1ca373a2adbbb7e0d340a2780314cc4389..1c6d94944baad30ca043a06ece482d666c30ba13 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/messages.po +++ b/src/presentation/maarchRM/Resources/locale/fr/recordsManagement/messages.po @@ -420,6 +420,9 @@ msgstr "DUA" msgid "result(s)" msgstr "résultat(s)" +msgid "archive(s) on" +msgstr "archive(s) sur" + msgid "Search" msgstr "Rechercher" diff --git a/src/presentation/maarchRM/Resources/view/audit/result.html b/src/presentation/maarchRM/Resources/view/audit/result.html index 604ec2ab71e2027385bfad7d9e2247850399fdb8..d02fe60a4a69e245bbdfe45090c64ad210b34b80 100755 --- a/src/presentation/maarchRM/Resources/view/audit/result.html +++ b/src/presentation/maarchRM/Resources/view/audit/result.html @@ -3,7 +3,10 @@
+

result(s)

+ +

result(s) on total

@@ -69,4 +72,4 @@ $("#eventList").on('click', '.viewEvent', function () { } }); }); - \ No newline at end of file + diff --git a/src/presentation/maarchRM/Resources/view/audit/search.html b/src/presentation/maarchRM/Resources/view/audit/search.html index aa0f2ee245857aa0ad2ef1e696c08b805469cd6c..6a54d707ebd1ba16bb7e892e8fb3166c2729d896 100755 --- a/src/presentation/maarchRM/Resources/view/audit/search.html +++ b/src/presentation/maarchRM/Resources/view/audit/search.html @@ -18,6 +18,7 @@
+
@@ -128,8 +129,9 @@ event: $('#eventName').data('event-path'), accountId: $.trim($('#accountTypeahead').val()), term: $('#term').val(), + maxResults: $('#maxResults').val() }; - + if ($('#accountTypeahead').data('accountid')) { serializedObject.accountId = $('#accountTypeahead').data('accountid') ; } diff --git a/src/presentation/maarchRM/Resources/view/dashboard/mainScreen/folder.html b/src/presentation/maarchRM/Resources/view/dashboard/mainScreen/folder.html index 9cddb6b822639bbc7873e3f96a8eaa31b2837593..f33e65cca4fb24103db0bd5ad70fb797499c20ed 100755 --- a/src/presentation/maarchRM/Resources/view/dashboard/mainScreen/folder.html +++ b/src/presentation/maarchRM/Resources/view/dashboard/mainScreen/folder.html @@ -9,7 +9,7 @@
-
+

@@ -196,6 +196,7 @@ folderId : null, pathList : [], showArchivePath: false, + totalArchives: null, getfolderContents: function(orgRegNumber, folderId, archivalProfiles, disabled, locked, acceptArchivesWithoutProfiles, pathList) { this.orgRegNumber = orgRegNumber; @@ -230,7 +231,7 @@ type : "GET", dataType : 'json', success : function (response) { - ArchiveFolderList.buildResultList(response.archives); + ArchiveFolderList.buildResultList(response.archives, null, false, response.countWithoutLimit); if (locked || disabled) { ArchiveFolderList.folderPanel.find('.addChildrenArchive').remove(); } @@ -259,7 +260,7 @@ $("#folderToolbarSearch").data("orgregnumber", orgRegNumber).data("folderid", folderId); }, - buildResultList: function(archives, options, showArchivePath) { + buildResultList: function(archives, options, showArchivePath, totalResult) { // to inititate default value and avoid bug on IE 11 if (options === undefined) { options = null; @@ -285,8 +286,9 @@ defaultOptions = { datas: archives, + total: totalResult, rowMerge: ArchiveFolderList.mergeRow, - rowMaxNumber: 10, + rowMaxNumber: ($('#fullTextSearchForm').find('[name=maxResults]').val() != 'undefined' ? parseInt($('#fullTextSearchForm').find('[name=maxResults]').val(), 10) : 10), rowTranslation: $('#rows_text').text(), emptyMessage: ' <\/span>' + $('#emptyFolder_text').html() + '<\/i>', itemsName: [$('#archive_text').text(), $('#archives_text').text()], diff --git a/src/presentation/maarchRM/Resources/view/lifeCycle/searchForm.html b/src/presentation/maarchRM/Resources/view/lifeCycle/searchForm.html index 0ef051102bf42c8e6122d49c6431b60db2d538ba..ee05af0bc35e6804e4a559094eeb4208588b53b0 100755 --- a/src/presentation/maarchRM/Resources/view/lifeCycle/searchForm.html +++ b/src/presentation/maarchRM/Resources/view/lifeCycle/searchForm.html @@ -22,6 +22,7 @@
+
@@ -84,8 +85,8 @@
-
-
+
+
@@ -96,7 +97,7 @@ - +