Dev #24867 pnb remove loan button
Merge request reports
Activity
Filter activity
255 255 256 256 } 257 257 258 public function consultBookAjaxAction() { 259 if ($this->redirectToLogin()) 260 return ; 261 $this->_redirect($this->view->url(['action' => 'consult-book', 'render' =>null]), ['prependBase' => false]); 262 return; 263 } 264 265 public function redirectToLogin() { 268 return true; 269 } 270 return false; 271 } 272 273 274 public function loanBookAjaxAction() { 275 if ($this->redirectToLogin()) 276 return ; 277 $this->_redirect($this->view->url(['action' => 'loan-book', 'render' => null]), ['prependBase' => false]); 278 return true; 279 } 280 258 281 259 282 public function consultBookAction() { 283 if ($this->redirectToLogin()) 265 293 $content = json_decode($response); 266 294 if ($content->returnMessage) { 267 295 $this->_helper->notify(implode(',', $content->returnMessage)); 268 $this->_redirectToReferer(); 296 $this->redirectToNotice(); 269 297 return; 270 298 } 271 299 272 300 $this->_redirect($content->link->url); 273 301 } 274 302 303 public function redirectToNotice() { 267 295 $this->_helper->notify(implode(',', $content->returnMessage)); 268 $this->_redirectToReferer(); 296 $this->redirectToNotice(); 269 297 return; 270 298 } 271 299 272 300 $this->_redirect($content->link->url); 273 301 } 274 302 303 public function redirectToNotice() { 304 $this->_redirect($this->view->url(['controller' => 'recherche', 305 'action' => 'viewnotice']),['prependBase' => false]); 275 306 307 } 276 308 public function loanBookAction() { 309 if ($this->redirectToLogin()) 36 36 'width' => '100%', 37 37 'height' => '600px']); 38 38 39 $links = $this->view->tag('p', $this->view->_('Vous devez vous connecter pour accéder à la consultation en ligne.')); 39 $links = $this->view->tag('p', $this->view->_('Vous n\'avez pas le droit d\'accéder à la consultation en ligne.')); 40 40 41 if(($this->_user = Class_Users::getIdentity()) && ($this->_user->hasRightAccessDilicom())) 41 if(!Class_Users::getIdentity() || ($this->_user = Class_Users::getIdentity()) && ($this->_user->hasRightAccessDilicom())) 87 87 } 88 88 89 89 90 class BibNumeriqueContollerDilicomAjaxRedirectBookActionTest extends BibNumeriqueContollerDilicomTestCase { 91 public function setUp() { 92 parent::setUp(); 93 94 } 95 /** @test */ 96 public function redirectShouldBeConsultBook() { 97 $this->dispatch('/bib-numerique/consult-book-ajax/id/3', true); 98 $this->assertRedirectTo('/bib-numerique/consult-book/id/3', $this->getResponseLocation()); 99 } 100 101 102 /** @test */
Please register or sign in to reply