From e6d0e04306acb9b00b804c890b0176cb17f7c381 Mon Sep 17 00:00:00 2001
From: Aleisha <aleishaamohia@hotmail.com>
Date: Tue, 16 Feb 2016 04:01:13 +0000
Subject: [PATCH] Bug 15830 - Move Rotating Collections actions into a
 drop-down list

To test:
1) Go to Tools -> Rotating Collections
2) Confirm actions (Add or remove items, Transfer, Edit, Delete) have moved into a drop down menu
3) Confirm all of the actions work as expected

Sponsored-by: Catalyst IT
---
 .../rotating_collections/rotatingCollections.tt    |   29 ++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt
index a807b6b..761be64 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt
@@ -2,6 +2,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Rotating collections</title>
 [% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
     $(document).ready(function(){
         $(".confirmdelete").click(function(){
@@ -13,6 +14,13 @@
                 return false;
             }
         });
+        $('#rotating-collections-table').dataTable($.extend(true, {}, dataTablesDefaults, {
+            "autoWidth": false,
+            "aoColumnDefs": [
+                { "aTargets": [ -1, -2, -3, -4 ], "bSortable": false, "bSearchable": false },
+            ],
+            "sPaginationType": "four_button"
+        } ));
     });
 </script>
 </head>
@@ -32,15 +40,12 @@
                 <h1>Rotating collections</h1>
                 <div>
                     [% IF ( collectionsLoop ) %]
-                        <table>
+                        <table id="rotating-collections-table">
                             <tr>
                                 <th>Title</th>
                                 <th>Description</th>
                                 <th>Current location</th>
                                 <th>&nbsp;</th>
-                                <th>&nbsp;</th>
-                                <th>&nbsp;</th>
-                                <th>&nbsp;</th>
                             </tr>
 
                             [% FOREACH collectionsLoo IN collectionsLoop %]
@@ -48,10 +53,18 @@
                                     <td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% collectionsLoo.colId %]">[% collectionsLoo.colTitle %]</a></td>
                                     <td>[% collectionsLoo.colDesc %]</td>
                                     <td>[% Branches.GetName( collectionsLoo.colBranchcode ) %]</td>
-                                    <td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% collectionsLoo.colId %]">Add or remove items</a></td>
-                                    <td><a href="/cgi-bin/koha/rotating_collections/transferCollection.pl?colId=[% collectionsLoo.colId %]">Transfer</a></td>
-                                    <td><a href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=edit&amp;colId=[% collectionsLoo.colId %]">Edit</a></td>
-                                    <td><a class="confirmdelete" href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]">Delete</a></td>
+                                    <td>
+                                    <div class="dropdown">
+                                        <a class="btn btn-mini" dropdown-toggle" id="collectionsactions[% collectionsLoo.colId %]" role="button" data-toggle="dropdown" href="#">
+                                        Actions <b class="caret"></b></a>
+                                        <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="collectionsactions[% collectionsLoo.colId %]">
+                                            <li><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% collectionsLoo.colId %]"><i class="fa fa-plus"></i> Add or remove items</a></li>
+                                            <li><a href="/cgi-bin/koha/rotating_collections/transferCollection.pl?colId=[% collectionsLoo.colId %]"><i class="fa fa-exchange"></i> Transfer</a></li>
+                                            <li><a href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=edit&amp;colId=[% collectionsLoo.colId %]"><i class="fa fa-pencil"></i> Edit</a></li>
+                                            <li><a class="confirmdelete" href="/cgi-bin/koha/rotating_collections/editCollections.pl?action=delete&amp;colId=[% collectionsLoo.colId %]"><i class="fa fa-trash"></i> Delete</a></li>
+                                        </ul>
+                                    </div>
+                                    </td>
                                 </tr>
                             [% END %]
                         </table>
-- 
1.7.10.4