1 <eg-string #loanDurationShort i18n-text text="Short"></eg-string>
2 <eg-string #loanDurationNormal i18n-text text="Normal"></eg-string>
3 <eg-string #loanDurationLong i18n-text text="Long"></eg-string>
5 <eg-string #fineLevelLow i18n-text text="Low"></eg-string>
6 <eg-string #fineLevelNormal i18n-text text="Normal"></eg-string>
7 <eg-string #fineLevelHigh i18n-text text="High"></eg-string>
9 <eg-string #olLabel text="Owning Library" i18n-text></eg-string>
11 <eg-string #mintConditionYes i18n-text text="Good"></eg-string>
12 <eg-string #mintConditionNo i18n-text text="Damaged"></eg-string>
14 <eg-string #savedHoldingsTemplates i18n-text text="Saved holdings template(s)"></eg-string>
15 <eg-string #deletedHoldingsTemplate i18n-text text="Deleted holdings template"></eg-string>
17 <!-- We ask this question a lot. Here's a handy template -->
18 <ng-template #yesNoSelect let-field="field">
19 <eg-combobox domId="{{field}}-input"
20 [required]="true" [ngModel]="values['field']"
21 (ngModelChange)="values[field] = $event ? $event.id : null">
22 <eg-combobox-entry entryId="t" entryLabel="Yes" i18n-entryLabel>
24 <eg-combobox-entry entryId="f" entryLabel="No" i18n-entryLabel>
29 <!-- this one is also repeated a lot -->
30 <ng-template #batchAttr let-field="field" let-required="required"
31 let-label="label" let-template="template" let-displayAs="displayAs">
34 [label]="label || copyFieldLabel(field)"
35 [valueRequired]="required"
36 [displayAs]="displayAs"
37 [editInputDomId]="field + '-input'"
38 [editTemplate]="template"
39 [labelCounts]="itemAttrCounts(field)"
40 (valueCleared)="applyCopyValue(field, null)"
41 (changesSaved)="applyCopyValue(field, undefined, $event)">
45 <!-- Copy Templates -->
46 <div class="row border rounded border-dark pt-2 pb-2 bg-faint">
47 <div class="col-lg-1 fw-bold" i18n>Templates:</div>
48 <div class="col-lg-4">
49 <eg-combobox #copyTemplateCbox domId="template-select"
50 [allowFreeText]="true" [entries]="volcopy.templateNames">
53 <div class="col-lg-7 d-flex">
54 <button type="button" class="btn btn-outline-dark me-2" (click)="applyTemplate()" i18n>Apply Template</button>
55 <button type="button" class="btn btn-outline-dark me-2" (click)="saveTemplate()" i18n>Save Template</button>
58 The typical approach of wrapping a file input in a <label> results
59 in button-ish things that have slightly different dimensions.
60 Instead have a button activate a hidden file input.
62 <button type="button" class="btn btn-outline-dark me-2" (click)="templateFile.click()">
63 <input type="file" class="d-none" #templateFile
64 (change)="importTemplate($event)" id="template-file-upload"/>
65 <span i18n>Import Templates</span>
67 <input type="file" class="d-none" #templateFile
68 (change)="importTemplate($event)" id="template-file-upload"/>
70 <a (click)="exportTemplate($event)"
71 download="export_copy_template.json" [href]="exportTemplateUrl()">
72 <button type="button" class="btn btn-outline-dark me-2" i18n>Export All Templates</button>
75 <div class="flex-1"> </div>
76 <button type="button" class="btn btn-outline-danger me-2"
77 (click)="deleteTemplate()" i18n>Delete Template</button>
82 <div class="row d-flex">
85 <div class="flex-1 p-1">
86 <div class="p-1"><h4 class="fw-bold" i18n>Identification</h4></div>
89 <div class="mb-1" *ngIf="displayAttr('status')">
91 <ng-container *ngIf="statusEditable(); else noEditStat">
92 <ng-template #statusTemplate>
93 <eg-combobox domId="status-input"
94 (ngModelChange)="values['status'] = $event ? $event.id : null"
95 [ngModel]="values['status']" [disableEntries]="volcopy.magicCopyStats">
97 *ngFor="let stat of volcopy.commonData.acp_status"
98 [entryId]="stat.id()" [entryLabel]="stat.name()">
102 <ng-container *ngTemplateOutlet="batchAttr;
103 context:{field:'status', template:statusTemplate}">
107 <ng-template #noEditStat>
108 <eg-batch-item-attr label="Item Status" i18n-label [readOnly]="true"
109 [labelCounts]="itemAttrCounts('status')">
110 </eg-batch-item-attr>
114 <div class="mb-1" *ngIf="displayAttr('barcode')">
115 <eg-batch-item-attr label="Barcode" i18n-label
116 [readOnly]="true" [labelCounts]="itemAttrCounts('barcode')">
117 </eg-batch-item-attr>
120 <div class="mb-1" *ngIf="displayAttr('create_date')">
121 <eg-batch-item-attr label="Creation Date" i18n-label [readOnly]="true"
122 [labelCounts]="itemAttrCounts('create_date')">
123 </eg-batch-item-attr>
126 <div class="mb-1" *ngIf="displayAttr('active_date')">
127 <eg-batch-item-attr label="Active Date" i18n-label [readOnly]="true"
128 [labelCounts]="itemAttrCounts('active_date')">
129 </eg-batch-item-attr>
132 <div class="mb-1" *ngIf="displayAttr('creator')">
133 <eg-batch-item-attr label="Creator" i18n-label [readOnly]="true"
134 [labelCounts]="itemAttrCounts('creator')">
135 </eg-batch-item-attr>
138 <div class="mb-1" *ngIf="displayAttr('edit_date')">
139 <eg-batch-item-attr label="Last Edit Date" i18n-label [readOnly]="true"
140 [labelCounts]="itemAttrCounts('edit_date')">
141 </eg-batch-item-attr>
144 <div class="mb-1" *ngIf="displayAttr('editor')">
145 <eg-batch-item-attr label="Last Editor" i18n-label [readOnly]="true"
146 [labelCounts]="itemAttrCounts('editor')">
147 </eg-batch-item-attr>
153 <div class="flex-1 p-1">
154 <div class="p-1"><h4 class="fw-bold" i18n>Location</h4></div>
156 <div *ngIf="displayAttr('location')">
157 <ng-template #locationTemplate>
158 <eg-item-location-select (valueChange)="values['location'] = $event"
159 [contextOrgIds]="copyLocationOrgs()"
160 domId='location-input' [required]="true" permFilter="UPDATE_COPY">
161 </eg-item-location-select>
163 <ng-container *ngTemplateOutlet="batchAttr;
164 context:{field:'location',required:true,template:locationTemplate}">
168 <div *ngIf="displayAttr('circ_lib')">
169 <ng-template #circLibTemplate>
171 domId="circ_lib-input" [ariaLabel]="copyFieldLabel('circ_lib')"
172 (onChange)="values['circ_lib'] = $event ? $event.id() : null"
173 [hideOrgs]="volcopy.hideVolOrgs"
174 [limitPerms]="['UPDATE_COPY']">
177 <ng-container *ngTemplateOutlet="batchAttr;
178 context:{field:'circ_lib',required:true,template:circLibTemplate}">
182 <div *ngIf="displayAttr('owning_lib')">
183 <ng-template #owningLibTemplate>
185 domId="owning_lib-input" [ariaLabel]="olLabel.text"
186 (onChange)="values['owning_lib'] = $event ? $event.id() : null"
187 [hideOrgs]="volcopy.hideVolOrgs"
188 [limitPerms]="['UPDATE_COPY']">
191 <ng-container *ngTemplateOutlet="batchAttr;
192 context:{field:'owning_lib',required:true,template:owningLibTemplate,label:olLabel.text}">
196 <div *ngIf="displayAttr('copy_number')">
197 <ng-template #copyNumberTemplate>
198 <input type="number" class="form-control"
199 id="copy_number-input" [(ngModel)]="values['copy_number']"/>
201 <ng-container *ngTemplateOutlet="batchAttr;
202 context:{field:'copy_number',template:copyNumberTemplate}">
209 <div class="flex-1 p-1">
210 <div class="p-1"><h4 class="fw-bold" i18n>Circulation</h4></div>
212 <div *ngIf="displayAttr('circulate')">
213 <ng-template #circulateTemplate>
214 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'circulate'}">
217 <ng-container *ngTemplateOutlet="batchAttr;
218 context:{field:'circulate',required:true,template:circulateTemplate,displayAs:'bool'}">
222 <div *ngIf="displayAttr('holdable')">
223 <ng-template #holdableTemplate>
224 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'holdable'}">
227 <ng-container *ngTemplateOutlet="batchAttr;
228 context:{field:'holdable',required:true,template:holdableTemplate,displayAs:'bool'}">
232 <div *ngIf="displayAttr('age_protect')">
233 <ng-template #ageProtectTemplate>
234 <eg-combobox domId="age_protect-input"
235 (ngModelChange)="values['age_protect'] = $event ? $event.id : null"
236 [ngModel]="values['age_protect']">
238 *ngFor="let rule of volcopy.commonData.acp_age_protect"
239 [entryId]="rule.id()" [entryLabel]="rule.name()">
243 <ng-container *ngTemplateOutlet="batchAttr;
244 context:{field:'age_protect',template:ageProtectTemplate}">
248 <div *ngIf="displayAttr('floating')">
249 <ng-template #floatingTemplate>
250 <eg-combobox domId="floating-input"
251 (ngModelChange)="values['floating'] = $event ? $event.id : null"
252 [ngModel]="values['floating']">
254 *ngFor="let grp of volcopy.commonData.acp_floating_group"
255 [entryId]="grp.id()" [entryLabel]="grp.name()">
259 <ng-container *ngTemplateOutlet="batchAttr;
260 context:{field:'floating',template:floatingTemplate}">
264 <div *ngIf="displayAttr('loan_duration')">
265 <ng-template #loanDurationTemplate>
266 <select class="form-select"
267 id="loan_duration-input" [(ngModel)]="values['loan_duration']">
268 <option value="1" i18n>{{loanDurationShort.text}}</option>
269 <option value="2" i18n>{{loanDurationNormal.text}}</option>
270 <option value="3" i18n>{{loanDurationLong.text}}</option>
273 <ng-container *ngTemplateOutlet="batchAttr;
274 context:{field:'loan_duration',required:true,template:loanDurationTemplate}">
278 <div *ngIf="displayAttr('fine_level')">
279 <ng-template #fineLevelTemplate>
280 <select class="form-select"
281 id="fine_level-input" [(ngModel)]="values['fine_level']">
282 <option value="1" i18n>{{fineLevelLow.text}}</option>
283 <option value="2" i18n>{{fineLevelNormal.text}}</option>
284 <option value="3" i18n>{{fineLevelHigh.text}}</option>
287 <ng-container *ngTemplateOutlet="batchAttr;
288 context:{field:'fine_level',required:true,template:fineLevelTemplate}">
292 <div *ngIf="displayAttr('circ_as_type')">
293 <ng-template #circAsTypeTemplate>
294 <eg-combobox domId="circ_as_type-input"
295 (ngModelChange)="values['circ_as_type'] = $event ? $event.id : null"
296 [ngModel]="values['circ_as_type']">
297 <eg-combobox-entry *ngFor="let map of volcopy.commonData.acp_item_type_map"
298 [entryId]="map.code()" [entryLabel]="map.value()">
302 <ng-container *ngTemplateOutlet="batchAttr;
303 context:{field:'circ_as_type',template:circAsTypeTemplate}">
307 <div *ngIf="displayAttr('circ_modifier')">
308 <ng-template #circModifierTemplate>
309 <select class="form-select" id='circ_modifier-input'
310 [(ngModel)]="values['circ_modifier']">
311 <option [value]="null" i18n><Unset></option>
312 <option *ngFor="let mod of volcopy.commonData.acp_circ_modifier"
313 value="{{mod.code()}}">{{mod.name()}}</option>
316 <ng-container *ngTemplateOutlet="batchAttr;
317 context:{field:'circ_modifier',template:circModifierTemplate}">
325 <div class="flex-1 p-1">
326 <div class="p-1"><h4 class="fw-bold" i18n>Miscellaneous</h4></div>
328 <!-- Adding this for sites that still use alert messages (we do)
330 <ng-template #alertMessageTemplate>
331 <textarea rows="3" class="form-control" id="alert-message-input"
332 [(ngModel)]="values['alert_message']">
335 <eg-batch-item-attr label="Alert Message" i18n-label
336 editInputDomId="alert-message-input"
337 [editTemplate]="alertMessageTemplate"
338 [labelCounts]="itemAttrCounts('alert_message')"
339 (changesSaved)="applyCopyValue('alert_message')">
340 </eg-batch-item-attr>
344 <div class="border rounded m-1" *ngIf="displayAttr('copy_alerts')">
345 <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
346 <div class="batch-header fw-bold p-2" i18n>Add Item Alerts</div>
348 <button type="button" class="btn btn-outline-dark" (click)="openCopyAlerts()" i18n>
354 <div *ngIf="displayAttr('deposit')">
355 <ng-template #depositTemplate>
356 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'deposit'}">
359 <ng-container *ngTemplateOutlet="batchAttr;
360 context:{field:'deposit',required:true,template:depositTemplate,displayAs:'bool'}">
364 <div *ngIf="displayAttr('deposit_amount')">
365 <ng-template #depositAmountTemplate>
366 <input type="number" class="form-control"
367 id="deposit_amount-input" [(ngModel)]="values['deposit_amount']"/>
369 <ng-container *ngTemplateOutlet="batchAttr;
370 context:{field:'deposit_amount',required:true,template:depositAmountTemplate,displayAs:'currency'}">
374 <div *ngIf="displayAttr('price')">
375 <ng-template #priceTemplate>
376 <input type="number" class="form-control"
377 id="price-input" [(ngModel)]="values['price']"/>
379 <ng-container *ngTemplateOutlet="batchAttr;
380 context:{field:'price',template:priceTemplate,displayAs:'currency'}">
384 <div *ngIf="displayAttr('opac_visible')">
385 <ng-template #opacVisibleTemplate>
386 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'opac_visible'}">
389 <ng-container *ngTemplateOutlet="batchAttr;
390 context:{field:'opac_visible',required:true,template:opacVisibleTemplate,displayAs:'bool'}">
394 <div *ngIf="displayAttr('ref')">
395 <ng-template #refTemplate>
396 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'ref'}">
399 <ng-container *ngTemplateOutlet="batchAttr;
400 context:{field:'ref',required:true,template:refTemplate,displayAs:'bool'}">
404 <div *ngIf="displayAttr('cost')">
405 <ng-template #costTemplate>
406 <input type="number" class="form-control"
407 id="cost-input" [(ngModel)]="values['cost']"/>
409 <ng-container *ngTemplateOutlet="batchAttr;
410 context:{field:'cost',template:costTemplate,displayAs:'currency'}">
414 <div *ngIf="displayAttr('mint_condition')">
415 <ng-template #mintConditionTemplate>
416 <select class="form-select"
417 id="mint_condition-input" [(ngModel)]="values['mint_condition']">
418 <option value="t" i18n>{{mintConditionYes.text}}</option>
419 <option value="f" i18n>{{mintConditionNo.text}}</option>
422 <ng-container *ngTemplateOutlet="batchAttr;
423 context:{field:'mint_condition',template:mintConditionTemplate}">
430 <div class="flex-1 p-1">
431 <div class="p-1"><h4 class="fw-bold" i18n>Statistics</h4></div>
433 <div class="border rounded m-1" *ngIf="displayAttr('copy_tags')">
434 <eg-copy-tags-dialog #copyTagsDialog></eg-copy-tags-dialog>
435 <div class="batch-header fw-bold p-2" i18n>Add Item Tags</div>
437 <button type="button" class="btn btn-outline-dark" (click)="openCopyTags()" i18n>
443 <div class="border rounded m-1" *ngIf="displayAttr('copy_notes')">
444 <eg-copy-notes-dialog #copyNotesDialog></eg-copy-notes-dialog>
445 <div class="batch-header fw-bold p-2" i18n>Add Item Notes</div>
447 <button type="button" class="btn btn-outline-dark" (click)="openCopyNotes()" i18n>
453 <div class="border rounded m-1" *ngIf="displayAttr('statcat_filter')">
454 <div class="batch-header font-weight-bold p-2">
455 <label for="statcat_filter-select" class="form-label" i18n>Stat Cat Filter</label>
459 domId="statcat_filter-select"
460 placeholder="Stat Cat Filter..." i18n-placeholder
461 [initialOrgId]="statCatFilter"
462 (onChange)="statCatFilter = $event ? $event.id() : null">
467 <ng-container *ngIf="displayAttr('statcats')">
468 <div *ngFor="let cat of statCats()">
469 <ng-template #statCatTemplate>
470 <eg-combobox domId="stat-cat-input-{{cat.id()}}"
471 (ngModelChange)="statCatValues[cat.id()] = $event ? $event.id : null"
472 [ngModel]="statCatValues[cat.id()]">
473 <eg-combobox-entry *ngFor="let entry of cat.entries()"
474 [entryId]="entry.id()" [entryLabel]="entry.value()">
478 <eg-batch-item-attr label="{{cat.name()}} ({{orgSn(cat.owner())}})" i18n-label
479 name="stat_cat_{{cat.id()}}" editInputDomId="stat-cat-input-{{cat.id()}}"
480 [valueRequired]="cat.required() === 't'"
481 [editTemplate]="statCatTemplate"
482 [labelCounts]="statCatCounts(cat.id())"
483 (valueCleared)="statCatChanged(cat.id(), true)"
484 (changesSaved)="statCatChanged(cat.id())">
485 </eg-batch-item-attr>