Lines 28-34
Link Here
|
28 |
"create-requests-button" |
28 |
"create-requests-button" |
29 |
); |
29 |
); |
30 |
var statusesSelect = document.getElementById("status_code"); |
30 |
var statusesSelect = document.getElementById("status_code"); |
31 |
var cancelButton = document.getElementById("lhs").querySelector("button"); |
31 |
var cancelButton = document.getElementById("button_cancel_batch"); |
32 |
var cancelButtonOriginalText = cancelButton.innerHTML; |
32 |
var cancelButtonOriginalText = cancelButton.innerHTML; |
33 |
|
33 |
|
34 |
// We need a data structure keyed on identifier type, which tells us how to parse that |
34 |
// We need a data structure keyed on identifier type, which tells us how to parse that |
Lines 134-139
Link Here
|
134 |
// Are we updating an existing batch |
134 |
// Are we updating an existing batch |
135 |
var isUpdate = false; |
135 |
var isUpdate = false; |
136 |
|
136 |
|
|
|
137 |
// Have requests been created? |
138 |
var requestsCreated = false; |
139 |
|
137 |
// The datatable |
140 |
// The datatable |
138 |
var table; |
141 |
var table; |
139 |
var tableEl = document.getElementById("identifier-table"); |
142 |
var tableEl = document.getElementById("identifier-table"); |
Lines 188-193
Link Here
|
188 |
fetchBatch(); |
191 |
fetchBatch(); |
189 |
isUpdate = true; |
192 |
isUpdate = true; |
190 |
setModalHeading(); |
193 |
setModalHeading(); |
|
|
194 |
finishButton.removeAttribute("disabled"); |
191 |
createButton.style.display = "none"; |
195 |
createButton.style.display = "none"; |
192 |
} else { |
196 |
} else { |
193 |
batch.data = emptyBatch; |
197 |
batch.data = emptyBatch; |
Lines 317-322
Link Here
|
317 |
return row; |
321 |
return row; |
318 |
}); |
322 |
}); |
319 |
}) |
323 |
}) |
|
|
324 |
.then(function (data) { |
325 |
requestsCreated = true; |
326 |
}) |
320 |
.catch(function () { |
327 |
.catch(function () { |
321 |
window.handleApiError(ill_batch_api_request_fail); |
328 |
window.handleApiError(ill_batch_api_request_fail); |
322 |
}); |
329 |
}); |
Lines 470-475
Link Here
|
470 |
} |
477 |
} |
471 |
|
478 |
|
472 |
function doFinish() { |
479 |
function doFinish() { |
|
|
480 |
if (!requestsCreated && textarea.value.trim().length !== 0) { |
481 |
if ( |
482 |
!confirm( |
483 |
__( |
484 |
"Staged identifiers have not yet been added as requests. Proceed?" |
485 |
) |
486 |
) |
487 |
) { |
488 |
return; |
489 |
} |
490 |
} |
491 |
|
473 |
updateBatch().then(function () { |
492 |
updateBatch().then(function () { |
474 |
$("#ill-batch-modal").modal({ show: false }); |
493 |
$("#ill-batch-modal").modal({ show: false }); |
475 |
location.href = |
494 |
location.href = |
476 |
- |
|
|