Lines 1779-1787
Note that permanent location is a code, and location may be an authval.
Link Here
|
1779 |
posting.fail(function(data) { |
1779 |
posting.fail(function(data) { |
1780 |
if ( data.status === 409 ) { |
1780 |
if ( data.status === 409 ) { |
1781 |
var response = data.responseJSON; |
1781 |
var response = data.responseJSON; |
1782 |
if ( response.key === "PRIMARY" ) { |
1782 |
if ( response.error_code === 'already_bundled' ) { |
1783 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); |
1783 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); |
1784 |
} else if (response.key === 'checked_out') { |
1784 |
} else if (response.error_code === 'checked_out') { |
1785 |
const button = $('<button type="button">') |
1785 |
const button = $('<button type="button">') |
1786 |
.addClass('btn btn-xs') |
1786 |
.addClass('btn btn-xs') |
1787 |
.text(__('Check in and add to bundle')) |
1787 |
.text(__('Check in and add to bundle')) |
Lines 1793-1799
Note that permanent location is a code, and location may be an authval.
Link Here
|
1793 |
.attr('class', 'alert alert-warning') |
1793 |
.attr('class', 'alert alert-warning') |
1794 |
.append(__x('Warning: Item {barcode} is checked out', { barcode })) |
1794 |
.append(__x('Warning: Item {barcode} is checked out', { barcode })) |
1795 |
.append(' ', button); |
1795 |
.append(' ', button); |
1796 |
} else if (response.key === 'failed_checkin') { |
1796 |
} else if (response.error_code === 'failed_checkin') { |
1797 |
$('#addResult') |
1797 |
$('#addResult') |
1798 |
.empty() |
1798 |
.empty() |
1799 |
.attr('class', 'alert alert-danger') |
1799 |
.attr('class', 'alert alert-danger') |
Lines 1805-1811
Note that permanent location is a code, and location may be an authval.
Link Here
|
1805 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>'); |
1805 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>'); |
1806 |
} else if ( data.status === 400 ) { |
1806 |
} else if ( data.status === 400 ) { |
1807 |
var response = data.responseJSON; |
1807 |
var response = data.responseJSON; |
1808 |
if ( response.error === "Bundles cannot be nested" ) { |
1808 |
if ( response.error_code === "failed_nesting" ) { |
1809 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>'); |
1809 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>'); |
1810 |
} else { |
1810 |
} else { |
1811 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1811 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1812 |
- |
|
|