As with the XUL client, when performing a bib record TCN search
(Cataloging -> Retrieve Record By TCN), first look for non-deleted
records with the requested TCN. When none are found, perform a
secondary search for deleted records with the requested TCN.
To test in concerto:
[1] Navigate to Cataloging -> Retrieve Record By TCN
[2] Search for TCN value "10", which is deleted by default in Concerto.
[3] Confirm the deleted record is loaded.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Garry Collum <gcollum@gmail.com>
.then(function(resp) { // get_barcodes
- if (evt = egCore.evt.parse(resp)) {
- alert(evt); // FIXME
- return;
+ if (resp.count) {
+ return $q.when(resp);
+ } else {
+ // Search again including deleted records
+ return egCore.net.request('open-ils.search',
+ 'open-ils.search.biblio.tcn', args.record_tcn, true);
}
- if (!resp.count) {
+ }).then(function(resp2) {
+
+ if (!resp2.count) {
$scope.recordNotFound = args.record_tcn;
$scope.selectMe = true;
return;
}
- if (resp.count > 1) {
+ if (resp2.count > 1) {
$scope.moreRecordsFound = args.record_tcn;
$scope.selectMe = true;
return;
}
- var record_id = resp.ids[0];
+ var record_id = resp2.ids[0];
return loadRecord(record_id);
});
}