View | Details | Raw Unified | Return to bug 7677
Collapse All | Expand All

(-)a/C4/Items.pm (+4 lines)
Lines 3047-3052 sub PrepareItemrecordDisplay { Link Here
3047
                            push @authorised_values, $itemtype->{itemtype};
3047
                            push @authorised_values, $itemtype->{itemtype};
3048
                            $authorised_lib{$itemtype->{itemtype}} = $itemtype->{translated_description};
3048
                            $authorised_lib{$itemtype->{itemtype}} = $itemtype->{translated_description};
3049
                        }
3049
                        }
3050
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
3051
                            $defaultvalue = $defaultvalues->{'itemtype'};
3052
                        }
3053
3050
                        #---- class_sources
3054
                        #---- class_sources
3051
                    } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
3055
                    } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
3052
                        push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
3056
                        push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
(-)a/C4/Serials.pm (-1 / +25 lines)
Lines 67-73 BEGIN { Link Here
67
    @EXPORT = qw(
67
    @EXPORT = qw(
68
      &NewSubscription    &ModSubscription    &DelSubscription
68
      &NewSubscription    &ModSubscription    &DelSubscription
69
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
69
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
70
      &SearchSubscriptions
70
      &SearchSubscriptions &GetItemnumberFromSerialId
71
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
71
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
72
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
72
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
73
      &GetSubscriptionHistoryFromSubscriptionId
73
      &GetSubscriptionHistoryFromSubscriptionId
Lines 185-190 sub GetSerialStatusFromSerialId { Link Here
185
    return $dbh->prepare($query);
185
    return $dbh->prepare($query);
186
}
186
}
187
187
188
=head2 GetItemnumberFromSerialId
189
190
$itemnumber = GetSerialInformation($serialid);
191
this function returns the itemnumber, given a serialid in parameter
192
return : itemnumber
193
194
=cut
195
196
sub GetItemnumberFromSerialId {
197
    my ($serialid) = @_;
198
    my $dbh   = C4::Context->dbh;
199
    my $query = qq|
200
        SELECT itemnumber
201
        FROM   serialitems
202
        WHERE  serialid = ?
203
    |;
204
    my $sth = $dbh->prepare($query);
205
    $sth->execute($serialid);
206
    my ($result) = $sth->fetchrow;
207
    return ($result);
208
}
209
210
211
188
=head2 GetSerialInformation
212
=head2 GetSerialInformation
189
213
190
214
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref (-1 / +1 lines)
Lines 55-58 Serials: Link Here
55
          choices:
55
          choices:
56
            yes: Make
56
            yes: Make
57
            no: Do not make
57
            no: Do not make
58
        - previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.
58
        - 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.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 / +1 lines)
Lines 620-626 $(document).ready(function() { Link Here
620
                                </li>
620
                                </li>
621
                                [%IF makePreviousSerialAvailable %]
621
                                [%IF makePreviousSerialAvailable %]
622
                                <li>
622
                                <li>
623
                                    <label for="previousitemtype">Previous item type:</label>
623
                                    <label for="previousitemtype">item type for older issues:</label>
624
                                    <select name="previousitemtype" id="previousitemtype">
624
                                    <select name="previousitemtype" id="previousitemtype">
625
                                            <option value=""></option>
625
                                            <option value=""></option>
626
                                        [% FOREACH previous IN previoustypeloop %]
626
                                        [% FOREACH previous IN previoustypeloop %]
(-)a/serials/serials-edit.pl (-8 / +1 lines)
Lines 256-268 if ( $op and $op eq 'serialchangestatus' ) { Link Here
256
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
256
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
257
            if ($previous) {
257
            if ($previous) {
258
258
259
                # Getting the itemnumber matching the serialid
259
                if (my $itemnumber = GetItemnumberFromSerialId($previous)) {
260
                my $query = "SELECT itemnumber FROM serialitems WHERE serialid=?";
261
                my $sth = $dbh->prepare($query);
262
                $sth->execute($previous);
263
                my @row = $sth->fetchrow_array;
264
                if ($row[0]) {
265
                    my $itemnumber = $row[0];
266
260
267
                    # Getting the itemtype to set from the database
261
                    # Getting the itemtype to set from the database
268
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
262
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
269
- 

Return to bug 7677