<div ngbDropdownMenu>
<a routerLink="/staff/circ/patron/{{patronId}}/alerts"
ngbDropdownItem i18n>Alerts and Messages</a>
- <a routerLink="/staff/circ/patron/{{patronId}}/notes"
+ <a routerLink="/staff/circ/patron/{{patronId}}/notes" [disabled]="true"
ngbDropdownItem i18n>Notes</a>
- <a routerLink="/staff/circ/patron/{{patronId}}/triggered_events"
+ <a routerLink="/staff/circ/patron/{{patronId}}/triggered_events" [disabled]="true"
ngbDropdownItem i18n>Triggered Events / Notifications</a>
- <a routerLink="/staff/circ/patron/{{patronId}}/message_center"
+ <a routerLink="/staff/circ/patron/{{patronId}}/message_center" [disabled]="true"
ngbDropdownItem i18n>Message Center</a>
<a routerLink="/staff/circ/patron/{{patronId}}/stat_cats"
ngbDropdownItem i18n>Statistical Categories</a>
ngbDropdownItem i18n>Surveys</a>
<a routerLink="/staff/circ/patron/{{patronId}}/group"
ngbDropdownItem i18n>Group Member Details</a>
- <a routerLink="/staff/circ/patron/{{patronId}}/edit_perms"
+ <a routerLink="/staff/circ/patron/{{patronId}}/edit_perms"[disabled]="true"
ngbDropdownItem i18n>User Permission Editor</a>
<a routerLink="/staff/circ/patron/{{patronId}}/credentials"
ngbDropdownItem i18n>Test Password</a>
target="_top"
ngbDropdownItem i18n>Booking: Pick Up Reservations</a>
<a routerLink="/staff/booking/return/by_patron/{{patronId}}"
- target="_top"
- ngbDropdownItem i18n></a>
+ target="_top" ngbDropdownItem i18n></a>
<a href (click)="purgeAccount(); false"
[disabled]="disablePurge()"
ngbDropdownItem i18n>Completely Purge Account</a>
<eg-patron-survey-responses [patronId]="patronId">
</eg-patron-survey-responses>
</div>
+ <div *ngSwitchCase="'stat_cats'">
+ <eg-patron-statcats [patronId]="patronId">
+ </eg-patron-statcats>
+ </div>
</ng-container>
</ng-template>
</li>
import {BillStatementComponent} from './bill-statement.component';
import {TestPatronPasswordComponent} from './test-password.component';
import {PatronSurveyResponsesComponent} from './surveys.component';
+import {PatronStatCatsComponent} from './statcats.component';
@NgModule({
declarations: [
BillsComponent,
BillStatementComponent,
TestPatronPasswordComponent,
- PatronSurveyResponsesComponent
+ PatronSurveyResponsesComponent,
+ PatronStatCatsComponent
],
imports: [
StaffCommonModule,
'addresses',
'billing_address',
'mailing_address',
- 'stat_cat_entries',
'waiver_entries',
'usr_activity',
'notes',
--- /dev/null
+
+
+<div class="mt-2 alert well-like d-flex ml-3 mr-3" *ngFor="let map of catMaps">
+ <div class="font-weight-bold p-1">{{map.stat_cat().name()}}</div>
+ <div class="flex-1 ml-2 p-1">{{map.stat_cat_entry()}}</div>
+ <div class="ml-2 p-1">
+ <ng-container *ngIf="map.stat_cat().opac_visible() === 'f'">
+ <div class="badge badge-primary p-1" i18n>Staff Only</div>
+ </ng-container>
+ <ng-container *ngIf="map.stat_cat().opac_visible() === 't'">
+ <div class="badge badge-warning p-1" i18n>Patron Visible</div>
+ </ng-container>
+ </div>
+ <div class="p-1" i18n> @ {{map.stat_cat().owner().shortname()}}</div>
+</div>
+
--- /dev/null
+import {Component, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';
+import {from, empty, range} from 'rxjs';
+import {concatMap, tap, takeLast} from 'rxjs/operators';
+import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {IdlObject} from '@eg/core/idl.service';
+import {EventService} from '@eg/core/event.service';
+import {OrgService} from '@eg/core/org.service';
+import {NetService} from '@eg/core/net.service';
+import {PcrudService, PcrudContext} from '@eg/core/pcrud.service';
+import {AuthService} from '@eg/core/auth.service';
+import {PatronService} from '@eg/staff/share/patron/patron.service';
+import {PatronContextService} from './patron.service';
+
+@Component({
+ templateUrl: 'statcats.component.html',
+ selector: 'eg-patron-statcats'
+})
+export class PatronStatCatsComponent implements OnInit {
+
+ @Input() patronId: number;
+ catMaps: IdlObject[] = [];
+
+ constructor(
+ private router: Router,
+ private evt: EventService,
+ private net: NetService,
+ private auth: AuthService,
+ private org: OrgService,
+ private pcrud: PcrudService,
+ private patronService: PatronService,
+ private context: PatronContextService
+ ) {}
+
+ ngOnInit() {
+
+ this.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.user.fleshed.retrieve',
+ this.auth.token(), this.patronId, ['stat_cat_entries']).toPromise()
+ .then(user => {
+ const catIds = user.stat_cat_entries().map(e => e.stat_cat());
+ this.pcrud.search('actsc', {id: catIds})
+ .subscribe(cat => {
+ const map = user.stat_cat_entries()
+ .filter(e => e.stat_cat() === cat.id())[0];
+ map.stat_cat(cat);
+ cat.owner(this.org.get(cat.owner()));
+ this.catMaps.push(map);
+ });
+ });
+ }
+}
-<div class="card" *ngFor="let survey of surveys">
+<div class="card mt-2" *ngFor="let survey of surveys">
<div class="card-header">{{survey.survey.name()}}</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
cursor: not-allowed;
}
+/* copies color/border/elements from above sans position elements */
+.well-like {
+ background-color: #f5f5f5;
+ border-radius: 5px;
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
+}
+
/* usefuf for mat-icon buttons without any background or borders */
.material-icon-button {
/* Transparent background */
border-bottom: 1px solid rgba(0,0,0,.125);
}
-
/**
* Only display the print container when printing
*/