3 <!-- We ask this question a lot. Here's a handy template -->
4 <ng-template #yesNoSelect let-field="field">
5 <eg-combobox domId="{{field}}-input"
6 [required]="true" [ngModel]="values['field']"
7 (ngModelChange)="values[field] = $event ? $event.id : null">
8 <eg-combobox-entry entryId="t" entryLabel="Yes" i18n-entryLabel>
10 <eg-combobox-entry entryId="f" entryLabel="No" i18n-entryLabel>
15 <!-- this one is also repeated a lot -->
16 <ng-template #batchAttr let-field="field" let-required="required"
17 let-label="label" let-template="template" let-displayAs="displayAs">
20 [label]="label || copyFieldLabel(field)"
21 [valueRequired]="required"
22 [displayAs]="displayAs"
23 [editInputDomId]="field + '-input'"
24 [editTemplate]="template"
25 [labelCounts]="itemAttrCounts(field)"
26 (valueCleared)="applyCopyValue(field, null)"
27 (changesSaved)="applyCopyValue(field, undefined, $event)">
31 <!-- Copy Templates -->
32 <div class="row border rounded border-dark pt-2 pb-2 bg-faint">
33 <div class="col-lg-1 font-weight-bold" i18n>Templates:</div>
34 <div class="col-lg-4">
35 <eg-combobox #copyTemplateCbox domId="template-select"
36 [allowFreeText]="true" [entries]="volcopy.templateNames">
39 <div class="col-lg-7 d-flex">
40 <button class="btn btn-outline-dark mr-2" (click)="applyTemplate()" i18n>Apply</button>
41 <button class="btn btn-outline-dark mr-2" (click)="saveTemplate()" i18n>Save</button>
44 The typical approach of wrapping a file input in a <label> results
45 in button-ish things that have slightly different dimensions.
46 Instead have a button activate a hidden file input.
48 <button class="btn btn-outline-dark mr-2" (click)="templateFile.click()">
49 <input type="file" class="d-none" #templateFile
50 (change)="importTemplate($event)" id="template-file-upload"/>
51 <span i18n>Import</span>
54 <a (click)="exportTemplate($event)"
55 download="export_copy_template.json" [href]="exportTemplateUrl()">
56 <button class="btn btn-outline-dark mr-2" i18n>Export</button>
59 <div class="flex-1"> </div>
60 <button class="btn btn-outline-danger mr-2"
61 (click)="deleteTemplate()" i18n>Delete Template</button>
66 <div class="row d-flex">
69 <div class="flex-1 p-1">
70 <div class="p-1"><h4 class="font-weight-bold" i18n>Identification</h4></div>
73 <div class="mb-1" *ngIf="displayAttr('status')">
75 <ng-container *ngIf="statusEditable(); else noEditStat">
76 <ng-template #statusTemplate>
77 <eg-combobox domId="status-input"
78 (ngModelChange)="values['status'] = $event ? $event.id : null"
79 [ngModel]="values['status']">
81 *ngFor="let stat of volcopy.commonData.acp_status"
82 [entryId]="stat.id()" [entryLabel]="stat.name()">
86 <ng-container *ngTemplateOutlet="batchAttr;
87 context:{field:'status',template:statusTemplate}">
91 <ng-template #noEditStat>
92 <eg-batch-item-attr label="Status" i18n-label [readOnly]="true"
93 [labelCounts]="itemAttrCounts('status')">
98 <div class="mb-1" *ngIf="displayAttr('barcode')">
99 <eg-batch-item-attr label="Barcode" i18n-label
100 [readOnly]="true" [labelCounts]="itemAttrCounts('barcode')">
101 </eg-batch-item-attr>
104 <div class="mb-1" *ngIf="displayAttr('create_date')">
105 <eg-batch-item-attr label="Creation Date" i18n-label [readOnly]="true"
106 [labelCounts]="itemAttrCounts('create_date')">
107 </eg-batch-item-attr>
110 <div class="mb-1" *ngIf="displayAttr('active_date')">
111 <eg-batch-item-attr label="Active Date" i18n-label [readOnly]="true"
112 [labelCounts]="itemAttrCounts('active_date')">
113 </eg-batch-item-attr>
116 <div class="mb-1" *ngIf="displayAttr('creator')">
117 <eg-batch-item-attr label="Creator" i18n-label [readOnly]="true"
118 [labelCounts]="itemAttrCounts('creator')">
119 </eg-batch-item-attr>
122 <div class="mb-1" *ngIf="displayAttr('edit_date')">
123 <eg-batch-item-attr label="Last Edit Date" i18n-label [readOnly]="true"
124 [labelCounts]="itemAttrCounts('edit_date')">
125 </eg-batch-item-attr>
128 <div class="mb-1" *ngIf="displayAttr('editor')">
129 <eg-batch-item-attr label="Last Editor" i18n-label [readOnly]="true"
130 [labelCounts]="itemAttrCounts('editor')">
131 </eg-batch-item-attr>
137 <div class="flex-1 p-1">
138 <div class="p-1"><h4 class="font-weight-bold" i18n>Location</h4></div>
140 <div *ngIf="displayAttr('location')">
141 <ng-template #locationTemplate>
142 <eg-item-location-select (valueChange)="values['location'] = $event"
143 domId='location-input' [required]="true" permFilter="UPDATE_COPY">
144 </eg-item-location-select>
146 <ng-container *ngTemplateOutlet="batchAttr;
147 context:{field:'location',required:true,template:locationTemplate}">
151 <div *ngIf="displayAttr('circ_lib')">
152 <ng-template #circLibTemplate>
154 domId="circ_lib-input"
155 (onChange)="values['circ_lib'] = $event ? $event.id() : null"
156 [hideOrgs]="volcopy.hideVolOrgs"
157 [limitPerms]="['UPDATE_COPY']">
160 <ng-container *ngTemplateOutlet="batchAttr;
161 context:{field:'circ_lib',required:true,template:circLibTemplate}">
165 <div *ngIf="displayAttr('owning_lib')">
166 <eg-string #olLabel text="Owning Library" i18n-text></eg-string>
167 <ng-template #owningLibTemplate>
169 domId="owning_lib-input"
170 (onChange)="values['owning_lib'] = $event ? $event.id() : null"
171 [hideOrgs]="volcopy.hideVolOrgs"
172 [limitPerms]="['UPDATE_COPY']">
175 <ng-container *ngTemplateOutlet="batchAttr;
176 context:{field:'owning_lib',required:true,template:owningLibTemplate,label:olLabel.text}">
180 <div *ngIf="displayAttr('copy_number')">
181 <ng-template #copyNumberTemplate>
182 <input type="number" class="form-control"
183 id="copy_number-input" [(ngModel)]="values['copy_number']"/>
185 <ng-container *ngTemplateOutlet="batchAttr;
186 context:{field:'copy_number',template:copyNumberTemplate}">
193 <div class="flex-1 p-1">
194 <div class="p-1"><h4 class="font-weight-bold" i18n>Circulation</h4></div>
196 <div *ngIf="displayAttr('circulate')">
197 <ng-template #circulateTemplate>
198 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'circulate'}">
201 <ng-container *ngTemplateOutlet="batchAttr;
202 context:{field:'circulate',required:true,template:circulateTemplate,displayAs:'bool'}">
206 <div *ngIf="displayAttr('holdable')">
207 <ng-template #holdableTemplate>
208 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'holdable'}">
211 <ng-container *ngTemplateOutlet="batchAttr;
212 context:{field:'holdable',required:true,template:holdableTemplate,displayAs:'bool'}">
216 <div *ngIf="displayAttr('age_protect')">
217 <ng-template #ageProtectTemplate>
218 <eg-combobox domId="age_protect-input"
219 (ngModelChange)="values['age_protect'] = $event ? $event.id : null"
220 [ngModel]="values['age_protect']">
222 *ngFor="let rule of volcopy.commonData.acp_age_protect"
223 [entryId]="rule.id()" [entryLabel]="rule.name()">
227 <ng-container *ngTemplateOutlet="batchAttr;
228 context:{field:'age_protect',template:ageProtectTemplate}">
232 <div *ngIf="displayAttr('floating')">
233 <ng-template #floatingTemplate>
234 <eg-combobox domId="floating-input"
235 (ngModelChange)="values['floating'] = $event ? $event.id : null"
236 [ngModel]="values['floating']">
238 *ngFor="let grp of volcopy.commonData.acp_floating_group"
239 [entryId]="grp.id()" [entryLabel]="grp.name()">
243 <ng-container *ngTemplateOutlet="batchAttr;
244 context:{field:'floating',template:floatingTemplate}">
248 <div *ngIf="displayAttr('loan_duration')">
249 <eg-string #loanDurationShort i18n-text text="Short"></eg-string>
250 <eg-string #loanDurationNormal i18n-text text="Normal"></eg-string>
251 <eg-string #loanDurationLong i18n-text text="Long"></eg-string>
253 <ng-template #loanDurationTemplate>
254 <select class="form-control"
255 id="loan_duration-input" [(ngModel)]="values['loan_duration']">
256 <option value="1" i18n>{{loanDurationShort.text}}</option>
257 <option value="2" i18n>{{loanDurationNormal.text}}</option>
258 <option value="3" i18n>{{loanDurationLong.text}}</option>
261 <ng-container *ngTemplateOutlet="batchAttr;
262 context:{field:'loan_duration',required:true,template:loanDurationTemplate}">
266 <div *ngIf="displayAttr('fine_level')">
267 <eg-string #fineLevelLow i18n-text text="Low"></eg-string>
268 <eg-string #fineLevelNormal i18n-text text="Normal"></eg-string>
269 <eg-string #fineLevelHigh i18n-text text="High"></eg-string>
271 <ng-template #fineLevelTemplate>
272 <select class="form-control"
273 id="fine_level-input" [(ngModel)]="values['fine_level']">
274 <option value="1" i18n>{{fineLevelLow.text}}</option>
275 <option value="2" i18n>{{fineLevelNormal.text}}</option>
276 <option value="3" i18n>{{fineLevelHigh.text}}</option>
279 <ng-container *ngTemplateOutlet="batchAttr;
280 context:{field:'fine_level',required:true,template:fineLevelTemplate}">
284 <div *ngIf="displayAttr('circ_as_type')">
285 <ng-template #circAsTypeTemplate>
286 <eg-combobox domId="circ_as_type-input"
287 (ngModelChange)="values['circ_as_type'] = $event ? $event.id : null"
288 [ngModel]="values['circ_as_type']">
289 <eg-combobox-entry *ngFor="let map of volcopy.commonData.acp_item_type_map"
290 [entryId]="map.code()" [entryLabel]="map.value()">
294 <ng-container *ngTemplateOutlet="batchAttr;
295 context:{field:'circ_as_type',template:circAsTypeTemplate}">
299 <div *ngIf="displayAttr('circ_modifier')">
300 <ng-template #circModifierTemplate>
301 <select class="form-control" id='circ_modifier-input'
302 [(ngModel)]="values['circ_modifier']">
303 <option [value]="null" i18n><Unset></option>
304 <option *ngFor="let mod of volcopy.commonData.acp_circ_modifier"
305 value="{{mod.code()}}">{{mod.name()}}</option>
308 <ng-container *ngTemplateOutlet="batchAttr;
309 context:{field:'circ_modifier',template:circModifierTemplate}">
317 <div class="flex-1 p-1">
318 <div class="p-1"><h4 class="font-weight-bold" i18n>Miscellaneous</h4></div>
320 <!-- Adding this for sites that still use alert messages (we do)
322 <ng-template #alertMessageTemplate>
323 <textarea rows="3" class="form-control" id="alert-message-input"
324 [(ngModel)]="values['alert_message']">
327 <eg-batch-item-attr label="Alert Message" i18n-label
328 editInputDomId="alert-message-input"
329 [editTemplate]="alertMessageTemplate"
330 [labelCounts]="itemAttrCounts('alert_message')"
331 (changesSaved)="applyCopyValue('alert_message')">
332 </eg-batch-item-attr>
336 <div class="border rounded m-1" *ngIf="displayAttr('copy_alerts')">
337 <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
338 <div class="batch-header font-weight-bold p-2" i18n>Add Item Alerts</div>
340 <button class="btn btn-outline-dark" (click)="openCopyAlerts()" i18n>
346 <div *ngIf="displayAttr('deposit')">
347 <ng-template #depositTemplate>
348 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'deposit'}">
351 <ng-container *ngTemplateOutlet="batchAttr;
352 context:{field:'deposit',required:true,template:depositTemplate,displayAs:'bool'}">
356 <div *ngIf="displayAttr('deposit_amount')">
357 <ng-template #depositAmountTemplate>
358 <input type="number" class="form-control"
359 id="deposit_amount-input" [(ngModel)]="values['deposit_amount']"/>
361 <ng-container *ngTemplateOutlet="batchAttr;
362 context:{field:'deposit_amount',required:true,template:depositAmountTemplate,displayAs:'currency'}">
366 <div *ngIf="displayAttr('price')">
367 <ng-template #priceTemplate>
368 <input type="number" class="form-control"
369 id="price-input" [(ngModel)]="values['price']"/>
371 <ng-container *ngTemplateOutlet="batchAttr;
372 context:{field:'price',template:priceTemplate,displayAs:'currency'}">
376 <div *ngIf="displayAttr('opac_visible')">
377 <ng-template #opacVisibleTemplate>
378 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'opac_visible'}">
381 <ng-container *ngTemplateOutlet="batchAttr;
382 context:{field:'opac_visible',required:true,template:opacVisibleTemplate,displayAs:'bool'}">
386 <div *ngIf="displayAttr('ref')">
387 <ng-template #refTemplate>
388 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'ref'}">
391 <ng-container *ngTemplateOutlet="batchAttr;
392 context:{field:'ref',required:true,template:refTemplate,displayAs:'bool'}">
396 <div *ngIf="displayAttr('cost')">
397 <ng-template #costTemplate>
398 <input type="number" class="form-control"
399 id="cost-input" [(ngModel)]="values['cost']"/>
401 <ng-container *ngTemplateOutlet="batchAttr;
402 context:{field:'cost',template:costTemplate,displayAs:'currency'}">
406 <div *ngIf="displayAttr('mint_condition')">
407 <eg-string #mintConditionYes i18n-text text="Good"></eg-string>
408 <eg-string #mintConditionNo i18n-text text="Damaged"></eg-string>
410 <ng-template #mintConditionTemplate>
411 <select class="form-control"
412 id="mint_condition-input" [(ngModel)]="values['mint_condition']">
413 <option value="t" i18n>{{mintConditionYes.text}}</option>
414 <option value="f" i18n>{{mintConditionNo.text}}</option>
417 <ng-container *ngTemplateOutlet="batchAttr;
418 context:{field:'mint_condition',template:mintConditionTemplate}">
425 <div class="flex-1 p-1">
426 <div class="p-1"><h4 class="font-weight-bold" i18n>Statistics</h4></div>
428 <div class="border rounded m-1" *ngIf="displayAttr('copy_tags')">
429 <eg-copy-tags-dialog #copyTagsDialog></eg-copy-tags-dialog>
430 <div class="batch-header font-weight-bold p-2" i18n>Add Item Tags</div>
432 <button class="btn btn-outline-dark" (click)="openCopyTags()" i18n>
438 <div class="border rounded m-1" *ngIf="displayAttr('statcat_filter')">
439 <div class="batch-header font-weight-bold p-2" i18n>Stat Cat Filter</div>
442 domId="statcat_filter-select"
443 placeholder="Stat Cat Filter..." i18n-placeholder
444 [initialOrgId]="statCatFilter"
445 (onChange)="statCatFilter = $event ? $event.id() : null">
450 <ng-container *ngIf="displayAttr('statcats')">
451 <div *ngFor="let cat of statCats()">
452 <ng-template #statCatTemplate>
453 <eg-combobox domId="stat-cat-input-{{cat.id()}}"
454 (ngModelChange)="statCatValues[cat.id()] = $event ? $event.id : null"
455 [ngModel]="statCatValues[cat.id()]">
456 <eg-combobox-entry *ngFor="let entry of cat.entries()"
457 [entryId]="entry.id()" [entryLabel]="entry.value()">
461 <eg-batch-item-attr label="{{cat.name()}} ({{orgSn(cat.owner())}})" i18n-label
462 name="stat_cat_{{cat.id()}}" editInputDomId="stat-cat-input-{{cat.id()}}"
463 [editTemplate]="statCatTemplate"
464 [labelCounts]="statCatCounts(cat.id())"
465 (valueCleared)="statCatChanged(cat.id(), true)"
466 (changesSaved)="statCatChanged(cat.id())">
467 </eg-batch-item-attr>