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