Bug 9367: Code optimization: CheckReserves is too often called
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 8 Jan 2013 14:33:58 +0000 (15:33 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sat, 16 Mar 2013 15:49:43 +0000 (11:49 -0400)
commitfad1f44d42600f440ac88c8df767cfc81c51dea9
tree17f21f6e181ea70cb3373843fbfa2341347cda5b
parent8447aeccdbe10e3586c9707bb6a99a3e47d9908f
Bug 9367: Code optimization: CheckReserves is too often called

This patch rewrites the GetReserveStatus routine in order to take in
parameter the itemnumber and/or the biblionumber.

In some places, the C4::Reserves::CheckReserves routine is called when
we just want to get the status of the reserve. In these cases, the
C4::Reserves::GetReserveStatus is now called.
This routine executes 1 sql query (or 2 max).

Test plan:
Check that there is no regression on the different pages where reserves
are used. The different status will be the same than before applying
this patch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Biblio.pm
C4/Circulation.pm
C4/Reserves.pm
C4/Search.pm
C4/XSLT.pm
circ/circulation.pl
members/moremember.pl
opac/opac-detail.pl
opac/opac-user.pl