</div>
<input type="text" class="form-control" placeholder="Search Term"
i18n-placeholder aria-describedby="search-term"
- (change)="search()"
- (keyup.enter)="search()" [(ngModel)]="browse.searchTerm">
+ (change)="search(null, true)"
+ (keyup.enter)="search(null, true)" [(ngModel)]="browse.searchTerm">
</div>
</div>
<div class="col-lg-5">
<span class="input-group-text" id="auth-axis" i18n>Authority Type</span>
</div>
<eg-combobox #axisCbox [(ngModel)]="authorityAxis"
- [entries]="browse.authorityAxes" (onChange)="search(0, $event)">
+ [entries]="browse.authorityAxes" (onChange)="search(null, true)">
</eg-combobox>
<!--
Hiding 'submit' button since it should never be necessary, plus it
private net: NetService,
private org: OrgService,
private pcrud: PcrudService,
- private browse: BrowseService
+ public browse: BrowseService
) {}
ngOnInit() {
this.browse.markedForMerge = {};
}
- search(offset?: number) {
+ search(offset?: number, isNew?: boolean) {
if (offset) {
this.browse.searchOffset += offset;
+ } else if (isNew) {
+ this.browse.searchOffset = 0;
}
this.grid.reload();
}
};
# Extract the heading and thesaurus.
- # In theory this data has already been extracted in the DB,
- # but my results vary quite a bit from the previous authority
- # manage interface. I took the MARC parsing approach because
- # it matches the logic (and results) of the previous UI.
+ # In theory this data has already been extracted in the DB, but
+ # using authority.simple_heading results in data that varies
+ # quite a bit from the previous authority manage interface. I
+ # took the MARC parsing approach because it matches the logic
+ # (and results) of the previous UI.
my $marc = MARC::Record->new_from_xml($rec->marc);
my $heading_field = $marc->field('1..');
my $field_008 = $marc->field('008');
if ($field_008) {
+
+ # Extract the 1-char thesaurus code from the 008.
my $thes = substr($field_008->data, 11, 1);
if (defined $thes) {
$response->{thesaurus} = $thes;
if ($thes ne 'z') { # 'z' ('Other') maps to many entries
- my $thesaurus =
- $e->search_authority_thesaurus({short_code => $thes})->[0];
+ my $thesaurus = $e->search_authority_thesaurus(
+ {short_code => $thes})->[0];
- $response->{thesaurus_code} = $thesaurus->code if $thesaurus;
+ $response->{thesaurus_code} =
+ $thesaurus->code if $thesaurus;
}
}
}