- 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 <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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} );
@EXPORT = qw(
&NewSubscription &ModSubscription &DelSubscription
&GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber
- &SearchSubscriptions
+ &SearchSubscriptions &GetItemnumberFromSerialId
&GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory
&HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
&GetSubscriptionHistoryFromSubscriptionId
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
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.
</li>
[%IF makePreviousSerialAvailable %]
<li>
- <label for="previousitemtype">Previous item type:</label>
+ <label for="previousitemtype">item type for older issues:</label>
<select name="previousitemtype" id="previousitemtype">
<option value=""></option>
[% FOREACH previous IN previoustypeloop %]
my $previous = GetPreviousSerialid($subscriptionids[$i]);
if ($previous) {
- # Getting the itemnumber matching the serialid
- my $query = "SELECT itemnumber FROM serialitems WHERE serialid=?";
- my $sth = $dbh->prepare($query);
- $sth->execute($previous);
- my @row = $sth->fetchrow_array;
- if ($row[0]) {
- my $itemnumber = $row[0];
+ if (my $itemnumber = GetItemnumberFromSerialId($previous)) {
# Getting the itemtype to set from the database
my $subscriptioninfos = GetSubscription($subscriptionids[$i]);