Koha: support reserve_mode "single"
@@ -363,6 +363,14 @@ open class Koha : OkHttpBaseApi() {
val body = FormBody.Builder()
body.add("place_reserve", "1")
+ if (doc.select("input[name=reserve_mode]").`val`() == "single") {
+ // reserve_mode "single" - seems to only appear for staff accounts in Heilbronn
+ body.add("biblionumbers", "")
+ body.add("selecteditems", "")
+ body.add("reserve_mode", "single")
+ body.add("single_bib", item.id)
+ body.add("expiration_date_${item.id}", "")
+ } else {
body.add("biblionumbers", "${item.id}/")
body.add("reserve_mode", "multi")
body.add("single_bib", item.id)
@@ -408,6 +416,7 @@ open class Koha : OkHttpBaseApi() {
return OpacApi.ReservationResult(OpacApi.MultiStepResult.Status.ERROR,
doc.select(".holdrow .alert").text().trim())
}
+ }
doc = httpPost("$baseurl/cgi-bin/koha/opac-reserve.pl", body.build(), ENCODING).html
