<eg-mark-missing-dialog #markMissingDialog></eg-mark-missing-dialog>
<eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
<eg-replace-barcode-dialog #replaceBarcode></eg-replace-barcode-dialog>
-<eg-delete-volcopy-dialog #deleteVolcopy></eg-delete-volcopy-dialog>
+<eg-delete-holding-dialog #deleteHolding></eg-delete-holding-dialog>
<eg-bucket-dialog #bucketDialog></eg-bucket-dialog>
<eg-conjoined-items-dialog #conjoinedDialog></eg-conjoined-items-dialog>
<eg-make-bookable-dialog #makeBookableDialog></eg-make-bookable-dialog>
<!-- checkboxes / filters -->
<eg-grid-toolbar-checkbox i18n-label label="Show Call Numbers"
- #volsCheckbox (onChange)="toggleShowVolumes($event)">
+ #callNumsCheckbox (onChange)="toggleShowCallNums($event)">
</eg-grid-toolbar-checkbox>
<eg-grid-toolbar-checkbox i18n-label label="Show Copies"
#copiesCheckbox (onChange)="toggleShowCopies($event)">
</eg-grid-toolbar-checkbox>
<eg-grid-toolbar-checkbox i18n-label label="Show Empty Call Numbers"
- #emptyVolsCheckbox (onChange)="toggleShowEmptyVolumes($event)">
+ #emptyCallNumsCheckbox (onChange)="toggleShowEmptyCallNums($event)">
</eg-grid-toolbar-checkbox>
<eg-grid-toolbar-checkbox i18n-label label="Show Empty Libs"
#emptyLibsCheckbox (onChange)="toggleShowEmptyLibs($event)">
<eg-grid-toolbar-action
i18n-group group="Add" i18n-label label="Add Call Numbers"
- (onClick)="openVolCopyEdit($event, true, false)">
+ (onClick)="openHoldingEdit($event, true, false)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
i18n-group group="Add" i18n-label label="Add Items"
- (onClick)="openVolCopyEdit($event, false, true)">
+ (onClick)="openHoldingEdit($event, false, true)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
i18n-group group="Add" i18n-label label="Add Call Numbers and Items"
- (onClick)="openVolCopyEdit($event, true, true)">
+ (onClick)="openHoldingEdit($event, true, true)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
<eg-grid-toolbar-action
i18n-group group="Edit" i18n-label label="Edit Call Numbers"
- (onClick)="openVolCopyEdit($event, true, false)">
+ (onClick)="openHoldingEdit($event, true, false)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
i18n-group group="Edit" i18n-label label="Edit Call Numbers And Items"
- (onClick)="openVolCopyEdit($event, true, true)">
+ (onClick)="openHoldingEdit($event, true, true)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
i18n-group group="Edit" i18n-label label="Edit Items"
- (onClick)="openVolCopyEdit($event, false, true)">
+ (onClick)="openHoldingEdit($event, false, true)">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
<eg-grid-toolbar-action
i18n-group group="Delete" i18n-label label="Delete Empty Call Numbers"
- (onClick)="deleteHoldings($event, 'vols')">
+ (onClick)="deleteHoldings($event, 'callNums')">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action
</eg-grid-column>
<eg-grid-column name="id" path="copy.id" [hidden]="true" label="Item ID" i18n-label>
</eg-grid-column>
- <eg-grid-column path="volume.id" [hidden]="true" label="Call Number ID" i18n-label>
+ <eg-grid-column path="callNum.id" [hidden]="true" label="Call Number ID" i18n-label>
</eg-grid-column>
<eg-grid-column name="owner_label" [flex]="4"
[cellTemplate]="locationTemplate" [cellContext]="gridTemplateContext"
label="Location/Barcode" [disableTooltip]="true" i18n-label>
</eg-grid-column>
- <eg-grid-column path="volumeCount" datatype="number" label="Call Numbers" i18n-label>
+ <eg-grid-column path="callNumCount" datatype="number" label="Call Numbers" i18n-label>
</eg-grid-column>
<eg-grid-column path="copyCount" datatype="number" label="Copies" i18n-label>
</eg-grid-column>
- <eg-grid-column path="volume._label" name="call_number.label"
+ <eg-grid-column path="callNum._label" name="call_number.label"
label="Call Number" i18n-label>
</eg-grid-column>
<eg-grid-column path="copy.barcode" name="barcode" label="Barcode" i18n-label>
</eg-grid-column>
<eg-grid-column i18n-label label="Circ Library" path="copy.circ_lib"
name="circ_lib.name" datatype="org_unit"></eg-grid-column>
- <eg-grid-column i18n-label label="Owning Library" path="volume.owning_lib"
+ <eg-grid-column i18n-label label="Owning Library" path="callNum.owning_lib"
datatype="org_unit"></eg-grid-column>
<eg-grid-column i18n-label label="Due Date" path="circ.due_date"
datatype="timestamp"></eg-grid-column>
path="copy.status.name" name="status_name">
</eg-grid-column>
<eg-grid-column i18n-label label="Call Number Prefix"
- path="volume.prefix.label" name="call_number.prefix.label" [hidden]="true">
+ path="callNum.prefix.label" name="call_number.prefix.label" [hidden]="true">
</eg-grid-column>
<eg-grid-column i18n-label label="Call Number Suffix"
- path="volume.suffix.label" name="call_number.suffix.label" [hidden]="true">
+ path="callNum.suffix.label" name="call_number.suffix.label" [hidden]="true">
</eg-grid-column>
<eg-grid-column i18n-label label="Active/Create Date"
path="copy.active_date" datatype="timestamp">
} from '@eg/staff/share/holdings/copy-alerts-dialog.component';
import {ReplaceBarcodeDialogComponent
} from '@eg/staff/share/holdings/replace-barcode-dialog.component';
-import {DeleteVolcopyDialogComponent
+import {DeleteHoldingDialogComponent
} from '@eg/staff/share/holdings/delete-volcopy-dialog.component';
import {BucketDialogComponent
} from '@eg/staff/share/buckets/bucket-dialog.component';
// flattened on-demand into a list of HoldingEntry objects.
class HoldingsTreeNode {
children: HoldingsTreeNode[];
- nodeType: 'org' | 'volume' | 'copy';
+ nodeType: 'org' | 'callNum' | 'copy';
target: any;
parentNode: HoldingsTreeNode;
expanded: boolean;
copyCount: number;
- volumeCount: number;
+ callNumCount: number;
constructor() {
this.children = [];
}
locationLabel: string;
// location label indentation depth
locationDepth: number | null;
- volumeCount: number | null;
+ callNumCount: number | null;
copyCount: number | null;
callNumberLabel: string;
copy: IdlObject;
- volume: IdlObject;
+ callNum: IdlObject;
circ: IdlObject;
treeNode: HoldingsTreeNode;
}
@ViewChild('holdingsGrid') holdingsGrid: GridComponent;
// Manage visibility of various sub-sections
- @ViewChild('volsCheckbox')
- private volsCheckbox: GridToolbarCheckboxComponent;
+ @ViewChild('callNumsCheckbox')
+ private callNumsCheckbox: GridToolbarCheckboxComponent;
@ViewChild('copiesCheckbox')
private copiesCheckbox: GridToolbarCheckboxComponent;
- @ViewChild('emptyVolsCheckbox')
- private emptyVolsCheckbox: GridToolbarCheckboxComponent;
+ @ViewChild('emptyCallNumsCheckbox')
+ private emptyCallNumsCheckbox: GridToolbarCheckboxComponent;
@ViewChild('emptyLibsCheckbox')
private emptyLibsCheckbox: GridToolbarCheckboxComponent;
@ViewChild('markDamagedDialog')
private copyAlertsDialog: CopyAlertsDialogComponent;
@ViewChild('replaceBarcode')
private replaceBarcode: ReplaceBarcodeDialogComponent;
- @ViewChild('deleteVolcopy')
- private deleteVolcopy: DeleteVolcopyDialogComponent;
+ @ViewChild('deleteHolding')
+ private deleteHolding: DeleteHoldingDialogComponent;
@ViewChild('bucketDialog')
private bucketDialog: BucketDialogComponent;
@ViewChild('conjoinedDialog')
this.contextOrg = this.staffCat.searchContext.searchOrg;
this.rowClassCallback = (row: any): string => {
- if (row.volume) {
+ if (row.callNum) {
if (row.copy) {
return 'holdings-copy-row';
} else {
- return 'holdings-volume-row';
+ return 'holdings-callNum-row';
}
} else {
// Add a generic org unit class and a depth-specific
'cat.holdings_show_vols'
]);
- // Show volumes by default when no preference is set.
- let showVols = settings['cat.holdings_show_vols'];
- if (showVols === null) { showVols = true; }
+ // Show call numbers by default when no preference is set.
+ let showCallNums = settings['cat.holdings_show_vols'];
+ if (showCallNums === null) { showCallNums = true; }
- this.volsCheckbox.checked(showVols);
+ this.callNumsCheckbox.checked(showCallNums);
this.copiesCheckbox.checked(settings['cat.holdings_show_copies']);
- this.emptyVolsCheckbox.checked(settings['cat.holdings_show_empty']);
+ this.emptyCallNumsCheckbox.checked(settings['cat.holdings_show_empty']);
this.emptyLibsCheckbox.checked(settings['cat.holdings_show_empty_org']);
this.initHoldingsTree();
toggleShowCopies(value: boolean) {
this.store.setItem('cat.holdings_show_copies', value);
if (value) {
- // Showing copies implies showing volumes
- this.volsCheckbox.checked(true);
+ // Showing copies implies showing call numbers
+ this.callNumsCheckbox.checked(true);
}
this.renderFromPrefs = true;
this.holdingsGrid.reload();
}
- toggleShowVolumes(value: boolean) {
+ toggleShowCallNums(value: boolean) {
this.store.setItem('cat.holdings_show_vols', value);
if (!value) {
- // Hiding volumes implies hiding empty vols and copies.
+ // Hiding call numbers implies hiding empty call numbers and copies.
this.copiesCheckbox.checked(false);
- this.emptyVolsCheckbox.checked(false);
+ this.emptyCallNumsCheckbox.checked(false);
}
this.renderFromPrefs = true;
this.holdingsGrid.reload();
}
- toggleShowEmptyVolumes(value: boolean) {
+ toggleShowEmptyCallNums(value: boolean) {
this.store.setItem('cat.holdings_show_empty', value);
if (value) {
- this.volsCheckbox.checked(true);
+ this.callNumsCheckbox.checked(true);
}
this.renderFromPrefs = true;
this.holdingsGrid.reload();
this.treeNodeCache = {
org: {},
- volume: {},
+ callNum: {},
copy: {}
};
return 1;
} else {
// TODO: should this use label sortkey instead of
- // the compiled volume label?
+ // the compiled call number label?
return a.target._label < b.target._label ? -1 : 1;
}
});
if (node.nodeType === 'org') {
node.copyCount = 0;
- node.volumeCount = 0;
- } else if (node.nodeType === 'volume') {
+ node.callNumCount = 0;
+ } else if (node.nodeType === 'callNum') {
node.copyCount = 0;
}
this.setTreeCounts(child);
if (node.nodeType === 'org') {
node.copyCount += child.copyCount;
- if (child.nodeType === 'volume') {
- node.volumeCount++;
+ if (child.nodeType === 'callNum') {
+ node.callNumCount++;
} else {
- hasChildOrgWithData = child.volumeCount > 0;
- hasChildOrgSansData = child.volumeCount === 0;
- node.volumeCount += child.volumeCount;
+ hasChildOrgWithData = child.callNumCount > 0;
+ hasChildOrgSansData = child.callNumCount === 0;
+ node.callNumCount += child.callNumCount;
}
- } else if (node.nodeType === 'volume') {
+ } else if (node.nodeType === 'callNum') {
node.copyCount = node.children.length;
if (this.renderFromPrefs) {
node.expanded = this.copiesCheckbox.checked();
});
if (this.renderFromPrefs && node.nodeType === 'org') {
- if (node.copyCount > 0 && this.volsCheckbox.checked()) {
+ if (node.copyCount > 0 && this.callNumsCheckbox.checked()) {
node.expanded = true;
- } else if (node.volumeCount > 0 && this.emptyVolsCheckbox.checked()) {
+ } else if (node.callNumCount > 0 && this.emptyCallNumsCheckbox.checked()) {
node.expanded = true;
} else if (hasChildOrgWithData) {
node.expanded = true;
switch (node.nodeType) {
case 'org':
- if (node.volumeCount === 0
+ if (node.callNumCount === 0
&& !this.emptyLibsCheckbox.checked()) {
return;
}
entry.locationLabel = node.target.shortname();
entry.locationDepth = node.target.ou_type().depth();
entry.copyCount = node.copyCount;
- entry.volumeCount = node.volumeCount;
+ entry.callNumCount = node.callNumCount;
this.sortOrgNodeChildren(node);
break;
- case 'volume':
+ case 'callNum':
if (this.renderFromPrefs) {
- if (!this.volsCheckbox.checked()) {
+ if (!this.callNumsCheckbox.checked()) {
return;
}
if (node.copyCount === 0
- && !this.emptyVolsCheckbox.checked()) {
+ && !this.emptyCallNumsCheckbox.checked()) {
return;
}
}
entry.locationLabel = node.target._label;
entry.locationDepth = node.parentNode.target.ou_type().depth() + 1;
entry.callNumberLabel = entry.locationLabel;
- entry.volume = node.target;
+ entry.callNum = node.target;
entry.copyCount = node.copyCount;
break;
entry.locationLabel = node.target.barcode();
entry.locationDepth = node.parentNode.parentNode.target.ou_type().depth() + 2;
entry.callNumberLabel = node.parentNode.target.label(); // TODO
- entry.volume = node.parentNode.target;
+ entry.callNum = node.parentNode.target;
entry.copy = node.target;
entry.circ = node.target._circ;
break;
this.renderFromPrefs = false;
}
- // Grab volumes, copies, and related data.
+ // Grab call numbers, copies, and related data.
fetchHoldings(pager: Pager): Observable<any> {
if (!this.recordId) { return of([]); }
},
{authoritative: true}
).subscribe(
- vol => this.appendVolume(vol),
+ callNum => this.appendCallNum(callNum),
err => {},
() => {
this.refreshHoldings = false;
})).toPromise();
}
- // Compile prefix + label + suffix into field volume._label;
- setVolumeLabel(volume: IdlObject) {
- const pfx = volume.prefix() ? volume.prefix().label() : '';
- const sfx = volume.suffix() ? volume.suffix().label() : '';
- volume._label = pfx ? pfx + ' ' : '';
- volume._label += volume.label();
- volume._label += sfx ? ' ' + sfx : '';
+ // Compile prefix + label + suffix into field callNum._label;
+ setCallNumLabel(callNum: IdlObject) {
+ const pfx = callNum.prefix() ? callNum.prefix().label() : '';
+ const sfx = callNum.suffix() ? callNum.suffix().label() : '';
+ callNum._label = pfx ? pfx + ' ' : '';
+ callNum._label += callNum.label();
+ callNum._label += sfx ? ' ' + sfx : '';
}
- // Create the tree node for the volume if it doesn't already exist.
+ // Create the tree node for the call number if it doesn't already exist.
// Do the same for its linked copies.
- appendVolume(volume: IdlObject) {
- let volNode = this.treeNodeCache.volume[volume.id()];
- this.setVolumeLabel(volume);
-
- if (volNode) {
- const pNode = this.treeNodeCache.org[volume.owning_lib()];
- if (volNode.parentNode.target.id() !== pNode.target.id()) {
- // Volume owning library changed. Un-link it from the previous
- // org unit collection before adding to the new one.
+ appendCallNum(callNum: IdlObject) {
+ let callNumNode = this.treeNodeCache.callNum[callNum.id()];
+ this.setCallNumLabel(callNum);
+
+ if (callNumNode) {
+ const pNode = this.treeNodeCache.org[callNum.owning_lib()];
+ if (callNumNode.parentNode.target.id() !== pNode.target.id()) {
+ // Call number owning library changed. Un-link it from the
+ // previous org unit collection before adding to the new one.
// XXX TODO: ^--
- volNode.parentNode = pNode;
- volNode.parentNode.children.push(volNode);
+ callNumNode.parentNode = pNode;
+ callNumNode.parentNode.children.push(callNumNode);
}
} else {
- volNode = new HoldingsTreeNode();
- volNode.nodeType = 'volume';
- volNode.parentNode = this.treeNodeCache.org[volume.owning_lib()];
- volNode.parentNode.children.push(volNode);
- this.treeNodeCache.volume[volume.id()] = volNode;
+ callNumNode = new HoldingsTreeNode();
+ callNumNode.nodeType = 'callNum';
+ callNumNode.parentNode = this.treeNodeCache.org[callNum.owning_lib()];
+ callNumNode.parentNode.children.push(callNumNode);
+ this.treeNodeCache.callNum[callNum.id()] = callNumNode;
}
- volNode.target = volume;
+ callNumNode.target = callNum;
- volume.copies()
+ callNum.copies()
.filter((copy: IdlObject) => (copy.deleted() !== 't'))
.sort((a: IdlObject, b: IdlObject) => a.barcode() < b.barcode() ? -1 : 1)
- .forEach((copy: IdlObject) => this.appendCopy(volNode, copy));
+ .forEach((copy: IdlObject) => this.appendCopy(callNumNode, copy));
}
// Find or create a copy node.
- appendCopy(volNode: HoldingsTreeNode, copy: IdlObject) {
+ appendCopy(callNumNode: HoldingsTreeNode, copy: IdlObject) {
let copyNode = this.treeNodeCache.copy[copy.id()];
if (copyNode) {
const oldParent = copyNode.parentNode;
- if (oldParent.target.id() !== volNode.target.id()) {
- // TODO: copy changed owning volume. Remove it from
- // the previous volume before adding to the new volume.
- copyNode.parentNode = volNode;
- volNode.children.push(copyNode);
+ if (oldParent.target.id() !== callNumNode.target.id()) {
+ // TODO: copy changed owning call number. Remove it from
+ // the previous call number before adding to the new call number.
+ copyNode.parentNode = callNumNode;
+ callNumNode.children.push(copyNode);
}
} else {
// New node required
copyNode = new HoldingsTreeNode();
copyNode.nodeType = 'copy';
- volNode.children.push(copyNode);
- copyNode.parentNode = volNode;
+ callNumNode.children.push(copyNode);
+ copyNode.parentNode = callNumNode;
this.treeNodeCache.copy[copy.id()] = copyNode;
}
return copyRows.map(c => Number(c.id()));
}
- selectedVolumeIds(rows: HoldingsEntry[]): number[] {
+ selectedCallNumIds(rows: HoldingsEntry[]): number[] {
return rows
- .filter(r => r.treeNode.nodeType === 'volume')
- .map(r => Number(r.volume.id()));
+ .filter(r => r.treeNode.nodeType === 'callNum')
+ .map(r => Number(r.callNum.id()));
}
async showMarkDamagedDialog(rows: HoldingsEntry[]) {
return;
}
- // Action may only apply to a single org or volume row.
+ // Action may only apply to a single org or call number row.
const node = rows[0].treeNode;
if (node.nodeType === 'copy') {
return;
if (node.nodeType === 'org') {
orgId = node.target.id();
- // Clear volume target when performed on an org unit row
- this.localStore.removeLocalItem('eg.cat.transfer_target_vol');
+ // Clear call number target when performed on an org unit row
+ this.localStore.removeLocalItem('eg.cat.transfer_target_callnum');
- } else if (node.nodeType === 'volume') {
+ } else if (node.nodeType === 'callNum') {
- // All volume nodes are children of org nodes.
+ // All call number nodes are children of org nodes.
orgId = node.parentNode.target.id();
- // Add volume target when performed on a volume row.
+ // Add call number target when performed on a call number row.
this.localStore.setLocalItem(
- 'eg.cat.transfer_target_vol', node.target.id());
+ 'eg.cat.transfer_target_callnum', node.target.id());
}
this.localStore.setLocalItem('eg.cat.transfer_target_record', this.recordId);
.then(key => this.openAngJsWindow(`cat/printlabels/${key}`));
}
- openVolCopyEdit(rows: HoldingsEntry[], addVols: boolean, addCopies: boolean) {
+ openHoldingEdit(rows: HoldingsEntry[], addCallNums: boolean, addCopies: boolean) {
- // The user may select a set of volumes by selecting volume and/or
+ // The user may select a set of call numbers by selecting call number and/or
// copy rows.
- const volumes = [];
+ const callNums = [];
rows.forEach(r => {
- if (r.treeNode.nodeType === 'volume') {
- volumes.push(r.volume);
+ if (r.treeNode.nodeType === 'callNum') {
+ callNums.push(r.callNum);
} else if (r.treeNode.nodeType === 'copy') {
- volumes.push(r.treeNode.parentNode.target);
+ callNums.push(r.treeNode.parentNode.target);
}
});
- if (addCopies && !addVols) {
- // Adding copies to an existing set of volumes.
- if (volumes.length > 0) {
- const volIds = volumes.map(v => Number(v.id()));
- this.holdings.spawnAddHoldingsUi(this.recordId, volIds);
+ if (addCopies && !addCallNums) {
+ // Adding copies to an existing set of call numbers.
+ if (callNums.length > 0) {
+ const callNumIds = callNums.map(v => Number(v.id()));
+ this.holdings.spawnAddHoldingsUi(this.recordId, callNumIds);
}
- } else if (addVols) {
+ } else if (addCallNums) {
const entries = [];
- if (volumes.length > 0) {
+ if (callNums.length > 0) {
- // When adding volumes, if any are selected in the grid,
- // create volumes that have the same label and owner.
- volumes.forEach(v =>
+ // When adding call numbers, if any are selected in the grid,
+ // create call numbers that have the same label and owner.
+ callNums.forEach(v =>
entries.push({label: v.label(), owner: v.owning_lib()}));
} else {
- // Otherwise create new volumes from scratch.
+ // Otherwise create new call numbers from scratch.
entries.push({owner: this.auth.user().ws_ou()});
}
);
}
- // mode 'vols' -- only delete empty volumes
+ // mode 'callNums' -- only delete empty call numbers
// mode 'copies' -- only delete selected copies
- // mode 'both' -- delete selected copies and selected volumes, plus all
- // copies linked to selected volumes, regardless of whether they are selected.
- deleteHoldings(rows: HoldingsEntry[], mode: 'vols' | 'copies' | 'both') {
- const volHash: any = {};
-
- if (mode === 'vols' || mode === 'both') {
- // Collect the volumes to be deleted.
- rows.filter(r => r.treeNode.nodeType === 'volume').forEach(r => {
- const vol = this.idl.clone(r.volume);
- if (mode === 'vols') {
- if (vol.copies().length > 0) {
- // cannot delete non-empty volume in this mode.
+ // mode 'both' -- delete selected copies and selected call numbers, plus all
+ // copies linked to selected call numbers, regardless of whether they are selected.
+ deleteHoldings(rows: HoldingsEntry[], mode: 'callNums' | 'copies' | 'both') {
+ const callNumHash: any = {};
+
+ if (mode === 'callNums' || mode === 'both') {
+ // Collect the call numbers to be deleted.
+ rows.filter(r => r.treeNode.nodeType === 'callNum').forEach(r => {
+ const callNum = this.idl.clone(r.callNum);
+ if (mode === 'callNums') {
+ if (callNum.copies().length > 0) {
+ // cannot delete non-empty call number in this mode.
return;
}
} else {
- vol.copies().forEach(c => c.isdeleted(true));
+ callNum.copies().forEach(c => c.isdeleted(true));
}
- vol.isdeleted(true);
- volHash[vol.id()] = vol;
+ callNum.isdeleted(true);
+ callNumHash[callNum.id()] = callNum;
});
}
if (mode === 'copies' || mode === 'both') {
- // Collect the copies to be deleted, including their volumes
- // since the API expects fleshed volume objects.
+ // Collect the copies to be deleted, including their call numbers
+ // since the API expects fleshed call number objects.
rows.filter(r => r.treeNode.nodeType === 'copy').forEach(r => {
- const vol = r.treeNode.parentNode.target;
- if (!volHash[vol.id()]) {
- volHash[vol.id()] = this.idl.clone(vol);
- volHash[vol.id()].copies([]);
+ const callNum = r.treeNode.parentNode.target;
+ if (!callNumHash[callNum.id()]) {
+ callNumHash[callNum.id()] = this.idl.clone(callNum);
+ callNumHash[callNum.id()].copies([]);
}
const copy = this.idl.clone(r.copy);
copy.isdeleted(true);
- volHash[vol.id()].copies().push(copy);
+ callNumHash[callNum.id()].copies().push(copy);
});
}
- if (Object.keys(volHash).length === 0) {
+ if (Object.keys(callNumHash).length === 0) {
// No data to process.
return;
}
// Note forceDeleteCopies should not be necessary here, since we
- // manually marked all copies as deleted on deleted volumes in
+ // manually marked all copies as deleted on deleted call numbers in
// "both" mode.
- this.deleteVolcopy.forceDeleteCopies = mode === 'both';
- this.deleteVolcopy.volumes = Object.values(volHash);
- this.deleteVolcopy.open({size: 'sm'}).subscribe(
+ this.deleteHolding.forceDeleteCopies = mode === 'both';
+ this.deleteHolding.callNums = Object.values(callNumHash);
+ this.deleteHolding.open({size: 'sm'}).subscribe(
modified => {
if (modified) {
this.hardRefresh();