Bug 13778: Putting patron lists buttons into a dropdown menu
authorAleisha <aleishaamohia@hotmail.com>
Wed, 10 Feb 2016 20:43:27 +0000 (20:43 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 24 Feb 2016 02:46:05 +0000 (02:46 +0000)
To test:
1) Go to Tools -> Patron lists
2) If there are no lists, confirm there is a message box saying 'There are no patron lists.'
3) Create a list if you do not already have one.
4) Confirm that in the 'Actions' drop down menu next to the list, the options to 'Add patrons',
   'Edit', 'Delete', and 'Print patron cards' are all there and work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt

index 50c7213..ae875e7 100644 (file)
@@ -11,7 +11,7 @@
         $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
             "autoWidth": false,
             "aoColumnDefs": [
-                { "aTargets": [ -1, -2, -3, -4 ], "bSortable": false, "bSearchable": false },
+                { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
             ],
             "sPaginationType": "four_button"
         } ));
             <a class="btn btn-small" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
         </div>
 
+        [% IF ( lists ) %]
+
         <table id="patron-lists-table">
             <thead>
                 <tr>
                     <th>Name</th>
                     <th>Patrons in list</th>
                     <th>&nbsp;</th>
-                    <th>&nbsp;</th>
-                    <th>&nbsp;</th>
-                    <th>&nbsp;</th>
                 </tr>
             </thead>
 
                         <td>[% l.name %]</td>
                         <td>[% l.patron_list_patrons_rs.count || 0 %]</td>
                         <td>
-                            <a class="btn btn-mini" href="list.pl?patron_list_id=[% l.patron_list_id %]">
-                                <i class="fa fa-plus-sign"></i> Add patrons <i class="fa fa-user"></i>
-                            </a>
-                        </td>
-                        <td>
-                            <a class="btn btn-mini" href="add-modify.pl?patron_list_id=[% l.patron_list_id %]">
-                                <i class="fa fa-edit"></i> Edit
-                            </a>
-                        </td>
-                        <td>
-                            <a class="btn btn-mini" href="delete.pl?patron_list_id=[% l.patron_list_id %]" onclick='return ConfirmDelete("[% l.name | html %]")'>
-                                <i class="fa fa-trash"></i> Delete
-                            </a>
-                        </td>
-                        <td>
-                            <a class="btn btn-mini" href="#" onclick='GB_showCenter(_("Print patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id %]", 400, 800);return false;'>
-                                <i class="icon-print"></i> Print patron cards
-                            </a>
+                            <div class="dropdown">
+                                <a class="btn btn-mini dropdown-toggle" id="listactions[% l.patron_list_id %]" role="button" data-toggle="dropdown" href="#">
+                                   Actions <b class="caret"></b>
+                                </a>
+                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id %]">
+                                    <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-user"></i> Add patrons</a></li>
+                                    <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-edit"></i> Edit</a></li>
+                                    <li><a href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id %]" onclick='return ConfirmDelete("[% l.name %]")'><i class="fa fa-trash"></i> Delete</a></li>
+                                    <li><a href="#" onclick='GB_showCenter(_("Print patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id %]", 400, 800);return false;'><i class="icon-print"></i> Print patron cards</a></li>
+                                </ul>
+                            </div>
                         </td>
                     </tr>
                 [% END %]
             </tbody>
         </table>
+        [% ELSE %]
+           <div class="dialog message">There are no patron lists.</div>
+        [% END %]
     </div>
 </div>
 [% INCLUDE 'intranet-bottom.inc' %]