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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (-4 / +7 lines)
Lines 317-322 Link Here
317
[% MACRO jsinclude BLOCK %]
317
[% MACRO jsinclude BLOCK %]
318
    <script>
318
    <script>
319
        var active_table = "#article-requests-pending";
319
        var active_table = "#article-requests-pending";
320
        var last_cancel_reason;
320
        $(document).ready(function() {
321
        $(document).ready(function() {
321
            $('#article-request-tabs').tabs({
322
            $('#article-request-tabs').tabs({
322
                activate: function( activate_event, activate_ui ) {
323
                activate: function( activate_event, activate_ui ) {
Lines 376-381 Link Here
376
        }
377
        }
377
378
378
        function HandleMulti( fnHandler, id, a ) {
379
        function HandleMulti( fnHandler, id, a ) {
380
            last_cancel_reason = undefined;
379
            if( id !== 0 ) { fnHandler( id, a ); return; }
381
            if( id !== 0 ) { fnHandler( id, a ); return; }
380
            $( active_table + " input[type='checkbox']:checked").each(function() {
382
            $( active_table + " input[type='checkbox']:checked").each(function() {
381
                fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
383
                fnHandler( $(this).attr('reqid'), $(this).closest('tr').find('td.ar-actions div a') );
Lines 388-395 Link Here
388
        }
390
        }
389
391
390
        function Cancel( id, a ) {
392
        function Cancel( id, a ) {
391
            notes = prompt(_("Reason for cancellation:"));
393
            // last_cancel_reason: undefined means 'prompt for new reason'
392
            if ( notes == null ) {
394
            // a null value indicates that prompt was cancelled
395
            if( last_cancel_reason === undefined ) last_cancel_reason = prompt(_("Please specify the reason for cancelling selected item(s):"));
396
            if ( last_cancel_reason === null ) {
393
                return;
397
                return;
394
            }
398
            }
395
399
Lines 400-406 Link Here
400
                data: {
404
                data: {
401
                    action: 'cancel',
405
                    action: 'cancel',
402
                    id: id,
406
                    id: id,
403
                    notes: notes
407
                    notes: last_cancel_reason
404
                },
408
                },
405
                success: function( data ) {
409
                success: function( data ) {
406
                    a.closest('tr').remove();
410
                    a.closest('tr').remove();
407
- 

Return to bug 20468