Bugzilla – Attachment 109639 Details for
Bug 10921
You can edit an order even when it is in a closed basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10921: Prevent an order from a closed basket to be edited
Bug-10921-Prevent-an-order-from-a-closed-basket-to.patch (text/plain), 3.45 KB, created by
PTFS Europe Sandboxes
on 2020-09-03 20:29:53 UTC
(
hide
)
Description:
Bug 10921: Prevent an order from a closed basket to be edited
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2020-09-03 20:29:53 UTC
Size:
3.45 KB
patch
obsolete
>From e21762e62d6a9676559c4a3dea687fdb4d31e7d9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 31 Jul 2020 11:15:57 +0200 >Subject: [PATCH] Bug 10921: Prevent an order from a closed basket to be edited > >We don't allow editing of orders that are part of a closed basket, but >we don't enforce the rule in the controller file. > >This patch use output_and_exit to stop the script and display an error >to the end user. > >Test plan: >Create a basket, add an order >On the basket view you see the "Modify" link, open it in a separate tab >=> You can edit the basket >Keep this tab open, get back to the other one and close the basket >Reload the tab with the order edition form >=> You cannot longer edit the basket > >QA: Do we need a check in addorder.pl as well? > >Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk> >--- > acqui/neworderempty.pl | 14 ++++++++++---- > .../intranet-tmpl/prog/en/includes/blocking_errors.inc | 2 ++ > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 5a8629086d..676bc98039 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -135,6 +135,16 @@ my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); > output_and_exit( $input, $cookie, $template, 'unknown_basket') unless $basketobj; > output_and_exit( $input, $cookie, $template, 'unknown_vendor') unless $bookseller; > >+$template->param( >+ ordernumber => $ordernumber, >+ basketno => $basketno, >+ basket => $basket, >+ booksellerid => $basket->{'booksellerid'}, >+ name => $bookseller->name, >+); >+output_and_exit( $input, $cookie, $template, 'order_cannot_be_edited' ) >+ if $ordernumber and $basketobj->closedate; >+ > my $contract = GetContract({ > contractnumber => $basket->{contractnumber} > }); >@@ -408,10 +418,7 @@ $quantity //= 0; > # fill template > $template->param( > existing => $biblionumber, >- ordernumber => $ordernumber, > # basket informations >- basketno => $basketno, >- basket => $basket, > basketname => $basket->{'basketname'}, > basketnote => $basket->{'note'}, > booksellerid => $basket->{'booksellerid'}, >@@ -436,7 +443,6 @@ $template->param( > order_vendornote => $data->{'order_vendornote'}, > listincgst => $bookseller->listincgst, > invoiceincgst => $bookseller->invoiceincgst, >- name => $bookseller->name, > cur_active_sym => $active_currency->symbol, > cur_active => $active_currency->currency, > currencies => \@currencies, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >index 7bc3987afb..1821f54817 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc >@@ -13,6 +13,8 @@ > <div class="dialog message">Basket not found.</div> > [% CASE 'unknown_vendor' %] > <div class="dialog message">Vendor not found.</div> >+ [% CASE 'order_cannot_be_edited' %] >+ <div class="dialog message">This order cannot be edited, the basket is closed.</div> > [% CASE 'wrong_csrf_token' %] > <div class="dialog message">The form submission failed (Wrong CSRF token). Try to come back, refresh the page, then try again.</div> > [% CASE 'budget_is_locked' %] >-- >2.11.0
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 10921
:
107624
|
109639
|
109945