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

(-)a/C4/Serials.pm (-26 / +1 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 &GetItemnumberFromSerialId
70
      &SearchSubscriptions
71
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
71
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
72
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
72
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
73
      &GetSubscriptionHistoryFromSubscriptionId
73
      &GetSubscriptionHistoryFromSubscriptionId
Lines 185-217 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
212
=head2 GetSerialInformation
188
=head2 GetSerialInformation
213
189
214
215
$data = GetSerialInformation($serialid);
190
$data = GetSerialInformation($serialid);
216
returns a hash_ref containing :
191
returns a hash_ref containing :
217
  items : items marcrecord (can be an array)
192
  items : items marcrecord (can be an array)
(-)a/Koha/Serial/Item.pm (+52 lines)
Line 0 Link Here
1
package Koha::Serial::Item;
2
3
# Copyright ByWater Solutions 2016
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use base qw(Koha::Object);
27
28
=head1 NAME
29
30
Koha::Serial::Item - Koha Serial Item Object class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub type {
43
    return 'Serialitem';
44
}
45
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
(-)a/Koha/Serial/Items.pm (+58 lines)
Line 0 Link Here
1
package Koha::Serial::Items;
2
3
# Copyright ByWater Solutions 2016
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use Koha::Serial::Item;
27
28
use base qw(Koha::Objects);
29
30
=head1 NAME
31
32
Koha::Serial::Items - Koha Serial Items Object class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
45
    return 'Serialitem';
46
}
47
48
sub object_class {
49
    return 'Koha::Serial::Item';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;
(-)a/serials/serials-edit.pl (-2 / +4 lines)
Lines 74-79 use C4::Context; Link Here
74
use C4::Serials;
74
use C4::Serials;
75
use C4::Search qw/enabled_staff_search_views/;
75
use C4::Search qw/enabled_staff_search_views/;
76
use Koha::DateUtils;
76
use Koha::DateUtils;
77
use Koha::Serial::Items;
77
78
78
use List::MoreUtils qw/uniq/;
79
use List::MoreUtils qw/uniq/;
79
80
Lines 256-262 if ( $op and $op eq 'serialchangestatus' ) { Link Here
256
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
257
            my $previous = GetPreviousSerialid($subscriptionids[$i]);
257
            if ($previous) {
258
            if ($previous) {
258
259
259
                if (my $itemnumber = GetItemnumberFromSerialId($previous)) {
260
                my $serialitem = Koha::Serial::Items->find( $previous );
261
                my $itemnumber = $serialitem ? $serialitem->itemnumber : undef;
262
                if ($itemnumber) {
260
263
261
                    # Getting the itemtype to set from the database
264
                    # Getting the itemtype to set from the database
262
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
265
                    my $subscriptioninfos = GetSubscription($subscriptionids[$i]);
263
- 

Return to bug 7677