Bugzilla – Attachment 138545 Details for
Bug 30874
Simplify patron category handling in memberentry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30874: Replace categoryname
Bug-30874-Replace-categoryname.patch (text/plain), 3.47 KB, created by
Victor Grousset/tuxayo
on 2022-08-03 19:15:44 UTC
(
hide
)
Description:
Bug 30874: Replace categoryname
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2022-08-03 19:15:44 UTC
Size:
3.47 KB
patch
obsolete
>From 2e2621dd7a5c269df74ba6a8c0c00351f5e983c8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Jun 2022 09:54:25 +0200 >Subject: [PATCH] Bug 30874: Replace categoryname > >== Test plan == >1. Apply all patches >2. Create a new patron in a given category > => Form show the dropdown with the selected category >3. Edit again > => Value is kept >4. Edit a category to give it specific values for: messaging prefs, > password strength/length, can be guarantee >5. Edit the patron, change the category, and confirm that the different > limitation are correctly applied. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../prog/en/modules/members/memberentrygen.tt | 8 ++++---- > members/memberentry.pl | 10 +++++----- > 2 files changed, 9 insertions(+), 9 deletions(-) > >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 c5f17cb6f0..bdf59c87d3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -20,7 +20,7 @@ > Modify patron > [% END %] > [% INCLUDE 'patron-title.inc' no_html = 1 %] >- [% IF categoryname %]([% categoryname | html %])[% END %] >+ [% IF patron_category %]([% patron_category.description | html %])[% END %] > [% END %] › Patrons › Koha > </title> > <style> >@@ -65,8 +65,8 @@ legend:hover { > [% ELSE %] > <span>Modify patron</span> > [% END %] >- [% IF categoryname %] >- ([% categoryname | html %]) >+ [% IF patron_category %] >+ ([% patron_category.description | html %]) > [% END %] > </a> > </li> >@@ -118,7 +118,7 @@ legend:hover { > <span>Modify patron</span> > [% END %] > [% INCLUDE 'patron-title.inc' %] >- [% IF categoryname %]([% categoryname | html %])[% END %] >+ [% IF patron_category %]([% patron_category.description | html %])[% END %] > </h1> > > [% IF quickadd && opadd && !check_member %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 23575272aa..f849986a63 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -177,11 +177,11 @@ if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) { > > my $categorycode = $input->param('categorycode') || $borrower_data->{'categorycode'}; > my $category_type = $input->param('category_type') || ''; >-unless ($category_type or !($categorycode)){ >- my $borrowercategory = Koha::Patron::Categories->find($categorycode); >- $category_type = $borrowercategory->category_type; >- my $category_name = $borrowercategory->description; >- $template->param("categoryname"=>$category_name); >+my $category; >+if ( !$category_type && $categorycode ) { >+ $category = Koha::Patron::Categories->find($categorycode); >+ $category_type = $category->category_type; >+ $template->param( patron_category => $category ); > } > $category_type="A" unless $category_type; # FIXME we should display a error message instead of a 500 error ! > >-- >2.37.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 30874
:
135524
|
135525
|
135526
|
135527
|
135528
|
135529
|
138443
|
138444
|
138445
|
138446
|
138447
|
138545
|
138546
|
138547
|
138548
|
138549
|
138637
|
138638
|
138639
|
138640
|
138641