Bug 28220: UI changes
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
4de341c2d0
commit
0109dd751b
|
|
@ -343,11 +343,11 @@ sub import_patrons {
|
|||
|
||||
my $patron_id = defined $matchpoint ? $borrower{$matchpoint} : $matchpoint_attr_type;
|
||||
if ( $_->isa('Koha::Exceptions::Patron::Attribute::UniqueIDConstraint') ) {
|
||||
push @errors, { patron_attribute_unique_id_constraint => 1, patron_id => $patron_id, attribute => $_->attribute };
|
||||
push @errors, { patron_attribute_unique_id_constraint => 1, borrowernumber => $borrowernumber, attribute => $_->attribute };
|
||||
} elsif ( $_->isa('Koha::Exceptions::Patron::Attribute::InvalidType') ) {
|
||||
push @errors, { patron_attribute_invalid_type => 1, patron_id => $patron_id, attribute_type_code => $_->type };
|
||||
push @errors, { patron_attribute_invalid_type => 1, borrowernumber => $borrowernumber, attribute_type_code => $_->type };
|
||||
} elsif ( $_->isa('Koha::Exceptions::Patron::Attribute::NonRepeatable') ) {
|
||||
push @errors, { patron_attribute_non_repeatable => 1, patron_id => $patron_id, attribute => $_->attribute };
|
||||
push @errors, { patron_attribute_non_repeatable => 1, borrowernumber => $borrowernumber, attribute => $_->attribute };
|
||||
} else {
|
||||
use Data::Printer colored => 1; warn p $_;
|
||||
push @errors, { unknown_error => 1 };
|
||||
|
|
|
|||
|
|
@ -169,6 +169,33 @@
|
|||
Password error for patron with borrowernumber [% e.borrowernumber | html %].
|
||||
</li>
|
||||
[% END %]
|
||||
[% IF e.patron_attribute_unique_id_constraint %]
|
||||
<li class="line_error">
|
||||
[% IF e.borrowernumber %]
|
||||
Patron attribute [% e.attribute.code | html %] must be unique for patron with borrowernumber [% e.borrowernumber | html %].
|
||||
[% ELSE %]
|
||||
Patron attribute [% e.attribute.code | html %] must be unique for patron [% e.patron_id | html %].
|
||||
[% END %]
|
||||
</li>
|
||||
[% END %]
|
||||
[% IF e.patron_attribute_invalid_type %]
|
||||
<li class="line_error">
|
||||
[% IF e.borrowernumber %]
|
||||
Patron attribute [% e.attribute_type_code | html %] is invalid for patron with borrowernumber [% e.borrowernumber | html %].
|
||||
[% ELSE %]
|
||||
Patron attribute [% e.attribute_type_code | html %] is invalid for patron [% e.patron_id | html %].
|
||||
[% END %]
|
||||
</li>
|
||||
[% END %]
|
||||
[% IF e.patron_attribute_non_repeatable %]
|
||||
<li class="line_error">
|
||||
[% IF e.borrowernumber %]
|
||||
Patron attribute [% e.attribute.code | html %] is non-repeatable for patron with borrowernumber [% e.borrowernumber | html %].
|
||||
[% ELSE %]
|
||||
Patron attribute [% e.attribute.code | html %] is non-repeatable for patron [% e.patron_id | html %].
|
||||
[% END %]
|
||||
</li>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1042,7 +1042,7 @@ subtest 'patron_attributes' => sub {
|
|||
is( $result->{overwritten}, 0 );
|
||||
my $error = $result->{errors}->[0];
|
||||
is( $error->{patron_attribute_unique_id_constraint}, 1 );
|
||||
is( $error->{patron_id}, $cardnumber );
|
||||
is( $error->{borrowernumber}, $patron->borrowernumber );
|
||||
is( $error->{attribute}->code, $unique_attribute_type->code );
|
||||
|
||||
compare_patron_attributes($patron->extended_attributes->unblessed, {}, );
|
||||
|
|
@ -1067,7 +1067,7 @@ subtest 'patron_attributes' => sub {
|
|||
|
||||
$error = $result->{errors}->[0];
|
||||
is( $error->{patron_attribute_invalid_type}, 1 );
|
||||
is( $error->{patron_id}, $cardnumber );
|
||||
is( $error->{borrowernumber}, $patron->borrowernumber );
|
||||
is( $error->{attribute_type_code}, $non_existent_attribute_type_code );
|
||||
|
||||
# NonRepeatable
|
||||
|
|
@ -1088,7 +1088,7 @@ subtest 'patron_attributes' => sub {
|
|||
|
||||
$error = $result->{errors}->[0];
|
||||
is( $error->{patron_attribute_non_repeatable}, 1 );
|
||||
is( $error->{patron_id}, $cardnumber );
|
||||
is( $error->{borrowernumber}, $patron->borrowernumber );
|
||||
is( $error->{attribute}->code, $normal_attribute_type->code );
|
||||
|
||||
# Don't preserve existing attributes
|
||||
|
|
|
|||
Loading…
Reference in New Issue