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

(-)a/Koha/Patron.pm (+15 lines)
Lines 39-44 use Koha::DateUtils qw( dt_from_string ); Link Here
39
use Koha::Encryption;
39
use Koha::Encryption;
40
use Koha::Exceptions::Password;
40
use Koha::Exceptions::Password;
41
use Koha::Holds;
41
use Koha::Holds;
42
use Koha::CurbsidePickups;
42
use Koha::Old::Checkouts;
43
use Koha::Old::Checkouts;
43
use Koha::Patron::Attributes;
44
use Koha::Patron::Attributes;
44
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
Lines 1311-1316 sub old_holds { Link Here
1311
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1312
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1312
}
1313
}
1313
1314
1315
=head3 curbside_pickups
1316
1317
my $curbside_pickups = $patron->curbside_pickups;
1318
1319
Return all the curbside pickups for this patron
1320
1321
=cut
1322
1323
sub curbside_pickups {
1324
    my ($self) = @_;
1325
    my $curbside_pickups_rs = $self->_result->curbside_pickups_borrowernumbers->search;
1326
    return Koha::CurbsidePickups->_new_from_dbic($curbside_pickups_rs);
1327
}
1328
1314
=head3 return_claims
1329
=head3 return_claims
1315
1330
1316
my $return_claims = $patron->return_claims
1331
my $return_claims = $patron->return_claims
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc (+31 lines)
Lines 1-3 Link Here
1
[% USE raw %]
1
[% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %]
2
[% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %]
2
[% SET return_claims = patron.return_claims %]
3
[% SET return_claims = patron.return_claims %]
3
[% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %]
4
[% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %]
Lines 246-251 Link Here
246
    </div>
247
    </div>
247
[% END # /IF WaitingHolds.count %]
248
[% END # /IF WaitingHolds.count %]
248
249
250
[% IF Koha.Preference("CurbsidePickup") %]
251
    [% SET curbside_pickups = patron.curbside_pickups.search( branchcode => logged_in_user.branchcode ) %]
252
    [% IF curbside_pickups.count %]
253
        <div id="curbside_pickups" class="circmessage">
254
            <h4>Curbside pickups scheduled here</h4>
255
            <ul>
256
            [% FOR cp IN curbside_pickups %]
257
                <li>On [% cp.scheduled_pickup_datetime | $KohaDates %]:
258
                    [% SWITCH cp.status %]
259
                    [% CASE 'to-be-staged' %]
260
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=to-be-staged">
261
                        To be staged</a>
262
                    [% CASE 'staged-and-ready' %]
263
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=staged-and-ready">
264
                        Staged and ready</a>
265
                    [% CASE 'patron-is-outside' %]
266
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=patron-is-outside">
267
                        Patron is outside!</a>
268
                    [% CASE 'delivered' %]
269
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=delivered-today">
270
                        Delivered</a>
271
                    [% CASE %]<span>Unknown status "[% cp.status | html %]"</span>
272
                    [% END %]
273
                </li>
274
            [% END %]
275
            </ul>
276
        </div>
277
    [% END %]
278
[% END %]
279
249
[% IF ( patron.borrowernotes ) %]
280
[% IF ( patron.borrowernotes ) %]
250
    <div id="circnotes" class="circmessage">
281
    <div id="circnotes" class="circmessage">
251
        <h4>Notes</h4>
282
        <h4>Notes</h4>
(-)a/t/db_dependent/Koha/CurbsidePickups.t (-2 / +2 lines)
Lines 77-83 $policy->add_opening_slot('1-12:00-18:00'); Link Here
77
my $today = dt_from_string;
77
my $today = dt_from_string;
78
78
79
subtest 'Create a pickup' => sub {
79
subtest 'Create a pickup' => sub {
80
    plan tests => 7;
80
    plan tests => 8;
81
81
82
    # Day and datetime are ok
82
    # Day and datetime are ok
83
    my $next_monday =
83
    my $next_monday =
Lines 108-113 subtest 'Create a pickup' => sub { Link Here
108
    $policy->enable_waiting_holds_only(0)->store;
108
    $policy->enable_waiting_holds_only(0)->store;
109
    my $cp = Koha::CurbsidePickup->new($params)->store;
109
    my $cp = Koha::CurbsidePickup->new($params)->store;
110
    is( $cp->status, 'to-be-staged' );
110
    is( $cp->status, 'to-be-staged' );
111
    is( $patron->curbside_pickups->count, 1, 'Koha::Patron->curbside_pickups' );
111
112
112
    throws_ok {
113
    throws_ok {
113
        Koha::CurbsidePickup->new($params)->store
114
        Koha::CurbsidePickup->new($params)->store
114
- 

Return to bug 30650