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

Add filter originatorArchiveId

parent fe55e20d
......@@ -30,17 +30,19 @@ interface ContentInterface
* Recherche d'un contenu d'archive
* @param string $query
* @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom
* @param date $dateTo
* @param string $originatorOrgRegNumber
*
* @action archivesCourrier/Content/findCourrier
* @action archivesCourrier/Content/findLetter
*
* @return Array Array of archive description
*/
public function readSearch(
$query = null,
$descriptionLevel = 'File',
$originatorArchiveId = null,
$dateFrom = null,
$dateTo = null,
$originatorOrgRegNumber = null
......
......@@ -34,19 +34,21 @@ class Content
* Recherche d'un contenu d'archive
* @param string $query
* @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom
* @param date $dateTo
* @param string $originatorOrgRegNumber
*
* @return Array Array of archive description
*/
public function findCourrier(
public function findLetter(
$query = null,
$descriptionLevel = 'File',
$originatorArchiveId = null,
$dateFrom = null,
$dateTo = null,
$originatorOrgRegNumber = null)
{
$dateTo = null,
$originatorOrgRegNumber = null
) {
$queryParts = array();
$queryParams = array();
......@@ -63,6 +65,11 @@ class Content
$queryParts['term'] = "<?SQL text @@ to_tsquery('".implode(' & ', $tokens)."') ?>";
}
if ($originatorArchiveId) {
$queryParams['originatorArchiveId'] = $originatorArchiveId;
$queryParts['originatorArchiveId'] = "originatorArchiveId = :originatorArchiveId";
}
if ($originatorOrgRegNumber) {
$queryParams['originatorOrgRegNumber'] = $originatorOrgRegNumber;
$queryParts['originatorOrgRegNumber'] = "originatorOrgRegNumber = :originatorOrgRegNumber";
......
......@@ -28,11 +28,17 @@
<div id="publicArchive_searchFormCollapse" class="well panel-collapse collapse in" style="margin-bottom: 0px">
<form class="form-horizontal" id="publicArchive_searchForm">
<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="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">
<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 class="form-group">
......
......@@ -41,6 +41,7 @@ interface IndexCourrierInterface
* @param string $query
* @param string $originatorOrgRegNumber
* @param string $descriptionLevel
* @param string $originatorArchiveId
* @param date $dateFrom
* @param date $dateTo
*
......@@ -48,10 +49,11 @@ interface IndexCourrierInterface
* @uses archivesCourrier/Content/readSearch
*/
public function readArchivescourrierSearch(
$dateFrom,
$dateTo,
$query,
$originatorOrgRegNumber,
$descriptionLevel
$descriptionLevel,
$originatorArchiveId,
$dateFrom,
$dateTo
);
}
\ No newline at end of file
Markdown is supported
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