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 70-76 a { Link Here
70
        }
70
        }
71
    }
71
    }
72
72
73
74
    &.csv {
73
    &.csv {
75
        background-image: url("../img/famfamfam/silk/page_white_excel.png");
74
        background-image: url("../img/famfamfam/silk/page_white_excel.png");
76
    }
75
    }
Lines 133-138 a { Link Here
133
    }
132
    }
134
133
135
}
134
}
135
a.ctrl_link {
136
    display: inline-block;
137
    padding-right: 1rem;
138
}
136
139
137
aside {
140
aside {
138
    h5 {
141
    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 954-965 $(document).ready(function() { Link Here
954
                "bAutoWidth": false,
954
                "bAutoWidth": false,
955
                "sDom": "rt",
955
                "sDom": "rt",
956
                "aaSorting": [],
956
                "aaSorting": [],
957
                "aoColumnDefs": [
958
                    { "bSortable": false, "bSearchable": false, 'aTargets': ['NoSort'] },
959
                    { "sType": "anti-the", "aTargets": ["anti-the"] },
960
                ],
957
                "aoColumns": [
961
                "aoColumns": [
958
                    {
962
                    {
959
                        "mDataProp": "id",
963
                        "mDataProp": "id",
960
                        "bVisible": false,
964
                        "bVisible": false,
961
                    },
965
                    },
962
                    {
966
                    {
967
                        "mDataProp": function (oObj) {
968
                            if (oObj.resolution) {
969
                                return "is_resolved";
970
                            } else {
971
                                return "is_unresolved";
972
                            }
973
                        },
974
                        "bVisible": false,
975
                    },
976
                    {
963
                        "mDataProp": function ( oObj ) {
977
                        "mDataProp": function ( oObj ) {
964
                              let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">'
978
                              let title = '<a class="return-claim-title strong" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + oObj.biblionumber + '">'
965
                                  + oObj.title
979
                                  + oObj.title
Lines 1068-1077 $(document).ready(function() { Link Here
1068
                        fnCallback(json)
1082
                        fnCallback(json)
1069
                    } );
1083
                    } );
1070
                },
1084
                },
1085
                "search": { "search": "is_unresolved" },
1086
                "footerCallback": function (row, data, start, end, display) {
1087
                    var api = this.api();
1088
                    // Total over all pages
1089
                    var colData = api.column(1).data();
1090
                    var is_unresolved = 0;
1091
                    var is_resolved = 0;
1092
                    colData.each(function( index, value ){
1093
                        if( index == "is_unresolved" ){ is_unresolved++; }
1094
                        if (index == "is_resolved") { is_resolved++; }
1095
                    });
1096
                    // Update footer
1097
                    $("#return-claims-controls").html( showClaimFilter( is_unresolved, is_resolved ) )
1098
                }
1071
            });
1099
            });
1072
        }
1100
        }
1073
    }
1101
    }
1074
1102
1103
    function showClaimFilter( is_unresolved, is_resolved ){
1104
        var showAll, showUnresolved;
1105
        var total = Number( is_unresolved ) + Number( is_resolved );
1106
        if( total > 0 ){
1107
            showAll = __nx("Show 1 claim", "Show all {count} claims", total, { count: total });
1108
        } else {
1109
            showAll = "";
1110
        }
1111
        if( is_unresolved > 0 ){
1112
            showUnresolved = __nx("Show 1 unresolved claim", "Show {count} unresolved claims", is_unresolved, { count: is_unresolved })
1113
        } else {
1114
            showUnresolved = "";
1115
        }
1116
        $("#show_all_claims").html( showAll );
1117
        $("#show_unresolved_claims").html( showUnresolved );
1118
    }
1119
1075
    $('body').on('click', '.return-claim-tools-editnotes', function() {
1120
    $('body').on('click', '.return-claim-tools-editnotes', function() {
1076
        let id = $(this).data('return-claim-id');
1121
        let id = $(this).data('return-claim-id');
1077
        $('#return-claim-notes-static-' + id).parent().dblclick();
1122
        $('#return-claim-notes-static-' + id).parent().dblclick();
Lines 1182-1185 $(document).ready(function() { Link Here
1182
1227
1183
    });
1228
    });
1184
1229
1230
    $("#show_all_claims").on("click", function(e){
1231
        e.preventDefault();
1232
        $(".ctrl_link").removeClass("disabled");
1233
        $(this).addClass("disabled");
1234
        $("#return-claims-table").DataTable().search("").draw();
1235
    });
1236
1237
    $("#show_unresolved_claims").on("click", function (e) {
1238
        e.preventDefault();
1239
        $(".ctrl_link").removeClass("disabled");
1240
        $(this).addClass("disabled");
1241
        $("#return-claims-table").DataTable().search("is_unresolved").draw();
1242
    });
1243
1185
 });
1244
 });
1186
- 

Return to bug 27296