From 7d99cc071422a14436cf50d98920b54ef3f69974 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Mon, 28 Sep 2015 16:29:16 +0200 Subject: [PATCH] Bug 7677 [Follow-up]: New areas in subscriptions and new functions when receiving. - Various fixes. Test plan: Once the makePreviousSerialAvailable syspref is enabled, receive a serial, and then another, then check that: - the first received itemtype has been set to the "previous item type" value (set in the subscription). - the first received has been made available. - the last received serial itemtype has been set to the "item type" value (set in the subscription). - 995$l is automatically prefilled. Configure the serialsFieldsToAV syspref. When creating or editing a subscription, check that: - the domain and/or origin and/or support fields are correctly displaying the authorized values configured in the syspref. Signed-off-by: Chris --- C4/Items.pm | 4 +++ C4/Serials.pm | 26 +++++++++++++++++++- .../prog/en/modules/admin/preferences/serials.pref | 2 +- .../prog/en/modules/serials/subscription-add.tt | 2 +- serials/serials-edit.pl | 8 +----- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 26e9342..9c21674 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3047,6 +3047,10 @@ sub PrepareItemrecordDisplay { push @authorised_values, $itemtype->{itemtype}; $authorised_lib{$itemtype->{itemtype}} = $itemtype->{translated_description}; } + if ($defaultvalues && $defaultvalues->{'itemtype'}) { + $defaultvalue = $defaultvalues->{'itemtype'}; + } + #---- class_sources } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); diff --git a/C4/Serials.pm b/C4/Serials.pm index f6c26cf..7c930f1 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -67,7 +67,7 @@ BEGIN { @EXPORT = qw( &NewSubscription &ModSubscription &DelSubscription &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber - &SearchSubscriptions + &SearchSubscriptions &GetItemnumberFromSerialId &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire &GetSubscriptionHistoryFromSubscriptionId @@ -185,6 +185,30 @@ sub GetSerialStatusFromSerialId { return $dbh->prepare($query); } +=head2 GetItemnumberFromSerialId + +$itemnumber = GetSerialInformation($serialid); +this function returns the itemnumber, given a serialid in parameter +return : itemnumber + +=cut + +sub GetItemnumberFromSerialId { + my ($serialid) = @_; + my $dbh = C4::Context->dbh; + my $query = qq| + SELECT itemnumber + FROM serialitems + WHERE serialid = ? + |; + my $sth = $dbh->prepare($query); + $sth->execute($serialid); + my ($result) = $sth->fetchrow; + return ($result); +} + + + =head2 GetSerialInformation diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref index f68df59..76c89a8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref @@ -55,4 +55,4 @@ Serials: choices: yes: Make no: Do not make - - previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item. + - previous serial automatically available when receiving a new serial issue. The previous issue can also be set to another item type when receiving a new one. Please note that the item-level_itypes syspref must be set to specific item. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index dbc6720..93a2bd1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -620,7 +620,7 @@ $(document).ready(function() { [%IF makePreviousSerialAvailable %]
  • - +