Bug 15950: Use Font Awesome icons for acquisitions basket close confirmation
authorOwen Leonard <oleonard@myacpl.org>
Tue, 1 Mar 2016 18:23:52 +0000 (13:23 -0500)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 3 Mar 2016 22:56:43 +0000 (22:56 +0000)
When closing a basket in Acquisitions the confirmation dialog should be
styled using Font Awesome icons. This patch adds them.

The cancel button has been moved into its own form so that we can get
rid of several problematic JavaScript issues: The use of the
"javascript:" pseudo-protocol, the use of an "onclick" attribute, and
the use of a JS redirect where a GET action will do.

To test, apply the patch and locate an open basket in Acquisitions which
can be closed.

- Click the 'Close this basket' button and confirm that the icons in the
  dialog look correct.
- Test the cancel operation to make sure you are redirected back to the
  page showing the basket details.
- Test the confirm operation and verify that the basket is closed.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Please note that the confirmation message display depends on
BasketConfirmations.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

index 67ee332..7bcbbbe 100644 (file)
 [% IF ( confirm_close ) %]
         <div id="closebasket_needsconfirmation" class="dialog alert">
 
-        <form action="/cgi-bin/koha/acqui/basket.pl" class="confirm">
+        <form action="/cgi-bin/koha/acqui/basket.pl">
             <h1>Are you sure you want to close basket [% basketname|html %]?</h1>
             [% IF ( CAN_user_acquisition_group_manage ) %]
             <p>
             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
             <input type="hidden" name="confirm" value="1" />
             <input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
-            <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
-            <input type="submit" class="deny" value="No, don't close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
+            <button type="submit" class="approve" accesskey="y"><i class="fa fa-fw fa-check"></i> Yes, close (Y)</button>
+        </form>
+        <form action="/cgi-bin/koha/acqui/basket.pl" method="get">
+            <input type="hidden" name="basketno" value="[% basketno %]" />
+            <button type="submit" class="deny" accesskey="n"><i class="fa fa-fw fa-remove"></i> No, don't close (N)</button>
         </form>
         </div>
     [% END %]