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> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
130e1c888a
commit
36cb2bff47
|
|
@ -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 %]
|
||||
|
|
|
|||
|
|
@ -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 !
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue