Bug 23010: Handle error in updateitem.pl and template
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 73505a73ec)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
152af99174
commit
09fc5e8468
|
|
@ -81,9 +81,10 @@ my $title = $query->param('title');
|
|||
my $bi = $query->param('bi');
|
||||
$bi = $biblionumber unless $bi;
|
||||
$itemnumber = $query->param('itemnumber');
|
||||
my $data = &GetBiblioData($biblionumber);
|
||||
my $dewey = $data->{'dewey'};
|
||||
my $showallitems = $query->param('showallitems');
|
||||
my $data = &GetBiblioData($biblionumber);
|
||||
my $dewey = $data->{'dewey'};
|
||||
my $showallitems = $query->param('showallitems');
|
||||
my $withdraw_error = $query->param('nowithdraw');
|
||||
|
||||
#coping with subscriptions
|
||||
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
|
||||
|
|
@ -325,6 +326,7 @@ $template->param(
|
|||
);
|
||||
|
||||
$template->param(
|
||||
withdraw_error => $withdraw_error,
|
||||
ITEM_DATA => \@item_data,
|
||||
moredetailview => 1,
|
||||
loggedinuser => $loggedinuser,
|
||||
|
|
@ -341,4 +343,3 @@ my $holds = $biblio->holds;
|
|||
$template->param( holdcount => $holds->count );
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
||||
|
|
|
|||
|
|
@ -90,9 +90,13 @@ if ( $op eq "cud-set_non_public_note" ) {
|
|||
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
|
||||
exit;
|
||||
}
|
||||
|
||||
$item->store;
|
||||
|
||||
eval { $item->store; };
|
||||
if ($@) {
|
||||
my $error_message = $@->message;
|
||||
print $cgi->redirect(
|
||||
"moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber&nowithdraw=$error_message#item$itemnumber");
|
||||
exit;
|
||||
}
|
||||
LostItem( $itemnumber, 'moredetail' ) if $op eq "cud-set_lost";
|
||||
|
||||
print $cgi->redirect(
|
||||
|
|
|
|||
|
|
@ -152,6 +152,16 @@
|
|||
[% SET not_for_loan = 1 %]
|
||||
[% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
|
||||
[% END %]
|
||||
[% IF withdraw_error %]
|
||||
<div class="alert alert-info">
|
||||
[% IF withdraw_error == 'intransit_cannot_withdraw' %]
|
||||
Cannot withdraw item in transit.
|
||||
[% END %]
|
||||
[% IF withdraw_error == 'onloan_cannot_withdraw' %]
|
||||
Cannot withdraw checked out item.
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
<div class="listgroup">
|
||||
<h4>
|
||||
Item information
|
||||
|
|
|
|||
Loading…
Reference in New Issue