Bugzilla – Attachment 122141 Details for
Bug 12561
Remove non-XSLT views
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12561: Remove HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich
Bug-12561-Remove-HighlightOwnItemsOnOPAC-and-Highl.patch (text/plain), 10.56 KB, created by
Jonathan Druart
on 2021-06-18 14:22:37 UTC
(
hide
)
Description:
Bug 12561: Remove HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-06-18 14:22:37 UTC
Size:
10.56 KB
patch
obsolete
>From 9d9f707f033e49bf5b066eb66df01d11070862be Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 18 Jun 2021 14:55:25 +0200 >Subject: [PATCH] Bug 12561: Remove HighlightOwnItemsOnOPAC and > HighlightOwnItemsOnOPACWhich > >This is the only remaining non-XSLT only feature. We should remove the >non-XSLT views that have been deprecated for a while now, and remove >this feature. >--- > C4/UsageStats.pm | 1 - > .../data/mysql/atomicupdate/bug_12561.perl | 7 ++++ > .../en/modules/admin/preferences/opac.pref | 11 ------ > .../prog/en/modules/catalogue/detail.tt | 6 +--- > .../bootstrap/en/modules/opac-detail.tt | 6 +--- > .../bootstrap/en/modules/opac-results.tt | 7 +--- > opac/opac-detail.pl | 34 ------------------ > opac/opac-search.pl | 35 ------------------- > t/db_dependent/UsageStats.t | 1 - > 9 files changed, 10 insertions(+), 98 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_12561.perl > >diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm >index 1fa95bcb5f5..6aa08116a8a 100644 >--- a/C4/UsageStats.pm >+++ b/C4/UsageStats.pm >@@ -230,7 +230,6 @@ sub BuildReport { > COinSinOPACResults > DisplayOPACiconsXSLT > hidelostitems >- HighlightOwnItemsOnOPAC > OpacAddMastheadLibraryPulldown > OPACDisplay856uAsImage > OpacHighlightedWords >diff --git a/installer/data/mysql/atomicupdate/bug_12561.perl b/installer/data/mysql/atomicupdate/bug_12561.perl >new file mode 100644 >index 00000000000..da6777467ad >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12561.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ $dbh->do( q{ DELETE FROM systempreferences WHERE variable IN ('HighlightOwnItemsOnOPAC', 'HighlightOwnItemsOnOPACWhich')} ); >+ >+ NewVersion( $DBversion, 12561, "Remove system preferences HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich"); >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 535f65bd87f..49ffe1b2d62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -42,17 +42,6 @@ OPAC: > 0: Disable > - "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. " > - 'Note: This does not affect the public API, see the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RESTPublicAnonymousRequests">RESTPublicAnonymousRequests</a> to control the API.' >- - >- - pref: HighlightOwnItemsOnOPAC >- choices: >- 1: Emphasize >- 0: "Don't emphasize" >- - "results from the " >- - pref: HighlightOwnItemsOnOPACWhich >- choices: >- PatronBranch: "patron's home library" >- OpacURLBranch: "OPAC's library via the URL" >- - " by moving the results to the front and increasing the size or highlighting the rows for those results (non-XSLT only)." > - > - "Show star-ratings on" > - pref: OpacStarRatings >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index c7183df68a0..3b25a3e134f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -107,11 +107,7 @@ > [% END %] > > [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >- [% IF ( XSLTDetailsDisplay ) %] >- <div id="catalogue_detail_biblio" class="col-xs-9"> >- [% ELSE %] >- <div id="catalogue_detail_biblio" class="col-xs-9"> >- [% END %] >+ <div id="catalogue_detail_biblio" class="col-xs-9"> > [% ELSE %] > <div id="catalogue_detail_biblio" class="col-xs-12"> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 3bd7623c8a9..353504ef574 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1263,11 +1263,7 @@ > </thead> > <tbody> > [% FOREACH ITEM_RESULT IN items %] >- [% IF ITEM_RESULT.this_branch %] >- <tr class="highlight-row-detail" vocab="http://schema.org/" typeof="Offer"> >- [% ELSE %] >- <tr vocab="http://schema.org/" typeof="Offer"> >- [% END %] >+ <tr vocab="http://schema.org/" typeof="Offer"> > > [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] > <td class="cover"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 361103afea9..9fb16173c4b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -501,12 +501,7 @@ > [% IF ( SEARCH_RESULT.available_items_loop.size() ) %] > <span class="available"><strong>Items available:</strong> > [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %] >- [% IF available_items_loo.this_branch %] >- <span class="highlight-row-results"> >- [% ELSE %] >- <span> >- [% END %] >- >+ <span> > [% IF ( singleBranchMode ) %] > <span class="shelvingloc">[% available_items_loo.location | html %]</span> > [% ELSE %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 6173b728622..dff6d3ac5ed 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -558,40 +558,6 @@ if ($hideitems) { > @items = @all_items; > } > >-my $branch = ''; >-if (C4::Context->userenv){ >- $branch = C4::Context->userenv->{branch}; >-} >-if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) { >- if ( >- ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch ) >- || >- C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' >- ) { >- my $branchcode; >- if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { >- $branchcode = $branch; >- } >- elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { >- $branchcode = $ENV{'BRANCHCODE'}; >- } >- >- my @our_items; >- my @other_items; >- >- foreach my $item ( @items ) { >- if ( $item->{branchcode} eq $branchcode ) { >- $item->{'this_branch'} = 1; >- push( @our_items, $item ); >- } else { >- push( @other_items, $item ); >- } >- } >- >- @items = ( @our_items, @other_items ); >- } >-} >- > my $dat = &GetBiblioData($biblionumber); > my $HideMARC = $record_processor->filters->[0]->should_hide_marc( > { >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 878d97826f6..2894dbcdb93 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -834,41 +834,6 @@ for (my $i=0;$i<@servers;$i++) { > } > $template->param(results_per_page => $results_per_page); > my $hide = ($hidingrules) ? 1 : 0; >- my $branch = ''; >- if (C4::Context->userenv){ >- $branch = C4::Context->userenv->{branch}; >- } >- if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) { >- if ( >- ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch ) >- || >- C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' >- ) { >- my $branchcode; >- if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { >- $branchcode = $branch; >- } >- elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { >- $branchcode = $ENV{'BRANCHCODE'}; >- } >- >- foreach my $res ( @newresults ) { >- my @new_loop; >- my @top_loop; >- my @old_loop = @{$res->{'available_items_loop'}}; >- foreach my $item ( @old_loop ) { >- if ( $item->{'branchcode'} eq $branchcode ) { >- $item->{'this_branch'} = 1; >- push( @top_loop, $item ); >- } else { >- push( @new_loop, $item ); >- } >- } >- my @complete_loop = ( @top_loop, @new_loop ); >- $res->{'available_items_loop'} = \@complete_loop; >- } >- } >- } > > $template->param( > SEARCH_RESULTS => \@newresults, >diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t >index cf61f5c9401..3d9a4a89aed 100755 >--- a/t/db_dependent/UsageStats.t >+++ b/t/db_dependent/UsageStats.t >@@ -491,7 +491,6 @@ sub mocking_systempreferences_to_a_set_value { > COinSinOPACResults > DisplayOPACiconsXSLT > hidelostitems >- HighlightOwnItemsOnOPAC > OpacAddMastheadLibraryPulldown > OPACDisplay856uAsImage > OpacHighlightedWords >-- >2.20.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 12561
:
122141
|
122142
|
122143
|
122144
|
122600
|
122601
|
122607
|
122608
|
122609
|
122610
|
123262
|
123263
|
123264
|
123265
|
123267
|
123268
|
123269
|
123270
|
123300
|
123301
|
123302
|
123303
|
123305
|
123306
|
123307
|
123308