Bug 7611

Summary: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Product: Koha Reporter: Frédérick Capovilla <fcapovilla>
Component: OPACAssignee: Frédérick Capovilla <fcapovilla>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: 1joynelson, barton, caroline.cyr-la-rose, david.bourgault, jonathan.druart, jschmidt, jzairo, katrin.fischer, kyle, m.de.rooy, magnus, marjorie.barry-vila, mehdi.hamidi, mglavica, nick, pablo.bianchi, rkuiper, sally.healey
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13854
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21260
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05
Bug Depends on:    
Bug Blocks: 24630    
Attachments: XSLT Results template improvement : Use the NOT_LOAN authorised values
XSLT Results template improvement : Use the NOT_LOAN authorised values (Corrected patch)
New version of the initial patch
Bug 7611 - Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Screenshot
Screenshot of current display
Bug 7611 - Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Bug 7611: Change negative notforloan as well
Bug 7611: Change negative notforloan as well
Bug 7611: (follow-up) Add missing space
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Sample marc record to illustrate display
Bug 23986: Pass strings to Catmandu for deletion
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Bug 7611: Change negative notforloan as well
Bug 7611: (follow-up) Add missing space
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Bug 7611: (follow-up) separate positive and negative statuses as in the past
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Bug 7611: Change negative notforloan as well
Bug 7611: (follow-up) Add missing space
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Bug 7611: (follow-up) separate positive and negative statuses as in the past
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Bug 7611: Change negative notforloan as well
Bug 7611: (follow-up) Add missing space
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Bug 7611: (follow-up) separate positive and negative statuses as in the past
Bug 7611: Adjust tests

Description Frédérick Capovilla 2012-02-27 16:52:54 UTC Comment hidden (obsolete)
Comment 1 Frédérick Capovilla 2012-02-27 16:55:07 UTC
Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 2 Frédérick Capovilla 2012-02-27 16:59:46 UTC Comment hidden (obsolete)
Comment 3 Frédérick Capovilla 2012-02-27 18:19:30 UTC Comment hidden (obsolete)
Comment 4 Magnus Enger 2012-02-28 10:22:16 UTC
I have made a note to look at this for NORMARC some time, but not sure when i can get around to doing it. 

Setting status to Needs Signoff, since there is a patch.
Comment 5 Owen Leonard 2012-03-09 18:21:52 UTC
I like this change because it better accommodates use of "not for loan" in cases where the item is available. I'm comparing the before and after:

Before:

Copies available for loan: Nelsonville [E Minarik] (1). 
Copies available for reference: Athens [E Minarik] (2). Lost (1). Damaged (1).

After:

Copies available for loan: Nelsonville [E Minarik] (1). Staff collection (1). Not for loan (1). Damaged (1). Lost (1). 

What the new version lacks, I think, is output of the call number for "not for loan" items. If we consider these items available in some sense of the term (in library-use, reference, etc), shouldn't we show the call number as in the "before" view?
Comment 6 Marijana Glavica 2012-06-11 11:20:46 UTC
Except not showing call numbers, as Owen noted, there are few more things I noticed until now, so here are my examples:

Before:
Availability: Copies available for loan: Gimnazija Požega [456] (1), Knjižnica FFZG [678] (1).
Copies available for reference: Knjižnica FFZG [R-123] (2). Damaged (1). 

After:
Availability: Copies available for loan: Gimnazija Požega [456] (1), Knjižnica FFZG [678] (1). Damaged (1). Not for loan (1). Staff Collection (1). 

So, everything is now in one line. I don't agree that this is nicer, because now we have "not for loan" items under "Copies available for loan" label. The solution would be to change label only to "Available" or "Available for use" or something.

This is tiny change to make, but there is another problem. In my second example I have situation like this:

Before:
Availability: Copies available for reference: Knjižnica FFZG [not for loan] (1). 

After:
Availability: No copies available Not for loan (1).

So, in my first example i have "not for loan" items under "Copies available for loan", but in my second example with just one item for biblio, this label disappears.


In our library, items marked with "not for loan" status are available, but they can be used only in library, so the label "copies available for reference" was telling our users exactly that.
Comment 7 Owen Leonard 2016-06-23 12:06:01 UTC
I think this is still valid on master. It looks to me like the only special handling we have for "not for loan" is for on-order items. Otherwise it's "Items available for reference."
Comment 8 Barton Chittenden 2016-10-12 18:39:26 UTC
We've had other libraries report this issue as well.

Would it be possible to get some movement on this?

Thanks,

--Barton
Comment 9 Mehdi Hamidi 2017-03-03 19:46:35 UTC
Created attachment 60816 [details] [review]
Bug 7611 - Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 10 Katrin Fischer 2017-05-01 20:19:19 UTC
Created attachment 62930 [details]
Screenshot

Tested with a record with 5 items:
- no status set, normal itemtype
- no status set, itemtype is marked as not for loan
- damaged: damaged
- not for loan: staff collection
- not for loan: on order

- As soon as I added the item with the not for loan itemtype an additional blank line appeared between the available and unavailable items
- Before the patch the items were counted as 'available' in green, after the patch the not for loan items are counted as 'unavailable' in red. I think this is a somewhat unexpected change. As I see it we define availability as 'accessible', but not necessarily as 'for loan'. I think this change needs to be discussed. 
- Showing the authorised value description means that this will no longer be translatable. For libraries offering the OPAC in multiple languages this might be a problem (we really need to make authorised values multi-lang as the itemtypes).

Marking failed for the additional blank line.
Comment 11 Katrin Fischer 2017-05-01 20:21:56 UTC
Created attachment 62931 [details]
Screenshot of current display

Current display for comparison (note: my items didn't have callnumbers)
Comment 12 Joy Nelson 2019-02-14 14:10:09 UTC
*** Bug 19572 has been marked as a duplicate of this bug. ***
Comment 13 Kyle M Hall 2019-02-14 14:10:58 UTC
Created attachment 85115 [details] [review]
Bug 7611 - Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 14 Kyle M Hall 2019-02-14 14:26:45 UTC
I'm not seeing the problem.
Comment 15 Owen Leonard 2019-02-15 14:10:52 UTC
This works for notforloatn values > 0. A value of -1 still shows a default "On order" instead of the text I have defined in authorized values.

I think it is a big change that items are now shown as unavailable instead of "available for reference." I think neither is ideal, but sticking with the old label is probably better if we're not going to come up with a more comprehensive solution in this bug (i.e. have a way to define what is "for reference" and what is wholly unavailable).
Comment 16 Caroline Cyr La Rose 2019-08-09 20:25:43 UTC
I find that this is still a problem. Is the only thing left to determine/dicuss is what we want for items that are "available" but "not for loan" (e.g. available for reference or in-library use)?
Comment 17 Nick Clemens 2019-08-29 13:54:17 UTC
Created attachment 92495 [details] [review]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 18 Nick Clemens 2019-08-29 13:54:24 UTC
Created attachment 92496 [details] [review]
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
Comment 19 ByWater Sandboxes 2019-10-11 16:21:49 UTC
Created attachment 94026 [details] [review]
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 <jzairo@bywatersolutions.com>
Comment 20 Katrin Fischer 2019-10-12 11:49:52 UTC
Sorry, but something is not working quite right here still. I get quite unreadable output in the OPAC :(

With this patch:
Availability: Items available for loan: CentervilleCall number: 005.13/3 (1).
Centerville Staff CollectionCall number: 005.13/3 (2), Centerville OrderedCall number: 005.13/3 (1). Damaged (1). 

Before:
Availability: Items available for loan: Centerville [Call number: 005.13/3] (1). Items available for reference: Centerville [Call number: 005.13/3] (1).
Damaged (1). On order (1). 

- Can we please bring back the [] for now? 
- Totally missing the: 'Available for reference' label?
- I am also tempted to say 'kill Call number', but we should concentrate on one change at a time here. We should focus on the 'not for loan' descriptions here first.
Comment 21 Katrin Fischer 2019-10-12 11:50:41 UTC
My example: Record with 4 items:
- 1 damaged + Staff collecton
- 1 ordered
- 1 Staff collection
- 1 'without' status
Comment 22 Katrin Fischer 2019-10-12 11:55:15 UTC
Forgot to run yarn build --view opac

It's better now, but problems still remain with spaces and 'for reference' label. [] show... but I can't copy and paste them from the OPAC to here? 

With C&P:
Items available for loan: CentervilleCall number: 005.13/3 (1).
Centerville Staff CollectionCall number: 005.13/3 (2), Centerville OrderedCall number: 005.13/3 (1). Damaged (1). 

Manually edited:
Items available for loan: Centerville[Call number: 005.13/3] (1).
Centerville Staff Collection[Call number: 005.13/3] (2), Centerville Ordered[Call number: 005.13/3] (1). Damaged (1).
Comment 23 Nick Clemens 2019-10-15 13:29:07 UTC
(In reply to Katrin Fischer from comment #22)
> Forgot to run yarn build --view opac
> 
> It's better now, but problems still remain with spaces and 'for reference'
> label. [] show... but I can't copy and paste them from the OPAC to here? 
> 
> With C&P:
> Items available for loan: CentervilleCall number: 005.13/3 (1).
> Centerville Staff CollectionCall number: 005.13/3 (2), Centerville
> OrderedCall number: 005.13/3 (1). Damaged (1). 
> 
> Manually edited:
> Items available for loan: Centerville[Call number: 005.13/3] (1).
> Centerville Staff Collection[Call number: 005.13/3] (2), Centerville
> Ordered[Call number: 005.13/3] (1). Damaged (1).

I can add a space to the callnumber brackets - I moved them from the template to the css as some libraries don't want them and it seemed an easier fix than adding yet another span to the template - the CSS is I supposed what makes them not copy/paste

What do you mean about missing 'for reference'? From my perspective that is a goal of the patch here - to remove that label and use the notforloan descriptions - if a library wants items to appear that way then they can make that the description of the authorized value for the opac. This way those who want it can put it in place, and those who don't can provide their own description
Comment 24 Nick Clemens 2019-10-15 13:30:25 UTC
Created attachment 94212 [details] [review]
Bug 7611: (follow-up) Add missing space
Comment 25 Katrin Fischer 2019-10-15 18:54:21 UTC
> > Manually edited:
> > Items available for loan: Centerville[Call number: 005.13/3] (1).
> > Centerville Staff Collection[Call number: 005.13/3] (2), Centerville
> > Ordered[Call number: 005.13/3] (1). Damaged (1).

> 
> What do you mean about missing 'for reference'? From my perspective that is
> a goal of the patch here - to remove that label and use the notforloan
> descriptions - if a library wants items to appear that way then they can
> make that the description of the authorized value for the opac. This way
> those who want it can put it in place, and those who don't can provide their
> own description

But then we should also remove the "Items available for loan".
Because that is clearly giving a wrong idea?

Just: Items: ?

Or we can still assume that items that are marked with any 'not for loan' value are for reference and list them with their individual status descriptions behind the "Items available for reference" label.
Comment 26 Nick Clemens 2019-10-16 16:40:08 UTC
(In reply to Katrin Fischer from comment #25)
> > > Manually edited:
> > > Items available for loan: Centerville[Call number: 005.13/3] (1).
> > > Centerville Staff Collection[Call number: 005.13/3] (2), Centerville
> > > Ordered[Call number: 005.13/3] (1). Damaged (1).
> 
> > 
> > What do you mean about missing 'for reference'? From my perspective that is
> > a goal of the patch here - to remove that label and use the notforloan
> > descriptions - if a library wants items to appear that way then they can
> > make that the description of the authorized value for the opac. This way
> > those who want it can put it in place, and those who don't can provide their
> > own description
> 
> But then we should also remove the "Items available for loan".
> Because that is clearly giving a wrong idea?
> 
> Just: Items: ?
> 
> Or we can still assume that items that are marked with any 'not for loan'
> value are for reference and list them with their individual status
> descriptions behind the "Items available for reference" label.

NVM, I got confused, yes, the conditional for 'reference' needs a fix, checking this one
Comment 27 Nick Clemens 2019-11-05 16:33:15 UTC
Okay, I reviewed this, what it does is that:
Available doesn't change
Items marked 'not for loan' at itemtype level go into 'Available for reference'
Items marked 'not for loan' individually, whether negative or positive, are displayed in the 'unavailable' section with the description of the 'not for loan' status showing.

If you have several not for loan statuses with the same description, e.g. 'Available for reference' then they will be displayed together in the unavailable section

It also adds some classes and styling to allow for the end user to adjust using css/jquery

I am attaching a smaple record as described in the test plan which you can import if using the default database. You will need to add a 'NOT_LOAN' value of 4 with opac description 'Ordered' to see it in operation
Comment 28 Nick Clemens 2019-11-05 16:33:35 UTC
Created attachment 95060 [details] [review]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Comment 29 Nick Clemens 2019-11-05 16:34:05 UTC
Created attachment 95061 [details]
Sample marc record to illustrate display
Comment 30 Katrin Fischer 2019-11-06 21:01:35 UTC
(In reply to Nick Clemens from comment #27)
> Okay, I reviewed this, what it does is that:
> Available doesn't change
> Items marked 'not for loan' at itemtype level go into 'Available for
> reference'
> Items marked 'not for loan' individually, whether negative or positive, are
> displayed in the 'unavailable' section with the description of the 'not for
> loan' status showing.
> 
> If you have several not for loan statuses with the same description, e.g.
> 'Available for reference' then they will be displayed together in the
> unavailable section
> 
> It also adds some classes and styling to allow for the end user to adjust
> using css/jquery
> 
> I am attaching a smaple record as described in the test plan which you can
> import if using the default database. You will need to add a 'NOT_LOAN'
> value of 4 with opac description 'Ordered' to see it in operation

Hi Nick, 

first: thank you for the summary! Second: I am sorry, it just doesn't feel quite right yet to me :( I am trying to put into words, but please feel free to get others opinions as well.

>Items marked 'not for loan' at itemtype level go into 'Available for reference'
>Items marked 'not for loan' individually, whether negative or positive, are displayed in the 'unavailable' section with the >description of the 'not for loan' status showing

1) We have built on the fact that the not-for-loan works the same on item type as on individual level and I think this change might be controversial. With the patch, itype level 'not for loan' is green, but individual show red = different messages. Koha defines available as 'on the shelf' not as 'loanable' in my understanding - so green seems the better default choice.

2) The display with the extra break looks like we are missing a label (I think it's intended, but that's the impression I get):

Availability: Items available for loan: Midway (1).
Centerville Staff Collection (1).

Or with some more items:

Availability: Items available for loan: Centerville (1). Items available for reference: Centerville (1).
Centerville Staff Collection (1). Damaged (1). 

I think I'd opt for removing the line break and always displaying the "Itmes available for reference:" when there is at least one item with a not for loan value. That would mean the first example would look like this:

Availability: Items available for loan: Midway (1). Items available for reference: Centerville Staff Collection (1).

And the second could be like this, using a comma between different values:

Availability: Items available for loan: Centerville (1). Items available for reference: Centerville (1),
Centerville Staff Collection (1). Damaged (1). 



Just notes (no lockers at all): 

I see that you use individual CSS classes on the items, I like that. Just wondering: currently we use the description, so a description change will mean the CSS needs to change as well. On the other side: not for loan values are numeric and we are grouping the onces with the same name and I like that - so that's probably the best way.
Comment 31 Nick Clemens 2019-11-08 16:58:04 UTC
Created attachment 95235 [details] [review]
Bug 23986: Pass strings to Catmandu for deletion

The deletion subroutine expects to get a string, this is fine in most places, but when
we sort our records for batch deletion they are cast to numbers and the delete is not processed.

This patch quotes the biblionumbers as strings before passing them to Catmandu

To aid in detecting orphaned records you can use the patches on bug 22831

To test:
 1 - Have or create a bib
 2 - Go to Tools->Batch record deletion
 3 - Click 'Enter a list of record numbers'
 4 - Enter the biblionumber'
 5 - Confirm deletion
 6 - Search for the record, it still appears
 7 - Apply patch, restart all the things
 8 - Repeat 1-6
 9 - This time the record is deleted
10 - Test other methods of record deletion to confirm the record is removed
Comment 32 Nick Clemens 2019-11-08 16:58:52 UTC
Created attachment 95236 [details] [review]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 33 Nick Clemens 2019-11-08 16:58:56 UTC
Created attachment 95237 [details] [review]
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 <jzairo@bywatersolutions.com>
Comment 34 Nick Clemens 2019-11-08 16:59:00 UTC
Created attachment 95238 [details] [review]
Bug 7611: (follow-up) Add missing space
Comment 35 Nick Clemens 2019-11-08 16:59:04 UTC
Created attachment 95239 [details] [review]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Comment 36 Nick Clemens 2019-11-08 16:59:09 UTC
Created attachment 95240 [details] [review]
Bug 7611: (follow-up) separate positive and negative statuses as in the past

This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here
Comment 37 Nick Clemens 2019-11-08 17:03:34 UTC
(In reply to Katrin Fischer from comment #30)
> (In reply to Nick Clemens from comment #27)
> 
> 1) We have built on the fact that the not-for-loan works the same on item
> type as on individual level and I think this change might be controversial.

Good point, last patch restores postive statuses to the 'green' section. Itemtype notforloan get 'Not for loan' as description and will lump with any others with same description

> 2) The display with the extra break looks like we are missing a label (I
> think it's intended, but that's the impression I get)

The line break was always there for Checked Out or On Order items, so I opted to preserve it. Negative not for loan are on this line as they were all 'On order' before - the negative seeming to imply 'holdable' but not 'available'

> Just notes (no blockers at all): 
> 
> I see that you use individual CSS classes on the items, I like that. Just
> wondering: currently we use the description, so a description change will
> mean the CSS needs to change as well. On the other side: not for loan values
> are numeric and we are grouping the onces with the same name and I like that
> - so that's probably the best way.

Excellent, I think you agree with me here that grouping by description is good. It allows for staff to have two separate values with differing descriptions that show the same on the opac, which I think could have value.
Comment 38 Jonathan Druart 2020-01-23 11:46:32 UTC
error: sha1 information is lacking or useless (koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl).
Comment 39 Nick Clemens 2020-01-23 11:56:41 UTC
Created attachment 97804 [details] [review]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )
Comment 40 Nick Clemens 2020-01-23 11:56:46 UTC
Created attachment 97805 [details] [review]
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 <jzairo@bywatersolutions.com>
Comment 41 Nick Clemens 2020-01-23 11:56:50 UTC
Created attachment 97806 [details] [review]
Bug 7611: (follow-up) Add missing space
Comment 42 Nick Clemens 2020-01-23 11:56:54 UTC
Created attachment 97807 [details] [review]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class
Comment 43 Nick Clemens 2020-01-23 11:56:58 UTC
Created attachment 97808 [details] [review]
Bug 7611: (follow-up) separate positive and negative statuses as in the past

This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here
Comment 44 Jonathan Druart 2020-02-05 10:24:43 UTC
Nick, could you confirm it will not break the display for UNIMARC and NORMARC?
Comment 45 Nick Clemens 2020-02-11 14:21:12 UTC
(In reply to Jonathan Druart from comment #44)
> Nick, could you confirm it will not break the display for UNIMARC and
> NORMARC?

NORMARC is no longer maintained according to Magnuse, so we cna ignore that

UNIMARC is not affected by these changes - the status for notforloan items remains the same, only substatus is added. The CSS changes rely on classes that don't exist in the UNIMARC xslt

I did file bug 24630 and attempt UNIMARC changes, but that should not block this patchset
Comment 46 Jonathan Druart 2020-02-17 10:49:08 UTC
Created attachment 99074 [details] [review]
Bug 7611: Show the NOT_LOAN authorised values for item status in XSLT OPAC search results

Added : Call number for all not for loan status

XSLT Results template improvement : Use the NOT_LOAN authorised values

Improvement : Use the NOT_LOAN authorised values when showing items status in the OPAC search results.
Before this patch, these items were only considered as "unavailable".

Note : This patch only affects the OPAC XSLT search results template for MARC21 records. This patch was not tested on UNIMARC or NORMARC records. I won't be able to support these formats, so I'm hoping someone could do the same for these other record formats.

Patch sponsored by the CCSR ( http://www.ccsr.qc.ca )

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 47 Jonathan Druart 2020-02-17 10:49:13 UTC
Created attachment 99075 [details] [review]
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 <jzairo@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 48 Jonathan Druart 2020-02-17 10:49:18 UTC
Created attachment 99076 [details] [review]
Bug 7611: (follow-up) Add missing space

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 49 Jonathan Druart 2020-02-17 10:49:22 UTC
Created attachment 99077 [details] [review]
Bug 7611: (follow-up) Fix display of undefined statuses and add a class

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 50 Jonathan Druart 2020-02-17 10:49:29 UTC
Created attachment 99078 [details] [review]
Bug 7611: (follow-up) separate positive and negative statuses as in the past

This patch preserves someting closer to previous functionality.

Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference

Item specific status will override an itemtype level.

The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 51 Martin Renvoize 2020-02-17 11:31:47 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 52 Jonathan Druart 2020-02-18 09:38:14 UTC
Created attachment 99163 [details] [review]
Bug 7611: Adjust tests
Comment 53 Martin Renvoize 2020-02-18 13:55:38 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 54 Joy Nelson 2020-03-05 01:29:26 UTC
enhancement not backported to 19.11.x
Comment 55 Joy Nelson 2020-04-21 19:01:25 UTC
Backported to 19.11.x for 19.11.05 per request
Comment 56 Pablo AB 2020-07-06 19:37:03 UTC
On 20.05 this seems to add an untranslatable "Not for loan" near span.notforloan, on MARC21slim2OPACResults.xsl. I reproduce it on Michael Kuhn's Koha demo:

1. On a biblio, add an item to an item type flagged with "not for loan"=Yes
2. Search for it on the OPAC

- German: "Verfügbarkeit: Ausleihbare Exemplare: (1). Verfügbarer Präsenzbestand: Not for loan (1).".
  http://koha.adminkuhn.ch/cgi-bin/koha/opac-search.pl?q=Dictionary
- Spanish: "Disponibilidad: Not for loanSignatura topográfica: 520 A552 (1). :".
Comment 57 Jonathan Druart 2020-07-20 07:41:54 UTC
Hi Pablo, yes it's the authorised value's description, which is not translatable (yet).
Comment 58 Marcel de Rooy 2020-08-19 13:51:38 UTC
Sorry for posting on this old report, but it looks like (at least imo) that this availability block still needs further attention:

Availability line looks like: Block 1 (Alternate holdings) Block 2 (For loan with callno) Block 3 (Reference block with callno) Block 4 (if with colon) Block 5 (reallynotforloan with callno) Block 6 (list of other statuses)

On order status is no longer set in C4/XSLT; the term reallynotforloan is used now and is quite confusing to me?
Block 4 with the colon and the <br> in block 5 are dubious.
No big difference between block reference and block reallynotforloan.

On the already opened bug 21260 I hope to provide some follow up work..
Comment 59 Nick Clemens 2020-08-19 15:33:55 UTC
(In reply to Marcel de Rooy from comment #58)
> Sorry for posting on this old report, but it looks like (at least imo) that
> this availability block still needs further attention:
> 
> Availability line looks like: Block 1 (Alternate holdings) Block 2 (For loan
> with callno) Block 3 (Reference block with callno) Block 4 (if with colon)
> Block 5 (reallynotforloan with callno) Block 6 (list of other statuses)
> 
> On order status is no longer set in C4/XSLT; the term reallynotforloan is
> used now and is quite confusing to me?
> Block 4 with the colon and the <br> in block 5 are dubious.
> No big difference between block reference and block reallynotforloan.
> 
> On the already opened bug 21260 I hope to provide some follow up work..

Clarifications:
Before these patches all positive not for loan values were listed as 'Available for reference' and all negative not for loan were 'On order'

After we separate 'Not for loan' items into:

reallynotforloan - negative not for loan values
reference - positive not for loan values

Block 1:
If no items available for loan and none for reference then we check the AlternateHoldingsField in the sysprefs to see if we should display items from there. Other we show 'No items available'

Block 2:
Available items - they don't have pending holds or waiting holds, they aren't in transit, damaged, lost, withdrawn, marked notforloan or checked out. 

This block includes the 'reference' items (you call these 2 blocks) they go into the <span class="available"> because we assume that these are still in the library and can be accessed

Block 3:
This if with colon is wrong - it should be part of block 1 or just removed- if there are no items available we say 'No items available' then add the colon, then list the unavailable items on a new line

Block 4:
Unavailable notforloan items (reallynotforloan) on a new line - the br has always been there to separate 'available' and 'unavailable' spans

Block 5:
List of other status, all under the 'unavailable' umbrella and same line as above
Comment 60 Marcel de Rooy 2020-08-20 06:04:40 UTC
Thx for your additional explanation, Nick.