Commit 60ca6c60 authored by Alexandre Morin's avatar Alexandre Morin
Browse files

Add filter originatorArchiveId

parent fe55e20d
...@@ -30,17 +30,19 @@ interface ContentInterface ...@@ -30,17 +30,19 @@ interface ContentInterface
* Recherche d'un contenu d'archive * Recherche d'un contenu d'archive
* @param string $query * @param string $query
* @param string $descriptionLevel * @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom * @param date $dateFrom
* @param date $dateTo * @param date $dateTo
* @param string $originatorOrgRegNumber * @param string $originatorOrgRegNumber
* *
* @action archivesCourrier/Content/findCourrier * @action archivesCourrier/Content/findLetter
* *
* @return Array Array of archive description * @return Array Array of archive description
*/ */
public function readSearch( public function readSearch(
$query = null, $query = null,
$descriptionLevel = 'File', $descriptionLevel = 'File',
$originatorArchiveId = null,
$dateFrom = null, $dateFrom = null,
$dateTo = null, $dateTo = null,
$originatorOrgRegNumber = null $originatorOrgRegNumber = null
......
...@@ -34,19 +34,21 @@ class Content ...@@ -34,19 +34,21 @@ class Content
* Recherche d'un contenu d'archive * Recherche d'un contenu d'archive
* @param string $query * @param string $query
* @param string $descriptionLevel * @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom * @param date $dateFrom
* @param date $dateTo * @param date $dateTo
* @param string $originatorOrgRegNumber * @param string $originatorOrgRegNumber
* *
* @return Array Array of archive description * @return Array Array of archive description
*/ */
public function findCourrier( public function findLetter(
$query = null, $query = null,
$descriptionLevel = 'File', $descriptionLevel = 'File',
$originatorArchiveId = null,
$dateFrom = null, $dateFrom = null,
$dateTo = null, $dateTo = null,
$originatorOrgRegNumber = null) $originatorOrgRegNumber = null
{ ) {
$queryParts = array(); $queryParts = array();
$queryParams = array(); $queryParams = array();
...@@ -63,6 +65,11 @@ class Content ...@@ -63,6 +65,11 @@ class Content
$queryParts['term'] = "<?SQL text @@ to_tsquery('".implode(' & ', $tokens)."') ?>"; $queryParts['term'] = "<?SQL text @@ to_tsquery('".implode(' & ', $tokens)."') ?>";
} }
if ($originatorArchiveId) {
$queryParams['originatorArchiveId'] = $originatorArchiveId;
$queryParts['originatorArchiveId'] = "originatorArchiveId = :originatorArchiveId";
}
if ($originatorOrgRegNumber) { if ($originatorOrgRegNumber) {
$queryParams['originatorOrgRegNumber'] = $originatorOrgRegNumber; $queryParams['originatorOrgRegNumber'] = $originatorOrgRegNumber;
$queryParts['originatorOrgRegNumber'] = "originatorOrgRegNumber = :originatorOrgRegNumber"; $queryParts['originatorOrgRegNumber'] = "originatorOrgRegNumber = :originatorOrgRegNumber";
......
...@@ -28,11 +28,17 @@ ...@@ -28,11 +28,17 @@
<div id="publicArchive_searchFormCollapse" class="well panel-collapse collapse in" style="margin-bottom: 0px"> <div id="publicArchive_searchFormCollapse" class="well panel-collapse collapse in" style="margin-bottom: 0px">
<form class="form-horizontal" id="publicArchive_searchForm"> <form class="form-horizontal" id="publicArchive_searchForm">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="form-group">
<label class="col-sm-3 control-label">Terme</label>
<div class="col-md-6">
<input type="text" class="form-control" id="query" name="query" placeholder="Terme"/>
</div>
</div>
<div class="col-lg-6"> <div class="col-lg-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Terme</label> <label class="col-sm-4 control-label">Numéro chrono</label>
<div class="col-md-8"> <div class="col-md-8">
<input type="text" class="form-control" id="query" name="query" placeholder="Terme"/> <input type="text" class="form-control" id="originatorArchiveId" name="originatorArchiveId" placeholder="Numéro chrono"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -41,6 +41,7 @@ interface IndexCourrierInterface ...@@ -41,6 +41,7 @@ interface IndexCourrierInterface
* @param string $query * @param string $query
* @param string $originatorOrgRegNumber * @param string $originatorOrgRegNumber
* @param string $descriptionLevel * @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom * @param date $dateFrom
* @param date $dateTo * @param date $dateTo
* *
...@@ -48,10 +49,11 @@ interface IndexCourrierInterface ...@@ -48,10 +49,11 @@ interface IndexCourrierInterface
* @uses archivesCourrier/Content/readSearch * @uses archivesCourrier/Content/readSearch
*/ */
public function readArchivescourrierSearch( public function readArchivescourrierSearch(
$dateFrom,
$dateTo,
$query, $query,
$originatorOrgRegNumber, $originatorOrgRegNumber,
$descriptionLevel $descriptionLevel,
$originatorArchiveId,
$dateFrom,
$dateTo
); );
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment