From b5eed8bd6b41dd37d9e50f037b345e64257d98d4 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 29 Aug 2019 12:06:24 +0000 Subject: [PATCH] Bug 7611: Change negative notforloan as well This makes the changes apply to both positive and negative notforloan values The extra line generated before is removed Some spans are added and cleaned up and labels moved to CSS to allow for easier altering where needed Itemtypes marked notforloan remain as reference, the label can be changed via css To test: 1 - Have a record with items in various statuses, ideally - 3 available, with 2 in one branch, 1 in another - 3 with itemtype not for loan, 2 in one branch, 1 in another - 3 in a positive not for loan status, 2 and 1 as above - 3 in a negative not for loan status, 2 and 1 as above - 1 in a different positive loan status, but with the same opac description as the negative above 2 - Search the opac to include this record, take a screenshot 3 - Apply patch 4 - Restart all and refresh 5 - Compare to screen shot 6 - Differences include: - Positive statuses are now on separate line with opac description showing - Unavailable (not for loan items) now include callnumber and branch in display - Positive and negative notforloan with same description are combined where branches match - Inspect the elements, note new spans around 'Items available for loan/reference' 7 - Add to OPACUserCSS: .ItemSummary .ItemBranch{ display:none; } .unavailable .ItemSummary .CallNumber,.unavailable .ItemSummary .LabelCallNumber{ display:none; } 8 - Note the branches are hidden, and callnumbe rhidden for unavailable items Signed-off-by: Jessica Zairo --- C4/XSLT.pm | 7 +-- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 8 +++ .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 68 ++++++++++++++-------- 3 files changed, 53 insertions(+), 30 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 4574f5f917..e52969d7ef 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -320,13 +320,10 @@ sub buildKohaItemsNamespace { if ( ( $item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan} ) || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} || (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") || $item->{has_pending_hold} ){ - if ( $item->{notforloan} < 0) { - $status = "On order"; - } - if ( $item->{itemnotforloan} && $item->{itemnotforloan} > 0 || $item->{notforloan} && $item->{notforloan} > 0 || $item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan} && $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { + if ( $item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan} && $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { $status = "reference"; } - if ($item->{itemnotforloan} > 0 || $item->{notforloan} > 0 ){ + if ($item->{notforloan}){ $status = "reallynotforloan"; $substatus = $descs{$item->{notforloan}} || ''; $substatus = $substatus->{opac_description} if $substatus; diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 5e324feaac..ae22b198ce 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2671,6 +2671,14 @@ button.closebtn { color: #990033; } +.ItemSummary .LabelCallNumber::before { + content: "["; +} + +.ItemSummary .CallNumber::after { + content: "]"; +} + .waiting, .intransit, .notforloan, diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index a92b0987f9..dade7f92c2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -1231,8 +1231,8 @@ - - Items available for loan: + + Items available for loan: @@ -1241,7 +1241,8 @@ - [Call number: ] + Call number: + ( @@ -1259,10 +1260,11 @@ - + - [Call number: ] + Call number: + ( @@ -1278,10 +1280,11 @@ - + - [Call number: ] + Call number: + ( @@ -1304,17 +1307,18 @@ - - Items available for reference: + + Items available for reference: - + - [Call number: ] + Call number: + ( @@ -1327,12 +1331,6 @@ - - -
-
-
- : @@ -1343,12 +1341,22 @@
- - [Call number: ] - ( - - ) - . , + + + + + + + + Call number: + + + + ( + + ) + . , +
@@ -1417,7 +1425,12 @@
- + + + Call number: + + + . ,
@@ -1430,7 +1443,12 @@ - + + + Call number: + + + . ,
-- 2.11.0