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

(-)a/C4/Items.pm (+4 lines)
Lines 3031-3036 sub PrepareItemrecordDisplay { Link Here
3031
                            push @authorised_values, $itemtype;
3031
                            push @authorised_values, $itemtype;
3032
                            $authorised_lib{$itemtype} = $description;
3032
                            $authorised_lib{$itemtype} = $description;
3033
                        }
3033
                        }
3034
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
3035
                            $defaultvalue = $defaultvalues->{'itemtype'};
3036
                        }
3037
3034
                        #---- class_sources
3038
                        #---- class_sources
3035
                    } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
3039
                    } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
3036
                        push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
3040
                        push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
(-)a/C4/Serials.pm (-1 / +25 lines)
Lines 63-69 BEGIN { Link Here
63
    @EXPORT = qw(
63
    @EXPORT = qw(
64
      &NewSubscription    &ModSubscription    &DelSubscription
64
      &NewSubscription    &ModSubscription    &DelSubscription
65
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
65
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
66
      &SearchSubscriptions
66
      &SearchSubscriptions &GetItemnumberFromSerialId
67
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
67
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
68
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
68
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
69
      &GetSubscriptionHistoryFromSubscriptionId
69
      &GetSubscriptionHistoryFromSubscriptionId
Lines 181-186 sub GetSerialStatusFromSerialId { Link Here
181
    return $dbh->prepare($query);
181
    return $dbh->prepare($query);
182
}
182
}
183
183
184
=head2 GetItemnumberFromSerialId
185
186
$itemnumber = GetSerialInformation($serialid);
187
this function returns the itemnumber, given a serialid in parameter
188
return : itemnumber
189
190
=cut
191
192
sub GetItemnumberFromSerialId {
193
    my ($serialid) = @_;
194
    my $dbh   = C4::Context->dbh;
195
    my $query = qq|
196
        SELECT itemnumber
197
        FROM   serialitems
198
        WHERE  serialid = ?
199
    |;
200
    my $sth = $dbh->prepare($query);
201
    $sth->execute($serialid);
202
    my ($result) = $sth->fetchrow;
203
    return ($result);
204
}
205
206
207
184
=head2 GetSerialInformation
208
=head2 GetSerialInformation
185
209
186
210
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +1 lines)
Lines 10893-10899 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
10893
        ADD `previousitemtype` VARCHAR( 10 ) NULL AFTER itemtype
10893
        ADD `previousitemtype` VARCHAR( 10 ) NULL AFTER itemtype
10894
    });
10894
    });
10895
    $dbh->do(
10895
    $dbh->do(
10896
        "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('makePreviousSerialAvailable','0','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','','YesNo');"
10896
        "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('makePreviousSerialAvailable','0','make 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.','','YesNo');"
10897
    );
10897
    );
10898
    print "Upgrade to $DBversion done (Bug 7677: Adds fields to subscription table and makePreviousSerialAvailable syspref)\n";
10898
    print "Upgrade to $DBversion done (Bug 7677: Adds fields to subscription table and makePreviousSerialAvailable syspref)\n";
10899
    SetVersion($DBversion);
10899
    SetVersion($DBversion);
(-)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 251-263 if ( $op and $op eq 'serialchangestatus' ) { Link Here
251
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
251
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
252
            if ($previous) {
252
            if ($previous) {
253
253
254
                # Getting the itemnumber matching the serialid
254
                if (my $itemnumber = GetItemnumberFromSerialId($previous)) {
255
                my $query = "SELECT itemnumber FROM serialitems WHERE serialid=?";
256
                my $sth = $dbh->prepare($query);
257
                $sth->execute($previous);
258
                my @row = $sth->fetchrow_array;
259
                if ($row[0]) {
260
                    my $itemnumber = $row[0];
261
255
262
                    # Getting the itemtype to set from the database
256
                    # Getting the itemtype to set from the database
263
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
257
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
264
- 

Return to bug 7677