1 $(document).ready(function() {
2 // Don't load holds table unless it is clicked on
4 $("#holds-tab").click( function() {
6 holdsTable = $("#holds-table").dataTable({
8 "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
11 "mDataProp": "reservedate_formatted"
14 "mDataProp": function ( oObj ) {
15 title = "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber="
20 $.each(oObj.subtitle, function( index, value ) {
21 title += " " + value.subfield;
27 title += " " + BY.replace( "_AUTHOR_", oObj.author );
30 if ( oObj.itemnotes ) {
32 if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
33 span_class = "circ-hlt";
35 title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
42 "mDataProp": function( oObj ) {
43 return oObj.itemcallnumber || "";
47 "mDataProp": function( oObj ) {
50 if ( oObj.suspend == 1 ) {
51 data += "<p>" + HOLD_IS_SUSPENDED;
52 if ( oObj.suspend_until ) {
53 data += " " + UNTIL.format( oObj.suspend_until_formatted );
60 if ( oObj.found == "W" ) {
61 data += ITEM_IS_WAITING;
63 if ( ! oObj.waiting_here ) {
64 data += " " + AT.format( oObj.waiting_at );
66 } else if ( oObj.transferred ) {
67 data += ITEM_IS_IN_TRANSIT.format( oObj.from_branch );
68 } else if ( oObj.not_transferred ) {
69 data += NOT_TRANSFERRED_YET.format( oObj.not_transferred_by );
73 data += " <a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
87 { "mDataProp": "expirationdate_formatted" },
89 "mDataProp": function( oObj ) {
90 if ( oObj.priority && parseInt( oObj.priority ) && parseInt( oObj.priority ) > 0 ) {
99 "mDataProp": function( oObj ) {
100 return "<select name='rank-request'>"
101 + "<option value='n'>" + NO + "</option>"
102 + "<option value='del'>" + YES + "</option>"
104 + "<input type='hidden' name='biblionumber' value='" + oObj.biblionumber + "'>"
105 + "<input type='hidden' name='borrowernumber' value='" + borrowernumber + "'>"
106 + "<input type='hidden' name='reserve_id' value='" + oObj.reserve_id + "'>";
112 "bServerSide": false,
113 "sAjaxSource": '/cgi-bin/koha/svc/holds',
114 "fnServerData": function ( sSource, aoData, fnCallback ) {
115 aoData.push( { "name": "borrowernumber", "value": borrowernumber } );
117 $.getJSON( sSource, aoData, function (json) {
123 if ( $("#holds-table").length ) {
124 $("#holds-table_processing").position({
125 of: $( "#holds-table" ),