Bug 15584 - Staff client list errors are incorrectly styled

To Test-
1. In the Staff Client, go to Lists
   (/cgi-bin/koha/virtualshelves/shelves.pl) and create a new list with
   the same name as an existing one. --note that it has some red in it
   like an error
2. apply patch
3. In the Staff Client, go to Lists
   (/cgi-bin/koha/virtualshelves/shelves.pl) and create a new list with
   the same name as an existing one. --note that now it should be just
   yellow with black writing as an alert

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4bd2188aff)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Chloe 2016-01-21 03:20:58 +00:00 committed by Katrin Fischer
parent b441c89f4f
commit dc40f04752
1 changed files with 20 additions and 19 deletions

View File

@ -59,11 +59,11 @@ if ( $op eq 'add_form' ) {
my $patron = GetMember( 'borrowernumber' => $shelf->owner );
$template->param( owner => $patron, );
unless ( $shelf->can_be_managed( $loggedinuser ) ) {
push @messages, { type => 'error', code => 'unauthorized_on_update' };
push @messages, { type => 'alert', code => 'unauthorized_on_update' };
$op = 'list';
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
} elsif ( $op eq 'add' ) {
eval {
@ -81,9 +81,10 @@ if ( $op eq 'add_form' ) {
$shelfnumber = $shelf->shelfnumber;
};
if ($@) {
push @messages, { type => 'error', code => ref($@), msg => $@ };
push @messages, { type => 'alert', code => ref($@), msg => $@ };
} elsif ( not $shelf ) {
push @messages, { type => 'error', code => 'error_on_insert' };
push @messages, { type => 'alert', code => 'error_on_insert' };
} else {
push @messages, { type => 'message', code => 'success_on_insert' };
$op = 'view';
@ -106,16 +107,16 @@ if ( $op eq 'add_form' ) {
eval { $shelf->store };
if ($@) {
push @messages, { type => 'error', code => 'error_on_update' };
push @messages, { type => 'alert', code => 'error_on_update' };
$op = 'edit_form';
} else {
push @messages, { type => 'message', code => 'success_on_update' };
}
} else {
push @messages, { type => 'error', code => 'unauthorized_on_update' };
push @messages, { type => 'alert', code => 'unauthorized_on_update' };
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
} elsif ( $op eq 'delete' ) {
$shelfnumber = $query->param('shelfnumber');
@ -124,15 +125,15 @@ if ( $op eq 'add_form' ) {
if ( $shelf->can_be_deleted( $loggedinuser ) ) {
eval { $shelf->delete; };
if ($@) {
push @messages, { type => 'error', code => ref($@), msg => $@ };
push @messages, { type => 'alert', code => ref($@), msg => $@ };
} else {
push @messages, { type => 'message', code => 'success_on_delete' };
}
} else {
push @messages, { type => 'error', code => 'unauthorized_on_delete' };
push @messages, { type => 'alert', code => 'unauthorized_on_delete' };
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
$op = 'list';
} elsif ( $op eq 'add_biblio' ) {
@ -146,21 +147,21 @@ if ( $op eq 'add_form' ) {
if ( $shelf->can_biblios_be_added( $loggedinuser ) ) {
my $added = eval { $shelf->add_biblio( $biblio->{biblionumber}, $loggedinuser ); };
if ($@) {
push @messages, { type => 'error', code => ref($@), msg => $@ };
push @messages, { type => 'alert', code => ref($@), msg => $@ };
} elsif ( $added ) {
push @messages, { type => 'message', code => 'success_on_add_biblio' };
} else {
push @messages, { type => 'message', code => 'error_on_add_biblio' };
}
} else {
push @messages, { type => 'error', code => 'unauthorized_on_add_biblio' };
push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' };
}
} else {
push @messages, { type => 'error', code => 'item_does_not_exist' };
push @messages, { type => 'alert', code => 'item_does_not_exist' };
}
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
$op = $referer;
} elsif ( $op eq 'remove_biblios' ) {
@ -178,17 +179,17 @@ if ( $op eq 'add_form' ) {
);
};
if ($@) {
push @messages, { type => 'error', code => ref($@), msg => $@ };
push @messages, { type => 'alert', code => ref($@), msg => $@ };
} elsif ( $number_of_biblios_removed ) {
push @messages, { type => 'message', code => 'success_on_remove_biblios' };
} else {
push @messages, { type => 'error', code => 'no_biblio_removed' };
push @messages, { type => 'alert', code => 'no_biblio_removed' };
}
} else {
push @messages, { type => 'error', code => 'unauthorized_on_remove_biblios' };
push @messages, { type => 'alert', code => 'unauthorized_on_remove_biblios' };
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
$op = $referer;
}
@ -307,7 +308,7 @@ if ( $op eq 'view' ) {
undef $shelf;
}
} else {
push @messages, { type => 'error', code => 'does_not_exist' };
push @messages, { type => 'alert', code => 'does_not_exist' };
}
}