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

dev #50215 add link to items table

parent c1ea3b60
Branches
Tags
5 merge requests!2102#57574 : correction orthographe des jours de la semaine,!2080Sandbox detach zf from storm,!2061Master,!2052Dev#50215 explo st omer henin arques sso avec portail departemental fin moissonnage oai,!2049Dev#50215 explo st omer henin arques sso avec portail departemental fin moissonnage oai
Pipeline #533 passed with stage
in 12 minutes and 5 seconds
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Notice_Sso extends Class_Entity {
public function __construct($record) {
$this->setRecord($record);
}
public function isValid() {
if(!$record = $this->getRecord())
return false;
if(!$catalog_agency = $record->get_subfield('801', 'b'))
return false;
return reset($catalog_agency) == 'Bibliondemand';
}
}
?>
\ No newline at end of file
......@@ -254,6 +254,15 @@ class ZendAfi_View_Helper_Notice_Exemplaires_Dispo extends ZendAfi_View_Helper_N
$libelle = $this->view->tagAnchor($exemplaire->getUrl(),
$this->view->_('Description en ligne'));
if((new Class_Notice_Sso($exemplaire->getNotice()))->isValid())
$libelle = $this->view->tagAnchor($this->view->url(['module' => 'opac',
'controller' => 'modules',
'action' => 'sso',
'id' => $exemplaire->getIdNotice()],
null,
true),
$this->view->_('Consulter en ligne'));
if ($exemplaire->getNbResas() > 0)
$libelle.=
'<span>'
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class NoticeAjaxControllerBibliondemandItemsTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$unimarc = (new Class_Indexation_PseudoNotice_UnimarcVisitor())
->visitCatalogAgency('Bibliondemand')
->visitLocations(['1DTOUCH'])
->getUnimarc();
$item = $this->fixture('Class_Exemplaire',
['id' => 56,
'cote' => '789456456']);
$record = $this->fixture('Class_Notice',
['id' => 21,
'exemplaires' => [$item],
'unimarc' => $unimarc]);
$this->dispatch('/opac/noticeajax/exemplaires/id_notice/21', true);
}
/** @test */
public function shouldContainsLinkToModulesSso() {
$this->assertXPathContentContains('//table//td/a[contains(@href, "/modules/sso/id/21")]',
'Consulter en ligne',
$this->_response->getBody());
}
}
?>
\ No newline at end of file
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