diff --git a/data/maarchRM/conf/configuration.ini.default b/data/maarchRM/conf/configuration.ini.default index bea0be42fc124b8a336693eb5116d227a9bda068..f4f224623ae0e1b06e698cc8e4189ff3cab9a8b1 100755 --- a/data/maarchRM/conf/configuration.ini.default +++ b/data/maarchRM/conf/configuration.ini.default @@ -92,6 +92,11 @@ stopWordsFilePath = "%laabsDirectory%/data/stopwords/stopwords_fr.txt" ; Chain journal with timestamp file. The timestamp dependency must be configured. chainWithTimestamp = false; +; Any path on this list will no be logged in the application journal +;ignorePaths = "['organization/organization/readTodisplay']" + +; Any operation on this list will no be logged in the application journal +;ignoreMethods = "['read']" [auth] ; Encryption algorithm (MD5, SHA256, SHA512...) diff --git a/dependency/html/Document.php b/dependency/html/Document.php index d4b7e27ccf4f62b665eb6daf165ece6a9822074f..fa3456fe2e5fe210aadb52eca53537c105f6f421 100755 --- a/dependency/html/Document.php +++ b/dependency/html/Document.php @@ -38,6 +38,8 @@ class Document extends \dependency\xml\Document protected $layout; protected $classes; protected $plugins; + protected $headers; + protected $layoutData; public $XPath; public $translator; public $dateTimeFormatter; diff --git a/src/bundle/audit/Controller/event.php b/src/bundle/audit/Controller/event.php index a66e9f2a8e83a612ab0112fe87ca60621a0d4bc2..7fda2e8efb3ac9209c8d3de638cc9cf51254ffb5 100755 --- a/src/bundle/audit/Controller/event.php +++ b/src/bundle/audit/Controller/event.php @@ -57,6 +57,7 @@ class event */ public function add($path, array $variables = null, $input = null, $output = null, $status = false, $info = null) { + // Event creation $event = \laabs::newInstance('audit/event'); $event->eventId = \laabs::newId(); $event->eventDate = \laabs::newTimestamp(); diff --git a/src/bundle/audit/Controller/journal.php b/src/bundle/audit/Controller/journal.php index 7d58aacc1e47dc98c318fca39505c8aff95e09be..f2cd6e9dc910936238313d340e438b05467dd7bd 100755 --- a/src/bundle/audit/Controller/journal.php +++ b/src/bundle/audit/Controller/journal.php @@ -115,6 +115,17 @@ class journal $eventLine[] = (string) $event->accountId; $eventLine[] = (string) $event->path; $eventLine[] = (string) $event->status; + + if (isset($event->output)) { + $output = json_decode($event->output); + if ($output) { + $messages = []; + foreach ($output as $value) { + $messages[] = $value->fullMessage; + } + $eventLine[] = implode(' ', $messages); + } + } fputcsv($journalFile, $eventLine); } diff --git a/src/bundle/audit/Observer/logger.php b/src/bundle/audit/Observer/logger.php index 53ef2ab762dd54517a1ffa501ac34367af41b718..f3313efc6fc5c86edd9f68d6dd39c1d22eb9c35d 100755 --- a/src/bundle/audit/Observer/logger.php +++ b/src/bundle/audit/Observer/logger.php @@ -34,8 +34,9 @@ class logger public $currentAuditFile; public $servicePath; public $input; - public $ignoreReads = false; - public $ignorePaths; + public $output; + public $ignoreMethods = []; + public $ignorePaths = []; /** * Constructor @@ -45,7 +46,14 @@ class logger { $this->sdoFactory = $sdoFactory; - $this->ignorePaths = array("audit/*"); + if (isset(\laabs::configuration('audit')['ignoreMethods'])) { + $this->ignoreMethods = \laabs::configuration('audit')['ignoreMethods']; + } + + if (isset(\laabs::configuration('audit')['ignorePaths'])) { + $this->ignorePaths = \laabs::configuration('audit')['ignorePaths']; + } + $this->ignorePaths[] = ("audit/*"); } /** @@ -123,22 +131,20 @@ class logger */ public function notifyServicePath(&$servicePath, &$serviceMessage = null) { - if ($servicePath->method == 'read' && $this->ignoreReads) { + if (in_array($servicePath->method, $this->ignoreMethods)) { return; } + $fullpath = $servicePath->domain . LAABS_URI_SEPARATOR . $servicePath->interface . LAABS_URI_SEPARATOR . $servicePath->path; - // TO DO : add admin to set ignore path - if ($this->ignorePaths) { - foreach ($this->ignorePaths as $ignorePath) { - if (fnmatch($ignorePath, $fullpath)) { - return; - } + foreach ($this->ignorePaths as $ignorePath) { + if (fnmatch($ignorePath, $servicePath->domain . LAABS_URI_SEPARATOR . $servicePath->interface . LAABS_URI_SEPARATOR . $servicePath->name)) { + return; } } + $this->servicePath = $servicePath; - //var_dump($servicePath); // Extract revealant info from input message if ($serviceMessage) { $this->input = array(); @@ -184,36 +190,17 @@ class logger return; } - // Extract revealant info from output message - $output = null; - if ($serviceReturn) { - switch (true) { - case (is_scalar($serviceReturn) && ctype_print($serviceReturn)) : - case is_bool($serviceReturn): - case is_numeric($serviceReturn): - $output = $serviceReturn; - break; - - case (is_object($serviceReturn) && method_exists($serviceReturn, '__toString')) : - $output = (string) $serviceReturn; - break; - - case is_array($serviceReturn): - $output = count($serviceReturn); - } - } - - if (count($this->input) == 0) { - $input = null; - } else { - $input = $this->input; + if (is_array($this->output)) { + $this->output = json_encode($this->output); } \laabs::callService( - 'audit/event/create', $this->servicePath->getName(), $this->servicePath->variables, $input, $output, true + 'audit/event/create', $this->servicePath->getName(), $this->servicePath->variables, $this->input, $this->output, true ); $this->servicePath = null; + $this->output = null; + $this->input = null; } /** @@ -239,4 +226,23 @@ class logger ); } + /** + * Log a given output by observation + * @param object &$output + * + * @return void + * + * @subject bundle\audit\AUDIT_ENTRY_OUTPUT + */ + public function notifyOutput(&$output) + { + if (isset($output['variables'])) { + $output['fullMessage'] = vsprintf($output['message'], $output['variables']); + } else { + $output['fullMessage'] = $output['message']; + + } + $this->output[] = $output; + } + } diff --git a/src/bundle/audit/constants.php b/src/bundle/audit/constants.php index 4ab3cfb7d635f4bc90a2175b0dd5170dd38e87a8..b5f3806ba8f3e374f14160068dfbfd767296536c 100755 --- a/src/bundle/audit/constants.php +++ b/src/bundle/audit/constants.php @@ -18,4 +18,5 @@ * along with bundle audit. If not, see <http://www.gnu.org/licenses/>. */ namespace bundle\audit; -define('bundle\audit\AUDIT_ENTRY', 'auditEntry'); \ No newline at end of file +define('bundle\audit\AUDIT_ENTRY', 'auditEntry'); +define('bundle\audit\AUDIT_ENTRY_OUTPUT', 'auditEntryOutput'); \ No newline at end of file diff --git a/src/bundle/batchProcessing/Controller/scheduling.php b/src/bundle/batchProcessing/Controller/scheduling.php index 9033833e0883ff3dd573bf133bac6ca1677fce6b..e795d5ccbd29fa42f1c8b8d31523f3cc8111c0b4 100755 --- a/src/bundle/batchProcessing/Controller/scheduling.php +++ b/src/bundle/batchProcessing/Controller/scheduling.php @@ -162,6 +162,7 @@ class scheduling public function execute($schedulingId) { $status = true; + $info = null; $scheduling = $this->sdoFactory->read("batchProcessing/scheduling", $schedulingId); $task = $this->readTask($scheduling->taskId); @@ -184,13 +185,12 @@ class scheduling $pathRouter = new \core\Route\PathRouter($task->route); \core\Observer\Dispatcher::notify(LAABS_SERVICE_PATH,$pathRouter->path); if (!empty($scheduling->parameters)) { - $info = \laabs::callServiceArgs($task->route, (array) $scheduling->parameters); + \laabs::callServiceArgs($task->route, (array) $scheduling->parameters); } else { - $info = \laabs::callService($task->route); + \laabs::callService($task->route); } - \laabs::notify(LAABS_SERVICE_RETURN, $info); } catch (\Exception $info) { $this->changeStatus($schedulingId, "error"); $status = false; @@ -210,6 +210,14 @@ class scheduling $this->update($scheduling); + $observerPool = \core\Observer\Dispatcher::getPool(\bundle\audit\AUDIT_ENTRY_OUTPUT); + foreach ($observerPool as $key=>$value) { + if ($value instanceof \bundle\audit\Observer\logger) { + $info = $value->output; + break; + } + } + $this->logSchedulingController->add($schedulingId, $scheduling->executedBy, $launchedBy, $status, $info); return $scheduling; diff --git a/src/bundle/recordsManagement/Controller/archiveComplianceTrait.php b/src/bundle/recordsManagement/Controller/archiveComplianceTrait.php index dc9dd3535de928a26e4ac2483dbe41b156cad1bd..d61846987b385ab6916f8ebea3ed98030019bb96 100755 --- a/src/bundle/recordsManagement/Controller/archiveComplianceTrait.php +++ b/src/bundle/recordsManagement/Controller/archiveComplianceTrait.php @@ -57,6 +57,10 @@ trait archiveComplianceTrait $queryPart["status"] = "status!='error' AND status!='disposed'"; $queryPart["parentArchiveId"] = "parentArchiveId=null"; + $totalNbArchivesToCheck = 0; + $totalNbArchivesInSample = 0; + $totalarchivesChecked = 0; + foreach ($serviceLevels as $serviceLevel) { if (($serviceLevel->samplingFrequency <= 0) || ($serviceLevel->samplingRate <= 0)) { continue; @@ -102,6 +106,9 @@ trait archiveComplianceTrait $success = $this->checkArchiveIntegrity($archive); if (!$success) { + $logMessage = ["message" => "Error on integrity check"]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + break; } else { $archivesChecked++; @@ -121,8 +128,21 @@ trait archiveComplianceTrait $eventInfo['archivesChecked'] = $archivesChecked; $this->lifeCycleJournalController->logEvent('recordsManagement/periodicIntegrityCheck', 'recordsManagement/serviceLevel', $serviceLevel->serviceLevelId, $eventInfo, $success); + + $totalNbArchivesToCheck += nbArchivesToCheck; + $totalNbArchivesInSample += nbArchivesInSample; + $totalarchivesChecked += archivesChecked; } + $logMessage = ["message" => "%s archive(s) to check", "variables"=> $totalNbArchivesToCheck]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + $logMessage = ["message" => "%s archive(s) in sample", "variables"=> $totalNbArchivesInSample]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + $logMessage = ["message" => "%s archive(s) checked", "variables"=> $totalarchivesChecked]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + return true; } @@ -146,7 +166,7 @@ trait archiveComplianceTrait } /** * Check integrity of one or several archives giving their identifiers - * @param object $archiveIds An array of archive identifier or an archive identifier + * @param object $archiveIds An array of archive identifier or an archive identifier * * @return recordsManagement/archive[] Array of archive object */ @@ -168,6 +188,20 @@ trait archiveComplianceTrait } } + $logMessage = ["message" => "%s archives cheked", "variables"=> count($archives)]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + $logMessage = ["message" => "%s archives are valid", "variables"=> count($res['success'])]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + $logMessage = ["message" => "%s archives are not valid", "variables"=> count($res['error'])]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + if (count($res[error])) { + $logMessage = ["message" => "Invalid archive identifier : %s", "variables"=> implode(', ', $res['error'])]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + } + return $res; } diff --git a/src/bundle/recordsManagement/Controller/log.php b/src/bundle/recordsManagement/Controller/log.php index 8eaac5f495c30f37a0aa0213f6e16a8e43a36a6f..61cb8fb3064d3b9467fc76f3e9feb1102b467c0c 100755 --- a/src/bundle/recordsManagement/Controller/log.php +++ b/src/bundle/recordsManagement/Controller/log.php @@ -330,6 +330,9 @@ class log implements archiveDescriptionInterface // Create timestamp resource $timestampResource = $digitalResourceController->createFromFile($timestampFileName); $digitalResourceController->getHash($timestampResource, "SHA256"); + + $logMessage = ["message" => "Timestamp file generated"]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); $timestampResource->archiveId = $journalResource->archiveId; $timestampResource->relatedResId = $journalResource->resId; @@ -354,6 +357,29 @@ class log implements archiveDescriptionInterface $archive->fullTextIndexation = "none"; } - return $archiveController->deposit($archive, 'journal/'.$log->type.'/<date("Y")>/<date("m")>'); + try { + $archive = $archiveController->deposit($archive, 'journal/'.$log->type.'/<date("Y")>/<date("m")>'); + $logMessage = ["message" => "New journal identifier : %s", "variables" => $archive->archiveId]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + + } catch (\Exception $e) { + $logMessage = ["message" => "Error on journal creation"]; + \laabs::notify(\bundle\audit\AUDIT_ENTRY_OUTPUT, $logMessage); + throw $e; + } + + return $archive->archiveId; + } + + public function contents ($type, $archiveId, $resourceId) { + $archiveController = \laabs::newController('recordsManagement/archive'); + + $res = $archiveController->consultation($archiveId, $resourceId); + + $journal = $type . PHP_EOL; + $journal .= $archiveId . ',' . $resourceId . PHP_EOL; + $journal .= file_get_contents($res->address[0]->repository->repositoryUri . $res->address[0]->path); + + return $journal; } } diff --git a/src/bundle/recordsManagement/logInterface.php b/src/bundle/recordsManagement/logInterface.php index cfa8b9f0b9d27400765f2050d2166c7d91bc250e..d6eac857e23af8a338fff08eb302bc398bb09f67 100755 --- a/src/bundle/recordsManagement/logInterface.php +++ b/src/bundle/recordsManagement/logInterface.php @@ -50,5 +50,12 @@ interface logInterface * @action recordsManagement/log/depositJournal */ public function createDepositjournal($journalFileName, $fromDate, $toDate, $type, $processName = null, $timestampFileName = null); - + + /** + * @param string $archiveId Archiver identifier + * @param string $resourceId Resource identifier + * + * @action recordsManagement/log/contents + */ + public function contents_type__archiveId__resourceId_(); } diff --git a/src/presentation/maarchRM/Presenter/audit/event.php b/src/presentation/maarchRM/Presenter/audit/event.php index 9c820f1352d4e8e12db945c0e150cf5e2296dea2..83426414e6f568c237862943790cff3b80d2948c 100755 --- a/src/presentation/maarchRM/Presenter/audit/event.php +++ b/src/presentation/maarchRM/Presenter/audit/event.php @@ -86,6 +86,7 @@ class event { $events = array(); $routes = array(); + $translator = $this->view->translator; $bundles = \laabs::bundles(); foreach ($bundles as $bundle) { @@ -101,29 +102,17 @@ class event } $routes = array_unique($routes); - foreach ($routes as $route) { $event = new \stdClass(); $event->path = $route; - - if (strpos($route, 'read') || strpos($route, 'get')) { - $event->class = 'read'; - } elseif (strpos($route, 'create') || strpos($route, 'add') || strpos($route, 'new')) { - $event->class = 'create'; - } elseif (strpos($route, 'update') || strpos($route, 'modify')) { - $event->class = 'update'; - } elseif (strpos($route, 'delete')) { - $event->class = 'delete'; - } else { - $event->class = 'all'; - } + $event->label = $translator->getText($event->path, false, "audit/messages"); $events[] = $event; } $this->view->addContentFile("audit/search.html"); $this->view->setSource("events", $events); - $this->view->merge(); $this->view->translate(); + $this->view->merge(); $this->view->addScriptSrc( <<<EOD @@ -170,7 +159,7 @@ EOD $dataTable->setSorting(array(array(2, 'desc'))); } else { $dataTable->setUnsortableColumns(4); - $dataTable->setSorting(array(array(1, 'desc'))); + $dataTable->setSorting(array(array(0, 'desc'))); } return $this->view->saveHtml(); @@ -188,23 +177,36 @@ EOD $this->view->translate(); - // Fix error on event info if(isset($event->info )) { foreach (json_decode($event->info) as $name => $value) { - $event->info2[] = array('name'=> $name, 'value'=> $value); + $nameTraduction = $this->view->translator->getText($name, false, "audit/messages"); + $event->info2[] = array('name'=> $nameTraduction, 'value'=> $value); } } - if (isset($event->input)) { - if (is_array($event->input)) { - foreach ($event->input as $name => $value) { - if (is_string($value) && strlen($value) > 70) { - $event->input[$name] = substr($value, 0, 70)."..."; + + if ($event->output) { + $output = []; + $outputObject = json_decode($event->output); + if (is_array($outputObject)) { + foreach ($outputObject as $outputMessage) { + if (isset($outputMessage->message)) { + $outputMessage->message = $this->view->translator->getText($outputMessage->message, false, "audit/messages"); + if (isset($outputMessage->variables)) { + $output[] = vsprintf($outputMessage->message, $outputMessage->variables); + } else { + $output[] = $outputMessage->message; + } } } + + $event->output = $output; + + } elseif (is_string($event->output)) { + $event->output = [$this->view->translator->getText($event->output, false, "audit/messages")]; } } - $event->output = $this->view->translator->getText($event->output, false, "audit/messages"); + $event->pathTraduction = $this->view->translator->getText($event->path, false, "audit/messages"); $this->view->setSource("event", $event); $this->view->merge(); diff --git a/src/presentation/maarchRM/Presenter/auth/authentication.php b/src/presentation/maarchRM/Presenter/auth/authentication.php index b3dae578620173922f8ffba02e98e5072082d572..815c2458f00f9d035ae108af1d5bc5bda3007586 100755 --- a/src/presentation/maarchRM/Presenter/auth/authentication.php +++ b/src/presentation/maarchRM/Presenter/auth/authentication.php @@ -72,7 +72,6 @@ class authentication { $view = $this->view; - $view->addHeaders(); $view->addContentFile("auth/userAccount/login/form.html"); $view->setSource('logo', $this->logoUri); $view->translate(); diff --git a/src/presentation/maarchRM/Presenter/batchProcessing/logScheduling.php b/src/presentation/maarchRM/Presenter/batchProcessing/logScheduling.php index fc36ea721f9659056497ce324a1f1bf52626ae1b..aacd8dee1fdca6b275c1b81e2e7130dbf911dd43 100755 --- a/src/presentation/maarchRM/Presenter/batchProcessing/logScheduling.php +++ b/src/presentation/maarchRM/Presenter/batchProcessing/logScheduling.php @@ -84,7 +84,6 @@ EOD public function getlogSchedulings($logSchedulings) { $this->view->addContentFile("batchProcessing/logScheduling/result.html"); - $this->view->translate(); $this->view->setSource("logSchedulings", $logSchedulings); $this->view->merge(); @@ -107,6 +106,27 @@ EOD public function getlogScheduling($logScheduling) { $this->view->addContentFile("batchProcessing/logScheduling/modalEvent.html"); + if ($logScheduling->info) { + $info = []; + $infoObject = json_decode($logScheduling->info); + if (is_array($infoObject)) { + foreach ($infoObject as $infoMessage) { + if (isset($infoMessage->message)) { + $infoMessage->message = $this->view->translator->getText($infoMessage->message, false, "audit/messages"); + if (isset($infoMessage->variables)) { + $info[] = vsprintf($infoMessage->message, $infoMessage->variables); + } else { + $info[] = $infoMessage->message; + } + } + } + + $logScheduling->info = $info; + + } elseif (is_string($logScheduling->info)) { + $logScheduling->info = [$this->view->translator->getText($logScheduling->info, false, "audit/messages")]; + } + } $this->view->translate(); $this->view->setSource("logScheduling", $logScheduling); diff --git a/src/presentation/maarchRM/Presenter/organization/orgTree.php b/src/presentation/maarchRM/Presenter/organization/orgTree.php index 7dbbf06684bc710bfbe8d7c236586f55499993e0..b45458b38cae822c52ab9287d9f9ef9556ca8ddf 100755 --- a/src/presentation/maarchRM/Presenter/organization/orgTree.php +++ b/src/presentation/maarchRM/Presenter/organization/orgTree.php @@ -80,7 +80,7 @@ class orgTree return strcmp($a->reference, $b->reference); }); - if(\laabs::getToken("ORGANIZATION")){ + if(\laabs::getToken("ORGANIZATION") && \laabs::getToken("ORGANIZATION")->orgRoleCodes){ $addOrganizationRight = in_array('owner',\laabs::getToken("ORGANIZATION")->orgRoleCodes); } else { $addOrganizationRight = true; diff --git a/src/presentation/maarchRM/Presenter/recordsManagement/log.php b/src/presentation/maarchRM/Presenter/recordsManagement/log.php index abc649033fd1d468ea83a9b7b429af6a6443a9b4..df1e0cfda9da71d48b505fdbd9f9f762854180bf 100755 --- a/src/presentation/maarchRM/Presenter/recordsManagement/log.php +++ b/src/presentation/maarchRM/Presenter/recordsManagement/log.php @@ -74,7 +74,7 @@ class log $dataTable->setSorting(array(array(1, 'desc'))); foreach ($logs as $log) { - $log->type = $this->view->translator->getText($log->type, false, 'recordsManagement/log'); + $log->typeTranslate = $this->view->translator->getText($log->type, false, 'recordsManagement/log'); $log->resId = \laabs::callService('recordsManagement/archives/readArchivecontents_archive_', (string) $log->archiveId)->digitalResources[0]->resId; } @@ -85,6 +85,50 @@ class log return $this->view->saveHtml(); } + + /** + * + */ + public function contents($res) + { + $journal = explode(PHP_EOL, $res); + $id = str_getcsv($journal[1]); + $head = str_getcsv($journal[2]); + + $events = []; + for ($i = 3; $i < count($journal) - 1; $i++) { + $events[] = str_getcsv($journal[$i]); + } + + $type = $journal[0]; + $typeTranslate = $this->view->translator->getText($type, false, 'recordsManagement/log'); + + $this->view->addContentFile("recordsManagement/log/view.html"); + $this->view->translate(); + + $dataTable = $this->view->getElementsByClass("dataTable")->item(0)->plugin['dataTable']; + $dataTable->setPaginationType("full_numbers"); + $dataTable->setSorting(array(array(0, 'desc'))); + + if ($type === "lifeCycle") { + $dataTable->setUnsortableColumns(2); + } else if ( $type === "application") { + for ($i = 0; $i < count($events); $i++) { + $events[$i][2] = $this->view->translator->getText($events[$i][2], false, 'audit/messages'); + } + } + + $this->view->setSource("archiveId", $id[0]); + $this->view->setSource("resourceId", $id[1]); + $this->view->setSource("type", $type); + $this->view->setSource("typeTranslate", $typeTranslate); + $this->view->setSource("head", $head); + $this->view->setSource("events", $events); + $this->view->merge(); + + return $this->view->saveHtml(); + } + /** * View log * @param recordsManagement/log $log The log object diff --git a/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po b/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po index 7761643110c3d6bea680fc1a0788ee69b8abc3ac..902ed782dc5e716fa9b7e8dd96bc78cef6a35415 100755 --- a/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po +++ b/src/presentation/maarchRM/Resources/locale/fr/audit/messages.po @@ -155,6 +155,63 @@ msgstr "Compte de service" msgid "No account found" msgstr "Aucun compte trouvé" +msgid "Journal detail" +msgstr "Détail du journal" + +msgid "Identifier" +msgstr "Identifiant" + +msgid "To date" +msgstr "Date de début" + +msgid "From date" +msgstr "Date de fin" + +msgid "Download journal" +msgstr "Télécharger le journal (csv)" + +msgid "Path" +msgstr "Route" + +msgid "remoteIp" +msgstr "Ip distant" + +msgid "New journal identifier : %s" +msgstr "Identifiant du journal archivé : %s" + +msgid "Timestamp file generated" +msgstr "Fichier d'horodatage généré" + +msgid "%s archives cheked" +msgstr "%s archives vérifiées" + +msgid "%s archives are valid" +msgstr "%s archives sont valides" + +msgid "%s archives are not valid" +msgstr "%s archives ne sont pas valides" + +msgid "Invalid archive identifier : %s" +msgstr "Identifiant des archives invalides : %s" + +msgid "Error on integrity check" +msgstr "Erreur lors de la vérification d'intégrité" + +msgid "%s archive(s) to check" +msgstr "%s archive(s) à vérifier" + +msgid "%s archive(s) in sample" +msgstr "%s archive(s) dans l'échantillon" + +msgid "%s archive(s) checked" +msgstr "%s archive(s) vérifiée(s)" + +msgid "%s message(s) validate" +msgstr "%s bordereau(x) validé(s)" + +msgid "%s message(s) processed" +msgstr "%s bordereau(x) traité(s)" + msgid "recordsManagement/accessRule/readIndex" msgstr "Lecture des règles de communicabilité" @@ -372,6 +429,9 @@ msgstr "Suppression d'un journal de l'application" msgid "recordsManagement/log/form" msgstr "Recherche des journaux de l'application" +msgid "recordsManagement/log/contents_type__archiveId__resourceId_" +msgstr "Lecture du detail d'un journal" + msgid "recordsManagement/retentionRule/readIndex" msgstr "Lecture de toutes les règles de conservation" diff --git a/src/presentation/maarchRM/Resources/view/audit/modalEvent.html b/src/presentation/maarchRM/Resources/view/audit/modalEvent.html index 90ddd0f7ed47b71ec63d1d9033d5a4e1dadabb3d..21bc1ea474b5c29ece9ccf222213389f561bd97e 100755 --- a/src/presentation/maarchRM/Resources/view/audit/modalEvent.html +++ b/src/presentation/maarchRM/Resources/view/audit/modalEvent.html @@ -1,63 +1,60 @@ - <div class="container-fluid" data-translate-catalog="audit/messages"> - <div class="row"> - <div class="col-xs-12"> - <h1 class="page-header"> - Event - </h1> +<div class="container-fluid" data-translate-catalog="audit/messages"> + <div class="row"> + <div class="col-xs-12"> + <h1 class="page-header"> + Event + </h1> + </div> + </div> +</div> +<div class="container-fluid" data-translate-catalog="audit/messages"> + <div class="row"> + <div class="col-xs-12"> + <div class="row"> + <dl class="dl dl-horizontal"> + <dt><strong>Date</strong></dt> <dd id="audit_eventDate"><?merge event.eventDate ?></dd> + <dt><strong>Account</strong></dt> <dd id="audit_account"><?merge event.accountId ?></dd> + <dt><strong>Event</strong></dt> <dd id="audit_event"><?merge event.pathTraduction ?></dd> + <dt><strong>Path</strong></dt> <dd id="audit_event"><?merge event.path ?></dd> + + <dt><strong>Status</strong></dt> + <dd> + <?merge event.status.ifeq(1) ?><strong class="text-success fa fa-check" disabled=""> </strong> + <?merge event.status.ifne(1) ?><strong class="text-danger fa fa-times" disabled=""> </strong> + </dd> + </dl> + <div class="col-xs-12"> + <?merge event.variables.bool() ?> + <div id="audit_variables"> + <hr/> + <h4 class="col-xs-offset-1">Variables</h4> + <dl class='dl dl-horizontal'> + <?merge event.variables.parse(1) ?> + <span><dt><?merge event.variables.current().key()?></dt> <dd> <?merge . ?></dd></span> + </dl> </div> - </div> - </div> - <div class="container-fluid" data-translate-catalog="audit/messages"> - <div class="row"> - <div class="col-xs-12"> - <div class="panel"> - <div class="row"> - <dl class="dl dl-horizontal"> - <dt><strong>Date</strong></dt> <dd id="audit_eventDate"><?merge event.eventDate ?></dd> - <dt><strong>Account</strong></dt> <dd id="audit_account"><?merge event.accountId ?></dd> - <dt><strong>Event</strong></dt> <dd id="audit_event"><?merge event.path ?></dd> - - <dt><strong>Status</strong></dt> - <dd> - <?merge event.status.ifeq(1) ?><strong class="text-success fa fa-check" disabled=""> </strong> - <?merge event.status.ifne(1) ?><strong class="text-danger fa fa-times" disabled=""> </strong> - </dd> - </dl> - <div class="col-xs-12"> - <b>Variables</b> - <div class="panel well" id="audit_variables"> - <dl class='dl dl-horizontal'> - <?merge event.variables.parse(1) ?> - <span><dt><?merge event.variables.current().key()?></dt> <dd> <?merge . ?></dd></span> - </dl> - </div> - <b>Info</b> - <div class="panel well" id="audit_info"> - <dl class='dl dl-horizontal'> - <?merge event.info2 ?> - <span><dt><?merge ['name'] ?></dt> <dd> <?merge ['value'] ?></dd></span> - </dl> - </div> - <b>Input</b> - <div class="panel well" id="audit_input"> - <dl class='dl dl-horizontal'> - <?merge event.input.parse(1) ?> - <span><dt><?merge event.input.current().key()?></dt> <dd> <?merge . ?></dd></span> - </dl> - </div> - <b>Output</b> - <div class="panel well" id="audit_output"> - <?merge event.output ?> - </div> - </div> - - </div> - </div> - + <?merge event.info2.bool() ?> + <div id="audit_info"> + <hr/> + <h4 class="col-xs-offset-1">Information</h4> + <dl class='dl dl-horizontal'> + <?merge event.info2 ?> + <span><dt><?merge ['name'] ?></dt> <dd> <?merge ['value'] ?></dd></span> + </dl> </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal" title="Close">Close</button> + <?merge event.output.bool() ?> + <div id="audit_output"> + <hr/> + <h4 class="col-xs-offset-1">Output</h4> + <?merge event.output ?> + <span class="col-xs-offset-2 col-xs-10"><?merge . ?></span> </div> </div> </div> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal" title="Close">Close</button> + </div> +</div> diff --git a/src/presentation/maarchRM/Resources/view/audit/result.html b/src/presentation/maarchRM/Resources/view/audit/result.html index f486351580ed4f8cb1e243205d85701ea970d79b..604ec2ab71e2027385bfad7d9e2247850399fdb8 100755 --- a/src/presentation/maarchRM/Resources/view/audit/result.html +++ b/src/presentation/maarchRM/Resources/view/audit/result.html @@ -1,5 +1,4 @@ -<!DOCTYPE html> -<div class="row" data-translate-catalog="audit/messages"> +<div id="eventList" class="row" data-translate-catalog="audit/messages"> <div class="col-xs-12"> <div class="panel panel-primary"> <div class="panel-heading clearfix"> @@ -44,3 +43,30 @@ </div> </div> </div> + +<div class="modal fade" id="modalEvent" data-backdrop="static" data-keyboard="false" tabindex="999" data-focus-on="input:first" role="dialog" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content" id="modalEvent_content"> + </div> + </div> +</div> + +<script type="text/javascript"> + +$("#eventList").on('click', '.viewEvent', function () { + + var eventId = $(this).attr('data-eventId'); + $.ajax({ + type: 'GET', + url: '/Event/' + eventId, + dataType: 'html', + contentType: 'application/json', + async: true, + success: function (response) { + $('#modalEvent_content').html(response); + + $('#modalEvent').modal(); + } + }); +}); +</script> \ 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 a2a85cf7a3c9debb58f04b235aa32cf1b426e5ae..5696ea9757060f857a891d9618350dc40723660b 100755 --- a/src/presentation/maarchRM/Resources/view/audit/search.html +++ b/src/presentation/maarchRM/Resources/view/audit/search.html @@ -1,24 +1,24 @@ -<div id="contain" > - <div class="container-fluid" data-translate-catalog="audit/messages"> - <div class="page-header"> - <h1> - <i class="fa fa-desktop"></i> - Audit search - </h1> - </div> +<div class="container-fluid" data-translate-catalog="audit/messages"> + <div class="page-header"> + <h1> + <i class="fa fa-desktop"></i> + Audit search + </h1> </div> - <div class="container-fluid" lang="en" data-translate-catalog="audit/messages"> - <div class="panel-group" id="accordion"> - <div class="panel panel-default"> - <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" style="cursor:pointer;"> - <h4 class="panel-title" style="float:left;"> - Search form - </h4> - <i class="fa fa-caret-down" style="float:right;"></i> - <div style="clear:both;"></div> - </div> - <div id="collapseOne" class="well panel-collapse collapse in" style="margin-bottom: 0px"> - <form class="form-horizontal" id="event_form"> +</div> +<div class="container-fluid" lang="en" data-translate-catalog="audit/messages"> + <div class="panel-group" id="accordion"> + <div class="panel panel-default"> + <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" style="cursor:pointer;"> + <h4 class="panel-title" style="float:left;"> + Search form + </h4> + <i class="fa fa-caret-down" style="float:right;"></i> + <div style="clear:both;"></div> + </div> + <div id="collapseOne" class="well panel-collapse collapse in" style="margin-bottom: 0px"> + <form class="form-horizontal" id="eventSearchForm"> + <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="col-sm-3 control-label" for="fromDate">Entry date to</label> @@ -33,105 +33,61 @@ </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label" for="event_accountTypeahead">Account</label> + <label class="col-sm-3 control-label" for="accountTypeahead">Account</label> <div class="col-sm-6"> - <input type="text" class="form-control" placeholder="Account" id="event_accountTypeahead" data-accountId=""/> + <input type="text" class="form-control" placeholder="Account" id="accountTypeahead"/> </div> </div> + </div> + <div class="col-md-6"> <div class="form-group"> - <label class="col-sm-3 control-label" for="status">Status</label> - <div class="btn-group col-sm-7" data-toggle="buttons" > + <label class="col-sm-4 control-label" for="status">Status</label> + <div class="btn-group col-sm-6" data-toggle="buttons" > <label class="btn btn-info active status" title="all"> - <input type="checkbox" id="all" name="status" value="all" checked>All + <input type="radio" id="all" name="status" value="all" checked>All </label> <label class="btn btn-default status" title="noErrors"> - <input type="checkbox" id="true" name="status" value="true">Success + <input type="radio" id="true" name="status" value="true">Success </label> <label class="btn btn-default status" title="errors"> - <input type="checkbox" id="false" name="status" value="false">Errors + <input type="radio" id="false" name="status" value="false">Errors </label> </div> </div> - </div> - <div class="col-md-6"> <div class="form-group"> - <div class="form-group"> - <label class="col-sm-4 control-label" for="wording">Wording</label> - <div class="btn-group col-sm-7" data-toggle="buttons" > - <label class="btn btn-info active wordingAll" title="all"> - <input type="checkbox" id="all" name="wording" value="all" checked>All - </label> - <label class="btn btn-default wording" title="Variables"> - <input type="checkbox" id="variables" name="wording" value="variables">Variables - </label> - <label class="btn btn-default wording" title="Input"> - <input type="checkbox" id="input" name="wording" value="input">Input - </label> - <label class="btn btn-default wording" title="Info"> - <input type="checkbox" id="info" name="wording" value="info">Info - </label> - </div> - </div> - <div class="form-group"> - <label class="col-sm-4 control-label" for="userIdAudit">Search term</label> - <div class="col-md-6"> - <input type="text" class="form-control" placeholder="Term" id="term"/> - </div> - </div> - <label class="col-sm-4 control-label">Event type</label> - <div class="btn-group col-sm-8" data-toggle="buttons"> - <label class="btn btn-info active eventTypeAll" title="All"> - <input type="checkbox" name="eventType" value="all" checked/> All - </label> - <label class="btn btn-default eventType" title="Read"> - <input type="checkbox" name="eventType" value="read">Read - </label> - <label class="btn btn-default eventType" title="Create"> - <input type="checkbox" name="eventType" value="create">Create - </label> - <label class="btn btn-default eventType" title="Update"> - <input type="checkbox" name="eventType" value="update" >Update - </label> - <label class="btn btn-default eventType" title="Delete"> - <input type="checkbox" name="eventType" value="delete">Delete - </label> + <label class="col-sm-4 control-label" for="userIdAudit">Search term</label> + <div class="col-md-6"> + <input type="text" class="form-control" placeholder="Term" id="term"/> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" for="eventType">Event</label> <div class="col-sm-6"> - <select class="form-control" name="event" id="event" > - <?merge events ?> - <option value="[?merge .path ?]" class="[?merge .class ?]"><?merge .path ?></option> - </select> + <input type="text" class="form-control" placeholder="Event" id="eventName" data-eventlist="[?merge events.json() ?]"/> </div> </div> </div> - <div class="clearfix"> - <button type="button" class="btn btn-primary col-md-offset-4 col-md-4" id="search" data-form-submit title="Search"><i class="fa fa-search"> </i>Search</button> - <button type="button" class="btn btn-warning col-md-offset-1" id="reset" data-form-reset title="Reset"><i class="fa fa-refresh"> </i>Reset</button> - </div> - </form> - </div> - </div> - </div> - <div class="container-fluid" id="resultSearch"></div> - <div class="modal fade" id="modalEvent" data-backdrop="static" data-keyboard="false" tabindex="999" data-focus-on="input:first" role="dialog" aria-hidden="true"> - <div class="modal-dialog modal-lg"> - <div class="modal-content" id="modalEvent_content"> - </div> + </div> + <div class="row clearfix"> + <button type="button" class="btn btn-primary col-md-offset-4 col-md-4" id="search" data-form-submit title="Search"><i class="fa fa-search"> </i>Search</button> + <button type="button" class="btn btn-warning col-md-offset-1" id="reset" data-form-reset title="Reset"><i class="fa fa-refresh"> </i>Reset</button> + </div> + </form> </div> </div> - <span id="selectAnEvent_text" class="hide">Select an event</span> - </div> - <div style="display:none" data-translate-catalog="audit/messages"> - <span id="user_text">User</span> - <span id="service_text">Service</span> - <span id="noAccountFound">No account found</span> </div> - <script type="text/javascript"> - - $('#contain').ready(function() { + <div class="container-fluid" id="resultSearch"/> +</div> +<div class="hide" data-translate-catalog="audit/messages"> + <span id="user_text">User</span> + <span id="service_text">Service</span> + <span id="noAccountFound">No account found</span> + <span id="selectAnEvent_text">Select an event</span> +</div> + +<script type="text/javascript"> + + /*$('#contain').ready(function() { $("#event").append($("#event option").remove().sort(function(a, b) { var at = $(a).text(), bt = $(b).text(); return (at > bt)?1:((at < bt)?-1:0); @@ -141,22 +97,15 @@ $('#event').val(''); }); - - status= 'all'; - wording = 'all'; $('select').find('option').removeClass('hidden'); - $('#contain').keypress(function (e) { - if (e.which != 13) { - return; - } - // Prevent form submit - e.preventDefault(); - $("#search").click(); - }); + */ - $('#search').on('click', function () { - var parameters = serializeEvent(); - $('#search').attr('disabled', ''); + EventSearchForm = { + form : $('#eventSearchForm'), + result : $('#resultSearch'), + + search: function() { + var parameters = this.serialize(); ajax($(this), { type: 'GET', url: '/Events', @@ -166,48 +115,87 @@ async: true, headers: { 'X-Laabs-Max-Count': 100 }, success: function (response) { - $('#resultSearch').html(''); - $('#resultSearch').append(response); + EventSearchForm.result.empty().append(response); } }); - $('#search').removeAttr('disabled'); - }); + }, - $("#reset").on("click", function () { - var form = $('#event_form'); - - form.find('input[type=text]').val(''); - form.find('select').prop('selectedIndex', 0); - - form.find('.eventTypeAll').click(); - form.find('.wordingAll').click(); - form.find('.status :first').click(); + serialize : function() { + serializedObject = { + fromDate: $('#fromDate').val(), + toDate: $('#toDate').val(), + status: this.form.find('[name="status"]:checked').val(), + event: $('#eventName').data('event-path'), + accountId: $.trim($('#accountTypeahead').val()), + term: $('#term').val(), + }; + + if ($('#accountTypeahead').data('accountid')) { + serializedObject.accountId = $('#accountTypeahead').data('accountid') ; + } - $("#resultSearch").empty().html(''); - }); + return serializedObject; + }, - var users = new Bloodhound({ - datumTokenizer: Bloodhound.tokenizers.obj.whitespace('displayName'), - queryTokenizer: Bloodhound.tokenizers.whitespace, - prefetch: {url: '/user/todisplay', ttl: '0'}, - limit: 500 - }); - users.initialize(); + clear: function() { + this.form.find('input[type=text]').val(''); + this.form.find('select').prop('selectedIndex', 0); + $('#eventName').data('event-path') + this.form.find('.wordingAll').click(); + this.form.find('.status :first').click(); - var services = new Bloodhound({ - datumTokenizer: Bloodhound.tokenizers.obj.whitespace('displayName'), - queryTokenizer: Bloodhound.tokenizers.whitespace, - prefetch: {url: '/service/todisplay', ttl: '0'}, - limit: 100 - }); - services.initialize(); + this.result.empty().html(''); + } + } - $('#event_accountTypeahead').typeahead( - { - hint: true, - highlight: true, - minLength: 2 - }, + $('#app_maarchRM_main').keypress(function (e) { + if (e.which != 13) { + return; + } + // Prevent form submit + e.preventDefault(); + $("#search").click(); + }); + + $('#search').on('click', function () { + EventSearchForm.search(); + }); + + $("#reset").on("click", function () { + EventSearchForm.clear(); + }); + + // checkBox button + $("#eventSearchForm").on('click', '.status', function () { + $('#eventSearchForm').find('.status').removeClass('btn-info active').addClass('btn-default'); + $(this).addClass('btn-info active').removeClass('btn-default'); + }); + + + //Account typeahead + + var users = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('displayName'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + prefetch: {url: '/user/todisplay', ttl: '0'}, + limit: 500 + }); + users.initialize(); + + var services = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('displayName'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + prefetch: {url: '/service/todisplay', ttl: '0'}, + limit: 100 + }); + services.initialize(); + + $('#accountTypeahead').typeahead( + { + hint: true, + highlight: true, + minLength: 2 + }, { name: 'users', displayKey: function (account) { @@ -245,163 +233,59 @@ }, skipCache: true } - ).on('typeahead:selected', function ($event, suggestion, source) { - $("#event_accountTypeahead").attr('data-accountId', suggestion.accountId); - }); - - $("#event_accountTypeahead").on('keypress', function () { - $("#event_accountTypeahead").attr('data-accountId', ""); - }); - - // checkBox button - $("#event_form").on('click', '.eventType', function () { - - type = $(this).find('input').val(); - if ($(this).attr('class').indexOf('btn-default') != -1) { - - $('#event_form ').find('.eventTypeAll').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - if ($('#event_form ').find('.eventType').hasClass('active') == false) { - $('select').find('option').addClass('hidden'); - } - - if (type == 'read') { - $('select').find('option.read').removeClass('hidden'); - } else if (type == 'create') { - $('select').find('option.create').removeClass('hidden'); - } else if (type == 'update') { - $('select').find('option.update').removeClass('hidden'); - } else if (type == 'delete') { - $('select').find('option.delete').removeClass('hidden'); - } - - } else { - - if (type == 'read') { - $('select').find('option.read').addClass('hidden'); - } else if (type == 'create') { - $('select').find('option.create').addClass('hidden'); - } else if (type == 'update') { - $('select').find('option.update').addClass('hidden'); - } else if (type == 'delete') { - $('select').find('option.delete').addClass('hidden'); - } - - $(this).removeClass('btn-info').addClass('btn-default'); - } - }); - - $("#event_form").on('click', '.eventTypeAll', function () { - - $('#event_form ').find('.eventType').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - $('select').find('option').removeClass('hidden'); - }); - - - // checkBox button - $("#event_form").on('click', '.status', function () { - - if ($(this).attr('class').indexOf('btn-default') != -1) { - status = $(this).find('input').val(); - $('#event_form ').find('.status').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - } else { - $('#event_form ').find('.status').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - $(this).removeClass('btn-info').addClass('btn-default'); - } - }); - - // checkBox button - $("#event_form").on('click', '.wording', function () { - - wording = $(this).find('input').val(); - if ($(this).attr('class').indexOf('btn-default') != -1) { - - $('#event_form ').find('.wordingAll').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - if ($('#event_form ').find('.wording').hasClass('active') == false) { - $('select').find('option').addClass('hidden'); - } - - if (wording == 'variables') { - $('select').find('option.variables').removeClass('hidden'); - } else if (wording == 'input') { - $('select').find('option.input').removeClass('hidden'); - } else if (wording == 'update') { - $('select').find('option.info').removeClass('hidden'); - } - - } else { - - if (wording == 'variables') { - $('select').find('option.variables').addClass('hidden'); - } else if (wording == 'input') { - $('select').find('option.input').addClass('hidden'); - } else if (wording == 'info') { - $('select').find('option.info').addClass('hidden'); + ).on('typeahead:selected', function ($event, suggestion, source) { + $("#accountTypeahead").data('accountid', suggestion.accountId); + }); + + $("#accountTypeahead").on('keypress', function () { + $("#accountTypeahead").data('accountid', ""); + }); + + var events = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('label'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + local: $('#eventName').data('eventlist') + }); + events.initialize(); + + $('#eventName').typeahead( + { + hint: true, + highlight: true, + minLength: 2 + }, + { + name: 'event', + displayKey: function (event) { + return event.label; + }, + templates: { + suggestion: function (event) { + var name = event.label; + var display = + "<span>" + + name + + "</span><br>"; + return display; } + }, + source: function (query, process) { + eventList = []; + events.search(query, function (suggestions) { + eventList = suggestions; + }); + process(eventList); + }, + limit: 10, + skipCache: true + } + ).on('typeahead:selected', function ($event, suggestion, source) { + $("#eventName").data('event-path', suggestion.path); + }); - $(this).removeClass('btn-info').addClass('btn-default'); - } - }); - - $("#event_form").on('click', '.wordingAll', function () { - - $('#event_form ').find('.wording').removeClass('btn-info active').addClass('btn-default'); - $(this).removeClass('btn-default').addClass('btn-info'); - - $('select').find('option').removeClass('hidden'); - }); - - $("#contain").on('click', '.viewEvent', function () { - - var eventId = $(this).attr('data-eventId'); - $.ajax({ - type: 'GET', - url: '/Event/' + eventId, - dataType: 'html', - contentType: 'application/json', - async: true, - success: function (response) { - $('#modalEvent_content').html(response); - - $('#modalEvent').modal(); - } - }); - }); + $("#eventName").on('keypress', function () { + $("#eventName").data('event-path', ""); + }); - function serializeEvent() { - wording = "all"; - $.each($("#event_form").find('.wording.active'), function (index, value) { - if (wording != "all") { - wording = wording + "," + value.firstElementChild.value; - } else { - wording = value.firstElementChild.value; - } - }); - - serializedObject = { - fromDate: $('#fromDate').val(), - toDate: $('#toDate').val(), - status: status, - event: $('#event').val(), - accountId: $.trim($('#event_accountTypeahead').val()), - term: $('#term').val(), - wording : wording - }; - - if ($('#event_accountTypeahead').attr('data-accountId')) { - serializedObject.accountId = $('#event_accountTypeahead').attr('data-accountId') ; - } - - return serializedObject; - } - </script> +</script> diff --git a/src/presentation/maarchRM/Resources/view/batchProcessing/logScheduling/modalEvent.html b/src/presentation/maarchRM/Resources/view/batchProcessing/logScheduling/modalEvent.html index 5ebb7f3e0138accc6e370ae81292667192e5b800..96e6ba6888a3f8f397827d94da75475fb5e86b8a 100644 --- a/src/presentation/maarchRM/Resources/view/batchProcessing/logScheduling/modalEvent.html +++ b/src/presentation/maarchRM/Resources/view/batchProcessing/logScheduling/modalEvent.html @@ -24,11 +24,12 @@ <?merge logScheduling.status.ifne(1) ?><strong class="text-danger fa fa-times" disabled=""> </strong> </dd> </dl> - <div class="col-xs-12"> - <b>Info</b> - <div class="panel well" id="audit_info"> - <?merge logScheduling.info ?> - </div> + <?merge logScheduling.info.bool() ?> + <div id="audit_output"> + <hr/> + <h4 class="col-xs-offset-1">Information</h4> + <?merge logScheduling.info ?> + <span class="col-xs-offset-2 col-xs-10"><?merge . ?></span> </div> </div> </div> diff --git a/src/presentation/maarchRM/Resources/view/recordsManagement/log/result.html b/src/presentation/maarchRM/Resources/view/recordsManagement/log/result.html index 1ea732b93d3447cd6fc29374af9714169ede507d..2fcd59af4f6b5e98c6fe9a780878e1670ce32906 100755 --- a/src/presentation/maarchRM/Resources/view/recordsManagement/log/result.html +++ b/src/presentation/maarchRM/Resources/view/recordsManagement/log/result.html @@ -38,7 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. <tbody> <?merge logs ?> <tr id="[?merge .archiveId ?]"> - <td><?merge .type ?></td> + <td><?merge .typeTranslate ?></td> <td><?merge .fromDate ?></td> <td><?merge .toDate ?></td> <td><?merge .processId ?></td> @@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. <div class="btn-group pull-right"> <button type="button" class="btn btn-warning btn-sm" data-log-check="[?merge .archiveId ?]" title="Check integrity"><span class="fa fa-database"></span></button> <button type="button" class="btn btn-success btn-sm viewArchive" title="Info"><span class="fa fa-info-circle"> </span></button> - <button type="button" class="btn btn-primary btn-sm" data-log-view="[?merge .archiveId ?]/[?merge .resId ?]" title="View"><span class="fa fa-eye"></span></button> + <button type="button" class="btn btn-primary btn-sm" data-type="[?merge .type ?]" data-log-view="[?merge .archiveId ?]/[?merge .resId ?]" title="View"><span class="fa fa-eye"></span></button> </div> </td> </tr> diff --git a/src/presentation/maarchRM/Resources/view/recordsManagement/log/searchForm.html b/src/presentation/maarchRM/Resources/view/recordsManagement/log/searchForm.html index 2844d078de7971b4b28e0124bdeecf468ed189ab..13f2beb8b92d980953920790bcb3b2c7aff2b309 100755 --- a/src/presentation/maarchRM/Resources/view/recordsManagement/log/searchForm.html +++ b/src/presentation/maarchRM/Resources/view/recordsManagement/log/searchForm.html @@ -92,6 +92,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. </div> </div> <div class="container-fluid" id="archiveList"></div> + + <!-- Modal --> + <div class="modal fade bs-example-modal-lg" id="infoModal" tabindex="-1" role="dialog" aria-labelledby="log" aria-hidden="true"> + <div class="modal-dialog modal-lg"> + <div class="modal-content" id="log_modalContainer"> + </div> + </div> + </div> + <?hinclude lifeCycle/eventModal.html ?> </div> <?hinclude recordsManagement/log/integrityCheck.html ?> <?hinclude recordsManagement/archive/archiveManagement.html ?> @@ -136,10 +145,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. $("#type").prop('selectedIndex', 0); $('#archiveList').html(''); }); - + $("#contain").on("click",'[data-log-view]', function () { - var url = "/recordsManagement/Contents/"+$(this).attr('data-log-view'); + var url = "/log/Contents/" + $(this).data('type') + '/' + $(this).attr('data-log-view'); + $.ajax({ + type: "GET", + url: url, + dataType : 'html', + success: function(response) { + $('#log_modalContainer').html(response); + $('#infoModal').modal(); + } + }); + $(this).removeAttr("disabled"); + }); + + $("#contain").on("click",'[data-log-download]', function () { + + var url = "/recordsManagement/Contents/"+$(this).attr('data-log-download'); var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); @@ -147,22 +171,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. var edge = ua.indexOf("Edge"); if (msie > 0 || ieemu > 0 || edge > 0) { - window.open(url, 'document'); + window.local(url, 'document'); } else { window.open(url, 'document'); return; - - $.ajax({ - type: "GET", - url: url, - dataType : 'html', - success: function(response, status, xhr) { - $('#viewer').attr('data', response); - $('#viewer').attr('type', xhr.getResponseHeader("content-type")); - - $('#viewModal').modal(); - } - }); } $(this).removeAttr("disabled"); }); @@ -185,4 +197,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. } }); }); + + $("#contain").on('click', '.showEvent', function () { + eventInfo.load($(this).data('eventid')); + }) </script> diff --git a/src/presentation/maarchRM/Resources/view/recordsManagement/log/view.html b/src/presentation/maarchRM/Resources/view/recordsManagement/log/view.html new file mode 100644 index 0000000000000000000000000000000000000000..1f943e2c9274236836c511e8ac8f20eed0b7db6a --- /dev/null +++ b/src/presentation/maarchRM/Resources/view/recordsManagement/log/view.html @@ -0,0 +1,86 @@ + +<div class="container-fluid" data-translate-catalog="audit/messages"> + <div class="row"> + <div class="col-xs-12"> + <h1 class="page-header"> + Journal detail + <div class="pull-right"> + <button type="button" class="btn btn-warning" data-log-download="[?merge archiveId ?]/[?merge resourceId ?]" title="Download journal"><i class="fa fa-download"> </i>Download journal</button> + </div> + </h1> + </div> + <div class="col-xs-12"> + <div class="panel"> + <?merge type.ifeq('application') ?> + <div class="row"> + <dl class="dl dl-horizontal"> + <dt>Type</dt><dd><?merge typeTranslate ?></dd> + <dt>Identifier</dt><dd><?merge head[0] ?></dd> + <dt>To date</dt><dd><?merge head[1] ?></dd> + <dt>From date</dt><dd><?merge head[2] ?></dd> + </dl> + </div> + <?merge type.ifeq('lifeCycle') ?> + <div class="row"> + <dl class="dl dl-horizontal"> + <dl class="dl dl-horizontal"> + <dt>Type</dt><dd><?merge typeTranslate ?></dd> + <dt>Identifier</dt><dd><?merge head[0] ?></dd> + <dt>To date</dt><dd><?merge head[2] ?></dd> + <dt>From date</dt><dd><?merge head[3] ?></dd> + </dl> + </dl> + </div> + </div> + </div> + </div> +</div> +<div class="container-fluid" data-translate-catalog="audit/messages"> + <div class="row"> + <div class="col-xs-12"> + <div class="panel"> + <table class="table dataTable"> + <thead> + <?merge type.ifeq('application') ?> + <tr> + <th>Date</th> + <th>Account</th> + <th>Event</th> + </tr> + <?merge type.ifeq('lifeCycle') ?> + <tr> + <th>Date</th> + <th>Event</th> + <th/> + </tr> + </thead> + <?merge type.ifeq('application') ?> + <tbody> + <?merge events ?> + <tr> + <td><?merge .[0] ?></td> + <td><?merge .[1] ?></td> + <td><?merge .[2] ?></td> + </tr> + </tbody> + <?merge type.ifeq('lifeCycle') ?> + <tbody> + <?merge events ?> + <tr> + <td><?merge .[2] ?></td> + <td><?merge .[7] ?></td> + <td> + <div class="btn-group pull-right"> + <button type="button" class="btn btn-warning btn-sm showEvent" title="Show the certificate" data-eventid='[?merge .[0] ?]' data-journal-id='[?merge head[0] ?]'><span class="fa fa-fw fa-eye"> </span></button> + </div> + </td> + </tr> + </tbody> + </table> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal" title="Close">Close</button> + </div> + </div> +</div> \ No newline at end of file diff --git a/src/presentation/maarchRM/UserStory/journal/searchLogArchiveInterface.php b/src/presentation/maarchRM/UserStory/journal/searchLogArchiveInterface.php index 9e7adbc6617b9eda5f0dfa27b5124720daab7435..89068339686e70e550877a11812d29153f66ced8 100755 --- a/src/presentation/maarchRM/UserStory/journal/searchLogArchiveInterface.php +++ b/src/presentation/maarchRM/UserStory/journal/searchLogArchiveInterface.php @@ -35,4 +35,14 @@ interface searchLogArchiveInterface * @uses recordsManagement/log/find */ public function readLogs(); + + /** + * + * @param string $archiveId Archive identifier + * @param string $resourceId Resource identifier + * + * @return recordsManagement/log/contents + * @uses recordsManagement/log/contents_type__archiveId__resourceId_ + */ + public function readLogContents_type__archiveId__resourceId_(); } \ No newline at end of file