Bugzilla – Attachment 133955 Details for
Bug 12446
Enable an adult to have a guarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12446: Add canbeguarantee value to patron categories sample data
Bug-12446-Add-canbeguarantee-value-to-patron-categ.patch (text/plain), 9.04 KB, created by
Owen Leonard
on 2022-04-26 16:22:13 UTC
(
hide
)
Description:
Bug 12446: Add canbeguarantee value to patron categories sample data
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-04-26 16:22:13 UTC
Size:
9.04 KB
patch
obsolete
>From 9fb39200e294eaf4849b75c3cca77336e9415f36 Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Thu, 12 Nov 2020 16:01:35 -0500 >Subject: [PATCH] Bug 12446: Add canbeguarantee value to patron categories > sample data > >This patch changes sample data so patron categories of type 'C' or >'P' can be guarantees by default. > >Signed-off-by: Salman Ali <salman.ali@inlibro.com> >Signed-off-by: Salman Ali <salman.ali@inlibro.com> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../mysql/en/optional/patron_categories.yml | 5 +++ > .../fr-FR/2-Optionel/patron_categories.sql | 18 ++++---- > .../nb-NO/2-Valgfritt/patron_categories.sql | 44 +++++++++++++++++++ > t/db_dependent/Patrons.t | 6 +-- > 4 files changed, 61 insertions(+), 12 deletions(-) > create mode 100644 installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql > >diff --git a/installer/data/mysql/en/optional/patron_categories.yml b/installer/data/mysql/en/optional/patron_categories.yml >index e5a02d1084..3d8d72696f 100644 >--- a/installer/data/mysql/en/optional/patron_categories.yml >+++ b/installer/data/mysql/en/optional/patron_categories.yml >@@ -99,6 +99,7 @@ tables: > issuelimit: ~ > reservefee: '0.000000' > category_type: 'C' >+ canbeguarantee: 1 > > - categorycode: 'J' > description: 'Juvenile' >@@ -112,6 +113,7 @@ tables: > issuelimit: ~ > reservefee: '0.000000' > category_type: 'C' >+ canbeguarantee: 1 > > - categorycode: 'YA' > description: 'Young Adult' >@@ -125,6 +127,7 @@ tables: > issuelimit: ~ > reservefee: '0.000000' > category_type: 'C' >+ canbeguarantee: 1 > > # Professionals > - categorycode: 'T' >@@ -139,6 +142,7 @@ tables: > issuelimit: ~ > reservefee: '0.000000' > category_type: 'P' >+ canbeguarantee: 1 > > - categorycode: 'B' > description: 'Board' >@@ -152,6 +156,7 @@ tables: > issuelimit: ~ > reservefee: '0.000000' > category_type: 'P' >+ canbeguarantee: 1 > > # Institutional > - categorycode: 'IL' >diff --git a/installer/data/mysql/fr-FR/2-Optionel/patron_categories.sql b/installer/data/mysql/fr-FR/2-Optionel/patron_categories.sql >index 22ddcd99f8..47902271aa 100644 >--- a/installer/data/mysql/fr-FR/2-Optionel/patron_categories.sql >+++ b/installer/data/mysql/fr-FR/2-Optionel/patron_categories.sql >@@ -1,15 +1,15 @@ > SET NAMES utf8; >-INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`) VALUES >-('ADULT','Adulte',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'), >-('ETUD','Etudiant',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A'), >+INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`, `canbeguarantee`) VALUES >+('ADULT','Adulte',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0), >+('ETUD','Etudiant',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0), > >-('ENF','Enfant',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), >-('ADO','Adolescent',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C'), >+('ENF','Enfant',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1), >+('ADO','Adolescent',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1), > >-('PROF','Professeur',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P'), >-('PERS','Personnel bibliothèque',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P'), >+('PROF','Professeur',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1), >+('PERS','Personnel bibliothèque',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1), > >-('PEB','Prêt Entre Bibliothèque',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'), >+('PEB','Prêt Entre Bibliothèque',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0), > ('PMI','PMI',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'), >-('BDP','Bibliothèque Départementale',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I'); >+('BDP','Bibliothèque Départementale',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0); > >diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql b/installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql >new file mode 100644 >index 0000000000..61428166ea >--- /dev/null >+++ b/installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql >@@ -0,0 +1,44 @@ >+-- >+-- Default classification sources and filing rules >+-- for Koha. >+-- >+-- Copyright (C) 2011 Magnus Enger Libriotech >+-- >+-- 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>. >+ >+INSERT INTO `categories` (`categorycode`, `description`, `enrolmentperiod`, `upperagelimit`, `dateofbirthrequired`, `finetype`, `bulk`, `enrolmentfee`, `overduenoticerequired`, `issuelimit`, `reservefee`, `category_type`, `canbeguarantee`) VALUES >+ >+-- Adult Patrons >+('PT','Låner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0), >+('ST','Student',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0), >+('HB','Hjemmelåner',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','A',0), >+ >+-- Children >+('K','Barn',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1), >+('J','Ungdom',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1), >+('YA','Ung voksen',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','C',1), >+ >+-- Professionals >+('T','Lærer',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','P',1), >+('B','Styremedlem',99,17,5,NULL,NULL,'0.000000',1,NULL,'0.000000','P',1), >+ >+-- Institutional >+('IL','Fjernlån',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0), >+('SC','Skole',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0), >+('L','Bibliotek',99,999,18,NULL,NULL,'0.000000',1,NULL,'0.000000','I',0), >+ >+-- Staff >+('S','Bibliotekansatt',99,999,18,NULL,NULL,'0.000000',0,NULL,'0.000000','S',0); >diff --git a/t/db_dependent/Patrons.t b/t/db_dependent/Patrons.t >index 4a5ff218c1..bc3f376bf8 100755 >--- a/t/db_dependent/Patrons.t >+++ b/t/db_dependent/Patrons.t >@@ -201,12 +201,12 @@ subtest "Update patron categories" => sub { > is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->next->borrowernumber, $child1->borrowernumber ); > is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too young'); > is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult'); >- is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2})->update_category_to({category=>$a_categorycode_2}),2,'Two child patrons updated to adult category'); >- is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantees were not removed when made adult which can be guarantee'); > > is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->next->borrowernumber, $child3->borrowernumber ); >- is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too old'); >+ is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_old=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category because too old'); > is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantee was removed when made adult'); >+ is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2})->update_category_to({category=>$a_categorycode_2}),1,'Two child patrons updated to adult category'); >+ is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantees were not removed when made adult which can be guarantee'); > > is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees'); > is( Koha::Patrons->search_patrons_to_update_category({from=>$p_categorycode})->update_category_to({category=>$a_categorycode}),1,'One professional patron updated to adult category'); >-- >2.20.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 12446
:
29278
|
36176
|
39744
|
42469
|
42470
|
42535
|
46277
|
46278
|
46327
|
46328
|
46345
|
46486
|
49793
|
50953
|
53534
|
53535
|
53536
|
53913
|
60929
|
60930
|
60934
|
63148
|
63149
|
63214
|
64793
|
64794
|
64828
|
72295
|
72883
|
77766
|
77767
|
77768
|
79343
|
79344
|
79345
|
79347
|
79348
|
85069
|
88364
|
88365
|
88366
|
88367
|
90389
|
90390
|
90391
|
90392
|
90470
|
90471
|
90472
|
90473
|
93388
|
93389
|
93390
|
93391
|
93392
|
93393
|
93394
|
95411
|
95853
|
95854
|
95855
|
95856
|
95857
|
95858
|
95859
|
95860
|
106753
|
106754
|
106755
|
106756
|
106757
|
107611
|
111052
|
111053
|
111317
|
111318
|
112102
|
112160
|
112161
|
112162
|
112163
|
113583
|
121925
|
121926
|
121927
|
121928
|
121929
|
122084
|
122085
|
122086
|
122087
|
122088
|
122089
|
122090
|
122091
|
122184
|
122185
|
122186
|
122187
|
130398
|
130399
|
130400
|
130401
|
130402
|
131965
|
131966
|
131967
|
131968
|
131969
|
133691
|
133952
|
133953
|
133954
|
133955
|
133956
|
133957
|
134930
|
134931
|
134932
|
134933
|
134934
|
134935
|
134936
|
135506
|
135507
|
135508
|
135509
|
135510
|
135511
|
135512
|
135519
|
135520
|
135521
|
135522
|
135523
|
135544
|
135545
|
142401
|
142408
|
142431
|
142432
|
142433
|
142434
|
142435
|
142436
|
142437
|
142438
|
142439