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

(-)a/C4/Serials.pm (-37 lines)
Lines 85-91 BEGIN { Link Here
85
      &check_routing &updateClaim
85
      &check_routing &updateClaim
86
      &CountIssues
86
      &CountIssues
87
      HasItems
87
      HasItems
88
      &GetSubscriptionsFromBorrower
89
      &subscriptionCurrentlyOnOrder
88
      &subscriptionCurrentlyOnOrder
90
89
91
    );
90
    );
Lines 2198-2238 sub in_array { # used in next sub down Link Here
2198
    return 0;
2197
    return 0;
2199
}
2198
}
2200
2199
2201
=head2 GetSubscriptionsFromBorrower
2202
2203
($count,@routinglist) = GetSubscriptionsFromBorrower($borrowernumber)
2204
2205
this gets the info from subscriptionroutinglist for each $subscriptionid
2206
2207
return :
2208
a count of the serial subscription routing lists to which a patron belongs,
2209
with the titles of those serial subscriptions as an array. Each element of the array
2210
contains a hash_ref with subscriptionID and title of subscription.
2211
2212
=cut
2213
2214
sub GetSubscriptionsFromBorrower {
2215
    my ($borrowernumber) = @_;
2216
    my $dbh              = C4::Context->dbh;
2217
    my $sth              = $dbh->prepare(
2218
        "SELECT subscription.subscriptionid, biblio.title
2219
            FROM subscription
2220
            JOIN biblio ON biblio.biblionumber = subscription.biblionumber
2221
            JOIN subscriptionroutinglist USING (subscriptionid)
2222
            WHERE subscriptionroutinglist.borrowernumber = ? ORDER BY title ASC
2223
                               "
2224
    );
2225
    $sth->execute($borrowernumber);
2226
    my @routinglist;
2227
    my $count = 0;
2228
    while ( my $line = $sth->fetchrow_hashref ) {
2229
        $count++;
2230
        push( @routinglist, $line );
2231
    }
2232
    return ( $count, @routinglist );
2233
}
2234
2235
2236
=head2 GetFictiveIssueNumber
2200
=head2 GetFictiveIssueNumber
2237
2201
2238
$issueno = GetFictiveIssueNumber($subscription, $publishedate);
2202
$issueno = GetFictiveIssueNumber($subscription, $publishedate);
2239
- 

Return to bug 20456