Lines 25-31
Link Here
|
25 |
var createProgressBar = document.getElementById("processed_progress_bar"); |
25 |
var createProgressBar = document.getElementById("processed_progress_bar"); |
26 |
var identifierTable = document.getElementById('identifier-table'); |
26 |
var identifierTable = document.getElementById('identifier-table'); |
27 |
var createRequestsButton = document.getElementById('create-requests-button'); |
27 |
var createRequestsButton = document.getElementById('create-requests-button'); |
28 |
var statusesSelect = document.getElementById('statuscode'); |
28 |
var statusesSelect = document.getElementById('status_code'); |
29 |
var cancelButton = document.getElementById('lhs').querySelector('button'); |
29 |
var cancelButton = document.getElementById('lhs').querySelector('button'); |
30 |
var cancelButtonOriginalText = cancelButton.innerHTML; |
30 |
var cancelButtonOriginalText = cancelButton.innerHTML; |
31 |
|
31 |
|
Lines 49-55
Link Here
|
49 |
backend: null, |
49 |
backend: null, |
50 |
cardnumber: '', |
50 |
cardnumber: '', |
51 |
branchcode: '', |
51 |
branchcode: '', |
52 |
statuscode: 'NEW' |
52 |
status_code: 'NEW' |
53 |
}; |
53 |
}; |
54 |
|
54 |
|
55 |
// The object that holds the batch we're working with |
55 |
// The object that holds the batch we're working with |
Lines 307-313
Link Here
|
307 |
} |
307 |
} |
308 |
|
308 |
|
309 |
var payload = { |
309 |
var payload = { |
310 |
batch_id: batchId, |
310 |
ill_batch_id: batchId, |
311 |
ill_backend_id: batch.data.backend, |
311 |
ill_backend_id: batch.data.backend, |
312 |
patron_id: batch.data.patron.patron_id, |
312 |
patron_id: batch.data.patron.patron_id, |
313 |
library_id: batch.data.library_id, |
313 |
library_id: batch.data.library_id, |
Lines 378-384
Link Here
|
378 |
var option = document.createElement('option') |
378 |
var option = document.createElement('option') |
379 |
option.value = status.code; |
379 |
option.value = status.code; |
380 |
option.text = status.name; |
380 |
option.text = status.name; |
381 |
if (batch.data.batch_id && batch.data.statuscode === status.code) { |
381 |
if (batch.data.ill_batch_id && batch.data.status_code === status.code) { |
382 |
option.selected = true; |
382 |
option.selected = true; |
383 |
} |
383 |
} |
384 |
statusesSelect.add(option); |
384 |
statusesSelect.add(option); |
Lines 479-485
Link Here
|
479 |
updateBatch() |
479 |
updateBatch() |
480 |
.then(function () { |
480 |
.then(function () { |
481 |
$('#ill-batch-modal').modal({ show: false }); |
481 |
$('#ill-batch-modal').modal({ show: false }); |
482 |
location.href = '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + batch.data.batch_id; |
482 |
location.href = '/cgi-bin/koha/ill/ill-requests.pl?batch_id=' + batch.data.ill_batch_id; |
483 |
}); |
483 |
}); |
484 |
}; |
484 |
}; |
485 |
|
485 |
|
Lines 509-520
Link Here
|
509 |
}) |
509 |
}) |
510 |
.then(function (jsoned) { |
510 |
.then(function (jsoned) { |
511 |
batch.data = { |
511 |
batch.data = { |
512 |
batch_id: jsoned.batch_id, |
512 |
ill_batch_id: jsoned.ill_batch_id, |
513 |
name: jsoned.name, |
513 |
name: jsoned.name, |
514 |
backend: jsoned.backend, |
514 |
backend: jsoned.backend, |
515 |
cardnumber: jsoned.cardnumber, |
515 |
cardnumber: jsoned.cardnumber, |
516 |
library_id: jsoned.library_id, |
516 |
library_id: jsoned.library_id, |
517 |
statuscode: jsoned.statuscode |
517 |
status_code: jsoned.status_code |
518 |
} |
518 |
} |
519 |
return jsoned; |
519 |
return jsoned; |
520 |
}) |
520 |
}) |
Lines 540-546
Link Here
|
540 |
backend: backend, |
540 |
backend: backend, |
541 |
cardnumber: cardnumberInput.value, |
541 |
cardnumber: cardnumberInput.value, |
542 |
library_id: selectedBranchcode, |
542 |
library_id: selectedBranchcode, |
543 |
statuscode: selectedStatuscode |
543 |
status_code: selectedStatuscode |
544 |
}) |
544 |
}) |
545 |
}) |
545 |
}) |
546 |
.then(function (response) { |
546 |
.then(function (response) { |
Lines 550-563
Link Here
|
550 |
return Promise.reject(response); |
550 |
return Promise.reject(response); |
551 |
}) |
551 |
}) |
552 |
.then(function (body) { |
552 |
.then(function (body) { |
553 |
batchId = body.batch_id; |
553 |
batchId = body.ill_batch_id; |
554 |
batch.data = { |
554 |
batch.data = { |
555 |
batch_id: body.batch_id, |
555 |
ill_batch_id: body.ill_batch_id, |
556 |
name: body.name, |
556 |
name: body.name, |
557 |
backend: body.backend, |
557 |
backend: body.backend, |
558 |
cardnumber: body.patron.cardnumber, |
558 |
cardnumber: body.patron.cardnumber, |
559 |
library_id: body.library_id, |
559 |
library_id: body.library_id, |
560 |
statuscode: body.statuscode, |
560 |
status_code: body.status_code, |
561 |
patron: body.patron, |
561 |
patron: body.patron, |
562 |
status: body.status |
562 |
status: body.status |
563 |
}; |
563 |
}; |
Lines 578-584
Link Here
|
578 |
var selectedBranchcode = branchcodeSelect.selectedOptions[0].value; |
578 |
var selectedBranchcode = branchcodeSelect.selectedOptions[0].value; |
579 |
var selectedStatuscode = statusesSelect.selectedOptions[0].value; |
579 |
var selectedStatuscode = statusesSelect.selectedOptions[0].value; |
580 |
|
580 |
|
581 |
return doBatchApiRequest('/' + batch.data.batch_id, { |
581 |
return doBatchApiRequest('/' + batch.data.ill_batch_id, { |
582 |
method: 'PUT', |
582 |
method: 'PUT', |
583 |
headers: { |
583 |
headers: { |
584 |
'Content-type': 'application/json' |
584 |
'Content-type': 'application/json' |
Lines 588-594
Link Here
|
588 |
backend: batch.data.backend, |
588 |
backend: batch.data.backend, |
589 |
cardnumber: batch.data.patron.cardnumber, |
589 |
cardnumber: batch.data.patron.cardnumber, |
590 |
library_id: selectedBranchcode, |
590 |
library_id: selectedBranchcode, |
591 |
statuscode: selectedStatuscode |
591 |
status_code: selectedStatuscode |
592 |
}) |
592 |
}) |
593 |
}) |
593 |
}) |
594 |
.catch(function () { |
594 |
.catch(function () { |
Lines 1045-1051
Link Here
|
1045 |
} |
1045 |
} |
1046 |
|
1046 |
|
1047 |
function manageBatchItemsDisplay() { |
1047 |
function manageBatchItemsDisplay() { |
1048 |
batchItemsDisplay.style.display = batch.data.batch_id ? 'block' : 'none' |
1048 |
batchItemsDisplay.style.display = batch.data.ill_batch_id ? 'block' : 'none' |
1049 |
}; |
1049 |
}; |
1050 |
|
1050 |
|
1051 |
function updateBatchInputs() { |
1051 |
function updateBatchInputs() { |