Koha/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
Owen Leonard 559091c558 Fix for Bug 6364 - Display of item availability broken on OPAC detail screen
Owen:

The markup for showing item availability has been moved to an include
file. The include lacked the scope declaration for the item results
loop. Adding the scope declaration to the include file means it can't
be used by other template unless within the same scope, but I'm not
aware of a better way to do it given the number of variables in use.

Frédéric:

I confirm the bug.

I propose a alternative solution which solve the bug and keep its
versability-reusability to the include file. With this solution, when including
item-status.inc, the foreach loop variable name, which can change from template
to template, is renamed by using a local variable definition: ie a variable
name specified after file name in the INCLUDE directive, this variable
temporalily masking any existing variable.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-05-29 15:49:50 +12:00

32 lines
1.3 KiB
HTML

[% IF ( item.datedue ) %]
[% IF ( OPACShowCheckoutName ) %]
Checked out to [% item.cardnumber %] [% item.firstname %] [% item.surname %]
[% ELSE %]
Checked out
[% END %]
[% ELSIF ( item.transfertwhen ) %]
In transit from [% item.transfertfrom %]
to [% item.transfertto %] since [% item.transfertwhen %]
[% ELSIF ( item.waiting ) %]
On hold
[% ELSIF ( item.wthdrawn ) %]
Item withdrawn
[% ELSIF ( item.itemlost ) %]
[% IF ( item.lostimageurl ) %]
<img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]">
[% ELSE %]
Item lost
[% END %]
[% ELSIF ( item.itemnotforloan ) %]
[% IF ( item.notforloanvalue ) %]
[% item.notforloanvalue %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% ELSE %]
Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% END %]
[% ELSIF ( item.notforloan_per_itemtype ) %]
Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% ELSIF ( item.damaged ) %]
Item damaged
[% ELSE %]
Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% END %]