Bugzilla – Attachment 42000 Details for
Bug 8483
Borrower reading history should include deleted items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8483 - Add record and item related classes
Bug-8483---Add-record-and-item-related-classes.patch (text/plain), 14.54 KB, created by
Kyle M Hall (khall)
on 2015-08-26 16:09:30 UTC
(
hide
)
Description:
Bug 8483 - Add record and item related classes
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-08-26 16:09:30 UTC
Size:
14.54 KB
patch
obsolete
>From ee30e7dbbce77c0976de20ada55845a32eff483b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 16 Jul 2015 07:56:18 -0400 >Subject: [PATCH] Bug 8483 - Add record and item related classes > >--- > Koha/BiblioItem.pm | 52 +++++++++++++++++++++++++++++++++++ > Koha/BiblioItems.pm | 58 +++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/Biblio.pm | 57 ++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/BiblioItem.pm | 57 ++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/BiblioItems.pm | 63 ++++++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/Biblios.pm | 64 +++++++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/Item.pm | 58 +++++++++++++++++++++++++++++++++++++++ > Koha/Deleted/Items.pm | 63 ++++++++++++++++++++++++++++++++++++++++++ > Koha/Item.pm | 47 +++++++++++++++++++++++++++++++ > 9 files changed, 519 insertions(+), 0 deletions(-) > create mode 100644 Koha/BiblioItem.pm > create mode 100644 Koha/BiblioItems.pm > create mode 100644 Koha/Deleted/Biblio.pm > create mode 100644 Koha/Deleted/BiblioItem.pm > create mode 100644 Koha/Deleted/BiblioItems.pm > create mode 100644 Koha/Deleted/Biblios.pm > create mode 100644 Koha/Deleted/Item.pm > create mode 100644 Koha/Deleted/Items.pm > >diff --git a/Koha/BiblioItem.pm b/Koha/BiblioItem.pm >new file mode 100644 >index 0000000..19c6525 >--- /dev/null >+++ b/Koha/BiblioItem.pm >@@ -0,0 +1,52 @@ >+package Koha::BiblioItem; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::BiblioItem - Koha BiblioItem Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Biblioitem'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/BiblioItems.pm b/Koha/BiblioItems.pm >new file mode 100644 >index 0000000..76f2023 >--- /dev/null >+++ b/Koha/BiblioItems.pm >@@ -0,0 +1,58 @@ >+package Koha::BiblioItems; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::BiblioItem; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::BiblioItem - Koha BiblioItem Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Biblioitem'; >+} >+ >+sub object_class { >+ return 'Koha::BiblioItem'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/Biblio.pm b/Koha/Deleted/Biblio.pm >new file mode 100644 >index 0000000..86b64f2 >--- /dev/null >+++ b/Koha/Deleted/Biblio.pm >@@ -0,0 +1,57 @@ >+package Koha::Deleted::Biblio; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::Biblio); >+ >+=head1 NAME >+ >+Koha::Deleted::Biblio - Koha Biblio Object class >+ >+This class is an extension of Koha::Biblio. >+ >+New methods should only be added to Koha::Biblio unless they are specifically >+and only for dealing with deleted bibs. >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deletedbiblio'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/BiblioItem.pm b/Koha/Deleted/BiblioItem.pm >new file mode 100644 >index 0000000..ca4a43b >--- /dev/null >+++ b/Koha/Deleted/BiblioItem.pm >@@ -0,0 +1,57 @@ >+package Koha::Deleted::BiblioItem; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::BiblioItem); >+ >+=head1 NAME >+ >+Koha::Deleted::BiblioItem - Koha Deleted BiblioItem Object class >+ >+This class is an extension of Koha::BiblioItem. >+ >+New methods should only be added to Koha::BiblioItem unless they are specifically >+and only for dealing with deleted biblioitems. >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deletedbiblioitem'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/BiblioItems.pm b/Koha/Deleted/BiblioItems.pm >new file mode 100644 >index 0000000..084af5a >--- /dev/null >+++ b/Koha/Deleted/BiblioItems.pm >@@ -0,0 +1,63 @@ >+package Koha::Deleted::BiblioItems; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::Deleted::BiblioItem; >+ >+use base qw(Koha::BiblioItems); >+ >+=head1 NAME >+ >+Koha::BiblioItem - Koha BiblioItem Object class >+ >+This class is an extension of Koha::BiblioItems. >+ >+New methods should only be added to Koha::BiblioItems unless they are specifically >+and only for dealing with deleted biblioitem sets >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deletedbiblioitem'; >+} >+ >+sub object_class { >+ return 'Koha::Deleted::BiblioItem'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/Biblios.pm b/Koha/Deleted/Biblios.pm >new file mode 100644 >index 0000000..7c15130 >--- /dev/null >+++ b/Koha/Deleted/Biblios.pm >@@ -0,0 +1,64 @@ >+package Koha::Deleted::Biblios; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::Deleted::Biblio; >+ >+use base qw(Koha::Biblios); >+ >+=head1 NAME >+ >+Koha::Deleted::Biblios - Koha Deleted Bibliographic Record set object class >+ >+This class is an extension of Koha::Biblios. >+ >+New methods should only be added to Koha::Biblios unless they are specifically >+and only for dealing with deleted bib sets >+ >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deletedbiblio'; >+} >+ >+sub object_class { >+ return 'Koha::Deleted::Biblio'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/Item.pm b/Koha/Deleted/Item.pm >new file mode 100644 >index 0000000..77a0a2a >--- /dev/null >+++ b/Koha/Deleted/Item.pm >@@ -0,0 +1,58 @@ >+package Koha::Deleted::Item; >+ >+# Copyright ByWater Solutions 2015 >+# >+# 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::Item); >+ >+=head1 NAME >+ >+Koha::Deleted::Item - Koha Deleted Item Object class >+ >+This class is an extension of Koha::Item. >+ >+New methods should only be added to Koha::Item unless they are specifically >+and only for dealing with deleted items only. >+ >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deleteditem'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Deleted/Items.pm b/Koha/Deleted/Items.pm >new file mode 100644 >index 0000000..363c01b >--- /dev/null >+++ b/Koha/Deleted/Items.pm >@@ -0,0 +1,63 @@ >+package Koha::Deleted::Items; >+ >+# Copyright ByWater Solutions 2014 >+# >+# 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::Deleted::Item; >+ >+use base qw(Koha::Items); >+ >+=head1 NAME >+ >+Koha::Deleted::Items - Koha Deleted Items Object class >+ >+This class is an extension of Koha::Items. >+ >+New methods should only be added to Koha::Items unless they are specifically >+and only for dealing with deleted item sets >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Deleteditem'; >+} >+ >+sub object_class { >+ return 'Koha::Deleted::Item'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2dcccfb..7640642 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -24,6 +24,10 @@ use Carp; > use Koha::Database; > > use Koha::Branches; >+use Koha::Biblios; >+use Koha::Deleted::Biblios; >+use Koha::BiblioItems; >+use Koha::Deleted::BiblioItems; > > use base qw(Koha::Object); > >@@ -73,6 +77,49 @@ sub holding_branch { > return $self->{_holding_branch}; > } > >+=head3 biblio >+ >+my $biblio = $checkout->biblio({ deleted => 1 }); >+ >+Returns the related Koha::Biblio for this checkout. >+ >+If the parameter delete is passed and true, and the biblionumber >+is not found for current biblios, this method will look for a matching >+deleted biblio. >+ >+=cut >+ >+sub biblio { >+ my ( $self, $params ) = @_; >+ >+ my $biblio = Koha::Biblios->search( { biblionumber => $self->biblionumber() } )->next(); >+ >+ $biblio ||= Koha::Deleted::Biblios->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} ); >+ >+ return $biblio || undef; >+} >+ >+=head3 biblioitem >+ >+my $biblioitem = $checkout->biblio({ deleted => 1 }); >+ >+Returns the related Koha::Biblio for this checkout. >+ >+If the parameter delete is passed and true, and the biblioitemnumber >+is not found for current biblioitems, this method will look for a matching >+deleted biblioitem. >+ >+=cut >+ >+sub biblioitem { >+ my ( $self, $params ) = @_; >+ >+ my $biblioitem = Koha::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next(); >+ >+ $biblioitem ||= Koha::Deleted::BiblioItems->search( { biblionumber => $self->biblionumber() } )->next() if ( $params->{deleted} ); >+ >+ return $biblioitem || undef; >+} > > =head3 type > >-- >1.7.2.5
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 8483
:
41013
|
41014
|
41015
|
41016
|
41017
|
41999
|
42000
|
42001
|
42787
|
42788
|
42789
|
42932
|
42935
|
42939
|
42940
|
42941
|
49129
|
49130
|
49131
|
49134
|
49135
|
49136
|
49137
|
49139
|
49140
|
49141
|
49142
|
49143
|
49144
|
49145