Skip to content
Snippets Groups Projects
Commit bd9219da authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #39494 fix tests comments

parent 1ce6fd80
Branches
Tags
3 merge requests!2334Master,!2131Dev#39494 1940 filtres de workflow dans listviewmode,!2126dev #39494 add status
Pipeline #1245 failed with stage
in 10 minutes and 43 seconds
......@@ -93,8 +93,9 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->view->titre = $this->view->_('Articles');
if($this->_request->isPost())
return $this->_redirectToRefererWithNewParams(['title_search' => $this->_getParam('title_search'),
'status' => $this->_getParam('status')]);
return $this->_redirectToRefererWithNewParams(['title_search' => $this->_getPost()['title_search'],
'page' => $this->_getParam('page'),
'status' => $this->_getPost()['status']]);
if (Class_AdminVar::isArticlesListMode())
return $this->_renderList();
......
......@@ -49,7 +49,13 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
public function getBaseUrl() {
return ['module' => 'admin',
'controller' => 'cms'];
'controller' => 'cms',
'action' => 'index',
'page' => 1,
'id_cat' => $this->getParam('id_cat'),
'id_bib' => $this->getParam('id_bib'),
'title_search' => $this->getSearch(),
'status' => $this->getParam('status')];
}
......@@ -57,6 +63,7 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
return $this->getBaseUrl() + ['action' => 'index',
'id_bib' => $this->getBibId(),
'title_search' => '',
'page' => '1',
'status' => ''];
}
......@@ -199,6 +206,7 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
protected function getMultipleSearchParams() {
return array_filter(['where' => $this->buildWhereParams(),
'status' => $this->getStatus(),
'id_cat' => $this->getParam('id_cat'),
'order' => 'titre']);
}
......@@ -207,9 +215,9 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
if($this->_search_params)
return $this->_search_params;
if (count($filtered_ids=$this->getFilteredCategoriesIds())>0)
if (count($filtered_ids = $this->getFilteredCategoriesIds()) > 0)
return $this->_search_params = array_merge($this->getMultipleSearchParams(),
['id_cat' => $filtered_ids]);
['id_cat' => $filtered_ids]);
return $this->_search_params = $this->getMultipleSearchParams();
}
......@@ -244,16 +252,12 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
'label' => $this->_('Racine'),
'options' => []],
['url' => ['module' => 'admin',
'controller' => 'cms',
'action' => 'index',
'id_bib' => $this->getBibId()],
['url' => array_merge($this->getBaseUrl(),
['id_bib' => $this->getBibId(),
'id_cat' => '']),
'label' => $this->getBibLabel(),
'options' => []]];
if ($this->isSearching())
return $breadcrumb;
if (Class_Users::getIdentity()->isRoleLibraryLimited())
$breadcrumb = [['url' => ['module' => 'admin',
'controller' => 'cms',
......@@ -356,7 +360,7 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr
$form->removeDisplayGroup('list_search_group');
return $form->addElement('select',
'status',
['multiOptions' => array_merge([0 => $this->_('Tout statut')],
['multiOptions' => array_merge([0 => $this->_('Tous statuts')],
Class_Article::getKnownStatus()),
'value' => $this->getStatus()])
->addUniqDisplayGroup('list_search_group');
......
......@@ -78,4 +78,9 @@ class ZendAfi_Controller_Action_Helper_BibListViewMode extends ZendAfi_Controlle
public function getStrategyLabel() {
return 'bib';
}
public function getItemsPaginator() {
return new Zend_Paginator(new Zend_Paginator_Adapter_Null(0));
}
}
\ No newline at end of file
......@@ -98,9 +98,8 @@ class CmsControllerListModeAdminBibRootTest extends CmsControllerListModeTestCas
/** @test */
public function shouldDisplayRootCategory() {
$this->assertXPathContentContains('//td/a[contains(@href, "cms/index/id_cat/1")]',
'Root',
$this->_response->getBody());
$this->assertXPathContentContains('//td/a[contains(@href, "cms/index/page/1/id_cat/1/id_bib/1/title_search//status/")]',
'Root');
}
}
......
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