|
Lines 44-50
Link Here
|
| 44 |
* |
44 |
* |
| 45 |
* It expects the select object to contain several data-* attributes |
45 |
* It expects the select object to contain several data-* attributes |
| 46 |
* - data-pickup-location-source: 'biblio', 'item' or 'hold' (default) |
46 |
* - data-pickup-location-source: 'biblio', 'item' or 'hold' (default) |
| 47 |
* - data-patron-id: required for 'biblio' and 'item' |
|
|
| 48 |
* - data-biblio-id: required for 'biblio' only |
47 |
* - data-biblio-id: required for 'biblio' only |
| 49 |
* - data-item-id: required for 'item' only |
48 |
* - data-item-id: required for 'item' only |
| 50 |
* |
49 |
* |
|
Lines 54-60
Link Here
|
| 54 |
$.fn.pickup_locations_dropdown = function () { |
53 |
$.fn.pickup_locations_dropdown = function () { |
| 55 |
var select = $(this); |
54 |
var select = $(this); |
| 56 |
var pickup_location_source = $(this).data("pickup-location-source"); |
55 |
var pickup_location_source = $(this).data("pickup-location-source"); |
| 57 |
var patron_id = $(this).data("patron-id"); |
|
|
| 58 |
var biblio_id = $(this).data("biblio-id"); |
56 |
var biblio_id = $(this).data("biblio-id"); |
| 59 |
var item_id = $(this).data("item-id"); |
57 |
var item_id = $(this).data("item-id"); |
| 60 |
var hold_id = $(this).data("hold-id"); |
58 |
var hold_id = $(this).data("hold-id"); |
|
Lines 63-80
Link Here
|
| 63 |
|
61 |
|
| 64 |
if (pickup_location_source === "biblio") { |
62 |
if (pickup_location_source === "biblio") { |
| 65 |
url = |
63 |
url = |
| 66 |
"/api/v1/biblios/" + |
64 |
"/api/v1/public/biblios/" + |
| 67 |
encodeURIComponent(biblio_id) + |
65 |
encodeURIComponent(biblio_id) + |
| 68 |
"/pickup_locations"; |
66 |
"/pickup_locations"; |
| 69 |
} else if (pickup_location_source === "item") { |
67 |
} else if (pickup_location_source === "item") { |
| 70 |
url = |
68 |
url = |
| 71 |
"/api/v1/items/" + |
69 |
"/api/v1/public/items/" + |
| 72 |
encodeURIComponent(item_id) + |
70 |
encodeURIComponent(item_id) + |
| 73 |
"/pickup_locations"; |
71 |
"/pickup_locations"; |
| 74 |
} else { |
72 |
} else { |
| 75 |
// hold |
73 |
// hold |
| 76 |
url = |
74 |
url = |
| 77 |
"/api/v1/holds/" + |
75 |
"/api/v1/public/holds/" + |
| 78 |
encodeURIComponent(hold_id) + |
76 |
encodeURIComponent(hold_id) + |
| 79 |
"/pickup_locations"; |
77 |
"/pickup_locations"; |
| 80 |
} |
78 |
} |
|
Lines 98-107
Link Here
|
| 98 |
_page: params.page, |
96 |
_page: params.page, |
| 99 |
}; |
97 |
}; |
| 100 |
|
98 |
|
| 101 |
if (pickup_location_source !== "hold") { |
|
|
| 102 |
query["patron_id"] = patron_id; |
| 103 |
} |
| 104 |
|
| 105 |
return query; |
99 |
return query; |
| 106 |
}, |
100 |
}, |
| 107 |
processResults: function (data) { |
101 |
processResults: function (data) { |
| 108 |
- |
|
|