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 1325-1330 sub old_holds { Link Here
1325
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1326
    return Koha::Old::Holds->_new_from_dbic($old_holds_rs);
1326
}
1327
}
1327
1328
1329
=head3 curbside_pickups
1330
1331
my $curbside_pickups = $patron->curbside_pickups;
1332
1333
Return all the curbside pickups for this patron
1334
1335
=cut
1336
1337
sub curbside_pickups {
1338
    my ($self) = @_;
1339
    my $curbside_pickups_rs = $self->_result->curbside_pickups_borrowernumbers->search;
1340
    return Koha::CurbsidePickups->_new_from_dbic($curbside_pickups_rs);
1341
}
1342
1328
=head3 return_claims
1343
=head3 return_claims
1329
1344
1330
my $return_claims = $patron->return_claims
1345
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
4
Lines 188-193 Link Here
188
    </div>
189
    </div>
189
[% END # /IF WaitingHolds.count %]
190
[% END # /IF WaitingHolds.count %]
190
191
192
[% IF Koha.Preference("CurbsidePickup") %]
193
    [% SET curbside_pickups = patron.curbside_pickups.search( branchcode => logged_in_user.branchcode ) %]
194
    [% IF curbside_pickups.count %]
195
        <div id="curbside_pickups" class="circmessage">
196
            <h4>Curbside pickups scheduled here</h4>
197
            <ul>
198
            [% FOR cp IN curbside_pickups %]
199
                <li>On [% cp.scheduled_pickup_datetime | $KohaDates %]:
200
                    [% SWITCH cp.status %]
201
                    [% CASE 'to-be-staged' %]
202
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=to-be-staged">
203
                        To be staged</a>
204
                    [% CASE 'staged-and-ready' %]
205
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=staged-and-ready">
206
                        Staged and ready</a>
207
                    [% CASE 'patron-is-outside' %]
208
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=patron-is-outside">
209
                        Patron is outside!</a>
210
                    [% CASE 'delivered' %]
211
                        <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=delivered-today">
212
                        Delivered</a>
213
                    [% CASE %]<span>Unknown status "[% cp.status | html %]"</span>
214
                    [% END %]
215
                </li>
216
            [% END %]
217
            </ul>
218
        </div>
219
    [% END %]
220
[% END %]
221
191
[% IF ( patron.borrowernotes ) %]
222
[% IF ( patron.borrowernotes ) %]
192
    <div id="circnotes" class="circmessage">
223
    <div id="circnotes" class="circmessage">
193
        <h4>Notes</h4>
224
        <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