--- /dev/null
+
+<form ng-submit="submitId(args)" role="form" class="form-inline">
+ <div class="input-group">
+
+ <label class="input-group-addon"
+ for="record-retreive-id" >[% l('Bib Record Id') %]</label>
+
+ <input select-me="selectMe" class="form-control"
+ ng-model="args.record_id" focus-me="focusMe"
+ placeholder="[% l('Bib Record Id') %]"
+ id="record-retreive-id" type="text"/>
+
+ </div>
+ <input class="btn btn-default" type="submit" value="[% l('Submit') %]"/>
+</form>
+
+<br/>
+<div class="alert alert-warning" ng-show="recordNotFound">
+ [% l('Bib Record Not Found: [_1]', '{{recordNotFound}}') %]
+</div>
+
+
--- /dev/null
+
+<form ng-submit="submitTCN(args)" role="form" class="form-inline">
+ <div class="input-group">
+
+ <label class="input-group-addon"
+ for="record-retreive-tcn" >[% l('Bib Record TCN') %]</label>
+
+ <input select-me="selectMe" class="form-control"
+ ng-model="args.record_tcn" focus-me="focusMe"
+ placeholder="[% l('Bib Record TCN') %]"
+ id="record-retreive-tcn" type="text"/>
+
+ </div>
+ <input class="btn btn-default" type="submit" value="[% l('Submit') %]"/>
+</form>
+
+<br/>
+<div class="alert alert-warning" ng-show="moreRecordsFound">
+ [% l('More than one Bib Record found with TCN: [_1]', '{{recordNotFound}}') %]
+</div>
+<div class="alert alert-warning" ng-show="recordNotFound">
+ [% l('Bib Record Not Found: [_1]', '{{recordNotFound}}') %]
+</div>
+
+
[% l('Record Buckets') %]
</a>
</li>
+ <li class="divider"></li>
+ <li>
+ <a href="./cat/catalog/retrieve_by_id" target="_self">
+ <span class="glyphicon glyphicon-file"></span>
+ [% l('Retrieve Bib Record by ID') %]
+ </a>
+ </li>
+ <li>
+ <a href="./cat/catalog/retrieve_by_tcn" target="_self">
+ <span class="glyphicon glyphicon-tag"></span>
+ [% l('Retrieve Bib Record by TCN') %]
+ </a>
+ </li>
<li>
<a href="" ng-click="retrieveLastRecord()" target="_self">
<span class="glyphicon glyphicon-share-alt"></span>
resolve : resolver
});
+ $routeProvider.when('/cat/catalog/retrieve_by_id', {
+ templateUrl: './cat/catalog/t_retrieve_by_id',
+ controller: 'CatalogRecordRetrieve',
+ resolve : resolver
+ });
+
+ $routeProvider.when('/cat/catalog/retrieve_by_tcn', {
+ templateUrl: './cat/catalog/t_retrieve_by_tcn',
+ controller: 'CatalogRecordRetrieve',
+ resolve : resolver
+ });
+
// create some catalog page-specific mappings
$routeProvider.when('/cat/catalog/record/:record_id', {
templateUrl: './cat/catalog/t_catalog',
/**
* */
+.controller('CatalogRecordRetrieve',
+ ['$scope','$routeParams','$location','$q','egCore',
+function($scope , $routeParams , $location , $q , egCore ) {
+
+ $scope.focusMe = true;
+
+ // jump to the patron checkout UI
+ function loadRecord(record_id) {
+ $location
+ .path('/cat/catalog/record/' + record_id);
+ }
+
+ $scope.submitId = function(args) {
+ $scope.recordNotFound = null;
+ if (!args.record_id) return;
+
+ // blur so next time it's set to true it will re-apply select()
+ $scope.selectMe = false;
+
+ return loadRecord(args.record_id);
+ }
+
+ $scope.submitTCN = function(args) {
+ $scope.recordNotFound = null;
+ $scope.moreRecordsFound = null;
+ if (!args.record_tcn) return;
+
+ // blur so next time it's set to true it will re-apply select()
+ $scope.selectMe = false;
+
+ // lookup TCN
+ egCore.net.request(
+ 'open-ils.search',
+ 'open-ils.search.biblio.tcn',
+ args.record_tcn)
+
+ .then(function(resp) { // get_barcodes
+
+ if (evt = egCore.evt.parse(resp)) {
+ alert(evt); // FIXME
+ return;
+ }
+
+ if (!resp.count) {
+ $scope.recordNotFound = args.record_tcn;
+ $scope.selectMe = true;
+ return;
+ }
+
+ if (resp.count > 1) {
+ $scope.moreRecordsFound = args.record_tcn;
+ $scope.selectMe = true;
+ return;
+ }
+
+ var record_id = resp.ids[0];
+ return loadRecord(record_id);
+ });
+ }
+
+}])
+
.controller('CatalogCtrl',
['$scope','$routeParams','$location','$q','egCore','egHolds',
'egGridDataProvider','egHoldGridActions',