cbc51753ec511580900bd3aa78461769d3468126
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / catalog / hold / hold.component.html
1
2 <eg-patron-search-dialog #patronSearch>
3 </eg-patron-search-dialog>
4
5 <div class="row">
6   <div class="col-lg-1">
7     <button class="btn btn-info label-with-material-icon"
8       (click)="goBack()" [disabled]="hasNoHistory()">
9       <span class="material-icons">keyboard_backspace</span>
10       <span i18n>Return</span>
11     </button>
12   </div>
13   <div class="col-lg-5">
14     <ng-container *ngIf="badBarcode">
15       <div class="alert alert-danger" i18n>
16         Barcode '{{badBarcode}}' not found.
17       </div>
18     </ng-container>
19     <ng-container *ngIf="!badBarcode">
20       <h3 i18n>Place Hold
21         <small *ngIf="user">
22         ({{user.family_name()}}, {{user.first_given_name()}})
23         </small>
24       </h3>
25     </ng-container>
26   </div>
27   <div class="col-lg-2">
28     <button class="btn btn-outline-dark btn-sm" (click)="searchPatrons()">
29       <span class="material-icons mat-icon-in-button align-middle"
30         i18n-title title="Search for Patron">search</span>
31       <span class="align-middle" i18n>Search for Patron</span>
32     </button>
33   </div>
34 </div>
35
36 <form class="form form-validated common-form"
37   autocomplete="off" (keydown.enter)="$event.preventDefault()">
38   <div class="row">
39     <div class="col-lg-6 common-form striped-odd">
40       <div class="row mt-2">
41         <div class="col-lg-6">
42           <div class="form-check">
43             <input class="form-check-input" type="radio"
44               (change)="holdForChanged()"
45               id="hold-for-patron"
46               name="holdFor" value="patron" [(ngModel)]="holdFor"/>
47             <label class="form-check-label" for="hold-for-patron" i18n>
48               Place hold for patron by barcode:
49             </label>
50           </div>
51         </div>
52         <div class="col-lg-6">
53           <div class="input-group">
54             <input type='text' class="form-control" name="userBarcode"
55               [disabled]="holdFor!='patron'" id='patron-barcode'
56               aria-label="Patron barcode" i18n-aria-label
57               (keyup.enter)="userBarcodeChanged()"
58               [(ngModel)]="userBarcode" (change)="userBarcodeChanged()"/>
59             <div class="input-group-append">
60               <button class="btn btn-outline-dark" (click)="userBarcodeChanged()">Submit</button>
61             </div>
62           </div>
63         </div>
64       </div>
65       <div class="row mt-2">
66         <div class="col-lg-6">
67           <div class="form-check">
68             <input class="form-check-input" type="radio"
69               (change)="holdForChanged()"
70               id="hold-for-staff"
71               name="holdFor" value="staff" [(ngModel)]="holdFor"/>
72             <label class="form-check-label" i18n for="hold-for-staff">
73               Place hold for this staff account:
74             </label>
75           </div>
76         </div>
77         <div class="col-lg-6 font-weight-bold">{{requestor.usrname()}}</div>
78       </div>
79       <div class="row mt-2">
80         <div class="col-lg-6">
81           <label i18n>Pickup Location: </label>
82         </div>
83         <div class="col-lg-6">
84           <eg-org-select [applyOrgId]="pickupLib"></eg-org-select>
85         </div>
86       </div>
87       <div class="row mt-2">
88         <div class="col-lg-6">
89           <div class="form-check">
90             <input class="form-check-input" type="checkbox" id="suspend"
91               name="suspend" [(ngModel)]="suspend"/>
92             <label class="form-check-label" for="suspend" i18n>Suspend Hold</label>
93           </div>
94         </div>
95         <div class="col-lg-6">
96           <eg-date-select [(ngModel)]="activeDate" name='active-date'
97             (onChangeAsIso)="activeDateSelected($event)" [disabled]="!suspend">
98           </eg-date-select>
99         </div>
100       </div>
101       <div class="row mt-2" *ngIf="multiHoldsActive">
102         <div class="col-lg-6">
103           <label for='multi-hold-count' i18n>Number of copies:</label>
104         </div>
105         <div class="col-lg-6">
106           <select class="form-control" name="multi-hold-count"
107             id="multi-hold-count" [(ngModel)]="multiHoldCount">
108             <option [value]="num"
109               *ngFor="let num of holdCountRange()">{{num}}</option>
110           </select>
111         </div>
112       </div>
113
114     </div><!-- left column -->
115     <div class="col-lg-6">
116       <div class="card">
117         <div class="card-header">
118           <h4 i18n>Notifications</h4>
119         </div>
120         <ul class="list-group list-group-flush">
121           <li class="list-group-item d-flex">
122             <div class="flex-1">
123               <div class="form-check">
124                 <input class="form-check-input" type="checkbox" name="notifyEmail"
125                   id="notifyEmail"
126                   [disabled]="!user || !user.email()" [(ngModel)]="notifyEmail"/>
127                 <label class="form-check-label" for="notifyEmail" i18n>Notify by Email</label>
128               </div>
129             </div>
130             <div class="flex-1">
131               <div class="input-group">
132                 <div class="input-group-prepend">
133                   <label for="userEmail" class="input-group-text" i18n>Email Address</label>
134                 </div>
135                 <input type="text" class="form-control" name="userEmail"
136                   id="userEmail"
137                   [disabled]="true" value="{{user ? user.email() : ''}}"/>
138               </div>
139             </div>
140           </li>
141           <li class="list-group-item d-flex">
142             <div class="flex-1">
143               <div class="form-check">
144                 <input class="form-check-input" type="checkbox"
145                   id="notifyPhone"
146                   name="notifyPhone" [(ngModel)]="notifyPhone"/>
147                 <label class="form-check-label" for="notifyPhone" i18n>Notify by Phone</label>
148               </div>
149             </div>
150             <div class="flex-1">
151               <div class="input-group">
152                 <div class="input-group-prepend">
153                   <label for="phoneValue" class="input-group-text" i18n>Phone Number</label>
154                 </div>
155                 <input type="text" class="form-control" [disabled]="!notifyPhone"
156                   name="phoneValue" id="phoneValue" [(ngModel)]="phoneValue"/>
157               </div>
158             </div>
159           </li>
160           <li *ngIf="smsEnabled" class="list-group-item d-flex">
161             <div class="flex-1">
162               <div class="form-check">
163                 <input class="form-check-input" type="checkbox" id="notifySms"
164                   name="notifySms" [(ngModel)]="notifySms"/>
165                 <label class="form-check-label" for="notifySms" i18n>Notify by SMS</label>
166               </div>
167             </div>
168             <div class="flex-1">
169               <div class="input-group">
170                 <div class="input-group-prepend">
171                   <label for="smsValue" class="input-group-text" i18n>SMS Number</label>
172                 </div>
173                 <input type="text" class="form-control" [disabled]="!notifySms"
174                   id="smsValue" name="smsValue" [(ngModel)]="smsValue"/>
175               </div>
176             </div>
177           </li>
178           <li *ngIf="smsEnabled" class="list-group-item d-flex">
179             <div class="flex-1">
180               <label for="smsCarriers" i18n>SMS Carrier</label>
181             </div>
182             <div class="flex-1">
183               <eg-combobox [disabled]="!notifySms" #smsCbox
184                 domId="smsCarriers"
185                 placeholder="SMS Carriers" i18n-placeholder
186                 [entries]="smsCarriers">
187               </eg-combobox>
188             </div>
189           </li>
190           <li class="list-group-item">
191             <button class="btn btn-success" (click)="placeHolds()"
192               [disabled]="!user || placeHoldsClicked" i18n>Place Hold(s)</button>
193
194             <button class="btn btn-outline-dark ml-2" (click)="resetForm()" i18n>Reset</button>
195           </li>
196         </ul><!-- col -->
197       </div><!-- row -->
198     </div><!--card -->
199   </div><!-- col -->
200 </form>
201
202 <div class="row"><div class="col-lg-12"><hr/></div></div>
203
204 <div class="row pt-3 ml-1 mr-1 d-flex">
205   <div class="">
206     <span class="font-weight-bold" i18n>Placing
207       <ng-container *ngIf="holdType == 'M'">METARECORD</ng-container>
208       <ng-container *ngIf="holdType == 'T'">TITLE</ng-container>
209       <ng-container *ngIf="holdType == 'V'">CALL NUMBER</ng-container>
210       <ng-container *ngIf="holdType == 'F'">FORCE ITEM</ng-container>
211       <ng-container *ngIf="holdType == 'C'">ITEM</ng-container>
212       <ng-container *ngIf="holdType == 'R'">RECALL</ng-container>
213       <ng-container *ngIf="holdType == 'I'">ISSUANCE</ng-container>
214       <ng-container *ngIf="holdType == 'P'">PARTS</ng-container>
215       hold on record(s)
216     </span>
217   </div>
218   <div class="flex-1"> </div>
219   <div>
220     <span class="pl-3" *ngIf="isItemHold()">
221       <span i18n>Item-Level Hold Options:</span>
222       <span class="pl-2">
223         <a routerLink="/staff/catalog/hold/C" queryParamsHandling="merge">
224           <button [disabled]="holdType === 'C'" class="btn btn-outline-primary"
225             i18n>Item Hold</button>
226         </a>
227       </span>
228       <span class="pl-2">
229         <a routerLink="/staff/catalog/hold/R" queryParamsHandling="merge">
230           <button [disabled]="holdType === 'R'" class="btn btn-outline-primary"
231             i18n>Recall Hold</button>
232         </a>
233       </span>
234       <span class="pl-2">
235         <a routerLink="/staff/catalog/hold/F" queryParamsHandling="merge">
236           <button [disabled]="holdType === 'F'" class="btn btn-outline-primary"
237             i18n>Force Item Hold</button>
238         </a>
239       </span>
240     </span>
241   </div>
242 </div>
243
244 <ng-template #anyValue>
245   <span class="font-italic" i18n>ANY</span>
246 </ng-template>
247
248 <!--
249     TODO: add a section per hold context for metarecord holds
250     listing the possible formats and languages.
251
252     TODO: add a secion per hold context for T holds providing a
253     link to the metarecord hold equivalent (AKA "Advanced Hold
254     Options") for each record that has selectable filters (and
255     only when metarecord holds are enabled).
256 -->
257
258 <div class="hold-records-list common-form striped-even">
259
260   <div class="row mt-2 ml-1 mr-1 font-weight-bold">
261     <div class="col-lg-1" i18n>Format</div>
262     <div class="col-lg-2" i18n>Title</div>
263     <div class="col-lg-1" i18n>Author</div>
264     <div class="col-lg-2" i18n>Part</div>
265     <div class="col-lg-2" i18n>Call Number</div>
266     <div class="col-lg-1" i18n>Barcode</div>
267     <div class="col-lg-2" i18n>Holds Status</div>
268     <div class="col-lg-1" i18n>Override</div>
269   </div>
270   <div class="row mt-1 ml-1 mr-1" *ngFor="let ctx of holdContexts">
271     <div class="col-lg-12" *ngIf="ctx.holdMeta">
272       <div class="row">
273         <div class="col-lg-1">
274           <ng-container
275             *ngFor="let code of ctx.holdMeta.bibSummary.attributes.icon_format">
276             <img class="pr-1"
277               alt="{{iconFormatLabel(code)}}"
278               title="{{iconFormatLabel(code)}}"
279               src="/images/format_icons/icon_format/{{code}}.png"/>
280           </ng-container>
281         </div>
282         <!-- TODO: link for a metarecord should
283             jump to constituent bib list search page? -->
284         <div class="col-lg-2">
285           <a routerLink="/staff/catalog/record/{{ctx.holdMeta.bibId}}">
286             {{ctx.holdMeta.bibSummary.display.title}}
287           </a>
288         </div>
289         <div class="col-lg-1">{{ctx.holdMeta.bibSummary.display.author}}</div>
290         <div class="col-lg-2">
291           <ng-container *ngIf="ctx.holdMeta.parts.length">
292             <select class="form-control"  (change)="setPart(ctx, $event)"
293               [ngModel]="ctx.holdMeta.part ? ctx.holdMeta.part.id() : ''">
294               <option value="" i18n>Any Part</option>
295               <option *ngFor="let part of ctx.holdMeta.parts"
296                 value="{{part.id()}}">{{part.label()}}</option>
297             </select>
298           </ng-container>
299           <ng-container *ngIf="ctx.holdMeta.parts.length == 0">
300             <ng-container *ngIf="ctx.holdMeta.part">
301               <span>{{ctx.holdMeta.part.label()}}</span>
302             </ng-container>
303             <ng-container *ngIf="!ctx.holdMeta.part">
304               <span i18n>N/A</span>
305             </ng-container>
306           </ng-container>
307         </div>
308         <div class="col-lg-2">
309           <ng-container *ngIf="ctx.holdMeta.callNum; else anyValue">
310             {{ctx.holdMeta.callNum.label()}}
311           </ng-container>
312         </div>
313         <div class="col-lg-1">
314           <ng-container *ngIf="ctx.holdMeta.copy; else anyValue">
315             {{ctx.holdMeta.copy.barcode()}}
316           </ng-container>
317         </div>
318         <div class="col-lg-2">
319           <ng-container *ngIf="!ctx.lastRequest && !ctx.processing">
320             <div class="alert alert-info p-1 ml-2" i18n>Hold Pending</div>
321           </ng-container>
322           <ng-container *ngIf="ctx.processing">
323             <div class="alert alert-primary p-1 ml-2" i18n>Hold Processing...</div>
324           </ng-container>
325           <ng-container *ngIf="ctx.lastRequest">
326             <ng-container *ngIf="ctx.lastRequest.result.success">
327               <div class="alert alert-success p-1 ml-2" i18n>Hold Succeeded</div>
328             </ng-container>
329             <ng-container *ngIf="!ctx.lastRequest.result.success">
330               <div class="alert alert-danger p-1 ml-2"
331                 title="{{ctx.lastRequest.result.evt.textcode}}">
332                 {{ctx.lastRequest.result.evt.textcode}}
333               </div>
334             </ng-container>
335           </ng-container>
336         </div>
337         <div class="col-lg-1">
338           <ng-container *ngIf="canOverride(ctx)">
339             <button class="btn btn-info" (click)="override(ctx)">Override</button>
340           </ng-container>
341         </div>
342       </div>
343       <!-- note: using inline style since class-level styling for rows
344           is superseded by the striped-even styling of the container -->
345       <div class="row" *ngIf="hasMetaFilters(ctx)"
346         style="background-color:inherit; border:none">
347         <div class="col-lg-1"><label i18n>Formats: </label></div>
348         <div class="col-lg-11 d-flex">
349           <ng-container
350             *ngFor="let ccvm of ctx.holdMeta.metarecord_filters.formats">
351             <div class="form-check ml-3">
352               <input class="form-check-input" type="checkbox"
353                 [disabled]="ctx.holdMeta.metarecord_filters.formats.length == 1"
354                 [(ngModel)]="ctx.selectedFormats.formats[ccvm.code()]"/>
355               <img class="ml-1"
356                 alt="{{iconFormatLabel(ccvm.code())}}"
357                 title="{{iconFormatLabel(ccvm.code())}}"
358                 src="/images/format_icons/icon_format/{{ccvm.code()}}.png"/>
359               <label class="form-check-label ml-1">
360                 {{ccvm.search_label() || ccvm.value()}}
361               </label>
362             </div>
363           </ng-container>
364         </div>
365       </div>
366       <div class="row" *ngIf="hasMetaFilters(ctx)"
367         style="background-color:inherit; border:none">
368         <div class="col-lg-1"><label i18n>Languages: </label></div>
369         <div class="col-lg-11 d-flex">
370           <ng-container
371             *ngFor="let ccvm of ctx.holdMeta.metarecord_filters.langs">
372             <div class="form-check ml-3">
373               <input class="form-check-input" type="checkbox"
374                 [disabled]="ctx.holdMeta.metarecord_filters.langs.length == 1"
375                 [(ngModel)]="ctx.selectedFormats.langs[ccvm.code()]"/>
376               <label class="form-check-label ml-1">
377                 {{ccvm.search_label() || ccvm.value()}}
378               </label>
379             </div>
380           </ng-container>
381         </div>
382       </div>
383     </div>
384   </div>
385 </div>
386
387