Bugzilla – Attachment 137278 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: Koha classes
Bug-30650-Koha-classes.patch (text/plain), 10.16 KB, created by
Jonathan Druart
on 2022-07-07 13:00:49 UTC
(
hide
)
Description:
Bug 30650: Koha classes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-07 13:00:49 UTC
Size:
10.16 KB
patch
obsolete
>From 368cfad517773bdd44c33aa325d6f953416c0c95 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 29 Apr 2022 10:42:05 +0200 >Subject: [PATCH] Bug 30650: Koha classes > >Sponsored-by: Association KohaLa - https://koha-fr.org/ > >Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr> >--- > Koha/CurbsidePickup.pm | 104 +++++++++++++++++++++++++++++++++ > Koha/CurbsidePickupIssue.pm | 57 ++++++++++++++++++ > Koha/CurbsidePickupIssues.pm | 50 ++++++++++++++++ > Koha/CurbsidePickupPolicies.pm | 50 ++++++++++++++++ > Koha/CurbsidePickupPolicy.pm | 57 ++++++++++++++++++ > Koha/CurbsidePickups.pm | 50 ++++++++++++++++ > 6 files changed, 368 insertions(+) > create mode 100644 Koha/CurbsidePickup.pm > create mode 100644 Koha/CurbsidePickupIssue.pm > create mode 100644 Koha/CurbsidePickupIssues.pm > create mode 100644 Koha/CurbsidePickupPolicies.pm > create mode 100644 Koha/CurbsidePickupPolicy.pm > create mode 100644 Koha/CurbsidePickups.pm > >diff --git a/Koha/CurbsidePickup.pm b/Koha/CurbsidePickup.pm >new file mode 100644 >index 00000000000..f43f1c5be99 >--- /dev/null >+++ b/Koha/CurbsidePickup.pm >@@ -0,0 +1,104 @@ >+package Koha::CurbsidePickup; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+use Koha::Patron; >+use Koha::Library; >+use Koha::CurbsidePickupIssues; >+ >+=head1 NAME >+ >+Koha::CurbsidePickup - Koha Curbside Pickup Object class >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 checkouts >+ >+Return the checkouts linked to this pickup >+ >+=cut >+ >+sub checkouts { >+ my ( $self ) = @_; >+ >+ my @pi = Koha::CurbsidePickupIssues->search({ curbside_pickup_id => $self->id })->as_list; >+ >+ my @checkouts = map { $_->checkout } @pi; >+ @checkouts = grep { defined $_ } @checkouts; >+ >+ return @checkouts; >+} >+ >+=head3 patron >+ >+Return the patron linked to this pickup >+ >+=cut >+ >+sub patron { >+ my ( $self ) = @_; >+ my $rs = $self->_result->borrowernumber; >+ return unless $rs; >+ return Koha::Patron->_new_from_dbic( $rs ); >+} >+ >+=head3 staged_by_staff >+ >+Return the staff member that staged this pickup >+ >+=cut >+ >+sub staged_by_staff { >+ my ( $self ) = @_; >+ my $rs = $self->_result->staged_by; >+ return unless $rs; >+ return Koha::Patron->_new_from_dbic( $rs ); >+} >+ >+=head3 library >+ >+Return the branch associated with this pickup >+ >+=cut >+ >+sub library { >+ my ( $self ) = @_; >+ my $rs = $self->_result->branchcode; >+ return unless $rs; >+ return Koha::Library->_new_from_dbic( $rs ); >+} >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickup'; >+} >+ >+1; >diff --git a/Koha/CurbsidePickupIssue.pm b/Koha/CurbsidePickupIssue.pm >new file mode 100644 >index 00000000000..55864c13670 >--- /dev/null >+++ b/Koha/CurbsidePickupIssue.pm >@@ -0,0 +1,57 @@ >+package Koha::CurbsidePickupIssue; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+use Koha::Checkouts; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::CurbsidePickupIssue - Koha Curbside Pickup Issue Object class >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 checkout >+ >+Return the checkout object >+ >+=cut >+ >+sub checkout { >+ my ( $self ) = @_; >+ >+ return Koha::Checkouts->find( $self->issue_id ); >+} >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickupIssue'; >+} >+ >+1; >diff --git a/Koha/CurbsidePickupIssues.pm b/Koha/CurbsidePickupIssues.pm >new file mode 100644 >index 00000000000..590c177041f >--- /dev/null >+++ b/Koha/CurbsidePickupIssues.pm >@@ -0,0 +1,50 @@ >+package Koha::CurbsidePickupIssues; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::CurbsidePickupIssue; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::CurbsidePickupIssues - Koha Curbside Pickup Issues Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickupIssue'; >+} >+ >+sub object_class { >+ return 'Koha::CurbsidePickupIssue'; >+} >+ >+1; >diff --git a/Koha/CurbsidePickupPolicies.pm b/Koha/CurbsidePickupPolicies.pm >new file mode 100644 >index 00000000000..97d9bbf5196 >--- /dev/null >+++ b/Koha/CurbsidePickupPolicies.pm >@@ -0,0 +1,50 @@ >+package Koha::CurbsidePickupPolicies; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::CurbsidePickupPolicy; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::CurbsidePickupPolicies - Koha Curbside Pickup Policies Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickupPolicy'; >+} >+ >+sub object_class { >+ return 'Koha::CurbsidePickupPolicy'; >+} >+ >+1; >diff --git a/Koha/CurbsidePickupPolicy.pm b/Koha/CurbsidePickupPolicy.pm >new file mode 100644 >index 00000000000..ce66f4c7eea >--- /dev/null >+++ b/Koha/CurbsidePickupPolicy.pm >@@ -0,0 +1,57 @@ >+package Koha::CurbsidePickupPolicy; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::CurbsidePickupPolicy - Koha Curbside Pickup Policy Object class >+ >+=head1 API >+ >+=head2 Class methods >+ >+=head3 library >+ >+Return the branch associated with this policy >+ >+=cut >+ >+sub library { >+ my ( $self ) = @_; >+ my $rs = $self->_result->branchcode; >+ return unless $rs; >+ return Koha::Library->_new_from_dbic( $rs ); >+} >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickupPolicy'; >+} >+ >+1; >diff --git a/Koha/CurbsidePickups.pm b/Koha/CurbsidePickups.pm >new file mode 100644 >index 00000000000..29f9a050f56 >--- /dev/null >+++ b/Koha/CurbsidePickups.pm >@@ -0,0 +1,50 @@ >+package Koha::CurbsidePickups; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::CurbsidePickup; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::CurbsidePickups - Koha Curbside Pickup Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'CurbsidePickup'; >+} >+ >+sub object_class { >+ return 'Koha::CurbsidePickup'; >+} >+ >+1; >-- >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