From c3a95f92da64582f5556b861687c65ba7e012cf3 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 Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- C4/Items.pm | 4 +++ C4/Serials.pm | 26 ++++++++++++++++++- .../en/modules/admin/preferences/serials.pref | 2 +- .../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 6df6b158da..71b16197b6 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3005,6 +3005,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 18d315c0ae..3408c470e4 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -66,7 +66,7 @@ BEGIN { @EXPORT = qw( &NewSubscription &ModSubscription &DelSubscription &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber - &SearchSubscriptions + &SearchSubscriptions &GetItemnumberFromSerialId &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire &GetSubscriptionHistoryFromSubscriptionId @@ -183,6 +183,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 f68df590f2..76c89a8c54 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 44d55c2c6b..ff918b057e 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 @@ -666,7 +666,7 @@ $(document).ready(function() { [%IF makePreviousSerialAvailable %]
  • - +