Lines 1957-1965
Note that permanent location is a code, and location may be an authval.
Link Here
|
1957 |
posting.fail(function(data) { |
1957 |
posting.fail(function(data) { |
1958 |
if ( data.status === 409 ) { |
1958 |
if ( data.status === 409 ) { |
1959 |
var response = data.responseJSON; |
1959 |
var response = data.responseJSON; |
1960 |
if ( response.key === "PRIMARY" ) { |
1960 |
if ( response.error_code === 'already_bundled' ) { |
1961 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); |
1961 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); |
1962 |
} else if (response.key === 'checked_out') { |
1962 |
} else if (response.error_code === 'checked_out') { |
1963 |
const button = $('<button type="button">') |
1963 |
const button = $('<button type="button">') |
1964 |
.addClass('btn btn-xs') |
1964 |
.addClass('btn btn-xs') |
1965 |
.text(__('Check in and add to bundle')) |
1965 |
.text(__('Check in and add to bundle')) |
Lines 1971-1977
Note that permanent location is a code, and location may be an authval.
Link Here
|
1971 |
.attr('class', 'alert alert-warning') |
1971 |
.attr('class', 'alert alert-warning') |
1972 |
.append(__x('Warning: Item {barcode} is checked out', { barcode })) |
1972 |
.append(__x('Warning: Item {barcode} is checked out', { barcode })) |
1973 |
.append(' ', button); |
1973 |
.append(' ', button); |
1974 |
} else if (response.key === 'failed_checkin') { |
1974 |
} else if (response.error_code === 'failed_checkin') { |
1975 |
$('#addResult') |
1975 |
$('#addResult') |
1976 |
.empty() |
1976 |
.empty() |
1977 |
.attr('class', 'alert alert-danger') |
1977 |
.attr('class', 'alert alert-danger') |
Lines 1983-1989
Note that permanent location is a code, and location may be an authval.
Link Here
|
1983 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>'); |
1983 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>'); |
1984 |
} else if ( data.status === 400 ) { |
1984 |
} else if ( data.status === 400 ) { |
1985 |
var response = data.responseJSON; |
1985 |
var response = data.responseJSON; |
1986 |
if ( response.error === "Bundles cannot be nested" ) { |
1986 |
if ( response.error_code === "failed_nesting" ) { |
1987 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>'); |
1987 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>'); |
1988 |
} else { |
1988 |
} else { |
1989 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1989 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1990 |
- |
|
|