From ad3594fded5bc25d8f5e06b5487b1492884b32d8 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 8 Apr 2010 20:04:24 +0100 Subject: [PATCH] Bug 4380 Use syspref to resolve which bib display is used Be consistent with elsewhere in cataloguing When switching there from serials TODO Duplicates Code Should be in a common routine --- .../prog/en/modules/serials/serials-edit.tmpl | 2 +- .../en/modules/serials/subscription-detail.tmpl | 2 +- serials/serials-edit.pl | 16 ++++++++++++++++ serials/subscription-detail.pl | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl index 56ffecec08..55499875ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tmpl @@ -424,7 +424,7 @@ function CloneSubfield(index){ )">Renew -
  • " title="go to ">Show Biblio
  • +
  • " title="go to ">Show Biblio
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl index 6e7b982a0e..86c3efcf61 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl @@ -82,7 +82,7 @@ function popup(subscriptionid) {
  • Subscription ID:
  • Librarian identity:
  • Vendor: "> 
  • -
  • Biblio: () ">
  • +
  • Biblio: () ">
  • Library:  
  • Serial receipt creates an item record.
  • diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 1ee831da23..3e2a852071 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -357,11 +357,27 @@ if ( $op and $op eq 'serialchangestatus' ) { print $query->redirect($redirect); } } +my $default_bib_view = get_default_view(); $template->param( serialsadditems => $serialdatalist[0]->{'serialsadditems'}, bibliotitle => $bibdata->{'title'}, biblionumber => $serialdatalist[0]->{'biblionumber'}, serialslist => \@serialdatalist, + default_bib_view => $default_bib_view, ); 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'; + } else { + return 'detail'; + } +} diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 0b8e57975d..a2b1d0c09a 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -101,6 +101,7 @@ if (! $subs->{dow}) { if (! $subs->{periodicity}) { $subs->{periodicity} = '0'; } +my $default_bib_view = get_default_view(); $template->param( subscriptionid => $subscriptionid, serialslist => \@serialslist, @@ -118,6 +119,21 @@ $template->param( intranetstylesheet => C4::Context->preference('intranetstylesheet'), intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'), irregular_issues => scalar @irregular_issues, + default_bib_view => $default_bib_view, ); 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'; + } else { + return 'detail'; + } +} -- 2.39.5