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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (-42 lines)
Lines 127-171 Link Here
127
    </div>
127
    </div>
128
  </div>
128
  </div>
129
</div>
129
</div>
130
131
<!-- Resolve Return Claim Modal -->
132
<div class="modal fade" id="claims-returned-resolved-modal" tabindex="-1" role="dialog" aria-labelledby="claims-returned-resolved-modal-label">
133
  <div class="modal-dialog" role="document">
134
    <div class="modal-content">
135
      <div class="modal-header">
136
        <h4 class="modal-title" id="claims-returned-resolved-modal-label">Resolve return claim</h4>
137
      </div>
138
      <div class="modal-body">
139
140
          <div class="form-group">
141
            <label for="claims-returned-resolved-code">Resolution</label>
142
            [% SET resolutions = AuthorisedValues.GetAuthValueDropbox('RETURN_CLAIM_RESOLUTION') %]
143
            <select class="form-control" id="claims-returned-resolved-modal-resolved-code">
144
              [% FOREACH r IN resolutions %]
145
                  <option value="[% r.authorised_value | html %]">[% r.lib | html %]</option>
146
              [% END %]
147
            </select>
148
149
            <label for="new_lost_status">New item lost value:</label>
150
            [% SET itemlost = AuthorisedValues.GetAuthValueDropbox('LOST') %]
151
            <select class="form-control" id="new_lost_status">
152
              <option value="0">(Not lost)</option>
153
              [% FOREACH lost IN itemlost %]
154
                  <option value="[% lost.authorised_value | html %]">[% lost.lib | html %]</option>
155
              [% END %]
156
            </select>
157
          </div>
158
159
          <input type="hidden" id="claims-returned-resolved-modal-id"/>
160
      </div>
161
      <div class="modal-footer">
162
        <button id="claims-returned-resolved-modal-btn-submit" type="button" class="btn btn-primary">
163
          <i id="claims-returned-resolved-modal-btn-submit-icon" class="fa fa-exclamation-circle"></i>
164
          <i id="claims-returned-resolved-modal-btn-submit-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i>
165
          Resolve claim
166
         </button>
167
        <button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
168
      </div>
169
    </div>
170
  </div>
171
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/resolve_return_claim.inc (+42 lines)
Line 0 Link Here
1
<!-- Resolve Return Claim Modal -->
2
<div class="modal fade" id="claims-returned-resolved-modal" tabindex="-1" role="dialog" aria-labelledby="claims-returned-resolved-modal-label">
3
  <div class="modal-dialog" role="document">
4
    <div class="modal-content">
5
      <div class="modal-header">
6
        <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
7
        <h4 class="modal-title" id="claims-returned-resolved-modal-label">Resolve return claim</h4>
8
      </div>
9
      <div class="modal-body">
10
11
          <div class="form-group">
12
            <label for="claims-returned-resolved-code">Resolution</label>
13
            [% SET resolutions = AuthorisedValues.GetAuthValueDropbox('RETURN_CLAIM_RESOLUTION') %]
14
            <select class="form-control" id="claims-returned-resolved-modal-resolved-code">
15
              [% FOREACH r IN resolutions %]
16
                  <option value="[% r.authorised_value | html %]">[% r.lib | html %]</option>
17
              [% END %]
18
            </select>
19
20
            <label for="new_lost_status">New item lost value:</label>
21
            [% SET itemlost = AuthorisedValues.GetAuthValueDropbox('LOST') %]
22
            <select class="form-control" id="new_lost_status">
23
              <option value="0">(Not lost)</option>
24
              [% FOREACH lost IN itemlost %]
25
                  <option value="[% lost.authorised_value | html %]">[% lost.lib | html %]</option>
26
              [% END %]
27
            </select>
28
          </div>
29
30
          <input type="hidden" id="claims-returned-resolved-modal-id"/>
31
      </div>
32
      <div class="modal-footer">
33
        <button id="claims-returned-resolved-modal-btn-submit" type="button" class="btn btn-primary">
34
          <i id="claims-returned-resolved-modal-btn-submit-icon" class="fa fa-exclamation-circle"></i>
35
          <i id="claims-returned-resolved-modal-btn-submit-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i>
36
          Resolve claim
37
         </button>
38
        <button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
39
      </div>
40
    </div>
41
  </div>
42
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+7 lines)
Lines 932-937 Link Here
932
            </div> <!-- /.row -->
932
            </div> <!-- /.row -->
933
        </main>
933
        </main>
934
934
935
        [% IF Koha.Preference('ClaimReturnedLostValue') %]
936
            [% INCLUDE 'modals/resolve_return_claim.inc' %]
937
        [% END %]
938
935
<!-- Modal -->
939
<!-- Modal -->
936
<div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
940
<div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
937
    <div class="modal-dialog">
941
    <div class="modal-dialog">
Lines 978-983 Link Here
978
    </script>
982
    </script>
979
    [% Asset.js("js/pages/circulation.js") | $raw %]
983
    [% Asset.js("js/pages/circulation.js") | $raw %]
980
    [% Asset.js("js/checkouts.js") | $raw %]
984
    [% Asset.js("js/checkouts.js") | $raw %]
985
    [% IF Koha.Preference('ClaimReturnedLostValue') %]
986
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
987
    [% END %]
981
    [% Asset.js("js/holds.js") | $raw %]
988
    [% Asset.js("js/holds.js") | $raw %]
982
    <script>
989
    <script>
983
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
990
        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +12 lines)
Lines 192-198 Link Here
192
                                    <ul>
192
                                    <ul>
193
                                        [% FOREACH rc IN ReturnClaims %]
193
                                        [% FOREACH rc IN ReturnClaims %]
194
                                            <li>
194
                                            <li>
195
                                                [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %]
195
                                                [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %] <a class="btn btn-default btn-xs return-claim-tools-resolve" role="button" data-return-claim-id="[% rc.id | html %]" data-current-lost-status="0"><i class="fa fa-check-square"></i> Resolve</a>
196
                                            </li>
196
                                            </li>
197
                                        [% END %]
197
                                        [% END %]
198
                                    </ul>
198
                                    </ul>
Lines 983-994 Link Here
983
            </div> <!-- /.col-sm-12 -->
983
            </div> <!-- /.col-sm-12 -->
984
        </div> <!-- /.row -->
984
        </div> <!-- /.row -->
985
985
986
    [% IF ( ReturnClaims ) %]
987
        [% INCLUDE 'modals/resolve_return_claim.inc' %]
988
    [% END %]
989
986
[% MACRO jsinclude BLOCK %]
990
[% MACRO jsinclude BLOCK %]
987
    [% INCLUDE 'datatables.inc' %]
991
    [% INCLUDE 'datatables.inc' %]
988
    [% INCLUDE 'columns_settings.inc' %]
992
    [% INCLUDE 'columns_settings.inc' %]
989
    [% INCLUDE 'calendar.inc' %]
993
    [% INCLUDE 'calendar.inc' %]
990
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
994
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
991
    [% Asset.js("js/pages/circulation.js") | $raw %]
995
    [% Asset.js("js/pages/circulation.js") | $raw %]
996
    [% IF ( ReturnClaims ) %]
997
        <script>
998
            /* Set a variable needed by resolve_claim_modal.js */
999
            var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1000
        </script>
1001
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1002
    [% END %]
992
    [% INCLUDE 'timepicker.inc' %]
1003
    [% INCLUDE 'timepicker.inc' %]
993
1004
994
    <script>
1005
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+7 lines)
Lines 853-858 Link Here
853
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
853
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
854
        </div> <!-- /.row -->
854
        </div> <!-- /.row -->
855
855
856
        [% IF Koha.Preference('ClaimReturnedLostValue') %]
857
            [% INCLUDE 'modals/resolve_return_claim.inc' %]
858
        [% END %]
859
856
[% MACRO jsinclude BLOCK %]
860
[% MACRO jsinclude BLOCK %]
857
    [% INCLUDE 'datatables.inc' %]
861
    [% INCLUDE 'datatables.inc' %]
858
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
862
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
Lines 885-890 Link Here
885
    </script>
889
    </script>
886
    [% Asset.js("js/pages/circulation.js") | $raw %]
890
    [% Asset.js("js/pages/circulation.js") | $raw %]
887
    [% Asset.js("js/checkouts.js") | $raw %]
891
    [% Asset.js("js/checkouts.js") | $raw %]
892
    [% IF Koha.Preference('ClaimReturnedLostValue') %]
893
        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
894
    [% END %]
888
    [% Asset.js("js/holds.js") | $raw %]
895
    [% Asset.js("js/holds.js") | $raw %]
889
    [% INCLUDE 'str/members-menu.inc' %]
896
    [% INCLUDE 'str/members-menu.inc' %]
890
    [% Asset.js("js/members-menu.js") | $raw %]
897
    [% Asset.js("js/members-menu.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-42 lines)
Lines 1185-1232 $(document).ready(function() { Link Here
1185
        }
1185
        }
1186
    });
1186
    });
1187
1187
1188
    // Handle return claim resolution
1189
    $('body').on('click', '.return-claim-tools-resolve', function() {
1190
        let id = $(this).data('return-claim-id');
1191
        let current_lost_status = $(this).data('current-lost-status');
1192
1193
        $('#claims-returned-resolved-modal-id').val(id);
1194
        $("#new_lost_status").val(current_lost_status);
1195
        let selected_option = $("#new_lost_status option:selected");
1196
        $(selected_option).text(_("%s (current status)").format($(selected_option).text()));
1197
        $('#claims-returned-resolved-modal').modal()
1198
    });
1199
1200
    $(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e) {
1201
        let resolution = $('#claims-returned-resolved-modal-resolved-code').val();
1202
        let new_lost_status = $('#new_lost_status').val();
1203
        let id = $('#claims-returned-resolved-modal-id').val();
1204
1205
        $('#claims-returned-resolved-modal-btn-submit-spinner').show();
1206
        $('#claims-returned-resolved-modal-btn-submit-icon').hide();
1207
1208
        params = {
1209
            resolution: resolution,
1210
            resolved_by: logged_in_user_borrowernumber,
1211
            new_lost_status: new_lost_status
1212
        };
1213
1214
        $.ajax({
1215
            url: '/api/v1/return_claims/' + id + '/resolve',
1216
            type: 'PUT',
1217
            data: JSON.stringify(params),
1218
            success: function( data ) {
1219
                $('#claims-returned-resolved-modal-btn-submit-spinner').hide();
1220
                $('#claims-returned-resolved-modal-btn-submit-icon').show();
1221
                $('#claims-returned-resolved-modal').modal('hide')
1222
1223
                refreshReturnClaimsTable();
1224
            },
1225
            contentType: "json"
1226
        });
1227
1228
    });
1229
1230
    $("#show_all_claims").on("click", function(e){
1188
    $("#show_all_claims").on("click", function(e){
1231
        e.preventDefault();
1189
        e.preventDefault();
1232
        $(".ctrl_link").removeClass("disabled");
1190
        $(".ctrl_link").removeClass("disabled");
(-)a/koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js (-1 / +40 lines)
Line 0 Link Here
0
- 
1
$('body').on('click', '.return-claim-tools-resolve', function() {
2
    let id = $(this).data('return-claim-id');
3
    let current_lost_status = $(this).data('current-lost-status');
4
5
    $('#claims-returned-resolved-modal-id').val(id);
6
    $("#new_lost_status").val(current_lost_status);
7
    let selected_option = $("#new_lost_status option:selected");
8
    $(selected_option).text(_("%s (current status)").format($(selected_option).text()));
9
    $('#claims-returned-resolved-modal').modal()
10
});
11
12
$(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e) {
13
    let resolution = $('#claims-returned-resolved-modal-resolved-code').val();
14
    let new_lost_status = $('#new_lost_status').val();
15
    let id = $('#claims-returned-resolved-modal-id').val();
16
17
    $('#claims-returned-resolved-modal-btn-submit-spinner').show();
18
    $('#claims-returned-resolved-modal-btn-submit-icon').hide();
19
20
    params = {
21
        resolution: resolution,
22
        resolved_by: logged_in_user_borrowernumber,
23
        new_lost_status: new_lost_status
24
    };
25
26
    $.ajax({
27
        url: '/api/v1/return_claims/' + id + '/resolve',
28
        type: 'PUT',
29
        data: JSON.stringify(params),
30
        success: function(data) {
31
            $('#claims-returned-resolved-modal-btn-submit-spinner').hide();
32
            $('#claims-returned-resolved-modal-btn-submit-icon').show();
33
            $('#claims-returned-resolved-modal').modal('hide')
34
35
            refreshReturnClaimsTable();
36
        },
37
        contentType: "json"
38
    });
39
40
});

Return to bug 29519