Bugzilla – Attachment 138280 Details for
Bug 30650
Add a curbside pickup module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30650: Add link from the circ patron page
Bug-30650-Add-link-from-the-circ-patron-page.patch (text/plain), 4.39 KB, created by
Jonathan Druart
on 2022-07-29 09:33:09 UTC
(
hide
)
Description:
Bug 30650: Add link from the circ patron page
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-29 09:33:09 UTC
Size:
4.39 KB
patch
obsolete
>From 044b28dc705231d95f23078248beca588258ea2d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 10 May 2022 09:50:55 +0200 >Subject: [PATCH] Bug 30650: Add link from the circ patron page > >Sponsored-by: Association KohaLa - https://koha-fr.org/ > >Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr> >--- > Koha/Patron.pm | 15 +++++++++ > .../prog/en/includes/patron_messages.inc | 31 +++++++++++++++++++ > t/db_dependent/Koha/CurbsidePickups.t | 3 +- > 3 files changed, 48 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 0a165ae0d19..8031257304d 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -39,6 +39,7 @@ use Koha::DateUtils qw( dt_from_string ); > use Koha::Encryption; > use Koha::Exceptions::Password; > use Koha::Holds; >+use Koha::CurbsidePickups; > use Koha::Old::Checkouts; > use Koha::Patron::Attributes; > use Koha::Patron::Categories; >@@ -1311,6 +1312,20 @@ sub old_holds { > return Koha::Old::Holds->_new_from_dbic($old_holds_rs); > } > >+=head3 curbside_pickups >+ >+my $curbside_pickups = $patron->curbside_pickups; >+ >+Return all the curbside pickups for this patron >+ >+=cut >+ >+sub curbside_pickups { >+ my ($self) = @_; >+ my $curbside_pickups_rs = $self->_result->curbside_pickups_borrowernumbers->search; >+ return Koha::CurbsidePickups->_new_from_dbic($curbside_pickups_rs); >+} >+ > =head3 return_claims > > my $return_claims = $patron->return_claims >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >index 6f6f6704c92..ffec80fbac1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -1,3 +1,4 @@ >+[% USE raw %] > [% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %] > [% SET return_claims = patron.return_claims %] > [% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %] >@@ -246,6 +247,36 @@ > </div> > [% END # /IF WaitingHolds.count %] > >+[% IF Koha.Preference("CurbsidePickup") %] >+ [% SET curbside_pickups = patron.curbside_pickups.search( branchcode => logged_in_user.branchcode ) %] >+ [% IF curbside_pickups.count %] >+ <div id="curbside_pickups" class="circmessage"> >+ <h4>Curbside pickups scheduled here</h4> >+ <ul> >+ [% FOR cp IN curbside_pickups %] >+ <li>On [% cp.scheduled_pickup_datetime | $KohaDates %]: >+ [% SWITCH cp.status %] >+ [% CASE 'to-be-staged' %] >+ <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=to-be-staged"> >+ To be staged</a> >+ [% CASE 'staged-and-ready' %] >+ <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=staged-and-ready"> >+ Staged and ready</a> >+ [% CASE 'patron-is-outside' %] >+ <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=patron-is-outside"> >+ Patron is outside!</a> >+ [% CASE 'delivered' %] >+ <a href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=delivered-today"> >+ Delivered</a> >+ [% CASE %]<span>Unknown status "[% cp.status | html %]"</span> >+ [% END %] >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% END %] >+[% END %] >+ > [% IF ( patron.borrowernotes ) %] > <div id="circnotes" class="circmessage"> > <h4>Notes</h4> >diff --git a/t/db_dependent/Koha/CurbsidePickups.t b/t/db_dependent/Koha/CurbsidePickups.t >index 6c0704ec5cb..344e46cdd45 100755 >--- a/t/db_dependent/Koha/CurbsidePickups.t >+++ b/t/db_dependent/Koha/CurbsidePickups.t >@@ -77,7 +77,7 @@ $policy->add_opening_slot('1-12:00-18:00'); > my $today = dt_from_string; > > subtest 'Create a pickup' => sub { >- plan tests => 7; >+ plan tests => 8; > > # Day and datetime are ok > my $next_monday = >@@ -108,6 +108,7 @@ subtest 'Create a pickup' => sub { > $policy->enable_waiting_holds_only(0)->store; > my $cp = Koha::CurbsidePickup->new($params)->store; > is( $cp->status, 'to-be-staged' ); >+ is( $patron->curbside_pickups->count, 1, 'Koha::Patron->curbside_pickups' ); > > throws_ok { > Koha::CurbsidePickup->new($params)->store >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30650
:
136584
|
136585
|
136586
|
136587
|
136588
|
136589
|
136590
|
136591
|
136592
|
136593
|
136594
|
136595
|
136596
|
136597
|
136598
|
136599
|
136600
|
136601
|
136602
|
136603
|
136604
|
136605
|
136606
|
136607
|
136608
|
136609
|
136610
|
137095
|
137100
|
137199
|
137211
|
137212
|
137277
|
137278
|
137279
|
137280
|
137281
|
137282
|
137283
|
137284
|
137285
|
137286
|
137287
|
137288
|
137289
|
137290
|
137291
|
137292
|
137293
|
137294
|
137295
|
137296
|
137297
|
137298
|
137299
|
137300
|
137301
|
137302
|
137303
|
137304
|
137305
|
137306
|
137307
|
138261
|
138262
|
138263
|
138264
|
138265
|
138266
|
138267
|
138268
|
138269
|
138270
|
138271
|
138272
|
138273
|
138274
|
138275
|
138276
|
138277
|
138278
|
138279
|
138280
|
138281
|
138282
|
138283
|
138284
|
138285
|
138286
|
138287
|
138288
|
138289
|
138290
|
138291
|
138292
|
138319
|
138320
|
138321
|
138322
|
138323
|
138324
|
138325
|
138330
|
138331
|
138332
|
138333
|
138334
|
138335
|
138336
|
138337
|
138338
|
138339
|
138340
|
138341
|
138342
|
138343
|
138344
|
138345
|
138346
|
138347
|
138348
|
138349
|
138350
|
138351
|
138352
|
138353
|
138354
|
138355
|
138356
|
138357
|
138358
|
138359
|
138360
|
138361
|
138362
|
138363
|
138364
|
138365
|
138366
|
138367
|
138368
|
138369
|
138375
|
138401
|
138610