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

dev #73233 display not published message

parent 7ba80885
Branches
Tags
3 merge requests!2660Master,!2655Dev#73233 planif contractuel minsoc formulaire gerer le rendu cote front,!2637Dev#73233 planif contractuel minsoc formulaire gerer le rendu cote front
Pipeline #4049 passed with stage
in 36 minutes and 2 seconds
......@@ -147,4 +147,9 @@ class Class_SearchFormWrapper {
public function getForm() {
return $this->_form;
}
public function isFormVisible() {
return $this->_search_form->getVisible();
}
}
\ No newline at end of file
......@@ -60,12 +60,19 @@ class ZendAfi_View_Helper_AdvancedSearch extends ZendAfi_View_Helper_BaseHelper
protected function _advancedForm($search_form) {
if(!$form_wrapper = $search_form->getFormInstance())
return;
return $this->_renderDefaultAdvancedSearch();
if($form_wrapper->hasError())
return $this->_renderErrors($form_wrapper);
return $this->view->renderForm($this->_populateForm($form_wrapper->getForm()));
$html = $this->view->renderForm($this->_populateForm($form_wrapper->getForm()));
if($form_wrapper->isFormVisible())
return $html;
return Class_Users::isCurrentUserCanAccesBackend()
? $this->_tag('p', $this->_('Ce formulaire n\'est pas publié.'), ['class' => 'error']) . $html
: $this->_renderDefaultAdvancedSearch();
}
......
......@@ -443,4 +443,10 @@ $form
public function mySuperInputShouldBePresent() {
$this->assertXPath('//input[@name="my_super_input"]', $this->_response->getBody());
}
/** @test */
public function notPublishedMessageShouldBePresent() {
$this->assertXPathContentContains('//p[@class="error"]', 'Ce formulaire n\'est pas publié.');
}
}
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