Bugzilla – Attachment 157184 Details for
Bug 18138
Use MARC modification template when adding/updating bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Bug-18138-follow-up-Add-Objects-for-MarcModificati.patch (text/plain), 5.58 KB, created by
David Gustafsson
on 2023-10-16 13:03:45 UTC
(
hide
)
Description:
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2023-10-16 13:03:45 UTC
Size:
5.58 KB
patch
obsolete
>From d74a3105f6abb1cd83302d0603348059f82a643e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 17 Mar 2021 20:29:32 +0000 >Subject: [PATCH] Bug 18138: (follow-up) Add Objects for > MarcModificationTemplates > >--- > Koha/MarcModificationTemplate.pm | 46 ++++++++++++++++ > Koha/MarcModificationTemplates.pm | 54 +++++++++++++++++++ > .../Koha/MarcModificationTemplates.t | 51 ++++++++++++++++++ > ...BiblioMarcModificationTemplatePreference.t | 0 > 4 files changed, 151 insertions(+) > create mode 100644 Koha/MarcModificationTemplate.pm > create mode 100644 Koha/MarcModificationTemplates.pm > create mode 100755 t/db_dependent/Koha/MarcModificationTemplates.t > mode change 100644 => 100755 t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t > >diff --git a/Koha/MarcModificationTemplate.pm b/Koha/MarcModificationTemplate.pm >new file mode 100644 >index 00000000000..049f2c2d857 >--- /dev/null >+++ b/Koha/MarcModificationTemplate.pm >@@ -0,0 +1,46 @@ >+package Koha::MarcModificationTemplate; >+ >+# 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, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::MarcModificationTemplate - Koha Marc Modification Templat Object class >+ >+=head1 API >+ >+=head2 Class methods >+ >+=cut >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'MarcModificationTemplate'; >+} >+ >+1; >diff --git a/Koha/MarcModificationTemplates.pm b/Koha/MarcModificationTemplates.pm >new file mode 100644 >index 00000000000..09ed6328458 >--- /dev/null >+++ b/Koha/MarcModificationTemplates.pm >@@ -0,0 +1,54 @@ >+package Koha::MarcModificationTemplates; >+ >+# 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, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::MarcModificationTemplate; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::MarcModificationTemplates - Koha Marc Modification Templates Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub _type { >+ return 'MarcModificationTemplate'; >+} >+ >+=head3 object_class >+ >+=cut >+ >+sub object_class { >+ return 'Koha::MarcModificationTemplate'; >+} >+ >+1; >diff --git a/t/db_dependent/Koha/MarcModificationTemplates.t b/t/db_dependent/Koha/MarcModificationTemplates.t >new file mode 100755 >index 00000000000..8b1a17644ac >--- /dev/null >+++ b/t/db_dependent/Koha/MarcModificationTemplates.t >@@ -0,0 +1,51 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 Koha Development team >+# >+# 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, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 4; >+ >+use Koha::MarcModificationTemplate; >+use Koha::MarcModificationTemplates; >+use Koha::Database; >+ >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $builder = t::lib::TestBuilder->new; >+my $nb_of_mmts = Koha::MarcModificationTemplates->search->count; >+my $new_mmt_1 = Koha::MarcModificationTemplate->new({ >+ name => 'my_mmt_name_for_test_1', >+})->store; >+my $new_mmt_2 = Koha::MarcModificationTemplate->new({ >+ name => 'my_mmt_name_for_test_2', >+})->store; >+ >+like( $new_mmt_1->template_id, qr|^\d+$|, 'Adding a new mmt should have set the id'); >+is( Koha::MarcModificationTemplates->search->count, $nb_of_mmts + 2, 'The 2 templates should have been added' ); >+ >+my $retrieved_mmt_1 = Koha::MarcModificationTemplates->find( $new_mmt_1->template_id ); >+is( $retrieved_mmt_1->name, $new_mmt_1->name, 'Find a mmt by id should return the correct mmt' ); >+ >+$retrieved_mmt_1->delete; >+is( Koha::MarcModificationTemplates->search->count, $nb_of_mmts + 1, 'Delete should have deleted the mmt' ); >+ >+$schema->storage->txn_rollback; >diff --git a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >old mode 100644 >new mode 100755 >-- >2.42.0
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 18138
:
61442
|
61443
|
61734
|
82783
|
86617
|
110266
|
110269
|
110270
|
110272
|
118439
|
118440
|
118441
|
118442
|
118443
|
118444
|
118824
|
120709
|
123125
|
123127
|
123128
|
123129
|
123130
|
123131
|
123132
|
123133
|
123137
|
124466
|
124467
|
124468
|
124469
|
124470
|
124471
|
124472
|
124473
|
124474
|
124475
|
124476
|
124477
|
124478
|
124484
|
124485
|
124486
|
124492
|
124493
|
124991
|
125157
|
148004
|
148005
|
148006
|
148007
|
148008
|
148009
|
157183
|
157184
|
157185
|
157186
|
157187
|
157188
|
157189
|
157190
|
157485
|
157486
|
157487
|
157488
|
157489
|
157490
|
157491
|
158414
|
158415
|
158416
|
158417
|
158418
|
158419
|
158420
|
158421
|
162612
|
162613