Dev#24865 pnb ergonomie interface emprunt
Merge request reports
Activity
Filter activity
281 if (!$this->_user->hasRightAccessDilicom()) 282 return $this->_ajaxRedirectToNotice(); 283 284 if(!$this->view->album = Class_Album::find($this->_getParam('id'))) 285 return $this->_ajaxRedirectToNotice(); 286 287 return $this->renderPopupResult($this->_('Emrpunter le livre au format EPUB'), 288 $this->view->render('bib-numerique/loan-book.phtml')); 289 } 290 291 292 public function consultBookAjaxAction() { 293 if($this->_redirectToPopupLogin($this->view->url())) 294 return; 295 296 if (!$this->_user->hasRightAccessDilicom()) 293 if($this->_redirectToPopupLogin($this->view->url())) 294 return; 295 296 if (!$this->_user->hasRightAccessDilicom()) 297 return $this->_ajaxRedirectToNotice(); 298 299 if(!$album = Class_Album::find($this->_getParam('id'))) 300 return $this->_ajaxRedirectToNotice(); 301 302 303 $client_ip = (new Class_RemoteClient($this->_request))->getIpAddress(); 304 $response = (new Class_WebService_BibNumerique_Dilicom_Hub())->consultBook($album, 305 $client_ip, 306 $this->_user); 307 $content = json_decode($response); 308 if ($content->returnMessage) { 305 $client_ip, 306 $this->_user); 307 $content = json_decode($response); 308 if ($content->returnMessage) { 309 $this->_helper->notify(implode(',', $content->returnMessage)); 310 return $this->_ajaxRedirectToNotice(); 311 } 312 313 $this->view->consult_url = $content->link->url; 314 315 $this->renderPopupResult($this->_('Consultation'), $this->view->render('bib-numerique/consult-book.phtml')); 316 } 317 318 319 public function downloadLoanBookAjaxAction() { 320 $content = (new Class_WebService_BibNumerique_Dilicom_Hub())->loanBook(Class_Album::find($this->_getParam('id')));
Please register or sign in to reply