Bug 14915: Use Font Awesome instead of Glyphicons for the staff intranet
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / virtualshelves / shelves.tt
index bba00b3..5a29ca7 100644 (file)
@@ -1,6 +1,19 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; [% IF ( viewshelf ) %]Lists &rsaquo; Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list [% shelfname | html %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
+
+[% IF print %]
+<script type="text/javascript">
+    $( document ).ready(function() {
+        window.print();
+        setTimeout('window.close()', 1);
+    });
+</script>
+[% END %]
+
 [% IF ( viewshelf ) %]
     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to remove this list?");
+
+[% IF op == 'list' %]
+$(document).ready(function(){
+    var type = 1;
+    var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        'bServerSide': true,
+        'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search",
+        'fnServerData': function(sSource, aoData, fnCallback) {
+            aoData.push({
+                'name': 'type',
+                'value': type,
+            },{
+                'name': 'shelfname',
+                'value': $("#searchshelfname_filter").val(),
+            },{
+                'name': 'owner',
+                'value': $("#searchowner_filter").val(),
+            },{
+                'name': 'sortby',
+                'value': $("#searchsortby_filter").val(),
+            },{
+                'name': 'template_path',
+                'value': 'virtualshelves/tables/shelves_results.tt',
+            });
+            $.ajax({
+                'dataType': 'json',
+                'type': 'POST',
+                'url': sSource,
+                'data': aoData,
+                'success': function(json){
+                    fnCallback(json);
+                }
+            });
+        },
+        'aoColumns':[
+            { 'mDataProp': 'dt_type' },
+            { 'mDataProp': 'dt_shelfname' },
+            { 'mDataProp': 'dt_count' },
+            { 'mDataProp': 'dt_owner' },
+            { 'mDataProp': 'dt_sortby' },
+            { 'mDataProp': 'dt_created_on' },
+            { 'mDataProp': 'dt_modification_time' },
+            { 'mDataProp': 'dt_action', 'bSortable': false }
+        ],
+        "aoColumnDefs": [
+            { "bVisible": false, "aTargets": [ 'NoVisible' ] }
+        ],
+        'bAutoWidth': false,
+        'sPaginationType': 'full_numbers',
+        'bFilter': false,
+        "bProcessing": true,
+        "bSortCellsTop": true
+    }));
+
+    dtListResults.fnAddFilters("filter", 750);
+
+    var tabs = $("#tabs").tabs({
+        activate: function(e, ui) {
+            var active = tabs.tabs("option", "active" );
+            if ( active == 0 ) {
+                type = 1; // private
+                dtListResults.fnDraw();
+            } else if ( active == 1 ) {
+                type = 2; // public
+                dtListResults.fnDraw();
+            }
+        }
+    });
+});
+[% END %]
+
 [% IF ( viewshelf ) %]
 $(document).ready(function(){
     [% IF ( itemsloop ) %]$('#searchheader').fixFloat();[% END %]
@@ -218,9 +302,11 @@ function placeHold () {
 
 [% IF ( viewshelf ) %]&rsaquo; Contents of <i>[% shelfname | html %]</i>[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list <i>[% shelfname | html %]</i>[% END %]</div>
 
-<div id="doc2" class="yui-t7">
- <div id="bd">
-  <div id="yui-main">
+<div id="doc3" class="yui-t2">
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">
+
    <div class="yui-g">[% INCLUDE 'virtualshelves-toolbar.inc' %]
    </div>
 [% IF ( paramsloop ) %]
@@ -282,7 +368,7 @@ function placeHold () {
     [% SET new_direction = 'asc' %]
 [% END %]
 
-<div id="searchheader">
+<div id="searchheader" class="noprint">
     [% IF ( itemsloop ) %]
         <div id="selection_ops"><span class="checkall"></span> |
         <span class="clearall"></span>
@@ -290,12 +376,12 @@ function placeHold () {
         <span class="addto">| </span>
         &nbsp;
         [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %]
-            <div class="btn-group"><button class="btn btn-mini placehold"><i class="icon-hold"></i> Place hold</button></div>
+            <div class="btn-group"><button class="btn btn-mini placehold"><i class="fa fa-hold"></i> Place hold</button></div>
         [% END %]
         [% IF ( allowremovingitems ) %]
-            <div class="btn-group"><button type="submit" class="btn btn-mini list-remove"><i class="icon-remove-sign"></i> Remove selected</button></div>
+            <div class="btn-group"><button type="submit" class="btn btn-mini list-remove"><i class="fa fa-remove-sign"></i> Remove selected</button></div>
         [% END %]
-        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-mini merge-items"><i class="icon-merge"></i> Merge selected</button></div>[% END %]
+        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<div class="btn-group"><button type="submit" class="btn btn-mini merge-items"><i class="fa fa-merge"></i> Merge selected</button></div>[% END %]
         </div>
     [% END %]
 </div>
@@ -399,25 +485,6 @@ function placeHold () {
    </div>
 [% END %]<!-- /viewshelf -->
 
-[% IF ( allowaddingitem ) %]
-<div class="yui-g">
-<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
- <fieldset class="brief">
-    <legend>Add an item to <i>[% shelfname | html %]</i></legend>
-        <ol>
-            <li>
-                <label for="addbarcode">Barcode:</label>
-                <input name="addbarcode" type="text" id="addbarcode" size="14" />
-                <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
-                <input type="hidden" name="modifyshelfcontents" value="1" />
-                <input type="submit" value="Add" />
-            </li>
-        </ol>
- </fieldset>
-</form>
-</div>
-[% END %]<!-- /allowaddingitem -->
-
 [% IF ( debug ) %]
   [% IF ( edit ) %]<div>Edit is on ([% shelfname | html %])</div>[% END %]
   [% IF ( seflag ) %]<div>seflag is on ([% seflag %])</div>[% END %]
@@ -514,123 +581,50 @@ function placeHold () {
 </div>
 [% END %]<!-- /seflag -->
 
-[% UNLESS ( vseflag ) %]
-        <h2>Lists</h2>
-        <div class="statictabs">
+[% IF op == 'list' %]
+    <h2>Lists</h2>
+    <div id="tabs" class="toptabs">
         <ul>
-        [% IF ( showprivateshelves ) %]
-            <li id="privateshelves_tab" class="active"><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a></li>
-        [% ELSE %]
-            <li id="privateshelves_tab" class=""><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=privateshelves">Your lists</a></li>
-        [% END %]
-        [% IF ( showpublicshelves ) %]
-            <li id="publicshelves_tab" class="active"><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a></li>
-        [% ELSE %]
-            <li id="publicshelves_tab" class=""><a href="/cgi-bin/koha/virtualshelves/shelves.pl?display=publicshelves">Public lists</a></li>
-        [% END %]
+            <li id="privateshelves_tab" class="active"><a href="#tab_content">Your lists</a></li>
+            <li id="publicshelves_tab" class="active"><a href="#tab_content">Public lists</a></li>
         </ul>
-        [% IF ( showprivateshelves ) %]
-        <div id="privateshelves" class="tabs-container" style="display:block;">
-               [% ELSE %]
-        <div id="privateshelves" class="tabs-container" style="display:none;">
-               [% END %]
-            [% IF ( shelveslooppriv ) %]
-                       <div class="pages">[% pagination_bar %]</div>
-                       <table>
-                       <tr><th>List Name</th><th>Contents</th><th>Sort by</th><th>Type</th><th>Options</th></tr>
-                [% FOREACH shelveslooppri IN shelveslooppriv %]
-                    [% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-        <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
-        <td>[% shelveslooppri.count %] item(s)</td>
-        <td>[% IF ( shelveslooppri.sortfield == "author" ) %]Author[% ELSIF ( shelveslooppri.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelveslooppri.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
-        <td>[% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %]
-                       [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
-               </td>
-        <td>
-            [% IF ( shelveslooppri.mine ) %]
-                               <form action="merge.pl" method="get">
-                                       <input type="hidden" name="shelf" value="[% shelveslooppri.shelf %]" />
-                               </form>
-                               <form action="shelves.pl" method="get">
-                                       <input type="hidden" name="shelfnumber" value="[% shelveslooppri.shelf %]" />
-                                       <input type="hidden" name="op" value="modif" />
-                    <input type="hidden" name="display" value="privateshelves" />
-                                       <input type="submit" class="editshelf" value="Edit" />
-                               </form>
-                               <form action="shelves.pl" method="post">
-                                   <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
-                                       <input type="hidden" name="shelves" value="1" />
-                    <input type="hidden" name="display" value="privateshelves" />
-                                       <input type="hidden" name="DEL-[% shelveslooppri.shelf %]" value="1" />
-                                       [% IF ( shelveslooppri.confirm ) %]
-                                       <input type="hidden" name="CONFIRM-[% shelveslooppri.confirm %]" value="1" />
-                                       <input type="submit" class="approve" value="Confirm" />
-                                       [% ELSE %]
-                    <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
-                                       [% END %]
-                               </form>
-                       [% ELSE %]
-                               None
-                       [% END %]
-               </td>
-               </tr>
-                [% END %]
-        </table>
-            [% ELSE %]
-            <p>No private lists.</p>
-            [% END %]<!-- /shelveslooppriv -->
-               </div><!-- /privateshelves -->
-
-        [% IF ( showpublicshelves ) %]
-        <div id="publicshelves" class="tabs-container" style="display:block;">
-               [% ELSE %]
-        <div id="publicshelves" class="tabs-container" style="display:none;">
-               [% END %]
-        [% IF ( shelvesloop ) %]
-               <div class="pages">[% pagination_bar %]</div>
-        <table>
-        <tr><th>List Name</th><th>Created by</th><th>Contents</th><th>Sort By</th><th>Type</th><th>Options</th></tr>
-            [% FOREACH shelvesloo IN shelvesloop %]
-                [% IF ( shelvesloo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-               <td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
-        <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
-               <td>[% shelvesloo.count %] item(s)</td>
-        <td>[% IF ( shelvesloo.sortfield == "author" ) %]Author[% ELSIF ( shelvesloo.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelvesloo.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
-        <td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
-                       [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
-               </td>
-        <td>
-            [% IF shelvesloo.manageshelf %]
-                               <form action="shelves.pl" method="get">
-                                       <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
-                                       <input type="hidden" name="op" value="modif" />
-                                       <input type="submit" class="editshelf" value="Edit" />
-                               </form>
-            [% END %]
-            [% IF shelvesloo.manageshelf OR shelvesloo.allowdeletingshelf %]
-                               <form action="shelves.pl" method="post">
-                                       <input type="hidden" name="shelfoff" value="[% shelfoff %]" />
-                                       <input type="hidden" name="shelves" value="1" />
-                                       <input type="hidden" name="DEL-[% shelvesloo.shelf %]" value="1" />
-                                       [% IF ( shelvesloo.confirm ) %]
-                                       <input type="hidden" name="CONFIRM-[% shelvesloo.confirm %]" value="1" />
-                                       <input type="submit" class="approve" value="Confirm" />
-                                       [% ELSE %]
-                    <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" />
-                                       [% END %]
-                               </form>
-                       [% ELSE %]
-                               None
-                       [% END %]
-               </td>
-               </tr>
-            [% END %]
-        </table>
-        [% ELSE %]
-            [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
-        [% END %]<!-- /shelvesloop -->
-        </div><!-- /publicshelves -->
-               </div>
+
+        <div id="tab_content">
+            <table id="listresultst">
+                <thead>
+                    <tr>
+                        <th class="NoVisible">Type</th>
+                        <th>List name</th>
+                        <th>Contents</th>
+                        <th>Owner</th>
+                        <th>Sort by</th>
+                        <th>Creation date</th>
+                        <th>Modification date</th>
+                        <th>Actions</th>
+                    </tr>
+                    <tr class="filters_row">
+                        <th></th>
+                        <th><input class="filter text_filter" id="searchshelfname_filter" placeholder="List name"></th>
+                        <th></th>
+                        <th><input class="filter text_filter" id="searchowner_filter" placeholder="Owner"></th>
+                        <th>
+                            <select class="filter text_filter" id="searchsortby_filter">
+                                <option value=""></option>
+                                <option value="title">Title</option>
+                                <option value="author">Author</option>
+                                <option value="copyrightdate">Copyrightdate</option>
+                                <option value="itemcallnumber">Call number</option>
+                            </select>
+                        </th>
+                        <th></th>
+                        <th></th>
+                        <th></th>
+                    </tr>
+                </thead>
+                <tbody></tbody>
+            </table>
+        </div>
+    </div>
 [% END %]
 
 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
@@ -641,4 +635,27 @@ function placeHold () {
 
 </div>
 </div>
+
+[% IF ( allowaddingitem ) %]
+<div class="yui-b">
+  <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
+    <fieldset class="brief">
+      <legend>Add an item</legend>
+      <ol>
+        <li>
+          <label for="addbarcode">Barcode:</label>
+          <input name="addbarcode" type="text" id="addbarcode" class="focus" />
+          <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
+          <input type="hidden" name="modifyshelfcontents" value="1" />
+        </li>
+      </ol>
+      <fieldset class="action">
+        <input type="submit" value="Add" />
+      </fieldset>
+    </fieldset>
+  </form>
+</div>
+[% END %]<!-- /allowaddingitem -->
+
+</div>
 [% INCLUDE 'intranet-bottom.inc' %]