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

hotline_#18504_pergame_exemplaire_same_id_origine_between_album_and_sigb

parent a00c347f
Branches
Tags
4 merge requests!715Master,!664report fix from stable to wip,!663Stable,!654Hotline #18504 pergame exemplaire same id origine between album and sigb
- ticket : #18504
- SIGB Pergame: correction d'un bug dans l'affichage des réservations en cours qui affichait une ressource numérique.
\ No newline at end of file
......@@ -16,12 +16,12 @@
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Reservation extends Storm_Model_Abstract {
protected $_table_name = 'reservations';
protected $_table_primary = 'id_resa';
protected $_table_primary = 'id_resa';
protected $_belongs_to = array('bib' => array('model' => 'Class_Bib',
'referenced_in' => 'id_site'));
......@@ -33,7 +33,8 @@ class Class_Reservation extends Storm_Model_Abstract {
if (isset($this->_notice))
return $this->_notice;
if ($exemplaire = Class_Exemplaire::getLoader()->findFirstBy(array('id_origine' => $this->getIdNoticeOrigine())))
if ($exemplaire = Class_Exemplaire::findFirstBy(['id_origine' => $this->getIdNoticeOrigine(),
'order' => 'zone995 desc']))
return $this->_notice = $exemplaire->getNotice();
return null;
......
......@@ -298,31 +298,37 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP
$potter =
(new Class_WebService_SIGB_Reservation('12',
(new Class_WebService_SIGB_Exemplaire(123))->setTitre('Potter')))
->parseExtraAttributes(array('Etat' => 'Réservation émise',
'Rang' => '2',
'Bibliotheque' => 'Tombouctou',
'N° de notice' => 564));
Class_Exemplaire::newInstance(['id_origine' => 564,
'notice' => $this->fixture('Class_Notice',
['id' => 823,
'titre_principal' => 'Potter'])
])->assertSave();
->parseExtraAttributes(['Etat' => 'Réservation émise',
'Rang' => '2',
'Bibliotheque' => 'Tombouctou',
'N° de notice' => 564]);
// This item has no library: non-regression test.
$dobby =
(new Class_WebService_SIGB_Reservation('13',
(new Class_WebService_SIGB_Exemplaire(124))->setTitre('Dobby')))
->parseExtraAttributes(array('Etat' => 'Réservation émise',
'Rang' => '2',
'N° de notice' => 565));
->parseExtraAttributes(['Etat' => 'Réservation émise',
'Rang' => '2',
'N° de notice' => 565]);
$this->fixture('Class_Notice',
['id' => 820,
'titre_principal' => 'Potter']);
Class_Exemplaire::newInstance(['id_origine' => 565,
'notice' => $this->fixture('Class_Notice',
['id' => 824,
'titre_principal' => 'Dobby'])
])->assertSave();
$this->fixture('Class_Notice',
['id' => 824,
'titre_principal' => 'Dobby']);
$this->fixture('Class_Exemplaire',
['id' => 120,
'id_origine' => 564,
'id_notice' => 820]);
$this->fixture('Class_Exemplaire',
['id' => 130,
'id_origine' => 565,
'id_notice' => '824',
'zone995' => '']);
$this->florence
->setFicheSigb(['type_comm' => Class_IntBib::COM_OPSYS,
......@@ -374,7 +380,7 @@ class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerP
/** @test */
public function titreShouldBePotterAndLinkToNotice() {
$this->assertXPathContentContains('//tbody/tr[1]//td//a[contains(@href, "recherche/viewnotice/id/823/retour_abonne/reservations")]',
$this->assertXPathContentContains('//tbody/tr[1]//td//a[contains(@href, "recherche/viewnotice/id/820/retour_abonne/reservations")]',
'Potter',
$this->_response->getBody());
}
......
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