Lines 1453-1460
Note that permanent location is a code, and location may be an authval.
Link Here
|
1453 |
|
1453 |
|
1454 |
// Toolbar |
1454 |
// Toolbar |
1455 |
var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>'); |
1455 |
var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>'); |
1456 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> Add to bundle</a>'); |
1456 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>'); |
1457 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> Remove from bundle</a>'); |
1457 |
bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>'); |
1458 |
|
1458 |
|
1459 |
// This is the table we'll convert into a DataTable |
1459 |
// This is the table we'll convert into a DataTable |
1460 |
var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>'); |
1460 |
var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>'); |
Lines 1486-1492
Note that permanent location is a code, and location may be an authval.
Link Here
|
1486 |
"columns": [ |
1486 |
"columns": [ |
1487 |
{ |
1487 |
{ |
1488 |
"data": "biblio.title:biblio.medium", |
1488 |
"data": "biblio.title:biblio.medium", |
1489 |
"title": "Title", |
1489 |
"title": _("Title"), |
1490 |
"searchable": true, |
1490 |
"searchable": true, |
1491 |
"orderable": true, |
1491 |
"orderable": true, |
1492 |
"render": function(data, type, row, meta) { |
1492 |
"render": function(data, type, row, meta) { |
Lines 1505-1541
Note that permanent location is a code, and location may be an authval.
Link Here
|
1505 |
}, |
1505 |
}, |
1506 |
{ |
1506 |
{ |
1507 |
"data": "biblio.author", |
1507 |
"data": "biblio.author", |
1508 |
"title": "Author", |
1508 |
"title": _("Author"), |
1509 |
"searchable": true, |
1509 |
"searchable": true, |
1510 |
"orderable": true, |
1510 |
"orderable": true, |
1511 |
}, |
1511 |
}, |
1512 |
{ |
1512 |
{ |
1513 |
"data": "collection_code", |
1513 |
"data": "collection_code", |
1514 |
"title": "Collection code", |
1514 |
"title": _("Collection"), |
1515 |
"searchable": true, |
1515 |
"searchable": true, |
1516 |
"orderable": true, |
1516 |
"orderable": true, |
1517 |
}, |
1517 |
}, |
1518 |
{ |
1518 |
{ |
1519 |
"data": "item_type", |
1519 |
"data": "item_type", |
1520 |
"title": "Item Type", |
1520 |
"title": _("Item type"), |
1521 |
"searchable": false, |
1521 |
"searchable": false, |
1522 |
"orderable": true, |
1522 |
"orderable": true, |
1523 |
}, |
1523 |
}, |
1524 |
{ |
1524 |
{ |
1525 |
"data": "callnumber", |
1525 |
"data": "callnumber", |
1526 |
"title": "Callnumber", |
1526 |
"title": _("Callnumber"), |
1527 |
"searchable": true, |
1527 |
"searchable": true, |
1528 |
"orderable": true, |
1528 |
"orderable": true, |
1529 |
}, |
1529 |
}, |
1530 |
{ |
1530 |
{ |
1531 |
"data": "external_id", |
1531 |
"data": "external_id", |
1532 |
"title": "Barcode", |
1532 |
"title": _("Barcode"), |
1533 |
"searchable": true, |
1533 |
"searchable": true, |
1534 |
"orderable": true, |
1534 |
"orderable": true, |
1535 |
}, |
1535 |
}, |
1536 |
{ |
1536 |
{ |
1537 |
"data": "lost_status:last_seen_date:return_claim.patron", |
1537 |
"data": "lost_status:last_seen_date:return_claim.patron", |
1538 |
"title": "Status", |
1538 |
"title": _("Status"), |
1539 |
"searchable": false, |
1539 |
"searchable": false, |
1540 |
"orderable": true, |
1540 |
"orderable": true, |
1541 |
"render": function(data, type, row, meta) { |
1541 |
"render": function(data, type, row, meta) { |
Lines 1557-1563
Note that permanent location is a code, and location may be an authval.
Link Here
|
1557 |
var result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n'; |
1557 |
var result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n'; |
1558 |
return result; |
1558 |
return result; |
1559 |
}, |
1559 |
}, |
1560 |
"title": "Actions", |
1560 |
"title": _("Actions"), |
1561 |
"searchable": false, |
1561 |
"searchable": false, |
1562 |
"orderable": false, |
1562 |
"orderable": false, |
1563 |
"class": "noExport" |
1563 |
"class": "noExport" |
Lines 1613-1619
Note that permanent location is a code, and location may be an authval.
Link Here
|
1613 |
/* Report the results */ |
1613 |
/* Report the results */ |
1614 |
posting.done(function(data) { |
1614 |
posting.done(function(data) { |
1615 |
var barcode = $('#external_id').val(); |
1615 |
var barcode = $('#external_id').val(); |
1616 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-success">Success: Added '+barcode+'</div>'); |
1616 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>'); |
1617 |
$('#external_id').val('').focus(); |
1617 |
$('#external_id').val('').focus(); |
1618 |
bundle_changed = 1; |
1618 |
bundle_changed = 1; |
1619 |
}); |
1619 |
}); |
Lines 1622-1633
Note that permanent location is a code, and location may be an authval.
Link Here
|
1622 |
if ( data.status === 409 ) { |
1622 |
if ( data.status === 409 ) { |
1623 |
var response = data.responseJSON; |
1623 |
var response = data.responseJSON; |
1624 |
if ( response.key === "PRIMARY" ) { |
1624 |
if ( response.key === "PRIMARY" ) { |
1625 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">Warning: Item '+barcode+' already attached</div>'); |
1625 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' aready attached").format(barcode)+'</div>'); |
1626 |
} else { |
1626 |
} else { |
1627 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">Failure: Item '+barcode+' belongs to another bundle</div>'); |
1627 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>'); |
1628 |
} |
1628 |
} |
1629 |
} else { |
1629 |
} else { |
1630 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">Failure: Check the logs for details</div>'); |
1630 |
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1631 |
} |
1631 |
} |
1632 |
$('#external_id').val('').focus(); |
1632 |
$('#external_id').val('').focus(); |
1633 |
}); |
1633 |
}); |
Lines 1680-1686
Note that permanent location is a code, and location may be an authval.
Link Here
|
1680 |
/* Report the results */ |
1680 |
/* Report the results */ |
1681 |
deleteReq.done(function(data) { |
1681 |
deleteReq.done(function(data) { |
1682 |
var barcode = $('#rm_external_id').val(); |
1682 |
var barcode = $('#rm_external_id').val(); |
1683 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed ")+barcode+'</div>'); |
1683 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>'); |
1684 |
$('#rm_external_id').val('').focus(); |
1684 |
$('#rm_external_id').val('').focus(); |
1685 |
bundle_changed = 1; |
1685 |
bundle_changed = 1; |
1686 |
}); |
1686 |
}); |
Lines 1689-1709
Note that permanent location is a code, and location may be an authval.
Link Here
|
1689 |
if ( data.status === 409 ) { |
1689 |
if ( data.status === 409 ) { |
1690 |
var response = data.responseJSON; |
1690 |
var response = data.responseJSON; |
1691 |
if ( response.key === "PRIMARY" ) { |
1691 |
if ( response.key === "PRIMARY" ) { |
1692 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">Warning: Item '+barcode+' already attached</div>'); |
1692 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>'); |
1693 |
} else { |
1693 |
} else { |
1694 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">Failure: Item '+barcode+' belongs to another bundle</div>'); |
1694 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>'); |
1695 |
} |
1695 |
} |
1696 |
} else { |
1696 |
} else { |
1697 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">Failure: Check the logs for details</div>'); |
1697 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>'); |
1698 |
} |
1698 |
} |
1699 |
$('#rm_external_id').val('').focus(); |
1699 |
$('#rm_external_id').val('').focus(); |
1700 |
}); |
1700 |
}); |
1701 |
} else { |
1701 |
} else { |
1702 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item ")+barcode+'</div>'); |
1702 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>'); |
1703 |
} |
1703 |
} |
1704 |
}); |
1704 |
}); |
1705 |
itemReq.fail(function(data) { |
1705 |
itemReq.fail(function(data) { |
1706 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found ")+barcode+'</div>'); |
1706 |
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>'); |
1707 |
$('#rm_external_id').val('').focus(); |
1707 |
$('#rm_external_id').val('').focus(); |
1708 |
|
1708 |
|
1709 |
}); |
1709 |
}); |