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 font-weight-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 class="btn btn-outline-dark mr-2" (click)="applyTemplate()" i18n>Apply</button>
55 <button class="btn btn-outline-dark mr-2" (click)="saveTemplate()" i18n>Save</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 class="btn btn-outline-dark mr-2" (click)="templateFile.click()">
63 <input type="file" class="d-none" #templateFile
64 (change)="importTemplate($event)" id="template-file-upload"/>
65 <span i18n>Import</span>
68 <a (click)="exportTemplate($event)"
69 download="export_copy_template.json" [href]="exportTemplateUrl()">
70 <button class="btn btn-outline-dark mr-2" i18n>Export</button>
73 <div class="flex-1"> </div>
74 <button class="btn btn-outline-danger mr-2"
75 (click)="deleteTemplate()" i18n>Delete Template</button>
80 <div class="row d-flex">
83 <div class="flex-1 p-1">
84 <div class="p-1"><h4 class="font-weight-bold" i18n>Identification</h4></div>
87 <div class="mb-1" *ngIf="displayAttr('status')">
89 <ng-container *ngIf="statusEditable(); else noEditStat">
90 <ng-template #statusTemplate>
91 <eg-combobox domId="status-input"
92 (ngModelChange)="values['status'] = $event ? $event.id : null"
93 [ngModel]="values['status']" [disableEntries]="volcopy.magicCopyStats">
95 *ngFor="let stat of volcopy.commonData.acp_status"
96 [entryId]="stat.id()" [entryLabel]="stat.name()">
100 <ng-container *ngTemplateOutlet="batchAttr;
101 context:{field:'status',template:statusTemplate}">
105 <ng-template #noEditStat>
106 <eg-batch-item-attr label="Status" i18n-label [readOnly]="true"
107 [labelCounts]="itemAttrCounts('status')">
108 </eg-batch-item-attr>
112 <div class="mb-1" *ngIf="displayAttr('barcode')">
113 <eg-batch-item-attr label="Barcode" i18n-label
114 [readOnly]="true" [labelCounts]="itemAttrCounts('barcode')">
115 </eg-batch-item-attr>
118 <div class="mb-1" *ngIf="displayAttr('create_date')">
119 <eg-batch-item-attr label="Creation Date" i18n-label [readOnly]="true"
120 [labelCounts]="itemAttrCounts('create_date')">
121 </eg-batch-item-attr>
124 <div class="mb-1" *ngIf="displayAttr('active_date')">
125 <eg-batch-item-attr label="Active Date" i18n-label [readOnly]="true"
126 [labelCounts]="itemAttrCounts('active_date')">
127 </eg-batch-item-attr>
130 <div class="mb-1" *ngIf="displayAttr('creator')">
131 <eg-batch-item-attr label="Creator" i18n-label [readOnly]="true"
132 [labelCounts]="itemAttrCounts('creator')">
133 </eg-batch-item-attr>
136 <div class="mb-1" *ngIf="displayAttr('edit_date')">
137 <eg-batch-item-attr label="Last Edit Date" i18n-label [readOnly]="true"
138 [labelCounts]="itemAttrCounts('edit_date')">
139 </eg-batch-item-attr>
142 <div class="mb-1" *ngIf="displayAttr('editor')">
143 <eg-batch-item-attr label="Last Editor" i18n-label [readOnly]="true"
144 [labelCounts]="itemAttrCounts('editor')">
145 </eg-batch-item-attr>
151 <div class="flex-1 p-1">
152 <div class="p-1"><h4 class="font-weight-bold" i18n>Location</h4></div>
154 <div *ngIf="displayAttr('location')">
155 <ng-template #locationTemplate>
156 <eg-item-location-select (valueChange)="values['location'] = $event"
157 [contextOrgIds]="copyLocationOrgs()"
158 domId='location-input' [required]="true" permFilter="UPDATE_COPY">
159 </eg-item-location-select>
161 <ng-container *ngTemplateOutlet="batchAttr;
162 context:{field:'location',required:true,template:locationTemplate}">
166 <div *ngIf="displayAttr('circ_lib')">
167 <ng-template #circLibTemplate>
169 domId="circ_lib-input"
170 (onChange)="values['circ_lib'] = $event ? $event.id() : null"
171 [hideOrgs]="volcopy.hideVolOrgs"
172 [limitPerms]="['UPDATE_COPY']">
175 <ng-container *ngTemplateOutlet="batchAttr;
176 context:{field:'circ_lib',required:true,template:circLibTemplate}">
180 <div *ngIf="displayAttr('owning_lib')">
181 <ng-template #owningLibTemplate>
183 domId="owning_lib-input"
184 (onChange)="values['owning_lib'] = $event ? $event.id() : null"
185 [hideOrgs]="volcopy.hideVolOrgs"
186 [limitPerms]="['UPDATE_COPY']">
189 <ng-container *ngTemplateOutlet="batchAttr;
190 context:{field:'owning_lib',required:true,template:owningLibTemplate,label:olLabel.text}">
194 <div *ngIf="displayAttr('copy_number')">
195 <ng-template #copyNumberTemplate>
196 <input type="number" class="form-control"
197 id="copy_number-input" [(ngModel)]="values['copy_number']"/>
199 <ng-container *ngTemplateOutlet="batchAttr;
200 context:{field:'copy_number',template:copyNumberTemplate}">
207 <div class="flex-1 p-1">
208 <div class="p-1"><h4 class="font-weight-bold" i18n>Circulation</h4></div>
210 <div *ngIf="displayAttr('circulate')">
211 <ng-template #circulateTemplate>
212 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'circulate'}">
215 <ng-container *ngTemplateOutlet="batchAttr;
216 context:{field:'circulate',required:true,template:circulateTemplate,displayAs:'bool'}">
220 <div *ngIf="displayAttr('holdable')">
221 <ng-template #holdableTemplate>
222 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'holdable'}">
225 <ng-container *ngTemplateOutlet="batchAttr;
226 context:{field:'holdable',required:true,template:holdableTemplate,displayAs:'bool'}">
230 <div *ngIf="displayAttr('age_protect')">
231 <ng-template #ageProtectTemplate>
232 <eg-combobox domId="age_protect-input"
233 (ngModelChange)="values['age_protect'] = $event ? $event.id : null"
234 [ngModel]="values['age_protect']">
236 *ngFor="let rule of volcopy.commonData.acp_age_protect"
237 [entryId]="rule.id()" [entryLabel]="rule.name()">
241 <ng-container *ngTemplateOutlet="batchAttr;
242 context:{field:'age_protect',template:ageProtectTemplate}">
246 <div *ngIf="displayAttr('floating')">
247 <ng-template #floatingTemplate>
248 <eg-combobox domId="floating-input"
249 (ngModelChange)="values['floating'] = $event ? $event.id : null"
250 [ngModel]="values['floating']">
252 *ngFor="let grp of volcopy.commonData.acp_floating_group"
253 [entryId]="grp.id()" [entryLabel]="grp.name()">
257 <ng-container *ngTemplateOutlet="batchAttr;
258 context:{field:'floating',template:floatingTemplate}">
262 <div *ngIf="displayAttr('loan_duration')">
263 <ng-template #loanDurationTemplate>
264 <select class="form-control"
265 id="loan_duration-input" [(ngModel)]="values['loan_duration']">
266 <option value="1" i18n>{{loanDurationShort.text}}</option>
267 <option value="2" i18n>{{loanDurationNormal.text}}</option>
268 <option value="3" i18n>{{loanDurationLong.text}}</option>
271 <ng-container *ngTemplateOutlet="batchAttr;
272 context:{field:'loan_duration',required:true,template:loanDurationTemplate}">
276 <div *ngIf="displayAttr('fine_level')">
277 <ng-template #fineLevelTemplate>
278 <select class="form-control"
279 id="fine_level-input" [(ngModel)]="values['fine_level']">
280 <option value="1" i18n>{{fineLevelLow.text}}</option>
281 <option value="2" i18n>{{fineLevelNormal.text}}</option>
282 <option value="3" i18n>{{fineLevelHigh.text}}</option>
285 <ng-container *ngTemplateOutlet="batchAttr;
286 context:{field:'fine_level',required:true,template:fineLevelTemplate}">
290 <div *ngIf="displayAttr('circ_as_type')">
291 <ng-template #circAsTypeTemplate>
292 <eg-combobox domId="circ_as_type-input"
293 (ngModelChange)="values['circ_as_type'] = $event ? $event.id : null"
294 [ngModel]="values['circ_as_type']">
295 <eg-combobox-entry *ngFor="let map of volcopy.commonData.acp_item_type_map"
296 [entryId]="map.code()" [entryLabel]="map.value()">
300 <ng-container *ngTemplateOutlet="batchAttr;
301 context:{field:'circ_as_type',template:circAsTypeTemplate}">
305 <div *ngIf="displayAttr('circ_modifier')">
306 <ng-template #circModifierTemplate>
307 <select class="form-control" id='circ_modifier-input'
308 [(ngModel)]="values['circ_modifier']">
309 <option [value]="null" i18n><Unset></option>
310 <option *ngFor="let mod of volcopy.commonData.acp_circ_modifier"
311 value="{{mod.code()}}">{{mod.name()}}</option>
314 <ng-container *ngTemplateOutlet="batchAttr;
315 context:{field:'circ_modifier',template:circModifierTemplate}">
323 <div class="flex-1 p-1">
324 <div class="p-1"><h4 class="font-weight-bold" i18n>Miscellaneous</h4></div>
326 <!-- Adding this for sites that still use alert messages (we do)
328 <ng-template #alertMessageTemplate>
329 <textarea rows="3" class="form-control" id="alert-message-input"
330 [(ngModel)]="values['alert_message']">
333 <eg-batch-item-attr label="Alert Message" i18n-label
334 editInputDomId="alert-message-input"
335 [editTemplate]="alertMessageTemplate"
336 [labelCounts]="itemAttrCounts('alert_message')"
337 (changesSaved)="applyCopyValue('alert_message')">
338 </eg-batch-item-attr>
342 <div class="border rounded m-1" *ngIf="displayAttr('copy_alerts')">
343 <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
344 <div class="batch-header font-weight-bold p-2" i18n>Add Item Alerts</div>
346 <button class="btn btn-outline-dark" (click)="openCopyAlerts()" i18n>
352 <div *ngIf="displayAttr('deposit')">
353 <ng-template #depositTemplate>
354 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'deposit'}">
357 <ng-container *ngTemplateOutlet="batchAttr;
358 context:{field:'deposit',required:true,template:depositTemplate,displayAs:'bool'}">
362 <div *ngIf="displayAttr('deposit_amount')">
363 <ng-template #depositAmountTemplate>
364 <input type="number" class="form-control"
365 id="deposit_amount-input" [(ngModel)]="values['deposit_amount']"/>
367 <ng-container *ngTemplateOutlet="batchAttr;
368 context:{field:'deposit_amount',required:true,template:depositAmountTemplate,displayAs:'currency'}">
372 <div *ngIf="displayAttr('price')">
373 <ng-template #priceTemplate>
374 <input type="number" class="form-control"
375 id="price-input" [(ngModel)]="values['price']"/>
377 <ng-container *ngTemplateOutlet="batchAttr;
378 context:{field:'price',template:priceTemplate,displayAs:'currency'}">
382 <div *ngIf="displayAttr('opac_visible')">
383 <ng-template #opacVisibleTemplate>
384 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'opac_visible'}">
387 <ng-container *ngTemplateOutlet="batchAttr;
388 context:{field:'opac_visible',required:true,template:opacVisibleTemplate,displayAs:'bool'}">
392 <div *ngIf="displayAttr('ref')">
393 <ng-template #refTemplate>
394 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'ref'}">
397 <ng-container *ngTemplateOutlet="batchAttr;
398 context:{field:'ref',required:true,template:refTemplate,displayAs:'bool'}">
402 <div *ngIf="displayAttr('cost')">
403 <ng-template #costTemplate>
404 <input type="number" class="form-control"
405 id="cost-input" [(ngModel)]="values['cost']"/>
407 <ng-container *ngTemplateOutlet="batchAttr;
408 context:{field:'cost',template:costTemplate,displayAs:'currency'}">
412 <div *ngIf="displayAttr('mint_condition')">
413 <ng-template #mintConditionTemplate>
414 <select class="form-control"
415 id="mint_condition-input" [(ngModel)]="values['mint_condition']">
416 <option value="t" i18n>{{mintConditionYes.text}}</option>
417 <option value="f" i18n>{{mintConditionNo.text}}</option>
420 <ng-container *ngTemplateOutlet="batchAttr;
421 context:{field:'mint_condition',template:mintConditionTemplate}">
428 <div class="flex-1 p-1">
429 <div class="p-1"><h4 class="font-weight-bold" i18n>Statistics</h4></div>
431 <div class="border rounded m-1" *ngIf="displayAttr('copy_tags')">
432 <eg-copy-tags-dialog #copyTagsDialog></eg-copy-tags-dialog>
433 <div class="batch-header font-weight-bold p-2" i18n>Add Item Tags</div>
435 <button class="btn btn-outline-dark" (click)="openCopyTags()" i18n>
441 <div class="border rounded m-1" *ngIf="displayAttr('copy_notes')">
442 <eg-copy-notes-dialog #copyNotesDialog></eg-copy-notes-dialog>
443 <div class="batch-header font-weight-bold p-2" i18n>Add Item Notes</div>
445 <button class="btn btn-outline-dark" (click)="openCopyNotes()" i18n>
451 <div class="border rounded m-1" *ngIf="displayAttr('statcat_filter')">
452 <div class="batch-header font-weight-bold p-2" i18n>Stat Cat Filter</div>
455 domId="statcat_filter-select"
456 placeholder="Stat Cat Filter..." i18n-placeholder
457 [initialOrgId]="statCatFilter"
458 (onChange)="statCatFilter = $event ? $event.id() : null">
463 <ng-container *ngIf="displayAttr('statcats')">
464 <div *ngFor="let cat of statCats()">
465 <ng-template #statCatTemplate>
466 <eg-combobox domId="stat-cat-input-{{cat.id()}}"
467 (ngModelChange)="statCatValues[cat.id()] = $event ? $event.id : null"
468 [ngModel]="statCatValues[cat.id()]">
469 <eg-combobox-entry *ngFor="let entry of cat.entries()"
470 [entryId]="entry.id()" [entryLabel]="entry.value()">
474 <eg-batch-item-attr label="{{cat.name()}} ({{orgSn(cat.owner())}})" i18n-label
475 name="stat_cat_{{cat.id()}}" editInputDomId="stat-cat-input-{{cat.id()}}"
476 [valueRequired]="cat.required() === 't'"
477 [editTemplate]="statCatTemplate"
478 [labelCounts]="statCatCounts(cat.id())"
479 (valueCleared)="statCatChanged(cat.id(), true)"
480 (changesSaved)="statCatChanged(cat.id())">
481 </eg-batch-item-attr>