GetAuthValCode calls were positioned inside the loop,
authorJoe Atzberger <joe.atzberger@liblime.com>
Wed, 7 Jan 2009 20:57:29 +0000 (14:57 -0600)
committerHenri-Damien LAURENT <henridamien@koha-fr.org>
Tue, 27 Jan 2009 11:19:44 +0000 (12:19 +0100)
commite17fa34ac5a487a0b8b1af85e11bb69498c5ad38
treedacee48c202b4d7f68f3767f59b0c89e7f3beea2
parent9276e1cdd26fc97dc13dadf4e24365e65b4a1dbf
GetAuthValCode calls were positioned inside the loop,

despite the same values being supplied each time.  Then
the conditional assignments would repeat the same calls again!
That means execution was liable to query the DB at least once
and as many as four times per item.  With a large number of items
this is an unnecessary burden.  By moving the calls outside
the loop, we can guarantee that we never have to call the DB for
that info more than twice (once for lost, once for damaged).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
catalogue/detail.pl