From 278d73a0056f886a1e1c47e126106b5e2f649dd5 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Thu, 14 May 2009 16:08:35 +0200 Subject: [PATCH] Ticket 1014 : Added serial collections in opac Added a syspref to decide what should be displayed by default (holdings or serial collections) Added filters for full subscription history (by branchcode and by subscription) Signed-off-by: Henri-Damien LAURENT --- .../data/mysql/en/mandatory/sysprefs.sql | 1 + .../unimarc_standard_systemprefs.sql | 1 + .../prog/en/modules/opac-detail.tmpl | 24 ++ .../en/modules/opac-full-serial-issues.tmpl | 212 ++++++++++++++---- opac/opac-detail.pl | 28 +++ 5 files changed, 226 insertions(+), 40 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index e2168d864f..490e1e2109 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -69,6 +69,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacCloud',0,'If ON, enables subject cloud on OPAC',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaccolorstylesheet','colors.css','Define the color stylesheet to use in the OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaccredits','','Define HTML Credits at the bottom of the OPAC page','70|10','Textarea'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacSerialDefaultTab', 'serialcollection', 'Define the default tab for serials in OPAC. If set to holdings when there are no items, then serial collections are still displayed by default.', 'holdings|serialcollection', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacheader','','Add HTML to be included as a custom header in the OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclayoutstylesheet','opac.css','Enter the name of the layout CSS stylesheet to use in the OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 95aacdf58e..2a2d2f1211 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -269,3 +269,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('D INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'Si activé, affiche la photo de l''adhérent lors de l''utilisation de la console de prêt auto-contrôlé', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo','') +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacSerialDefaultTab', 'serialcollection', 'Ce paramètre définit l''onglet par défaut pour l''affichage des périodiques dans l''OPAC. Si la préférence est sur holdings, mais qu''aucun exemplaire n''est présent, les états de collection seront tout de même affichés par défaut.', 'holdings|serialcollection', 'Choice'); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 32caa72e11..ec589a53d2 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -322,8 +322,32 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
  • #amazonreviews">Amazon Reviews
  • #babeltheque">Babelthèque
  • + + class="ui-tabs-selected">#serialcollection">Serial Collection + + +
    + + + + + + + + + + + + + + + +
    BranchSerial collection
    +
    + +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tmpl index 58582320ba..bb33711f0e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tmpl @@ -1,5 +1,113 @@ Koha Online Catalog › Serials + +
    @@ -23,53 +131,74 @@ &selectview=small">Compact view
    +
    +
    + + Filters : + + + + + + + + + +
    +
    " class="tabsub" style="display:block">
    " class="tabsub" style="display:none"> -
    - - - - - - - - - - - - - - - - - - - - - - +
    Date - Library - Notes - Date received - Number - Status -
    - - - - - Waiting - Arrived - Late - Missing - Not Published - () -
    + + + + + + + + + + + + + + + + + + + + + + + +
    Date + Library + Notes + Date received + Number + Status + Subscription
    + + + + + Waiting + Arrived + Late + Missing + Not Published + () + +
    diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index bd4dc0a4e1..f5fe1bdb6a 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -125,6 +125,12 @@ foreach my $subscription (@subscriptions) { $dat->{'count'} = scalar(@items); +# If there are no items or the syspref says so, we show serial collection as default tab +if ($dat->{'count'} == 0 || C4::Context->preference('opacSerialDefaultTab') eq 'serialcollection') { + $dat->{'defaultserialcollection'} = 1; + +} + my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) ); my $norequests = 1; @@ -283,6 +289,28 @@ if (C4::Context->preference("OPACFRBRizeEditions")==1) { }; if ($@) { warn "XISBN Failed $@"; } } + +# Serial Collection +my @sc_fields = $record->field(955); +my @serialcollections = (); + +foreach my $sc_field (@sc_fields) { + my %row_data; + + $row_data{text} = $sc_field->subfield('r'); + $row_data{branch} = $sc_field->subfield('9'); + + if ($row_data{text} && $row_data{branch}) { + push (@serialcollections, \%row_data); + } +} + +if (scalar(@serialcollections) > 0) { + $template->param( + serialcollection => 1, + serialcollections => \@serialcollections); +} + # Amazon.com Stuff if ( C4::Context->preference("OPACAmazonEnabled") ) { $template->param( AmazonTld => get_amazon_tld() ); -- 2.39.5