Bugzilla – Attachment 55201 Details for
Bug 8030
Change pickup location of a hold from patron record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 8030 (QA Followup) - Use REST api and provide feedback
PASSED-QA-Bug-8030-QA-Followup---Use-REST-api-and-.patch (text/plain), 4.74 KB, created by
Katrin Fischer
on 2016-09-05 20:28:16 UTC
(
hide
)
Description:
[PASSED QA] Bug 8030 (QA Followup) - Use REST api and provide feedback
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-09-05 20:28:16 UTC
Size:
4.74 KB
patch
obsolete
>From de7b2eff122494b5fba7730ff08653a4f5325e02 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 19 Aug 2016 20:51:07 +0000 >Subject: [PATCH] [PASSED QA] Bug 8030 (QA Followup) - Use REST api and provide > feedback > >Use REST API >If cancelled return to previous selection >If fail return to previous selection >Use fa spinning icon while waiting >Disable select while waiting > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 45 ++++++++++++++++++++++---------- > 1 file changed, 31 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index f2885a0..14ca154 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -101,11 +101,19 @@ $(document).ready(function() { > { > "mDataProp": function( oObj ) { > if( oObj.branches.length > 1 && oObj.found !== 'W' && oObj.found !== 'T' ){ >- var branchSelect='<select class="hold_location_select" reserve_id="'+oObj.reserve_id+'" name="pick-location">'; >+ var branchSelect='<select priority='+oObj.priority+' class="hold_location_select" reserve_id="'+oObj.reserve_id+'" name="pick-location">'; > for ( var i=0; i < oObj.branches.length; i++ ){ > var selectedbranch; >- if( oObj.branches[i].selected ){selectedbranch=" selected='selected' "}else{selectedbranch=''} >- branchSelect += '<option value="'+ oObj.branches[i].value +'"'+selectedbranch+'>'+oObj.branches[i].branchname+'</option>'; >+ var setbranch; >+ if( oObj.branches[i].selected ){ >+ selectedbranch = " selected='selected' "; >+ setbranch = " (set) "; >+ } >+ else{ >+ selectedbranch = ''; >+ setbranch = ''; >+ } >+ branchSelect += '<option value="'+ oObj.branches[i].value +'"'+selectedbranch+'>'+oObj.branches[i].branchname+setbranch+'</option>'; > } > branchSelect +='</select>'; > return branchSelect; >@@ -189,17 +197,26 @@ $(document).ready(function() { > > $(".hold_location_select").change(function(){ > if( confirm( _("Do you want to change the pickup location?") ) ){ >- $.post('/cgi-bin/koha/svc/hold/update_location', { "reserve_id": $(this).attr('reserve_id'), "updated_branch": $(this).val() }, function( data ){ >- if ( data.success ) { >- holdsTable.api().ajax.reload(); >- } >- else { >- if ( data.error == "HOLD_NOT_FOUND" ) { >- alert ( RESUME_HOLD_ERROR_NOT_FOUND ); >- holdsTable.api().ajax.reload(); >- } >- } >- }); >+ $(this).prop("disabled",true); >+ var cur_select = $(this); >+ $(this).after('<i id="holdwaiter" class="fa fa-circle-o-notch fa-spin fa-lg fa-fw"></i>'); >+ var api_url = '/api/v1/holds/'+$(this).attr('reserve_id'); >+ var update_info = JSON.stringify({ branchcode: $(this).val(), priority: parseInt($(this).attr("priority"),10) }); >+ $.ajax({ >+ method: "PUT", >+ url: api_url, >+ data: update_info , >+ success: function( data ){ holdsTable.api().ajax.reload(); }, >+ error: function( jqXHR, textStatus, errorThrown) { >+ alert('There was an error:'+textStatus+" "+errorThrown); >+ cur_select.prop("disabled",false); >+ $("#holdwaiter").remove(); >+ cur_select.val( cur_select.children('option[selected="selected"]').val() ); >+ }, >+ }); >+ } >+ else{ >+ $(this).val( $(this).children('option[selected="selected"]').val() ); > } > }); > >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8030
:
53046
|
53047
|
53508
|
54659
|
54712
|
55200
| 55201 |
55202
|
55448