Commit 1c6a462a authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

no message

parents 8160489b d671bd19
......@@ -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,6 +34,7 @@ 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
......@@ -41,14 +42,17 @@ class Content
*
* @return Array Array of archive description
*/
public function findCourrier(
public function findLetter(
$query = null,
$descriptionLevel = 'File',
$originatorArchiveId = null,
$dateFrom = null,
$dateTo = null,
$originatorOrgRegNumber = null,
$disposed = false)
{
$dateTo = null,
$originatorOrgRegNumber = null
$queryParts = array();
$queryParams = array();
......@@ -65,6 +69,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";
......
......@@ -140,9 +140,22 @@ class Content
$archive->actions = array();
}
//access code selector
$accessRuleController = \laabs::newController('recordsManagement/accessRule');
$accessRules = $accessRuleController->index();
foreach ($accessRules as $accessRule) {
$accessRule->json = json_encode($accessRule);
if ($accessRule->duration != null) {
$accessRule->accessRuleDurationUnit = substr($accessRule->duration, -1);
$accessRule->accessRuleDuration = substr($accessRule->duration, 1, -1);
}
}
$this->readPrivilegesOnArchives();
$this->view->setSource('content', $archives);
$this->view->setSource("accessRules", $accessRules);
$this->view->merge();
$dataTable = $this->view->getElementsByClass("dataTable")->item(0)->plugin['dataTable'];
......
......@@ -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">
......@@ -47,7 +53,7 @@
</div>
<div class="col-lg-6">
<div class="form-group">
<label class="col-sm-4 control-label">Service producteur</label>
<label class="col-sm-4 control-label">Service destinataire</label>
<div class="col-sm-6">
<select class="form-control" name="originatorOrgRegNumber">
<option value=""></option>
......
......@@ -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
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