Skip to content
Snippets Groups Projects
Commit 33a9a7b1 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #94469 : add authorities search and browse

parent 6123cf13
Branches
Tags
3 merge requests!3297WIP: Master,!3226Dev#94469 minsoc autorites recherche dediee aux autorites,!3221Dev#94469 minsoc autorites recherche dediee aux autorites
Pipeline #8206 passed with stage
in 37 minutes and 8 seconds
......@@ -22,14 +22,10 @@
class AuthoritySearchController extends ZendAfi_Controller_Action {
public function indexAction() {
$tree_roots = $this->_getParam('tree_roots', '');
$criteres = (new Class_CriteresRecherche_Authority)->setParams($this->_request->getParams());
if ($this->_request->isPost()) {
$redirect_params = $criteres->getUrlCriteres();
if ($tree_roots)
$redirect_params['tree_roots'] = $tree_roots;
return $this->_redirect($this->view->url($redirect_params, null, true),
['prependBase' => false]);
}
......@@ -37,11 +33,8 @@ class AuthoritySearchController extends ZendAfi_Controller_Action {
$prefs = $this->_getActionPreferences();
$this->view->titre = $prefs['titre'];
$this->view->tree_roots = $tree_roots;
$this->view->tree_roots = $criteres->getParam('tree_roots');
$action_params = $criteres->getUrlWithoutExpression();
if ($tree_roots)
$action_params['tree_roots'] = $tree_roots;
$this->view->form = (new ZendAfi_Form_AuthoritySearch())
->setAction($this->view->url($action_params, null, true));
......
......@@ -35,8 +35,7 @@ class ErrorController extends ZendAfi_Controller_Action {
if (($this->_request->getServer('HTTP_HOST') == 'localhost')
|| $this->_isInspecting()
|| ((null != ($user = Class_Users::getLoader()->getIdentity()))
&& $user->isAdmin())) {
|| Class_Users::isCurrentUserAdmin()) {
$this->view->errors = $errors;
return;
}
......
......@@ -24,13 +24,14 @@ class Class_CriteresRecherche_Authority extends Class_CriteresRecherche_Abstract
public function getValidParameters() {
$parameters = parent::getValidParameters();
$parameters[] = 'expressionRecherche';
$parameters[] = 'tree_roots';
return $parameters;
}
public function acceptVisitor($visitor) {
$visitor->visitNoExtension(true);
$visitor->visitExpression($this->getParam('expressionRecherche'), false, $this->getTri());
$visitor->visitExpression($this->getParam('expressionRecherche'), false, $this->getTri(), false);
$visitor->visitRecordType(Class_Notice::TYPE_AUTHORITY);
foreach($this->getFacettes() as $facette)
$visitor->visitFacette($facette);
......
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