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 <!-- We ask this question a lot. Here's a handy template -->
15 <ng-template #yesNoSelect let-field="field">
16 <eg-combobox domId="{{field}}-input"
17 [required]="true" [ngModel]="values['field']"
18 (ngModelChange)="values[field] = $event ? $event.id : null">
19 <eg-combobox-entry entryId="t" entryLabel="Yes" i18n-entryLabel>
21 <eg-combobox-entry entryId="f" entryLabel="No" i18n-entryLabel>
26 <!-- this one is also repeated a lot -->
27 <ng-template #batchAttr let-field="field" let-required="required"
28 let-label="label" let-template="template" let-displayAs="displayAs">
31 [label]="label || copyFieldLabel(field)"
32 [valueRequired]="required"
33 [displayAs]="displayAs"
34 [editInputDomId]="field + '-input'"
35 [editTemplate]="template"
36 [labelCounts]="itemAttrCounts(field)"
37 (valueCleared)="applyCopyValue(field, null)"
38 (changesSaved)="applyCopyValue(field, undefined, $event)">
42 <!-- Copy Templates -->
43 <div class="row border rounded border-dark pt-2 pb-2 bg-faint">
44 <div class="col-lg-1 font-weight-bold" i18n>Templates:</div>
45 <div class="col-lg-4">
46 <eg-combobox #copyTemplateCbox domId="template-select"
47 [allowFreeText]="true" [entries]="volcopy.templateNames">
50 <div class="col-lg-7 d-flex">
51 <button class="btn btn-outline-dark mr-2" (click)="applyTemplate()" i18n>Apply</button>
52 <button class="btn btn-outline-dark mr-2" (click)="saveTemplate()" i18n>Save</button>
55 The typical approach of wrapping a file input in a <label> results
56 in button-ish things that have slightly different dimensions.
57 Instead have a button activate a hidden file input.
59 <button class="btn btn-outline-dark mr-2" (click)="templateFile.click()">
60 <input type="file" class="d-none" #templateFile
61 (change)="importTemplate($event)" id="template-file-upload"/>
62 <span i18n>Import</span>
65 <a (click)="exportTemplate($event)"
66 download="export_copy_template.json" [href]="exportTemplateUrl()">
67 <button class="btn btn-outline-dark mr-2" i18n>Export</button>
70 <div class="flex-1"> </div>
71 <button class="btn btn-outline-danger mr-2"
72 (click)="deleteTemplate()" i18n>Delete Template</button>
77 <div class="row d-flex">
80 <div class="flex-1 p-1">
81 <div class="p-1"><h4 class="font-weight-bold" i18n>Identification</h4></div>
84 <div class="mb-1" *ngIf="displayAttr('status')">
86 <ng-container *ngIf="statusEditable(); else noEditStat">
87 <ng-template #statusTemplate>
88 <eg-combobox domId="status-input"
89 (ngModelChange)="values['status'] = $event ? $event.id : null"
90 [ngModel]="values['status']" [disableEntries]="volcopy.magicCopyStats">
92 *ngFor="let stat of volcopy.commonData.acp_status"
93 [entryId]="stat.id()" [entryLabel]="stat.name()">
97 <ng-container *ngTemplateOutlet="batchAttr;
98 context:{field:'status',template:statusTemplate}">
102 <ng-template #noEditStat>
103 <eg-batch-item-attr label="Status" i18n-label [readOnly]="true"
104 [labelCounts]="itemAttrCounts('status')">
105 </eg-batch-item-attr>
109 <div class="mb-1" *ngIf="displayAttr('barcode')">
110 <eg-batch-item-attr label="Barcode" i18n-label
111 [readOnly]="true" [labelCounts]="itemAttrCounts('barcode')">
112 </eg-batch-item-attr>
115 <div class="mb-1" *ngIf="displayAttr('create_date')">
116 <eg-batch-item-attr label="Creation Date" i18n-label [readOnly]="true"
117 [labelCounts]="itemAttrCounts('create_date')">
118 </eg-batch-item-attr>
121 <div class="mb-1" *ngIf="displayAttr('active_date')">
122 <eg-batch-item-attr label="Active Date" i18n-label [readOnly]="true"
123 [labelCounts]="itemAttrCounts('active_date')">
124 </eg-batch-item-attr>
127 <div class="mb-1" *ngIf="displayAttr('creator')">
128 <eg-batch-item-attr label="Creator" i18n-label [readOnly]="true"
129 [labelCounts]="itemAttrCounts('creator')">
130 </eg-batch-item-attr>
133 <div class="mb-1" *ngIf="displayAttr('edit_date')">
134 <eg-batch-item-attr label="Last Edit Date" i18n-label [readOnly]="true"
135 [labelCounts]="itemAttrCounts('edit_date')">
136 </eg-batch-item-attr>
139 <div class="mb-1" *ngIf="displayAttr('editor')">
140 <eg-batch-item-attr label="Last Editor" i18n-label [readOnly]="true"
141 [labelCounts]="itemAttrCounts('editor')">
142 </eg-batch-item-attr>
148 <div class="flex-1 p-1">
149 <div class="p-1"><h4 class="font-weight-bold" i18n>Location</h4></div>
151 <div *ngIf="displayAttr('location')">
152 <ng-template #locationTemplate>
153 <eg-item-location-select (valueChange)="values['location'] = $event"
154 domId='location-input' [required]="true" permFilter="UPDATE_COPY">
155 </eg-item-location-select>
157 <ng-container *ngTemplateOutlet="batchAttr;
158 context:{field:'location',required:true,template:locationTemplate}">
162 <div *ngIf="displayAttr('circ_lib')">
163 <ng-template #circLibTemplate>
165 domId="circ_lib-input"
166 (onChange)="values['circ_lib'] = $event ? $event.id() : null"
167 [hideOrgs]="volcopy.hideVolOrgs"
168 [limitPerms]="['UPDATE_COPY']">
171 <ng-container *ngTemplateOutlet="batchAttr;
172 context:{field:'circ_lib',required:true,template:circLibTemplate}">
176 <div *ngIf="displayAttr('owning_lib')">
177 <ng-template #owningLibTemplate>
179 domId="owning_lib-input"
180 (onChange)="values['owning_lib'] = $event ? $event.id() : null"
181 [hideOrgs]="volcopy.hideVolOrgs"
182 [limitPerms]="['UPDATE_COPY']">
185 <ng-container *ngTemplateOutlet="batchAttr;
186 context:{field:'owning_lib',required:true,template:owningLibTemplate,label:olLabel.text}">
190 <div *ngIf="displayAttr('copy_number')">
191 <ng-template #copyNumberTemplate>
192 <input type="number" class="form-control"
193 id="copy_number-input" [(ngModel)]="values['copy_number']"/>
195 <ng-container *ngTemplateOutlet="batchAttr;
196 context:{field:'copy_number',template:copyNumberTemplate}">
203 <div class="flex-1 p-1">
204 <div class="p-1"><h4 class="font-weight-bold" i18n>Circulation</h4></div>
206 <div *ngIf="displayAttr('circulate')">
207 <ng-template #circulateTemplate>
208 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'circulate'}">
211 <ng-container *ngTemplateOutlet="batchAttr;
212 context:{field:'circulate',required:true,template:circulateTemplate,displayAs:'bool'}">
216 <div *ngIf="displayAttr('holdable')">
217 <ng-template #holdableTemplate>
218 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'holdable'}">
221 <ng-container *ngTemplateOutlet="batchAttr;
222 context:{field:'holdable',required:true,template:holdableTemplate,displayAs:'bool'}">
226 <div *ngIf="displayAttr('age_protect')">
227 <ng-template #ageProtectTemplate>
228 <eg-combobox domId="age_protect-input"
229 (ngModelChange)="values['age_protect'] = $event ? $event.id : null"
230 [ngModel]="values['age_protect']">
232 *ngFor="let rule of volcopy.commonData.acp_age_protect"
233 [entryId]="rule.id()" [entryLabel]="rule.name()">
237 <ng-container *ngTemplateOutlet="batchAttr;
238 context:{field:'age_protect',template:ageProtectTemplate}">
242 <div *ngIf="displayAttr('floating')">
243 <ng-template #floatingTemplate>
244 <eg-combobox domId="floating-input"
245 (ngModelChange)="values['floating'] = $event ? $event.id : null"
246 [ngModel]="values['floating']">
248 *ngFor="let grp of volcopy.commonData.acp_floating_group"
249 [entryId]="grp.id()" [entryLabel]="grp.name()">
253 <ng-container *ngTemplateOutlet="batchAttr;
254 context:{field:'floating',template:floatingTemplate}">
258 <div *ngIf="displayAttr('loan_duration')">
259 <ng-template #loanDurationTemplate>
260 <select class="form-control"
261 id="loan_duration-input" [(ngModel)]="values['loan_duration']">
262 <option value="1" i18n>{{loanDurationShort.text}}</option>
263 <option value="2" i18n>{{loanDurationNormal.text}}</option>
264 <option value="3" i18n>{{loanDurationLong.text}}</option>
267 <ng-container *ngTemplateOutlet="batchAttr;
268 context:{field:'loan_duration',required:true,template:loanDurationTemplate}">
272 <div *ngIf="displayAttr('fine_level')">
273 <ng-template #fineLevelTemplate>
274 <select class="form-control"
275 id="fine_level-input" [(ngModel)]="values['fine_level']">
276 <option value="1" i18n>{{fineLevelLow.text}}</option>
277 <option value="2" i18n>{{fineLevelNormal.text}}</option>
278 <option value="3" i18n>{{fineLevelHigh.text}}</option>
281 <ng-container *ngTemplateOutlet="batchAttr;
282 context:{field:'fine_level',required:true,template:fineLevelTemplate}">
286 <div *ngIf="displayAttr('circ_as_type')">
287 <ng-template #circAsTypeTemplate>
288 <eg-combobox domId="circ_as_type-input"
289 (ngModelChange)="values['circ_as_type'] = $event ? $event.id : null"
290 [ngModel]="values['circ_as_type']">
291 <eg-combobox-entry *ngFor="let map of volcopy.commonData.acp_item_type_map"
292 [entryId]="map.code()" [entryLabel]="map.value()">
296 <ng-container *ngTemplateOutlet="batchAttr;
297 context:{field:'circ_as_type',template:circAsTypeTemplate}">
301 <div *ngIf="displayAttr('circ_modifier')">
302 <ng-template #circModifierTemplate>
303 <select class="form-control" id='circ_modifier-input'
304 [(ngModel)]="values['circ_modifier']">
305 <option [value]="null" i18n><Unset></option>
306 <option *ngFor="let mod of volcopy.commonData.acp_circ_modifier"
307 value="{{mod.code()}}">{{mod.name()}}</option>
310 <ng-container *ngTemplateOutlet="batchAttr;
311 context:{field:'circ_modifier',template:circModifierTemplate}">
319 <div class="flex-1 p-1">
320 <div class="p-1"><h4 class="font-weight-bold" i18n>Miscellaneous</h4></div>
322 <!-- Adding this for sites that still use alert messages (we do)
324 <ng-template #alertMessageTemplate>
325 <textarea rows="3" class="form-control" id="alert-message-input"
326 [(ngModel)]="values['alert_message']">
329 <eg-batch-item-attr label="Alert Message" i18n-label
330 editInputDomId="alert-message-input"
331 [editTemplate]="alertMessageTemplate"
332 [labelCounts]="itemAttrCounts('alert_message')"
333 (changesSaved)="applyCopyValue('alert_message')">
334 </eg-batch-item-attr>
338 <div class="border rounded m-1" *ngIf="displayAttr('copy_alerts')">
339 <eg-copy-alerts-dialog #copyAlertsDialog></eg-copy-alerts-dialog>
340 <div class="batch-header font-weight-bold p-2" i18n>Add Item Alerts</div>
342 <button class="btn btn-outline-dark" (click)="openCopyAlerts()" i18n>
348 <div *ngIf="displayAttr('deposit')">
349 <ng-template #depositTemplate>
350 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'deposit'}">
353 <ng-container *ngTemplateOutlet="batchAttr;
354 context:{field:'deposit',required:true,template:depositTemplate,displayAs:'bool'}">
358 <div *ngIf="displayAttr('deposit_amount')">
359 <ng-template #depositAmountTemplate>
360 <input type="number" class="form-control"
361 id="deposit_amount-input" [(ngModel)]="values['deposit_amount']"/>
363 <ng-container *ngTemplateOutlet="batchAttr;
364 context:{field:'deposit_amount',required:true,template:depositAmountTemplate,displayAs:'currency'}">
368 <div *ngIf="displayAttr('price')">
369 <ng-template #priceTemplate>
370 <input type="number" class="form-control"
371 id="price-input" [(ngModel)]="values['price']"/>
373 <ng-container *ngTemplateOutlet="batchAttr;
374 context:{field:'price',template:priceTemplate,displayAs:'currency'}">
378 <div *ngIf="displayAttr('opac_visible')">
379 <ng-template #opacVisibleTemplate>
380 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'opac_visible'}">
383 <ng-container *ngTemplateOutlet="batchAttr;
384 context:{field:'opac_visible',required:true,template:opacVisibleTemplate,displayAs:'bool'}">
388 <div *ngIf="displayAttr('ref')">
389 <ng-template #refTemplate>
390 <ng-container *ngTemplateOutlet="yesNoSelect;context:{field:'ref'}">
393 <ng-container *ngTemplateOutlet="batchAttr;
394 context:{field:'ref',required:true,template:refTemplate,displayAs:'bool'}">
398 <div *ngIf="displayAttr('cost')">
399 <ng-template #costTemplate>
400 <input type="number" class="form-control"
401 id="cost-input" [(ngModel)]="values['cost']"/>
403 <ng-container *ngTemplateOutlet="batchAttr;
404 context:{field:'cost',template:costTemplate,displayAs:'currency'}">
408 <div *ngIf="displayAttr('mint_condition')">
409 <ng-template #mintConditionTemplate>
410 <select class="form-control"
411 id="mint_condition-input" [(ngModel)]="values['mint_condition']">
412 <option value="t" i18n>{{mintConditionYes.text}}</option>
413 <option value="f" i18n>{{mintConditionNo.text}}</option>
416 <ng-container *ngTemplateOutlet="batchAttr;
417 context:{field:'mint_condition',template:mintConditionTemplate}">
424 <div class="flex-1 p-1">
425 <div class="p-1"><h4 class="font-weight-bold" i18n>Statistics</h4></div>
427 <div class="border rounded m-1" *ngIf="displayAttr('copy_tags')">
428 <eg-copy-tags-dialog #copyTagsDialog></eg-copy-tags-dialog>
429 <div class="batch-header font-weight-bold p-2" i18n>Add Item Tags</div>
431 <button class="btn btn-outline-dark" (click)="openCopyTags()" i18n>
437 <div class="border rounded m-1" *ngIf="displayAttr('copy_notes')">
438 <eg-copy-notes-dialog #copyNotesDialog></eg-copy-notes-dialog>
439 <div class="batch-header font-weight-bold p-2" i18n>Add Item Notes</div>
441 <button class="btn btn-outline-dark" (click)="openCopyNotes()" i18n>
447 <div class="border rounded m-1" *ngIf="displayAttr('statcat_filter')">
448 <div class="batch-header font-weight-bold p-2" i18n>Stat Cat Filter</div>
451 domId="statcat_filter-select"
452 placeholder="Stat Cat Filter..." i18n-placeholder
453 [initialOrgId]="statCatFilter"
454 (onChange)="statCatFilter = $event ? $event.id() : null">
459 <ng-container *ngIf="displayAttr('statcats')">
460 <div *ngFor="let cat of statCats()">
461 <ng-template #statCatTemplate>
462 <eg-combobox domId="stat-cat-input-{{cat.id()}}"
463 (ngModelChange)="statCatValues[cat.id()] = $event ? $event.id : null"
464 [ngModel]="statCatValues[cat.id()]">
465 <eg-combobox-entry *ngFor="let entry of cat.entries()"
466 [entryId]="entry.id()" [entryLabel]="entry.value()">
470 <eg-batch-item-attr label="{{cat.name()}} ({{orgSn(cat.owner())}})" i18n-label
471 name="stat_cat_{{cat.id()}}" editInputDomId="stat-cat-input-{{cat.id()}}"
472 [editTemplate]="statCatTemplate"
473 [labelCounts]="statCatCounts(cat.id())"
474 (valueCleared)="statCatChanged(cat.id(), true)"
475 (changesSaved)="statCatChanged(cat.id())">
476 </eg-batch-item-attr>