Bug 29609: Centralized code to build the link to a biblio detail page
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 1 Dec 2021 14:12:17 +0000 (15:12 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 8 Apr 2022 13:49:16 +0000 (15:49 +0200)
There are 2 prefs that control the default view of biblio detail pages:
IntranetBiblioDefaultView for staff and BiblioDefaultView for OPAC.
There are as well viewISBD, viewLabeledMARC and viewMARC to allow/don't
allow access to those page for staff members.

This code need to be in a single place to avoid discrepancy.

Test plan:
Play with BiblioDefaultView and IntranetBiblioDefaultView and confirm
that the links of biblio point to the correct view.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
25 files changed:
C4/Auth.pm
basket/basket.pl
cataloguing/value_builder/marc21_linking_section.pl
cataloguing/value_builder/unimarc_field_4XX.pl
circ/pendingreserves.pl
koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc
koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt
opac/opac-basket.pl
serials/checkexpiration.pl
serials/serials-edit.pl
serials/subscription-detail.pl

index b4edd2d..67158a0 100644 (file)
@@ -498,7 +498,6 @@ sub get_template_and_user {
     my $minPasswordLength = C4::Context->preference('minPasswordLength');
     $minPasswordLength = 3 if not $minPasswordLength or $minPasswordLength < 3;
     $template->param(
-        "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
         EnhancedMessagingPreferences                                       => C4::Context->preference('EnhancedMessagingPreferences'),
         GoogleJackets                                                      => C4::Context->preference("GoogleJackets"),
         OpenLibraryCovers                                                  => C4::Context->preference("OpenLibraryCovers"),
@@ -520,7 +519,6 @@ sub get_template_and_user {
         $template->param(
             AmazonCoverImages                                                          => C4::Context->preference("AmazonCoverImages"),
             AutoLocation                                                               => C4::Context->preference("AutoLocation"),
-            "BiblioDefaultView" . C4::Context->preference("IntranetBiblioDefaultView") => 1,
             PatronAutoComplete                                                       => C4::Context->preference("PatronAutoComplete"),
             FRBRizeEditions                                                            => C4::Context->preference("FRBRizeEditions"),
             IndependentBranches                                                        => C4::Context->preference("IndependentBranches"),
index f6943d9..92f6561 100755 (executable)
@@ -108,15 +108,6 @@ foreach my $biblionumber ( @bibs ) {
     $dat->{MARCURLS}    = $marcurlsarray;
     $dat->{HASAUTHORS}  = $hasauthors;
 
-    if ( C4::Context->preference("IntranetBiblioDefaultView") eq "normal" ) {
-        $dat->{dest} = "/cgi-bin/koha/catalogue/detail.pl";
-    }
-    elsif ( C4::Context->preference("IntranetBiblioDefaultView") eq "marc" ) {
-        $dat->{dest} = "/cgi-bin/koha/catalogue/MARCdetail.pl";
-    }
-    else {
-        $dat->{dest} = "/cgi-bin/koha/catalogue/ISBDdetail.pl";
-    }
     push( @results, $dat );
 }
 
index 8206e70..35072c1 100755 (executable)
@@ -255,7 +255,6 @@ my $launcher = sub {
         } else {
             $to = $from + $resultsperpage;
         }
-        my $defaultview = 'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
 
         #         my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search";
         #           foreach my $sort (@sort_by){
@@ -285,7 +284,6 @@ my $launcher = sub {
             to             => $to,
             numbers        => \@numbers,
             search         => $search,
-            $defaultview   => 1,
             Search         => 0
         );
 
index 21f284d..0437660 100755 (executable)
@@ -439,8 +439,6 @@ sub plugin {
         }else{
             $to = $from + $resultsperpage ;
         }
-        my $defaultview =
-          'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
 #         my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search";
 #           foreach my $sort (@sort_by){
 #             $link.="&sort_by=".$sort."&";
@@ -469,7 +467,6 @@ sub plugin {
             to             => $to,
             numbers        => \@numbers,
             search         => $search,
-            $defaultview   => 1,
             Search         => 0
         );
 
index 14f0dc8..85bcffe 100755 (executable)
@@ -300,7 +300,6 @@ $template->param(
     from                => $startdate,
     to                  => $enddate,
     holds_info          => \@holds_info,
-    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
     HoldsToPullStartDate => C4::Context->preference('HoldsToPullStartDate') || PULL_INTERVAL,
     HoldsToPullEndDate  => C4::Context->preference('ConfirmFutureHolds') || 0,
     messages            => \@messages,
index a714f4c..f3c7915 100644 (file)
@@ -1,13 +1,5 @@
 [% IF ( link ) %]
-    [% IF ( BiblioDefaultViewmarc ) %]
-        <a class="title" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio.biblionumber |url %]">
-    [% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
-        <a class="title" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblio.biblionumber |url %]">
-    [% ELSIF ( BiblioDefaultViewisbd ) %]
-        <a class="title" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblio.biblionumber |url %]">
-    [% ELSE %]
-        <a class="title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber |url %]">
-    [% END %]
+    <a href="[% PROCESS biblio_a_href biblionumber => biblio.biblionumber %]" class="title">
 [% END %]
 
 [% IF ( biblio.title ) %]
@@ -36,4 +28,4 @@
 
 [% IF ( link ) %]
     </a>
-[% END %]
\ No newline at end of file
+[% END %]
index 4f4f461..a991f0c 100644 (file)
     [% END %]
 [% END %]
 
+[% BLOCK biblio_a_href -%]
+    [%- IF Koha.Preference('IntranetBiblioDefaultView') == 'marc' && Koha.Preference('viewMARC') -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=" -%]
+    [%- ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'labeled_marc' && Koha.Preference('viewLabeledMARC') -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=" -%]
+    [%- ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'isbd' && Koha.Preference('viewISBD') -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=" -%]
+    [%- ELSE -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=" -%]
+    [%- END -%]
+    [%- this_biblio_href | url %][% biblionumber | url -%]
+[%- END %]
+
 [% BLOCK subfields_for_item %]
     <ol>
         [% FOREACH subfield IN subfields %]
index cd2beae..bd9bb5d 100644 (file)
 
 <div class="dialog alert">
 <h4>Duplicate warning</h4>
-<p>You selected a record from an external source that matches an existing record in your catalog: [% IF ( BiblioDefaultViewmarc ) %]<a target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber |url %]">
-[% ELSIF ( BiblioDefaultViewlabeled_marc ) %]<a target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblionumber |url %]">
-[% ELSIF ( BiblioDefaultViewisbd ) %]<a target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblionumber |url %]">
-[% ELSE %]<a target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber |url %]">[% END %] <i class="fa fa-window-restore"></i> [% duplicatetitle | html %]</a></p>
+<p>You selected a record from an external source that matches an existing record in your catalog: <a target="_blank" title="Open in new window" href="[% PROCESS biblio_a_href biblionumber => biblionumber %]"><i class="fa fa-window-restore"></i> [% duplicatetitle | html %]</a></p>
 </div>
 
 <div class="row">
index 0251cbe..4295c11 100644 (file)
@@ -7,15 +7,6 @@
 [% PROCESS 'i18n.inc' %]
 [% SET footerjs = 1 %]
 [% USE AuthorisedValues %]
-[% IF BiblioDefaultViewmarc %]
-    [% SET DetailPage="MARCdetail.pl" %]
-[% ELSIF BiblioDefaultViewlabeled_marc %]
-    [% SET DetailPage="labeledMARCdetail.pl" %]
-[% ELSIF BiblioDefaultViewisbd %]
-    [% SET DetailPage="ISBDdetail.pl" %]
-[% ELSE %]
-    [% SET DetailPage="detail.pl" %]
-[% END %]
 [% INCLUDE 'doc-head-open.inc' %]
 
 <title>[% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %] &rsaquo; Catalog &rsaquo; Koha</title>
         <div id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" class="cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]">
             [% IF ( LocalCoverImages ) %][% SEARCH_RESULT.localimage | html %]
                 <div id="local-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image local-coverimg">
-                    <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
+                    <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]" class => 'p1'>
                         <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" alt="Local cover image" />
                     </a>
                     <div class="hint">Local cover image</div>
 
             [% IF ( AmazonCoverImages && SEARCH_RESULT.normalized_isbn ) %]
                 <div id="amazon-bookcoverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image amazon-bookcoverimg">
-                    <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
+                    <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]" class => 'p1'>
                         <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="Cover image from Amazon.com" />
                     </a>
                     <div class="hint">Amazon cover image</div>
                 [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]
                 [% IF ( coce_id ) %]
                     <div id="coce-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image coce-coverimg">
-                        <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber | url %]">
+                        <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]" class => 'p1'>
                             <span style="block" title="[% SEARCH_RESULT.biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail[% SEARCH_RESULT.biblionumber | html %]"></span>
                         </a>
                         <div class="hint">Coce cover image</div>
index 4d90316..0f9c02a 100644 (file)
@@ -934,23 +934,9 @@ function PopupMARCFieldDoc(field) {
                     </div> <!-- /.btn-group -->
                     [% UNLESS (circborrowernumber) %][%# Hide in fast cataloging %]
                         [% IF (biblionumber) %]
-                            [% IF ( BiblioDefaultViewmarc ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSIF ( BiblioDefaultViewisbd ) %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% ELSE %]
-                                <div class="btn-group">
-                                    <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
-                                </div>
-                            [% END %]
+                            <div class="btn-group">
+                                <a href="[% PROCESS biblio_a_href biblionumber => biblionumber %]" class="btn btn-default" id="cancel">Cancel</a>
+                            </div>
                         [% ELSE %]
                             <div class="btn-group">
                                 <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/cataloguing/addbooks.pl">Cancel</a>
index 784034b..26ce2d4 100644 (file)
         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
 
 [% BLOCK actions %]
-                        [% IF ( BiblioDefaultViewmarc ) %]
+                        [% IF Koha.Preference('IntranetBiblioDefaultView') == 'marc' %]
                              <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
-                        [% ELSIF ( BiblioDefaultViewlabeled_marc ) %]
+                        [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'labeled_marc' %]
                              <form action="/cgi-bin/koha/catalogue/labeledMARCdetail.pl" method="post">
-                        [% ELSIF ( BiblioDefaultViewisbd ) %]
+                        [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'isbd' %]
                              <form action="/cgi-bin/koha/catalogue/ISBDdetail.pl" method="post">
                         [% ELSE %]
                              <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
index 96bb85d..4a1f29c 100644 (file)
                                                        <td>
 
 [% IF ( loopcel.reference ) %]
-[% IF ( loopcel.BiblioDefaultViewmarc ) %]
-       <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% loopcel.reference |url %]">
-[% ELSIF ( loopcel.BiblioDefaultViewisbd ) %]
-       <a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% loopcel.reference |url %]">
-[% ELSE %]
-       <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopcel.reference |url %]">
- [% END %]
+    <a href="[% PROCESS biblio_a_href biblionumber => loopcel.reference %]">
  [% END %]                                        
                                                                [% IF ( loopcel.value ) %][% loopcel.value | html %][% END %]
                                                                [% IF ( loopcel.reference ) %]</a>[% END %]
index 642dd2c..20c2448 100644 (file)
@@ -471,7 +471,7 @@ $(document).ready(function() {
                             [% END %]
                         [% END %]
                     [% END %]
-                    <li><a href="/cgi-bin/koha/catalogue/[% default_bib_view | uri %].pl?biblionumber=[% biblionumber | uri %]" title="go to [% bibliotitle | html %]">Show biblio</a></li></ul>
+                    <li><a href="[% PROCESS biblio_a_href biblionumber => biblionumber %]" title="go to [% bibliotitle | html %]">Show biblio</a></li></ul>
             </aside>
         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
      </div> <!-- /.row -->
index 4cccfff..b374082 100644 (file)
                                         <li><span class="label">Subscription ID: </span>[% subscriptionid | html %]</li>
                                         <li><span class="label">Librarian identity:</span> [% librarian | html %]</li>
                                         <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid | uri %]">[% aqbooksellername | html %]</a></li>
-                                        <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view | uri %].pl?biblionumber=[% bibnum | uri %]">[% bibliotitle | html %]</a> <em>([% bibnum | html %])</em></li>
+                                        <li><span class="label">Biblio:</span>  <a href="[% PROCESS biblio_a_href biblionumber => bibnum %]">[% bibliotitle | html %]</a> <em>([% bibnum | html %])</em></li>
                                         [% IF ( OPACBaseURL ) %]
                                             <li>
                                                 <span class="label">OPAC view:</span>
index 7a964de..d849154 100644 (file)
         </div>
     [% END %]
 [% END %]
+
+[% BLOCK biblio_a_href -%]
+    [%- IF Koha.Preference('BiblioDefaultView') == 'marc' -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=" -%]
+    [%- ELSIF Koha.Preference('BiblioDefaultView') == 'isbd' -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=" -%]
+    [%- ELSE -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-detail.pl?biblionumber=" -%]
+    [%- END -%]
+    [%- this_biblio_href | url %][% biblionumber | url -%]
+[%- END %]
index 5c3e6be..4e6219c 100644 (file)
                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
                                                 </td>
                                             <td>
-                                                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest | html %]',[% BIBLIO_RESULT.biblionumber | html %])">[% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT %]</a>
+                                                <a href="#" onclick="openBiblio('[% PROCESS biblio_a_href biblionumber => BIBLIO_RESULT.biblionumber %]',[% BIBLIO_RESULT.biblionumber | html %])">[% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT %]</a>
                                                 <!-- COinS / Openurl -->
                                                 <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
index fc7b773..33ba901 100644 (file)
                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
                 </li>
                 <li class="breadcrumb-item">
-                    [% IF ( BiblioDefaultViewmarc ) %]
-                        <a href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblionumber |url %]">
-                    [% ELSE %]
-                        [% IF ( BiblioDefaultViewisbd ) %]
-                            <a href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblionumber |url %]">
-                        [% ELSE %]
-                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber |url %]">
-                        [% END %]
-                    [% END %][% INCLUDE 'biblio-title.inc' %]</a>
+                    <a href="[% PROCESS biblio_a_href biblionumber => biblionumber %]">
+                    [% INCLUDE 'biblio-title.inc' %]</a>
                 </li>
                 <li class="breadcrumb-item active">
                     <a href="#" aria-current="page">Images</a>
                     <div class="row">
                         <div class="col-lg-9 maincontent">
                             <h1 class="title">Images for
-                                [% IF ( BiblioDefaultViewmarc ) %]
-                                    <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblionumber |url %]" title="View details for this title">
-                                [% ELSE %]
-                                    [% IF ( BiblioDefaultViewisbd ) %]
-                                        <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblionumber |url %]" title="View details for this title">
-                                    [% ELSE %]
-                                        <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber |url %]" title="View details for this title">
-                                    [% END %]
-                                [% END %][% INCLUDE 'biblio-title.inc' %]</a> [% biblio.author | html %]
+                                <a class="title" href="[% PROCESS biblio_a_href biblionumber => biblionumber %]" title="View details for this title">
+                                [% INCLUDE 'biblio-title.inc' %]</a> [% biblio.author | html %]
                             </h1>
                         </div> <!-- / col-lg-9 -->
                     </div> <!-- / .row -->
index de69346..798c724 100644 (file)
      <item>
        <title>[% INCLUDE 'biblio-title-head.inc' biblio=SEARCH_RESULT %]</title>
        <dc:identifier>ISBN:[% SEARCH_RESULT.isbn | html %]</dc:identifier>
-        [% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %]
-        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
-        [% ELSIF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %]
-        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
-        [% ELSE %]
-        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
-        [% END %]
+        <link>[% OPACBaseURL | url %][% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]</link>
        <description><![CDATA[
 [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | uri %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | uri %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode | uri %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc | uri %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | uri %][% END %]" alt="" />
    [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
    <entry>
      <title>[% SEARCH_RESULT.title | html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield | html %][% END %]</title>
-     <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% END %][% END %]</link>
+     <link>[% OPACBaseURL | url %][% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]</link>
      <!-- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> -->
      <updated>[% SEARCH_RESULT.timestamp | html %]</updated>
      <id>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]</id>
index a3ad4f4..c637e4a 100644 (file)
                                                 [% END %]
                                                 </td>
                                                 <td>
-                                                [% IF  issue.BiblioDefaultViewmarc %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
-                                                [% ELSIF issue.BiblioDefaultViewisbd %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
-                                                [% ELSE %]
-                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
-                                                [% END %]
+                                                [% INCLUDE 'biblio-title.inc' biblio=issue, link => 1 %]
                                                 <p class="results-summary item-details">[% issue.author | html %]</p>
 
                                                     [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' ) %]
index 18e9ac2..3ccb0fb 100644 (file)
                                                             [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
                                                                 [% SET custom_cover_image_url = itemsloo.biblio_object.custom_cover_image_url %]
                                                                 [% IF custom_cover_image_url %]
-                                                                    [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
-                                                                        <a class="custom_cover_image" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
-                                                                    [% ELSE %]
-                                                                        [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
-                                                                            <a class="custom_cover_image" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
-                                                                        [% ELSE %]
-                                                                            <a class="custom_cover_image" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
-                                                                        [% END %]
-                                                                    [% END %]
+                                                                    <a class="custom_cover_image" href="[% PROCESS biblio_a_href biblionumber => itemsloo.biblionumber %]">
                                                                     <img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
                                                                 [% END %]
                                                             [% END %]
index d52192e..5404864 100644 (file)
                                 <tr>
                                     <td>
                                         <p>
-                                            [% IF ( BiblioDefaultViewmarc ) %]
-                                                <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% review.biblionumber |url %]" title="View details for this title">
-                                            [% ELSE %]
-                                                [% IF ( BiblioDefaultViewisbd ) %]
-                                                    <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% review.biblionumber |url %]" title="View details for this title">
-                                                [% ELSE %]
-                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber |url %]#comments" title="View details for this title">
-                                                [% END %]
-                                            [% END %]
-                                            [% INCLUDE 'biblio-title.inc' biblio=review %]
+                                            <a class="title" href="[% PROCESS biblio_a_href biblionumber => review.biblionumber %]" title="View details for this title">
+                                                [% INCLUDE 'biblio-title.inc' biblio=review %]
                                             </a>
                                             [% IF ( review.author ) %]
                                                 by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% review.author |url %]" title="Search for works by this author" class="author">[% review.author | html %]</a>
                                         </p>
                                     </td>
                                     <td>
-                                        [% IF ( review.BiblioDefaultViewmarc ) %]
-                                            <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% review.biblionumber |url %]" title="View details for this title">
-                                        [% ELSE %]
-                                            [% IF ( review.BiblioDefaultViewisbd ) %]
-                                                <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% review.biblionumber |url %]" title="View details for this title">
-                                            [% ELSE %]
-                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber |url %]#comments" title="View details for this title">
-                                            [% END %]
-                                        [% END %]
+                                        <a class="title" href="[% PROCESS biblio_a_href biblionumber => review.biblionumber %]" title="View details for this title">
                                         [% IF ( OPACAmazonCoverImages ) %]
                                             [% IF ( review.normalized_isbn ) %]
                                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% review.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
index 4304541..18737d7 100755 (executable)
@@ -159,15 +159,6 @@ foreach my $biblionumber ( @bibs ) {
     $dat->{MARCURLS}    = $marcurlsarray;
     $dat->{HASAUTHORS}  = $hasauthors;
 
-    if ( C4::Context->preference("BiblioDefaultView") eq "normal" ) {
-        $dat->{dest} = "opac-detail.pl";
-    }
-    elsif ( C4::Context->preference("BiblioDefaultView") eq "marc" ) {
-        $dat->{dest} = "opac-MARCdetail.pl";
-    }
-    else {
-        $dat->{dest} = "opac-ISBDdetail.pl";
-    }
     push( @results, $dat );
 }
 
index 6ce76af..e253f18 100755 (executable)
@@ -108,7 +108,6 @@ if ($date) {
         numsubscription     => scalar @subscriptions_loop,
         date                => $date,
         subscriptions_loop  => \@subscriptions_loop,
-        "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1,
         searched                                                           => 1,
     );
 }
index 8c5720e..2b7f171 100755 (executable)
@@ -425,7 +425,6 @@ if ( $op and $op eq 'serialchangestatus' ) {
     }
 }
 my $location = $serialdatalist[0]->{'location'};
-my $default_bib_view = get_default_view();
 
 $template->param(
     subscriptionid  => $serialdatalist[0]->{subscriptionid},
@@ -435,24 +434,8 @@ $template->param(
     bibliotitle     => $biblio->title,
     biblionumber    => $serialdatalist[0]->{'biblionumber'},
     serialslist     => \@serialdatalist,
-    default_bib_view => $default_bib_view,
     location         => $location,
     (uc(C4::Context->preference("marcflavour"))) => 1
 
 );
 output_html_with_http_headers $query, $cookie, $template->output;
-
-sub get_default_view {
-    my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
-    my %views       = C4::Search::enabled_staff_search_views();
-    if ( $defaultview eq 'isbd' && $views{can_view_ISBD} ) {
-        return 'ISBDdetail';
-    }
-    elsif ( $defaultview eq 'marc' && $views{can_view_MARC} ) {
-        return 'MARCdetail';
-    }
-    elsif ( $defaultview eq 'labeled_marc' && $views{can_view_labeledMARC} ) {
-        return 'labeledMARCdetail';
-    }
-    return 'detail';
-}
index 392ce34..aa49945 100755 (executable)
@@ -122,8 +122,6 @@ my @irregular_issues = split /;/, $subs->{irregularity};
 my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subs->{periodicity});
 my $numberpattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subs->{numberpattern});
 
-my $default_bib_view = get_default_view();
-
 my $subscription_object = Koha::Subscriptions->find( $subscriptionid );
 $template->param(
     available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
@@ -165,25 +163,9 @@ $template->param(
     intranetstylesheet => C4::Context->preference('intranetstylesheet'),
     intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'),
     irregular_issues => scalar @irregular_issues,
-    default_bib_view => $default_bib_view,
     orders_grouped => $orders_grouped,
     (uc(C4::Context->preference("marcflavour"))) => 1,
     mana_comments => $subs->{comments},
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
-
-sub get_default_view {
-    my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
-    my %views       = C4::Search::enabled_staff_search_views();
-    if ( $defaultview eq 'isbd' && $views{can_view_ISBD} ) {
-        return 'ISBDdetail';
-    }
-    elsif ( $defaultview eq 'marc' && $views{can_view_MARC} ) {
-        return 'MARCdetail';
-    }
-    elsif ( $defaultview eq 'labeled_marc' && $views{can_view_labeledMARC} ) {
-        return 'labeledMARCdetail';
-    }
-    return 'detail';
-}