<div class="flex-1 p-1">
<div class="p-1"><h4 class="font-weight-bold" i18n>Identification</h4></div>
- <!-- TODO: status is batch editable under certain conditions -->
+
<div class="mb-1" *ngIf="displayAttr('status')">
- <eg-batch-item-attr label="Status" i18n-label
- [readOnly]="!statusEditable()"
- [labelCounts]="itemAttrCounts('status')">
- </eg-batch-item-attr>
+
+ <ng-container *ngIf="statusEditable(); else noEditStat">
+ <ng-template #statusTemplate>
+ <eg-combobox domId="status-input"
+ (ngModelChange)="values['status'] = $event ? $event.id : null"
+ [ngModel]="values['status']">
+ <eg-combobox-entry
+ *ngFor="let stat of volcopy.commonData.acp_status"
+ [entryId]="stat.id()" [entryLabel]="stat.name()">
+ </eg-combobox-entry>
+ </eg-combobox>
+ </ng-template>
+ <ng-container *ngTemplateOutlet="batchAttr;
+ context:{field:'status',template:statusTemplate}">
+ </ng-container>
+ </ng-container>
+
+ <ng-template #noEditStat>
+ <eg-batch-item-attr label="Status" i18n-label [readOnly]="true"
+ [labelCounts]="itemAttrCounts('status')">
+ </eg-batch-item-attr>
+ </ng-template>
</div>
<div class="mb-1" *ngIf="displayAttr('barcode')">
<eg-string #olLabel text="Owning Library" i18n-text></eg-string>
<ng-template #owningLibTemplate>
<eg-org-select
- domId="owning-lib-input"
+ domId="owning_lib-input"
(onChange)="values['owning_lib'] = $event ? $event.id() : null"
[limitPerms]="['UPDATE_COPY']">
</eg-org-select>
<div class="d-flex">
<ng-container *ngIf="context.sessionType != 'copy'">
<button class="clear-button" (click)="deleteCopy(copyNode)"
+ [disabled]="volcopy.restrictCopyDelete(copyNode.target.status())"
title="Delete Item {{copyNode.target.barcode()}}" i18n-title>
<span class="material-icons">clear</span>
</button>
}
- copyStatIsMagic(id: number): boolean {
- return this.magicCopyStats.includes(id);
+ copyStatIsMagic(statId: number): boolean {
+ return this.magicCopyStats.includes(statId);
+ }
+
+ restrictCopyDelete(statId: number): boolean {
+ return this.copyStatuses[statId].restrict_copy_delete() === 't';
}
}