View | Details | Raw Unified | Return to bug 27296
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-1 / +4 lines)
Lines 60-66 a { Link Here
60
        }
60
        }
61
    }
61
    }
62
62
63
64
    &.csv {
63
    &.csv {
65
        background-image: url("../img/famfamfam/silk/page_white_excel.png");
64
        background-image: url("../img/famfamfam/silk/page_white_excel.png");
66
    }
65
    }
Lines 123-128 a { Link Here
123
    }
122
    }
124
123
125
}
124
}
125
a.ctrl_link {
126
    display: inline-block;
127
    padding-right: 1rem;
128
}
126
129
127
aside {
130
aside {
128
    h5 {
131
    h5 {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc (-1 / +11 lines)
Lines 1-14 Link Here
1
<div id="return-claims">
1
<div id="return-claims">
2
    <p id="return-claims-controls">
3
        [% IF ( patron.return_claims.resolved.count > 0 || patron.return_claims.unresolved.count > 0 ) %]
4
            <a id="show_all_claims" class="ctrl_link" href="#">Show all [% patron.return_claims.count | html %] claim(s)</a>
5
            <a id="show_unresolved_claims" class="ctrl_link disabled" href="#">Show [% patron.return_claims.unresolved.count | html %] unresolved claims</a>
6
        [% ELSE %]
7
            <a id="show_all_claims" class="ctrl_link" href="#"></a>
8
            <a id="show_unresolved_claims" class="ctrl_link disabled" href="#"></a>
9
        [% END %]
10
    </p>
2
  <table id="return-claims-table" class="table table-bordered table-striped">
11
  <table id="return-claims-table" class="table table-bordered table-striped">
3
      <thead>
12
      <thead>
4
          <tr>
13
          <tr>
5
              <th class="return-claim-id">Claim ID</th>
14
              <th class="return-claim-id">Claim ID</th>
15
              <th class="return-claim-id">Resolved?</th>
6
              <th class="return-claim-record-title anti-the">Title</th>
16
              <th class="return-claim-record-title anti-the">Title</th>
7
              <th class="return-claim-notes">Notes</th>
17
              <th class="return-claim-notes">Notes</th>
8
              <th class="return-claim-created-on">Created on</th>
18
              <th class="return-claim-created-on">Created on</th>
9
              <th class="return-claim-updated-on">Updated on</th>
19
              <th class="return-claim-updated-on">Updated on</th>
10
              <th class="return-claim-resolution">Resolution</th>
20
              <th class="return-claim-resolution">Resolution</th>
11
              <th class="return-claim-actions">&nbsp;</th>
21
              <th class="return-claim-actions NoSort">&nbsp;</th>
12
          </tr>
22
          </tr>
13
      </thead>
23
      </thead>
14
  </table>
24
  </table>
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-1 / +59 lines)
Lines 934-945 $(document).ready(function() { Link Here
934
                "bAutoWidth": false,
934
                "bAutoWidth": false,
935
                "sDom": "rt",
935
                "sDom": "rt",
936
                "aaSorting": [],
936
                "aaSorting": [],
937
                "aoColumnDefs": [
938
                    { "bSortable": false, "bSearchable": false, 'aTargets': ['NoSort'] },
939
                    { "sType": "anti-the", "aTargets": ["anti-the"] },
940
                ],
937
                "aoColumns": [
941
                "aoColumns": [
938
                    {
942
                    {
939
                        "mDataProp": "id",
943
                        "mDataProp": "id",
940
                        "bVisible": false,
944
                        "bVisible": false,
941
                    },
945
                    },
942
                    {
946
                    {
947
                        "mDataProp": function (oObj) {
948
                            if (oObj.resolution) {
949
                                return "is_resolved";
950
                            } else {
951
                                return "is_unresolved";
952
                            }
953
                        },
954
                        "bVisible": false,
955
                    },
956
                    {
943
                        "mDataProp": function ( oObj ) {
957
                        "mDataProp": function ( oObj ) {
944
                              let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">'
958
                              let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">'
945
                                  + oObj.title
959
                                  + oObj.title
Lines 1047-1056 $(document).ready(function() { Link Here
1047
                        fnCallback(json)
1061
                        fnCallback(json)
1048
                    } );
1062
                    } );
1049
                },
1063
                },
1064
                "search": { "search": "is_unresolved" },
1065
                "footerCallback": function (row, data, start, end, display) {
1066
                    var api = this.api();
1067
                    // Total over all pages
1068
                    var colData = api.column(1).data();
1069
                    var is_unresolved = 0;
1070
                    var is_resolved = 0;
1071
                    colData.each(function( index, value ){
1072
                        if( index == "is_unresolved" ){ is_unresolved++; }
1073
                        if (index == "is_resolved") { is_resolved++; }
1074
                    });
1075
                    // Update footer
1076
                    $("#return-claims-controls").html( showClaimFilter( is_unresolved, is_resolved ) )
1077
                }
1050
            });
1078
            });
1051
        }
1079
        }
1052
    }
1080
    }
1053
1081
1082
    function showClaimFilter( is_unresolved, is_resolved ){
1083
        var showAll, showUnresolved;
1084
        var total = Number( is_unresolved ) + Number( is_resolved );
1085
        if( total > 0 ){
1086
            showAll = __nx("Show 1 claim", "Show all {count} claims", total, { count: total });
1087
        } else {
1088
            showAll = "";
1089
        }
1090
        if( is_unresolved > 0 ){
1091
            showUnresolved = __nx("Show 1 unresolved claim", "Show {count} unresolved claims", is_unresolved, { count: is_unresolved })
1092
        } else {
1093
            showUnresolved = "";
1094
        }
1095
        $("#show_all_claims").html( showAll );
1096
        $("#show_unresolved_claims").html( showUnresolved );
1097
    }
1098
1054
    $('body').on('click', '.return-claim-tools-editnotes', function() {
1099
    $('body').on('click', '.return-claim-tools-editnotes', function() {
1055
        let id = $(this).data('return-claim-id');
1100
        let id = $(this).data('return-claim-id');
1056
        $('#return-claim-notes-static-' + id).parent().dblclick();
1101
        $('#return-claim-notes-static-' + id).parent().dblclick();
Lines 1155-1158 $(document).ready(function() { Link Here
1155
1200
1156
    });
1201
    });
1157
1202
1203
    $("#show_all_claims").on("click", function(e){
1204
        e.preventDefault();
1205
        $(".ctrl_link").removeClass("disabled");
1206
        $(this).addClass("disabled");
1207
        $("#return-claims-table").DataTable().search("").draw();
1208
    });
1209
1210
    $("#show_unresolved_claims").on("click", function (e) {
1211
        e.preventDefault();
1212
        $(".ctrl_link").removeClass("disabled");
1213
        $(this).addClass("disabled");
1214
        $("#return-claims-table").DataTable().search("is_unresolved").draw();
1215
    });
1216
1158
 });
1217
 });
1159
- 

Return to bug 27296