Bugzilla – Attachment 29392 Details for
Bug 12508
The removal of a contract which is linked to a basket does not display an error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12508: adding an error message if a contract cannot be removed
Bug-12508-adding-an-error-message-if-a-contract-ca.patch (text/plain), 3.37 KB, created by
Yohann Dufour
on 2014-07-01 08:05:29 UTC
(
hide
)
Description:
Bug 12508: adding an error message if a contract cannot be removed
Filename:
MIME Type:
Creator:
Yohann Dufour
Created:
2014-07-01 08:05:29 UTC
Size:
3.37 KB
patch
obsolete
>From 20539a65befadf5fb0538d814e583bbde27c39e3 Mon Sep 17 00:00:00 2001 >From: Yohann Dufour <dufour.yohann@gmail.com> >Date: Tue, 1 Jul 2014 09:59:36 +0200 >Subject: [PATCH] Bug 12508: adding an error message if a contract cannot be > removed > >If a contract cannot be removed, no errors is displayed. Now, it displays an dialog messag error and the list of contracts. > >Test plan: >1) Log on with a superlibrarian permission >2) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor") >3) Record a vendor with a nonzero "name" >4) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu) >5) Click on the button "New" > "Contract" and record a new one >6) Click on "New" > "Basket" and record a basket by selectioning the created contract >7) Click on the contract name, then click on the "Contracts" item in the left menu >8) Try to delete this contract, an error is displayed : "Contract has not been deleted. Maybe a basket linked to this contract exists." >9) Delete the basket linked to the contract >10) Delete the contract, no errors is displayed >--- > admin/aqcontract.pl | 19 +++++++++++-------- > .../intranet-tmpl/prog/en/modules/admin/aqcontract.tt | 5 +++++ > 2 files changed, 16 insertions(+), 8 deletions(-) > >diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl >index d7166e3..8cfb517 100755 >--- a/admin/aqcontract.pl >+++ b/admin/aqcontract.pl >@@ -33,7 +33,7 @@ use C4::Contract; > my $input = new CGI; > my $contractnumber = $input->param('contractnumber'); > my $booksellerid = $input->param('booksellerid'); >-my $op = $input->param('op') || ''; >+my $op = $input->param('op') || 'list'; > > my $bookseller = GetBookSellerFromId($booksellerid); > >@@ -133,17 +133,20 @@ elsif ( $op eq 'delete_confirm' ) { > } > #DELETE_CONFIRMED: called by delete_confirm, used to effectively confirm deletion of data in DB > elsif ( $op eq 'delete_confirmed' ) { >- $template->param( delete_confirmed => 1 ); >+ my $deleted = DelContract( { contractnumber => $contractnumber } ); > >- DelContract( { contractnumber => $contractnumber } ); >- >- print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); >- exit; >+ if ( $deleted ) { >+ print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid"); >+ exit; >+ } else { >+ $template->param( error => 'not_deleted' ); >+ $op = 'list'; >+ } > >- # END $OP eq DELETE_CONFIRMED >+ # END $OP eq LIST > } > # DEFAULT: Builds a list of contracts and displays them >-else { >+if ( $op eq 'list' ) { > $template->param(else => 1); > > # get contracts >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >index 34040bd..b4a6e0c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >@@ -90,6 +90,11 @@ function Check(ff) { > <div class="yui-b"> > > [% INCLUDE 'acquisitions-toolbar.inc' %] >+ >+[% IF error == 'not_deleted' %] >+ <div class="dialog alert">Contract has not been deleted. Maybe a basket linked to this contract exists.</div> >+[% END %] >+ > [% IF ( add_form ) %] > <form name="Aform" action="[% script_name %]" method="post"> > <input type="hidden" name="op" value="add_validate" /> >-- >1.9.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 12508
:
29392
|
29421
|
29512
|
29513