Bugzilla – Attachment 139267 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: (QA follow-up) Restore customisablity of description
Bug-23681-QA-follow-up-Restore-customisablity-of-d.patch (text/plain), 7.77 KB, created by
Martin Renvoize (ashimema)
on 2022-08-17 11:21:22 UTC
(
hide
)
Description:
Bug 23681: (QA follow-up) Restore customisablity of description
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-08-17 11:21:22 UTC
Size:
7.77 KB
patch
obsolete
>From 36ee23283760eb5c0f37ec52b68aff9076c2bb5c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 3 May 2022 16:38:37 +0100 >Subject: [PATCH] Bug 23681: (QA follow-up) Restore customisablity of > description > >This patch restores the customisability of description for system restriction >types. Translatability is not affected as you can translate the defaults >via template translation and assuming the end users leave their >descriptions at the default, the translations will be picked. > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > admin/restrictions.pl | 2 +- > .../data/mysql/en/mandatory/patron_restrictions.yml | 4 ++-- > .../prog/en/includes/borrower_debarments.inc | 12 +++--------- > .../prog/en/includes/patron_restrictions.inc | 10 ++++++++++ > .../prog/en/modules/admin/restrictions.tt | 13 +++++++------ > 5 files changed, 23 insertions(+), 18 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc > >diff --git a/admin/restrictions.pl b/admin/restrictions.pl >index d3449269a5..b41fd3f6cd 100755 >--- a/admin/restrictions.pl >+++ b/admin/restrictions.pl >@@ -67,8 +67,8 @@ if ( $op eq 'add_form') { > }; > } else { > my $restriction = Koha::RestrictionTypes->find($code); >+ $restriction->display_text($display_text); > unless ($restriction->is_system) { >- $restriction->display_text($display_text); > $restriction->can_be_added_manually($can_be_added_manually); > } > $restriction->store; >diff --git a/installer/data/mysql/en/mandatory/patron_restrictions.yml b/installer/data/mysql/en/mandatory/patron_restrictions.yml >index c0aeb7a396..26216504bd 100644 >--- a/installer/data/mysql/en/mandatory/patron_restrictions.yml >+++ b/installer/data/mysql/en/mandatory/patron_restrictions.yml >@@ -22,7 +22,7 @@ description: > > tables: > - debarment_types: >- translatable: [ display_text ] >+ translatable: [] > multiline: [] > rows: > - code: "MANUAL" >@@ -47,4 +47,4 @@ tables: > display_text: "Discharge" > is_system: 1 > default: 0 >- can_be_added_manually: 0 >\ No newline at end of file >+ can_be_added_manually: 0 >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 b489c64123..e5ff9639dc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc >@@ -1,5 +1,6 @@ > [% USE raw %] > [% USE Koha %] >+[% PROCESS 'patron_restrictions.inc' %] > <div id="reldebarments"> > [% IF ( not debarments.defined || debarments.size < 1 ) %] > <p>Patron is currently unrestricted.</p> >@@ -21,14 +22,7 @@ > [% dtype = d.type %] > <tr> > <td> >- [% ddisplay = restriction_types.$dtype.display_text %] >- [% SWITCH ddisplay %] >- [% CASE 'Manual' %]Manual >- [% CASE 'Overdues' %]Overdues >- [% CASE 'Suspension' %]Suspension >- [% CASE 'Discharge' %]Discharge >- [% CASE %][% ddisplay | html %] >- [% END %] >+ [% PROCESS restriction_type_description restriction=restriction_types.$dtype %] > </td> > <td> > [% IF d.comment.search('OVERDUES_PROCESS') %] >@@ -65,7 +59,7 @@ > <select name="debarred_type"> > [% FOREACH code IN restriction_types.keys %] > [% IF restriction_types.$code.can_be_added_manually %] >- <option value="[% code | html %]">[% restriction_types.$code.display_text | html %]</option> >+ <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option> > [% END %] > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc >new file mode 100644 >index 0000000000..3d0afd5fc1 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc >@@ -0,0 +1,10 @@ >+[%- BLOCK restriction_type_description -%] >+ [% ddisplay = restriction.display_text %] >+ [% SWITCH ddisplay %] >+ [% CASE 'Manual' %]<span>Manual</span> >+ [% CASE 'Overdues' %]<span>Overdues</span> >+ [% CASE 'Suspension' %]<span>Suspension</span> >+ [% CASE 'Discharge' %]<span>Discharge</span> >+ [% CASE %]<span>[% ddisplay | html %]</span> >+ [% END %] >+[%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >index 82dcc485d7..4b9767e46e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt >@@ -1,10 +1,11 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >+[% PROCESS 'patron_restrictions.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >-<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% restriction.display_text | html %]'[% ELSE %]New restriction[% END %][% END %] >-[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% restriction.display_text | html %]'[% END %] › Patron restrictions › Administration › Koha >+<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% PROCESS restriction_type_description %]'[% ELSE %]New restriction[% END %][% END %] >+[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% PROCESS restriction_type_description %]'[% END %] › Patron restrictions › Administration › Koha > </title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >@@ -37,7 +38,7 @@ > [% IF restriction %] > <li> > <a href="#" aria-current="page"> >- Modify restriction '[% restriction.display_text | html %]' >+ Modify restriction '[% PROCESS restriction_type_description %]' > </a> > </li> > [% ELSE %] >@@ -85,7 +86,7 @@ > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="checked" value="0" /> > [% IF restriction %] >- <h1>Modify restriction [% restriction.display_text | html %]</h1> >+ <h1>Modify restriction [% PROCESS restriction_type_description %]</h1> > <input type="hidden" name="is_a_modif" value="1" /> > [% ELSE %] > <h1>New restriction</h1> >@@ -151,7 +152,7 @@ > Confirm restriction deletion > </legend> > >- <p>Are you sure you want to delete "[% restriction.display_text | html %]"</p> >+ <p>Are you sure you want to delete "[% PROCESS restriction_type_description %]"</p> > > <fieldset class="action"> > <input type="hidden" name="op" value="delete_confirmed" /> >@@ -191,7 +192,7 @@ > [% restriction.code | html %] > </td> > <td> >- [% restriction.display_text | html %] >+ [% PROCESS restriction_type_description %] > </td> > <td> > [% IF restriction.can_be_added_manually %]Yes[% END %] >-- >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