Bugzilla – Attachment 4213 Details for
Bug 6364
Display of item availability broken on OPAC detail screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch with improvement
0001-Fix-for-Bug-6364-Display-of-item-availability-broken.patch (text/plain), 4.83 KB, created by
Frédéric Demians
on 2011-05-21 06:39:12 UTC
(
hide
)
Description:
Signed-off patch with improvement
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2011-05-21 06:39:12 UTC
Size:
4.83 KB
patch
obsolete
>From 5f3555972dbd09d21f340aab0da692caa569a97b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 18 May 2011 11:01:20 -0400 >Subject: [PATCH] Fix for Bug 6364 - Display of item availability broken on > OPAC detail screen >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >--- > .../opac-tmpl/prog/en/includes/item-status.inc | 36 ++++++++++---------- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- > 2 files changed, 19 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc >index fcfe120..d05583f 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc >@@ -1,32 +1,32 @@ >-[% IF ( datedue ) %] >+[% IF ( item.datedue ) %] > [% IF ( OPACShowCheckoutName ) %] >- Checked out to [% cardnumber %] [% firstname %] [% surname %] >+ Checked out to [% item.cardnumber %] [% item.firstname %] [% item.surname %] > [% ELSE %] > Checked out > [% END %] >-[% ELSIF ( transfertwhen ) %] >- In transit from [% transfertfrom %] >- to [% transfertto %] since [% transfertwhen %] >-[% ELSIF ( waiting ) %] >+[% ELSIF ( item.transfertwhen ) %] >+ In transit from [% item.transfertfrom %] >+ to [% item.transfertto %] since [% item.transfertwhen %] >+[% ELSIF ( item.waiting ) %] > On hold >-[% ELSIF ( wthdrawn ) %] >+[% ELSIF ( item.wthdrawn ) %] > Item withdrawn >-[% ELSIF ( itemlost ) %] >- [% IF ( lostimageurl ) %] >- <img src="[% lostimageurl %]" alt="[% lostimagelabel %]" title="[% lostimagelabel %]"> >+[% ELSIF ( item.itemlost ) %] >+ [% IF ( item.lostimageurl ) %] >+ <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]"> > [% ELSE %] > Item lost > [% END %] >-[% ELSIF ( itemnotforloan ) %] >- [% IF ( notforloanvalue ) %] >- [% notforloanvalue %] [% IF ( restrictedopac ) %]<span class="restricted">([% restrictedopac %])</span>[% END %] >+[% ELSIF ( item.itemnotforloan ) %] >+ [% IF ( item.notforloanvalue ) %] >+ [% item.notforloanvalue %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] > [% ELSE %] >- Not for loan [% IF ( restrictedopac ) %]<span class="restricted">([% restrictedopac %])</span>[% END %] >+ Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] > [% END %] >-[% ELSIF ( notforloan_per_itemtype ) %] >- Not for loan [% IF ( restrictedopac ) %]<span class="restricted">([% restrictedopac %])</span>[% END %] >-[% ELSIF ( damaged ) %] >+[% 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 ( restrictedopac ) %]<span class="restricted">([% restrictedopac %])</span>[% END %] >+ Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] > [% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 7263b1e..ff4b52c 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -410,7 +410,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > [% IF ( itemdata_enumchron ) %]<td>[% ITEM_RESULT.enumchron %]</td>[% END %] > [% IF ( itemdata_uri ) %]<td><a href="[% ITEM_RESULT.uri %]">[% ITEM_RESULT.uri %]</a></td>[% END %] > [% IF ( itemdata_copynumber ) %]<td>[% ITEM_RESULT.copynumber %]</td>[% END %] >- <td>[% INCLUDE 'item-status.inc' %]</td> >+ <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td> > [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %] > <td>[% ITEM_RESULT.datedue %]</td> > [% IF ( ITEM_RESULT.type ) %] >-- >1.7.5.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6364
:
4166
| 4213