Bug 8732 - Add a system preference to allow users to choose to display an icon based on the MARC control fields or based on the Koha biblio level itemtype
Summary: Add a system preference to allow users to choose to display an icon based on ...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Cormack
QA Contact: Katrin Fischer
URL:
Keywords:
: 22708 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-05 23:53 UTC by Chris Cormack
Modified: 2020-08-03 13:17 UTC (History)
15 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8732 : Allowing biblio level itemtypes to display instead of MARC ones (7.74 KB, patch)
2012-09-06 21:54 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732 : Allowing biblio level itemtypes to display instead of MARC ones (7.82 KB, patch)
2012-09-07 13:36 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (18.78 KB, patch)
2012-09-30 21:59 UTC, Chris Cormack
Details | Diff | Splinter Review
Screenshot OPAC detail (30.61 KB, image/png)
2012-10-06 00:33 UTC, Mirko Tietgen
Details
Bug 8732 Style fixes (1.68 KB, patch)
2012-10-17 01:15 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (21.94 KB, patch)
2013-03-20 06:57 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732 Style fixes (1.91 KB, patch)
2013-03-20 06:58 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (22.01 KB, patch)
2013-10-05 02:19 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732 Style fixes (1.90 KB, patch)
2013-10-05 02:19 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (16.70 KB, patch)
2016-07-18 10:48 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732 Style fixes (1.21 KB, patch)
2016-07-18 10:49 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (21.75 KB, patch)
2019-07-30 19:06 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (21.69 KB, patch)
2019-08-20 15:05 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (21.85 KB, patch)
2020-04-22 15:19 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (21.91 KB, patch)
2020-04-23 08:51 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (12.59 KB, patch)
2020-07-13 14:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (12.70 KB, patch)
2020-07-13 14:54 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (12.65 KB, patch)
2020-07-13 18:42 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 8732: Update statement (1.20 KB, patch)
2020-07-16 11:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones (12.68 KB, patch)
2020-08-03 13:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: Update statement (1.20 KB, patch)
2020-08-03 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: undo XSLT changes (881 bytes, patch)
2020-08-03 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 8732: undo XSLT changes (1.80 KB, patch)
2020-08-03 13:17 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2012-09-05 23:53:34 UTC
Often the icon that is generated in XSLT using the MARC control fields is inaccurate or inadequate.

This systempreference would allow libraries to use the itemtype icon they have chosen for the biblio level itemtype (942 in MARC21)

This is sponsored by 6 New Zealand Libraries
Comment 1 Chris Cormack 2012-09-06 21:54:35 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2012-09-06 21:54:51 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2012-09-07 13:36:32 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2012-09-07 13:36:52 UTC Comment hidden (obsolete)
Comment 5 Chris Cormack 2012-09-30 19:49:37 UTC Comment hidden (obsolete)
Comment 6 Chris Cormack 2012-09-30 21:59:27 UTC Comment hidden (obsolete)
Comment 7 Mirko Tietgen 2012-10-06 00:33:25 UTC Comment hidden (obsolete)
Comment 8 Chris Cormack 2012-10-17 01:15:16 UTC Comment hidden (obsolete)
Comment 9 Chris Cormack 2012-10-17 01:18:50 UTC Comment hidden (obsolete)
Comment 10 Mirko Tietgen 2012-11-22 13:50:20 UTC Comment hidden (obsolete)
Comment 11 Nicole C. Engard 2012-11-26 14:00:24 UTC Comment hidden (obsolete)
Comment 12 cedric.vita 2013-03-19 15:37:23 UTC Comment hidden (obsolete)
Comment 13 Chris Cormack 2013-03-20 06:57:18 UTC Comment hidden (obsolete)
Comment 14 Chris Cormack 2013-03-20 06:58:27 UTC Comment hidden (obsolete)
Comment 15 Christophe Croullebois 2013-03-20 09:39:09 UTC Comment hidden (obsolete)
Comment 16 cedric.vita 2013-03-21 08:55:13 UTC Comment hidden (obsolete)
Comment 17 Chris Cormack 2013-10-05 02:19:27 UTC Comment hidden (obsolete)
Comment 18 Chris Cormack 2013-10-05 02:19:42 UTC Comment hidden (obsolete)
Comment 19 I'm just a bot 2013-10-28 06:25:20 UTC Comment hidden (obsolete)
Comment 20 Chris Cormack 2016-07-18 10:48:29 UTC Comment hidden (obsolete)
Comment 21 Chris Cormack 2016-07-18 10:49:02 UTC Comment hidden (obsolete)
Comment 22 Michael Kuhn 2016-10-14 10:01:16 UTC Comment hidden (obsolete)
Comment 23 Owen Leonard 2018-06-06 14:21:04 UTC
I would like to try to revive this. The merge issues don't seem very complicated. However, I'm not sure what I should be seeing if the patch is working. Could you attach some screenshots?
Comment 24 Katrin Fischer 2019-06-27 11:54:33 UTC
*** Bug 22708 has been marked as a duplicate of this bug. ***
Comment 25 Nick Clemens 2019-07-30 19:06:57 UTC
Created attachment 91885 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeImages

If you set BiblioItemtypeImage to Koha, you will see the Koha
itemtypes, if it is Control you will get the ones generated from
the MARC control fields.

The control field images are formed in XSLT and use label 'Material type'

When switching to 'Koha' the images are added in the tmeplate and labeled 'Item type' if labelled

TODO: Image size cleanup - adjust UNIMARC xslt

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear and material types dissappear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you now see material type and icon
10 - Repeat in staff interface
Comment 26 kraborn 2019-08-09 15:13:21 UTC
This patch sounds wonderful and would specifically be helpful as we try to make  large print titles more distinguishable in our OPAC for our seniors and other patrons who enjoy the large print collection. Thank you to everyone who is contributing to this patch!
Comment 27 ByWater Sandboxes 2019-08-20 15:05:56 UTC
Created attachment 92383 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeImages

If you set BiblioItemtypeImage to Koha, you will see the Koha
itemtypes, if it is Control you will get the ones generated from
the MARC control fields.

The control field images are formed in XSLT and use label 'Material type'

When switching to 'Koha' the images are added in the tmeplate and labeled 'Item type' if labelled

TODO: Image size cleanup - adjust UNIMARC xslt

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear and material types dissappear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you now see material type and icon
10 - Repeat in staff interface

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 28 Andrew Fuerste-Henry 2019-08-20 15:06:42 UTC
Signed off on behalf of Karen Raborn, kraborn@nrhtx.com
Comment 29 Katrin Fischer 2019-10-07 21:27:40 UTC
1) QA tools fail: 
 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
   FAIL	  filters
		missing_filter at line 111 (            [% description %])
		missing_filter at line 113 (            [% itemtype %])

2) It looks like this is only implemented for MARC21 (XSLT) - can we please add a note to the system preference description to document that?

3) While you are editing that file... could we shorten the options in the pull down a bit by putting the shared part into the text? Then the pull down would only be: 'Koha biblio level itemtype' and 'MARC control fields'.

4) When there is no itemtype image set, there is nothing displayed. Might be intended behaviour - so just noting. (no blocker)
Comment 30 Nick Clemens 2020-04-22 15:19:06 UTC
Created attachment 103488 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeImages

If you set BiblioItemtypeImage to Koha, you will see the Koha
itemtypes, if it is Control you will get the ones generated from
the MARC control fields.

The control field images are formed in XSLT and use label 'Material type'

When switching to 'Koha' the images are added in the tmeplate and labeled 'Item type' if labelled

TODO: Image size cleanup - adjust UNIMARC xslt

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear and material types dissappear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you now see material type and icon
10 - Repeat in staff interface
Comment 31 PTFS Europe Sandboxes 2020-04-23 08:51:55 UTC
Created attachment 103548 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeImages

If you set BiblioItemtypeImage to Koha, you will see the Koha
itemtypes, if it is Control you will get the ones generated from
the MARC control fields.

The control field images are formed in XSLT and use label 'Material type'

When switching to 'Koha' the images are added in the tmeplate and labeled 'Item type' if labelled

TODO: Image size cleanup - adjust UNIMARC xslt

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear and material types dissappear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you now see material type and icon
10 - Repeat in staff interface

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 32 Katrin Fischer 2020-06-21 15:45:06 UTC
Comment on attachment 103548 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

Review of attachment 103548 [details] [review]:
-----------------------------------------------------------------

This patch shows it's age a little, but let's work it out!

::: catalogue/detail.pl
@@ +588,4 @@
>  
>  $template->param (basketsorders => \@baskets_orders);
>  $template->param (basketsdeletedorders => \@baskets_deletedorders);
> +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage');

1) This can be removed in favor us using the TT plugin in the template instead.

::: installer/data/mysql/atomicupdate/bug_8732_add_BiblioItemtypeImage_system_preference.perl
@@ +1,3 @@
> +$DBversion = 'XXX'; # will be replaced by the RM
> +if( CheckVersion( $DBversion ) ) {
> +    $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BiblioItemtypeImage', 'Control','Control what biblio level itemtype image displays','Control|Koha','Choice')" );

2) Please switch to INSERT IGNORE INTO...

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
@@ +275,5 @@
> +            - pref: BiblioItemtypeImage
> +              choices:
> +                  Control: "MARC control fields"
> +                  Koha: "Koha biblio level itemtype"
> +            - "This preference only affects MARC21 XSLT views.

3) (pref description in yml file):

Currently reads:
Display itemtype information from the [MARC control fields|Koha biblio level itemtype] This preference only affects MARC21 XSLT views.

I wonder if we could improve the description a little. 

a) In current version the icon this changes is labelled 'material type', so it might not be so easy to locate where and what happens here.
b) We've been trying to remove biblio in favor of bibliographic
c) missing punctuation :)

Suggestion:

Display [material type icon derived from MARC control fields|Koha record level item type icon] on detail and results pages in the OPAC. Only works for MARC21.

(We are in the process of removing non-XSLT this release)

But actually, I'd much prefer a more radical approach in merging this new pref with the existing DisplayIconsXSLT and DisplayOpacIconsXSLT prefs:

[Show|Don't show] the format, audience, and material type icons and descriptions in XSLT MARC21 results and detail pages in the OPAC. 

Show [
no format, audience and material type information|
the record level item type icon|
format, audience and material type information derived from MARC control fields
]
in XSLT MARC21 results and detail pages in the OPAC.

This way, we'd not need a new pref and we could avoid the conflict of different settings (turn off display and turn on itemtype icon display = still nothing shows) And we'd have this controlled separately for OPAC and staff interface. 

But then we also got OpacNoItemTypeImages... just wondering how to get these all to play together in a way that is most clear to end users about the effects!

::: koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
@@ +171,5 @@
>              <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
>          </xsl:call-template>
>  
> +        <xsl:if test="$BiblioItemtypeImage='Control'">
> +        <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">

4) Full quote:

<xsl:if test="$BiblioItemtypeImage='Control'"> <xsl:if <test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">

I think this highlights a conceptual issue as we already have a pref dealing with the display of this information (DisplayIconsXSLT and DisplayOpacIconsXSLT - trying to explain in 3)

Also there appears to be no code for the actual icon display?

@@ +181,2 @@
>  
>      <xsl:call-template name="show-lang-041"/>

5) I believe there is a merge/rebase error here - the xsl:if should be before the 041 display.

::: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
@@ -134,5 @@
> -                            [% ELSE %]
> -                                [% itemtype | html %]
> -                            [% END %]
> -                            ] [% END %]
> -                            [% IF ( unititle ) %], [% unititle | html %][% END %]

6) Is this removed intentionally?

@@ -246,4 @@
>                              <span class="results_summary year"><span class="label">Year: </span>[% copyrightdate | html %]</span>
>                          [% END %]
>  
> -                        [% UNLESS ( item_level_itypes ) %]

Similar here (see above).

::: opac/opac-detail.pl
@@ +1189,4 @@
>      @serialcollections > 0 
>          ? 'serialcollection' : 'subscriptions';
>  $template->param('defaulttab' => $defaulttab);
> +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage');

See above!

::: opac/opac-search.pl
@@ +1024,4 @@
>  $template->{VARS}->{DidYouMean} =
>    ( defined C4::Context->preference('OPACdidyoumean')
>        && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
> +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage');

See above!
Comment 33 Nick Clemens 2020-07-13 14:03:30 UTC Comment hidden (obsolete)
Comment 34 Nick Clemens 2020-07-13 14:05:50 UTC
This is rebuilt after Katrin's comment

It no longer touches XSLT, only the templates. XSLT display is controlled by existing prefs, the new pref only controls whether record level info is shown
Comment 35 Nick Clemens 2020-07-13 14:54:15 UTC
Created attachment 106836 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeInfo

If you set BiblioItemtypeInfo to Koha, you will see the Koha
record level itemtype info. This info is also shown if item-level_itypes
is set to biblio

Display of icons are controlled by
noItemTypeImages/OpacnoItemTypeImages

Material type display is controlled by DisplayIconsXSLT/DisplayOPACIconsXSLT

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you don't see record level itemtype and icon
10 - Repeat in staff interface
Comment 36 Andrew Fuerste-Henry 2020-07-13 18:42:53 UTC
Created attachment 106848 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeInfo

If you set BiblioItemtypeInfo to Koha, you will see the Koha
record level itemtype info. This info is also shown if item-level_itypes
is set to biblio

Display of icons are controlled by
noItemTypeImages/OpacnoItemTypeImages

Material type display is controlled by DisplayIconsXSLT/DisplayOPACIconsXSLT

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you don't see record level itemtype and icon
10 - Repeat in staff interface

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 37 Nick Clemens 2020-07-16 11:47:30 UTC
Created attachment 106948 [details] [review]
Bug 8732: Update statement
Comment 38 Katrin Fischer 2020-07-30 20:56:07 UTC
Hi Nick, 

2 issues:

1) There are still some XSLT changes in the patch set that look like remnants from the rewrite and unintentional - can you please check?

2) Patch doesn't apply...
Comment 39 Nick Clemens 2020-08-03 13:09:57 UTC
Created attachment 107705 [details] [review]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones

This patchset adds a new syspref: BiblioItemtypeInfo

If you set BiblioItemtypeInfo to Koha, you will see the Koha
record level itemtype info. This info is also shown if item-level_itypes
is set to biblio

Display of icons are controlled by
noItemTypeImages/OpacnoItemTypeImages

Material type display is controlled by DisplayIconsXSLT/DisplayOPACIconsXSLT

To test:
 1 - Apply patch
 2 - Update database
 3 - Do an opac search and view results
 4 - Switch pref to 'Koha' and refresh
 5 - Note itemtypes appear
 6 - Click in to a record details
 7 - Note you see itemtype and icon
 8 - Switch the pref
 9 - Note you don't see record level itemtype and icon
10 - Repeat in staff interface

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 40 Nick Clemens 2020-08-03 13:10:01 UTC
Created attachment 107706 [details] [review]
Bug 8732: Update statement
Comment 41 Nick Clemens 2020-08-03 13:10:05 UTC
Created attachment 107707 [details] [review]
Bug 8732: undo XSLT changes
Comment 42 Nick Clemens 2020-08-03 13:17:01 UTC
Created attachment 107709 [details] [review]
Bug 8732: undo XSLT changes