Bug 10614 - have add order form at top and bottom
authorOwen Leonard <oleonard@myacpl.org>
Mon, 12 Aug 2013 12:36:09 +0000 (08:36 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 13 Aug 2013 14:18:50 +0000 (14:18 +0000)
If a basket has a lot of items it may be inconvenient to scroll to the
bottom of the patch to reach the "add to basket" form. This patch adds
as "Add to basket" button to the toolbar which uses JavaScript to copy
the form into a modal dialog for quick access.

To test, apply the patch and view an open basket. You should be able to
click the "Add to basket" button to trigger a modal dialog with the full
"Add to basket" list of options. All options in the list should function
normally.

If you view a closed basket the new button should not appear.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass and I love it :)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

index 84df886..8cbc46e 100644 (file)
 
         $("#show_all_details").attr('checked', false);
         updateColumnsVisibility(false);
+        [% UNLESS ( closedate ) %]
+            $('#addtoBasket').on('show', function () {
+               $(this).find(".modal-body").html($("#acqui_basket_add")[0].outerHTML);
+            });
+        [% END %]
     });
 //]]>
 </script>
         [% UNLESS ( selectbasketg ) %]
             [% UNLESS ( closedate ) %]
                 <div id="toolbar" class="btn-toolbar">
+                    <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-small" data-toggle="modal"><i class="icon-plus"></i> Add to basket</a></div>
                     <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;op=add_form" class="btn btn-small" id="basketheadbutton"><i class="icon-pencil"></i> Edit basket</a></div>
                     <div class="btn-group"><a href="#" class="btn btn-small" id="delbasketbutton"><i class="icon-remove"></i> Delete this basket</a></div>
                     [% IF ( unclosable ) %]
         [% END %]
         <br />
         [% UNLESS ( closedate ) %]
+
+    <!-- Modal -->
+    <div id="addtoBasket" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true">
+        <div class="modal-body"></div>
+        <div class="modal-footer">
+            <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
+        </div>
+    </div>
+
         [% INCLUDE 'acquisitions-add-to-basket.inc' %]
         [% END %]
         [% END %]