Bug 14505: single quotes in journal number cause print routing list window to not...
authorJoonas Kylmälä <j.kylmala@gmail.com>
Thu, 20 Aug 2015 09:24:17 +0000 (09:24 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 25 Sep 2015 14:54:49 +0000 (11:54 -0300)
Escapes single quotes from serial.serialseq string.

Test plan:

1. Have a serial with a number which has single quote in it.
2. Go to Serials -> Find some serial subscription -> Serial collection.
3. Set up a routing list for this serial.
4. Click on Print list under the column Routing.
5. Notice that the print window doesn't open.
6. Apply patch.
7. Notice that the print window opens.

Sponsored-by: Vaara-kirjastot

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt

index 4418baf..43bae8c 100644 (file)
@@ -294,7 +294,7 @@ $(document).ready(function() {
                 </td>
                 [% IF ( routing ) %]
                 <td>
-                    <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %] ([% serial.publisheddate | $KohaDates %])'); return false" >Print list</a>
+                    <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq.replace("'", "\\'") |html %] ([% serial.publisheddate | $KohaDates %])'); return false" >Print list</a>
                 </td>
                 [% END %]
             </tr>