Bug 19329

Summary: IntranetSlipPrinterJS label is obsoleted
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: TemplatesAssignee: Josef Moravec <josef.moravec>
Status: CLOSED FIXED QA Contact: Julian Maurice <julian.maurice>
Severity: major    
Priority: P5 - low CC: fridolin.somers, julian.maurice, katrin.fischer, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: String patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17014    
Bug Blocks:    
Attachments: Bug 19329: Fix slip printing when IntranetSlipPrinterJS defined
Bug 19329: Update IntranetSlipPrinterJS system preference description.
Bug 19329: Update IntranetSlipPrinterJS system preference description.
Bug 19329: Update IntranetSlipPrinterJS system preference description.

Description Josef Moravec 2017-09-16 07:55:39 UTC

    
Comment 1 Josef Moravec 2017-09-16 08:14:20 UTC
Created attachment 67172 [details] [review]
Bug 19329: Fix slip printing when IntranetSlipPrinterJS defined

Test plan:
1) Set IntranetSlipPrinterJS according to documentation (= define
function printThenClose)
2) Go to circulation and try to print some slip
=> without patch the printThenClose function is not executed
=> with patch it is executed as it should
Comment 2 Owen Leonard 2017-09-18 15:49:59 UTC
The manual refers to the wiki, which includes this instruction:

"Important: The script must implement the function $( window ).load(function()
because it replaces the original function)."

The example on that wiki page includes a try-catch example which includes "window.print()" and "window.close()."

Isn't this patch going to create conflicts for libraries with existing IntranetSlipPrinterJS setups?
Comment 3 Josef Moravec 2017-09-19 05:42:13 UTC
(In reply to Owen Leonard from comment #2)
> The manual refers to the wiki, which includes this instruction:
> 
> "Important: The script must implement the function $( window
> ).load(function()
> because it replaces the original function)."
> 
> The example on that wiki page includes a try-catch example which includes
> "window.print()" and "window.close()."
> 
> Isn't this patch going to create conflicts for libraries with existing
> IntranetSlipPrinterJS setups?

In that case, yes it would be conflict. Then we need to document it better in UI, because the text by the system preference '' says:

'Use the following JavaScript for printing slips. Define at least function printThenClose().'

Which is what does not work.

I will rework the patch to just change this sentence. Thanks Owen.
Comment 4 Josef Moravec 2017-09-19 07:16:58 UTC
Created attachment 67197 [details] [review]
Bug 19329: Update IntranetSlipPrinterJS system preference description.

Test plan:
0) Apply the patch
1) Go to administration -> system preferences -> staff client
2) Read the description by IntranetSlipPrinterJS and confirm it's right
Comment 5 Marc Véron 2017-09-19 08:04:51 UTC
Created attachment 67199 [details] [review]
Bug 19329: Update IntranetSlipPrinterJS system preference description.

Test plan:
0) Apply the patch
1) Go to administration -> system preferences -> staff client
2) Read the description by IntranetSlipPrinterJS and confirm it's right

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 6 Julian Maurice 2017-09-29 09:39:19 UTC
Created attachment 67435 [details] [review]
Bug 19329: Update IntranetSlipPrinterJS system preference description.

Test plan:
0) Apply the patch
1) Go to administration -> system preferences -> staff client
2) Read the description by IntranetSlipPrinterJS and confirm it's right

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Jonathan Druart 2017-09-29 15:48:45 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 8 Fridolin Somers 2017-10-25 08:08:32 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 9 Katrin Fischer 2017-10-29 18:11:59 UTC
Depends on bug 17014 which is not in 16.11.x, skipping.