Bug 16739: Show note instead of 500 error for 'Generate EDIFACT' when no EDI account...
authorJon Knight <J.P.Knight@lboro.ac.uk>
Mon, 14 May 2018 15:30:55 +0000 (15:30 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 10 Oct 2018 09:52:30 +0000 (11:52 +0200)
commitf13910a1f7307ea2851cab5e3f1cfa444aba3beb
tree88df2dc773e1b9ff66539ded0301cee8cf55078b
parent10eb6cb65ebd917bf34872fb3efe98e7a37648fe
Bug 16739: Show note instead of 500 error for 'Generate EDIFACT' when no EDI account is configured

When a book seller (vendor) does not have EDI account information configured
the basketgroup display still shows a button to generate EDIFACT output which
results in 500 error when clicked.  This patch fixes two aspects of this:

a) it stops the button being displayed in the first place, replacing it with
a message that explains there is not EDIFACT configuration for the vendor.

b) if, somehow, an edifact print operation is passed to the basketgroup
script it detects the lack of an EAN and redirects back to the basket group
display page with a warning message.

To test:
1) Create a vendor with no EDI details.
2) Create a basket with some items in, then close it and add it to a basket
   group for this vendor.
   3) Go to that vendor's basket groups, click on the "Closed" tab and then
      click on the 'generate edifact order' button. You should get a 500 error.
   4) Apply this patch.
   5) Repeat 3, except this time you should find that the 'generate edifact
      order' button has been replaced with a note that there is
      "No EDIFACT configuration for <vendor>".

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 121b8105bcb00909b1e8081442148c1939c101a6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 43b6644818f71c2d3c4bf09c6c40b36f5c0522c2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
acqui/basketgroup.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt