From 7f38668e778c1611cf938f385732d6e253a5a713 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Mon, 28 Sep 2015 16:29:16 +0200 Subject: [PATCH] BZ7677 [Follow-up]: New areas in subscriptions and new functions when receiving. - Various fixes. --- 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 a7db6ef..888da22 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3043,6 +3043,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 46aa89d..d3afe49 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -64,7 +64,7 @@ BEGIN { @EXPORT = qw( &NewSubscription &ModSubscription &DelSubscription &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber - &SearchSubscriptions + &SearchSubscriptions &GetItemnumberFromSerialId &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire &GetSubscriptionHistoryFromSubscriptionId @@ -182,6 +182,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 %]
  • - +