LP1904036 patron summary pref name; penalties
authorBill Erickson <berickxx@gmail.com>
Tue, 2 Mar 2021 16:18:19 +0000 (11:18 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:25 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/summary.component.css
Open-ILS/src/eg2/src/app/staff/circ/patron/summary.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/summary.component.ts
Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts

index 04c388a..fe1542d 100644 (file)
@@ -45,7 +45,8 @@
             <ng-container *ngIf="loading">
               <ng-container *ngTemplateOutlet="progress"></ng-container>
             </ng-container>
-            <eg-circ-grid #nonCatGrid [persistKey]="persistKey" (reloadRequested)="load()">
+            <eg-circ-grid #nonCatGrid [persistKey]="persistKey" 
+              menuStyle="none" (reloadRequested)="load()">
             </eg-circ-grid>
           </ng-container>
         </ng-container>
index f917cbb..8ccfd34 100644 (file)
@@ -4,16 +4,16 @@
   </eg-staff-banner>
 </ng-container>
 
-<eg-circ-components></eg-circ-components>
-
 <ng-container *ngIf="context.patron">
-  <eg-staff-banner i18n-bannerText bannerText="
-    {{patronService.namePart(context.patron, 'family_name')}}, 
-    {{patronService.namePart(context.patron, 'first_given_name')}} 
-    {{patronService.namePart(context.patron, 'second_given_name')}}">
+  <eg-staff-banner i18n-bannerText bannerText="Patron: 
+    {{context.patron.family_name()}}, 
+    {{context.patron.first_given_name()}} 
+    {{context.patron.second_given_name()}}">
   </eg-staff-banner>
 </ng-container>
 
+<eg-circ-components></eg-circ-components>
+
 <div class="row">
 
   <ng-container *ngIf="showSummaryPane()">
index 71ba8a4..2c7d847 100644 (file)
@@ -1,5 +1,5 @@
 
-.patron-summary-container .row:nth-child(odd) {
+.patron-summary-container .row:nth-child(odd):not(.alert) {
   background-color: rgb(248, 248, 248);
 }
 
index 32f773b..05ac82d 100644 (file)
@@ -1,11 +1,29 @@
 
 <div class="patron-summary-container">
 
-  <h3 *ngIf="patron()" class="font-weight-bold" i18n>
-    {{patronService.namePart(patron(), 'family_name')}}, 
-    {{patronService.namePart(patron(), 'first_given_name')}} 
-    {{patronService.namePart(patron(), 'second_given_name')}}
-  </h3>
+  <div class="row d-flex" *ngIf="patron()">
+    <div class="flex-1 pt-1">
+      <h4 class="font-weight-bold" i18n>
+        {{patron().family_name()}}, 
+        {{patron().first_given_name()}} 
+        {{patron().second_given_name()}}
+      </h4>
+    </div>
+    <ng-container *ngIf="hasPrefName()">
+      <div class="mr-2 ml-2 text-info font-italic" i18n>account</div>
+    </ng-container>
+  </div>
+
+  <div class="row d-flex border-top" *ngIf="hasPrefName()">
+    <div class="flex-1 pt-1">
+      <h4 class="font-weight-bold" i18n>
+        {{patronService.namePart(patron(), 'family_name')}}, 
+        {{patronService.namePart(patron(), 'first_given_name')}} 
+        {{patronService.namePart(patron(), 'second_given_name')}}
+      </h4>
+    </div>
+    <div class="mr-2 ml-2 text-info font-italic" i18n>preferred</div>
+  </div>
 
   <div class="row mb-1 alert alert-danger p-0" 
     *ngIf="context.alerts.accountExpiresSoon">
     </div>
   </div>
 
+  <div class="row mb-1 alert alert-danger p-0" 
+    *ngFor="let pen of context.alerts.alertPenalties">
+    <div class="col-lg-9"
+      title="{{pen.standing_penalty().name()">
+      {{pen.note() || pen.standing_penalty().label()}}
+    </div>
+    <div class="col-lg-3">{{pen.set_date() | date:'shortDate'}}</div>
+  </div>
+
   <div class="row mb-1">
     <div class="col-lg-5" i18n>Profile</div>
     <div class="col-lg-7">{{patron().profile().name()}}</div>
index dd1a830..79d6957 100644 (file)
@@ -30,6 +30,16 @@ export class SummaryComponent implements OnInit {
         return this.context.patron;
     }
 
+    hasPrefName(): boolean {
+        if (this.patron()) {
+            return (
+                this.patron().pref_first_given_name() ||
+                this.patron().pref_second_given_name() ||
+                this.patron().pref_family_name()
+            );
+        }
+    }
+
     printAddress(addr: IdlObject) {
         this.printer.print({
             templateName: 'patron_address',
index 5a79e40..37a78c2 100644 (file)
   [rowClassCallback]="rowClass" [persistKey]="persistKey"
   [useLocalSort]="true" [cellTextGenerator]="cellTextGenerator">
 
-  <eg-grid-toolbar-action
-    i18n-label label="Print Item Receipt(s)" (onClick)="printReceipts($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    i18n-group group="Add" i18n-label label="Add Item Alerts"
-    (onClick)="openItemAlerts($event, 'create')">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    i18n-group group="Add" i18n-label label="Add Billing"
-    (onClick)="openBillingDialog($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    i18n-group group="Circulation" i18n-label label="Edit Due Date"
-    (onClick)="editDueDate($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    group="Mark" i18n-group i18n-label label="Mark Item Damaged"
-    (onClick)="markDamaged($event)"></eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    group="Mark" i18n-group i18n-label label="Mark Item Missing"
-    (onClick)="markMissing($event)"></eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    group="Mark" i18n-group i18n-label label="Mark Claims Returned"
-    (onClick)="claimsReturned($event)"></eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    group="Mark" i18n-group i18n-label label="Mark Claims Never Checked Out"
-    (onClick)="claimsNeverCheckedOut($event)"></eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action
-    group="Mark" i18n-group i18n-label label="Mark Lost (By Patron)"
-    (onClick)="markLost($event)"></eg-grid-toolbar-action>
-
-  <!-- .subscribe() nudges the observable to run -->
-  <eg-grid-toolbar-action 
-    group="Circulation" i18n-group i18n-label label="Checkin" 
-    (onClick)="checkin($event).subscribe()">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action group="Circulation" i18n-group 
-    i18n-label label="Renew" (onClick)="renew($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action group="Circulation" i18n-group 
-    i18n-label label="Renew All" (onClick)="renewAll()">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action group="Circulation" i18n-group 
-    i18n-label label="Renew With Specific Due Date"
-    (onClick)="renewWithDate($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action group="Show" i18n-group 
-    i18n-label label="Show Last Few Circulation" (onClick)="showRecentCircs($event)">
-  </eg-grid-toolbar-action>
-
-  <eg-grid-toolbar-action group="Show" i18n-group 
-    i18n-label label="Show Triggered Events" (onClick)="showTriggeredEvents($event)">
-  </eg-grid-toolbar-action>
+  <ng-container *ngIf="menuStyle == 'full'">
+
+    <eg-grid-toolbar-action
+      i18n-label label="Print Item Receipt(s)" (onClick)="printReceipts($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      i18n-group group="Add" i18n-label label="Add Item Alerts"
+      (onClick)="openItemAlerts($event, 'create')">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      i18n-group group="Add" i18n-label label="Add Billing"
+      (onClick)="openBillingDialog($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      i18n-group group="Circulation" i18n-label label="Edit Due Date"
+      (onClick)="editDueDate($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      group="Mark" i18n-group i18n-label label="Mark Item Damaged"
+      (onClick)="markDamaged($event)"></eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      group="Mark" i18n-group i18n-label label="Mark Item Missing"
+      (onClick)="markMissing($event)"></eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      group="Mark" i18n-group i18n-label label="Mark Claims Returned"
+      (onClick)="claimsReturned($event)"></eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      group="Mark" i18n-group i18n-label label="Mark Claims Never Checked Out"
+      (onClick)="claimsNeverCheckedOut($event)"></eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action
+      group="Mark" i18n-group i18n-label label="Mark Lost (By Patron)"
+      (onClick)="markLost($event)"></eg-grid-toolbar-action>
+
+    <!-- .subscribe() nudges the observable to run -->
+    <eg-grid-toolbar-action 
+      group="Circulation" i18n-group i18n-label label="Checkin" 
+      (onClick)="checkin($event).subscribe()">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action group="Circulation" i18n-group 
+      i18n-label label="Renew" (onClick)="renew($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action group="Circulation" i18n-group 
+      i18n-label label="Renew All" (onClick)="renewAll()">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action group="Circulation" i18n-group 
+      i18n-label label="Renew With Specific Due Date"
+      (onClick)="renewWithDate($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action group="Show" i18n-group 
+      i18n-label label="Show Last Few Circulation" (onClick)="showRecentCircs($event)">
+    </eg-grid-toolbar-action>
+
+    <eg-grid-toolbar-action group="Show" i18n-group 
+      i18n-label label="Show Triggered Events" (onClick)="showTriggeredEvents($event)">
+    </eg-grid-toolbar-action>
+
+  </ng-container>
 
   <!-- Columns =========================================== -->
 
index 8b79cba..0a28134 100644 (file)
@@ -79,6 +79,7 @@ export class CircGridComponent implements OnInit {
 
     @Input() persistKey: string;
     @Input() printTemplate: string; // defaults to items_out
+    @Input() menuStyle: 'full' | 'slim' | 'none' = 'full';
 
     // Emitted when a grid action modified data in a way that could
     // affect which cirulcations should appear in the grid.  Caller