Bugzilla – Attachment 134585 Details for
Bug 23681
Make patron restrictions user definable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23681: Allow for changes to debarments
Bug-23681-Allow-for-changes-to-debarments.patch (text/plain), 6.05 KB, created by
Martin Renvoize (ashimema)
on 2022-05-04 11:42:22 UTC
(
hide
)
Description:
Bug 23681: Allow for changes to debarments
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-04 11:42:22 UTC
Size:
6.05 KB
patch
obsolete
>From e95ddb4815f05d0c8e823f095be81a19a1ec0f6d Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Thu, 3 Oct 2019 12:21:21 +0100 >Subject: [PATCH] Bug 23681: Allow for changes to debarments > >The structure of debarments has changes slightly in that the displayed >text is now a product of a call to Koha::RestrictionTypes rather than >just the debarment's code. This patch allows for that > >Signed-off-by: Benjamin Veasey <B.T.Veasey@lboro.ac.uk> >Sponsored-by: Loughborough University >--- > circ/circulation.pl | 2 ++ > .../prog/en/includes/borrower_debarments.inc | 12 ++---------- > .../prog/en/modules/members/memberentrygen.tt | 3 ++- > members/memberentry.pl | 5 ++++- > members/moremember.pl | 5 +++++ > 5 files changed, 15 insertions(+), 12 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index dfa5cb1fd7..81e59af565 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -45,6 +45,7 @@ use Koha::AuthorisedValues; > use Koha::CsvProfiles; > use Koha::Patrons; > use Koha::Patron::Debarments qw( GetDebarments ); >+use Koha::RestrictionTypes; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Plugins; > use Koha::Database; >@@ -629,6 +630,7 @@ $template->param( > SpecifyDueDate => $duedatespec_allow, > PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), > debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), >+ restriction_types => scalar Koha::RestrictionTypes->keyed_on_code(), > todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), > has_modifications => $has_modifications, > override_high_holds => $override_high_holds, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc >index 2bbfc7aad3..dbc1273f88 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc >@@ -17,18 +17,10 @@ > </thead> > <tbody> > [% FOREACH d IN debarments %] >+ [% dtype = d.type %] > <tr> > <td> >- [% SWITCH d.type %] >- [% CASE 'MANUAL' %] >- <span>Manual</span> >- [% CASE 'OVERDUES' %] >- <span>Overdues</span> >- [% CASE 'SUSPENSION' %] >- <span>Suspension</span> >- [% CASE 'DISCHARGE' %] >- <span>Discharge</span> >- [% END %] >+ [% restriction_types.$dtype.display_text | html %] > </td> > <td> > [% IF d.comment.search('OVERDUES_PROCESS') %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index d01b2316bc..74dde19170 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1331,8 +1331,9 @@ legend:hover { > </thead> > <tbody> > [% FOREACH d IN debarments %] >+ [% dtype = d.type %] > <tr> >- <td>[% d.type | html %]</td> >+ <td>[% restriction_types.$dtype.display_text | html %]</td> > <td> > [% IF d.comment.search('OVERDUES_PROCESS') %] > Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 4e25891dd0..962b0ffce8 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -36,6 +36,7 @@ use Koha::AuthUtils; > use Koha::AuthorisedValues; > use Koha::Email; > use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments ); >+use Koha::RestrictionTypes; > use Koha::Cities; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Libraries; >@@ -116,7 +117,9 @@ foreach my $id ( @delete_guarantor ) { > > ## Deal with debarments > $template->param( >- debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ) ); >+ debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ), >+ restriction_types => scalar Koha::RestrictionTypes->keyed_on_code() >+); > my @debarments_to_remove = $input->multi_param('remove_debarment'); > foreach my $d ( @debarments_to_remove ) { > DelDebarment( $d ); >diff --git a/members/moremember.pl b/members/moremember.pl >index 89ec5d9af5..3b0f5a752b 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -37,6 +37,7 @@ use List::MoreUtils qw( uniq ); > use Scalar::Util qw( looks_like_number ); > use Koha::Patron::Attribute::Types; > use Koha::Patron::Debarments qw( GetDebarments ); >+use Koha::RestrictionTypes; > use Koha::Patron::Messages; > use Koha::CsvProfiles; > use Koha::Holds; >@@ -79,6 +80,10 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) { > $patron->$_ and $template->param(flagged => 1) and last; > } > >+$template->param( >+ restriction_types => scalar Koha::RestrictionTypes->keyed_on_code() >+} >+ > if ( $patron->is_debarred ) { > $template->param( > 'debarments' => scalar GetDebarments({ borrowernumber => $borrowernumber }), >-- >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 23681
:
93769
|
93770
|
93771
|
93772
|
93773
|
93774
|
93775
|
93776
|
93777
|
93778
|
93779
|
93780
|
93781
|
93782
|
93783
|
93784
|
93785
|
93786
|
94862
|
94863
|
94864
|
94865
|
94866
|
94867
|
94868
|
94869
|
94870
|
94896
|
94897
|
94898
|
94899
|
94900
|
94901
|
94902
|
94903
|
94904
|
95148
|
95255
|
95256
|
95257
|
95258
|
95259
|
95260
|
95261
|
95262
|
95263
|
95264
|
99893
|
99894
|
99895
|
99896
|
99897
|
99898
|
99899
|
99900
|
99901
|
99902
|
130373
|
130374
|
130375
|
130376
|
130377
|
130378
|
130379
|
130380
|
130381
|
130382
|
130383
|
130384
|
132302
|
132303
|
132304
|
132305
|
132306
|
132307
|
132308
|
132309
|
132310
|
132311
|
132312
|
132313
|
132314
|
132315
|
132316
|
132318
|
132319
|
132320
|
134512
|
134513
|
134514
|
134515
|
134516
|
134517
|
134518
|
134519
|
134520
|
134521
|
134522
|
134523
|
134524
|
134525
|
134526
|
134527
|
134528
|
134529
|
134580
|
134581
|
134582
|
134583
|
134584
|
134585
|
134586
|
134587
|
134588
|
134589
|
134590
|
134591
|
134592
|
134593
|
134594
|
134595
|
134596
|
134597
|
134598
|
134599
|
134600
|
134601
|
134602
|
134684
|
134685
|
134686
|
134687
|
134688
|
134689
|
134690
|
134691
|
134692
|
134693
|
134694
|
134696
|
134697
|
134698
|
134699
|
134700
|
134701
|
134702
|
134703
|
134704
|
134705
|
134706
|
134707
|
134708
|
136716
|
136717
|
136718
|
136719
|
136720
|
136721
|
136722
|
136723
|
136724
|
136725
|
136726
|
136727
|
136728
|
136729
|
136730
|
136731
|
136732
|
136733
|
136734
|
136735
|
136736
|
136737
|
136738
|
136739
|
137066
|
137067
|
137068
|
137069
|
137070
|
137071
|
137072
|
137073
|
137074
|
137075
|
137076
|
137077
|
137078
|
137079
|
137080
|
137081
|
137082
|
137083
|
137084
|
137085
|
137086
|
137087
|
137088
|
137089
|
137090
|
137091
|
137092
|
137093
|
137094
|
137102
|
137103
|
137104
|
137105
|
137106
|
137107
|
137108
|
137109
|
137110
|
137111
|
137112
|
137113
|
137114
|
137115
|
137116
|
137117
|
137118
|
137119
|
137120
|
137121
|
137122
|
137123
|
137124
|
137125
|
137126
|
137127
|
137128
|
137129
|
137130
|
139250
|
139251
|
139252
|
139253
|
139254
|
139255
|
139256
|
139257
|
139258
|
139259
|
139260
|
139261
|
139262
|
139263
|
139264
|
139265
|
139266
|
139267
|
139268
|
139269
|
139270
|
139271
|
139272
|
139273
|
139509
|
139512
|
139649
|
139717
|
139768
|
139769
|
139770
|
139771
|
139772
|
139773
|
139774
|
139775
|
139776
|
139777
|
139778
|
139779
|
139780
|
139781
|
139782
|
139783
|
139784
|
139785
|
139786
|
139787
|
139788
|
139789
|
139790
|
139791
|
139792
|
139793
|
139794
|
139795