Bugzilla – Attachment 32160 Details for
Bug 9214
Show damaged status in the OPAC for items which are not for loan
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9214 - Show damaged status in the OPAC for items which are not for loan
Bug-9214---Show-damaged-status-in-the-OPAC-for-ite.patch (text/plain), 7.48 KB, created by
Chris Cormack
on 2014-10-10 14:52:13 UTC
(
hide
)
Description:
Bug 9214 - Show damaged status in the OPAC for items which are not for loan
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-10-10 14:52:13 UTC
Size:
7.48 KB
patch
obsolete
>From 482137b37dbeeab9e2fc443c8e53c7fc2e0d4cbe Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 7 Oct 2014 14:08:02 -0400 >Subject: [PATCH] Bug 9214 - Show damaged status in the OPAC for items which > are not for loan > >Item statuses in the OPAC displayed according to a cascading hierarchy: >If something is lost it will appear as lost, "else if" it is checked out >it will appear as checked out, etc. I don't think there is a logical >reason why statuses should appear this way. > >This patch modifies the logic in the template so that multiple statuses >can be displayed at the same time. The patch also wraps each status in >its own class so that libraries can apply custom CSS if they wish. > >Some tweaks have been made to the LESS file adding some style to the >common "item-status" class for display of item statuses. > >To test, apply the patch and view one or more titles in the OPAC which >have items with the following statuses: lost, checked out, damaged, not >for loan, waiting, on order, in transit, withdrawn, and available. > >Modify items to have more that one status simultaneously, in particular >not for loan and damaged. > >Also test the display of item statuses in the OPAC cart and the OPAC's >course details page (Course reserves -> [Course name]) since these pages >use the same include file. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../bootstrap/en/includes/item-status.inc | 72 +++++++++++++++------- > .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 3 +- > koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 10 +++ > 3 files changed, 61 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 16599de..c3721b0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -1,4 +1,5 @@ > [% USE AuthorisedValues %] >+[% SET itemavailable = 1 %] > > [%#- > This include takes two parameters: an item structure >@@ -8,46 +9,71 @@ not use an API to fetch items that populates item.datedue. > -%] > > [% IF ( item.itemlost ) %] >+ [% SET itemavailable = 0 %] > [% av_lib_include = AuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %] > [% IF ( av_lib_include ) %] >- [% av_lib_include %] >+ <span class="item-status lost">[% av_lib_include %]</span> > [% ELSE %] > [% IF ( item.lostimageurl ) %] > <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]" /> > [% ELSE %] >- Item lost >+ <span class="item-status lost">Item lost</span> > [% END %] > [% END %] >-[% ELSIF ( item.datedue || issue.date_due ) %] >+[% END %] >+ >+[% IF ( item.datedue || issue.date_due ) %] >+ [% SET itemavailable = 0 %] > [% IF ( OPACShowCheckoutName ) %] >- Checked out to [% item.cardnumber %] [% item.firstname %] [% item.surname %] >+ <span class="item-status checkedout">Checked out to [% item.firstname %] [% item.surname %] [% IF ( item.cardnumber ) %]([% item.cardnumber %])[% END %]</span> > [% ELSE %] >- Checked out >+ <span class="item-status checkedout">Checked out</span> > [% END %] >-[% ELSIF ( item.transfertwhen ) %] >- In transit from [% item.transfertfrom %] >- to [% item.transfertto %] since [% item.transfertwhen %] >-[% ELSIF ( item.waiting ) %] >- On hold >-[% ELSIF ( item.withdrawn ) %] >- Item withdrawn >-[% ELSIF ( item.itemnotforloan ) %] >+[% END %] >+ >+[% IF ( item.transfertwhen ) %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status intransit">In transit from [% item.transfertfrom %] >+ to [% item.transfertto %] since [% item.transfertwhen | $KohaDates %]</span> >+[% END %] >+ >+[% IF ( item.waiting ) %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status onhold">On hold</span> >+[% END %] >+ >+[% IF ( item.withdrawn ) %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status withdrawn">Item withdrawn</span> >+[% END %] >+ >+[% IF ( item.itemnotforloan ) %] >+ [% SET itemavailable = 0 %] > [% IF ( item.notforloanvalueopac ) %] >- [% item.notforloanvalueopac %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] >+ <span class="item-status notforloan">[% item.notforloanvalueopac %] [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span> > [% ELSE %] >- Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] >+ <span class="item-status notforloan">Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span> > [% END %] > [% ELSIF ( item.notforloan_per_itemtype ) %] >- Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] >-[% ELSIF ( item.damaged ) %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status notforloan">Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span> >+[% END %] >+ >+[% IF ( item.damaged ) %] >+ [% SET itemavailable = 0 %] > [% av_lib_include = AuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %] > [% IF av_lib_include %] >- [% av_lib_include %] >+ <span class="item-status damaged">[% av_lib_include %]</span> > [% ELSE %] >- Item damaged >+ <span class="item-status damaged">Item damaged</span> > [% END %] >-[% ELSIF item.on_order %] >- On order >-[% ELSE %] >- Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %] >+[% END %] >+ >+[% IF item.on_order %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status onorder">On order</span> >+[% END %] >+ >+[% IF ( itemavailable ) %] >+ <span class="item-status available">Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index f1d43d6..4a44b33 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -1,10 +1,11 @@ > [% USE Koha %] >+[% USE KohaDates %] > [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %] > > [% INCLUDE 'doc-head-open.inc' %] > [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart > [% INCLUDE 'doc-head-close.inc' %] >-[% BLOCK cssinclude %][% END %] >+[% BLOCK cssinclude %]<style type="text/css">.item-status { display: inline; }</style>[% END %] > </head> > [% INCLUDE 'bodytag.inc' bodyid='basket' %] > <div class="main"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >index 9e1a964..88b7e9d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >+++ b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >@@ -2054,6 +2054,12 @@ button.closebtn{padding:0;cursor:pointer;background:transparent;border:0;-webkit > margin-bottom : .5em; > } > >+.item-status { >+ display: block; >+ font-size: 95%; >+ margin-bottom: .5em; >+} >+ > .available { > color : #006600; > } >@@ -2195,6 +2201,10 @@ td img { > padding-right: 19px; > background: #ECEDE6 none; > } >+ th, >+ td { >+ line-height: 135%; >+ } > } > .tags { > ul { >-- >1.9.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 9214
:
32047
|
32048
|
32049
|
32050
|
32160
|
32161
|
32269
|
32270
|
33463
|
33464