LP1904036 Ang Patron UI updating non-menu links
authorBill Erickson <berickxx@gmail.com>
Wed, 13 Jul 2022 18:31:55 +0000 (14:31 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:43 +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>

25 files changed:
Open-ILS/src/eg2/src/app/staff/booking/reservations-grid.component.ts
Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.html
Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html
Open-ILS/src/eg2/src/app/staff/share/holdings/mark-damaged-dialog.component.html
Open-ILS/src/eg2/src/app/staff/share/holds/detail.component.html
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts
Open-ILS/src/templates/staff/admin/local/circ/neg_balance_users.tt2
Open-ILS/src/templates/staff/cat/bucket/batch_hold/t_pending.tt2
Open-ILS/src/templates/staff/cat/bucket/batch_hold/t_view.tt2
Open-ILS/src/templates/staff/cat/bucket/share/t_bucket_info.tt2
Open-ILS/src/templates/staff/cat/item/t_circ_list_pane.tt2
Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2
Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2
Open-ILS/src/templates/staff/circ/curbside/t_arrived_manager.tt2
Open-ILS/src/templates/staff/circ/curbside/t_delivered_manager.tt2
Open-ILS/src/templates/staff/circ/curbside/t_staged_manager.tt2
Open-ILS/src/templates/staff/circ/curbside/t_to_be_staged_manager.tt2
Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2
Open-ILS/src/templates/staff/circ/patron/bucket/t_pending.tt2
Open-ILS/src/templates/staff/circ/patron/bucket/t_view.tt2
Open-ILS/src/templates/staff/circ/share/t_event_override_dialog.tt2
Open-ILS/src/templates/staff/t_splash.tt2

index 8344ee5..92b23b8 100644 (file)
@@ -1,4 +1,5 @@
 import {Component, EventEmitter, Input, Output, OnChanges, OnInit, ViewChild} from '@angular/core';
+import {Location} from '@angular/common';
 import {Router} from '@angular/router';
 import {Observable, from, of} from 'rxjs';
 import {tap, switchMap, mergeMap} from 'rxjs/operators';
@@ -75,6 +76,7 @@ export class ReservationsGridComponent implements OnChanges, OnInit {
     returnNotAppropriate: (rows: IdlObject[]) => boolean;
 
     constructor(
+        private ngLocation: Location,
         private auth: AuthService,
         private format: FormatService,
         private pcrud: PcrudService,
@@ -171,7 +173,11 @@ export class ReservationsGridComponent implements OnChanges, OnInit {
 
         this.viewPatronRecord = (reservations: IdlObject[]) => {
             const patronIds = reservations.map(reservation => reservation.usr().id());
-            window.open('/eg/staff/circ/patron/' + patronIds[0] + '/checkout');
+            window.open(
+                this.ngLocation.prepareExternalUrl(
+                    '/staff/circ/patron/' + patronIds[0] + '/checkout'
+                )
+            );
         };
 
         this.noSelectedRows = (rows: IdlObject[]) => (rows.length === 0);
index 17c7ffb..7de0b03 100644 (file)
@@ -6,7 +6,7 @@
     <div class="col-lg-10 offset-lg-1 d-flex justify-content-center">
       <span class="mt-2" i18n>
         Placing hold for patron 
-        <a href="/eg/staff/circ/patron/{{holdForUser().id()}}/holds">
+        <a routerLink="/staff/circ/patron/{{holdForUser().id()}}/holds">
           {{holdForUser().pref_family_name() || holdForUser().family_name()}}, 
           {{holdForUser().pref_first_given_name() || holdForUser().first_given_name()}}
         </a>.
index bc6ec77..09f258c 100644 (file)
               Created {{summary.record.create_date() | date:'shortDate'}} by
               <!-- creator if fleshed after the initial data set is loaded -->
               <a *ngIf="summary.record.creator().usrname" target="_self"
-                href="/eg/staff/circ/patron/{{summary.record.creator().id()}}/checkout">
+                routerLink="/staff/circ/patron/{{summary.record.creator().id()}}/checkout">
                   {{summary.record.creator().usrname()}}
               </a>
               <!-- add a spacer pending data to reduce page shuffle -->
             <div class="float-right small-text-1" i18n>
               Edited {{summary.record.edit_date() | date:'shortDate'}} by
               <a *ngIf="summary.record.editor().usrname" target="_self"
-                href="/eg/staff/circ/patron/{{summary.record.editor().id()}}/checkout">
+                routerLink="/staff/circ/patron/{{summary.record.editor().id()}}/checkout">
                   {{summary.record.editor().usrname()}}
               </a>
               <span *ngIf="!summary.record.editor().usrname"> ... </span>
index 07e5c52..9510b4f 100644 (file)
@@ -32,7 +32,7 @@
         <ul class="list-group list-group-flush">
           <li class="list-group-item" i18n>
             Item was last checked out by patron
-            <a href="/eg/staff/circ/patron/{{chargeResponse.circ.usr().id()}}/checkout">
+            <a routerLink="/staff/circ/patron/{{chargeResponse.circ.usr().id()}}/checkout">
               {{chargeResponse.circ.usr().family_name()}},
               {{chargeResponse.circ.usr().first_given_name()}} 
               ({{chargeResponse.circ.usr().usrname()}})
index 4315e28..0b3b50f 100644 (file)
   <div class="well-row">
     <div class="well-label" i18n>Patron Name</div>
     <div class="well-value">
-      <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout">
+      <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout">
         {{hold.usr_display_name}}
       </a>
     </div>
     <!-- force consistent width -->
     <div class="well-label" i18n>Patron Barcode</div>
     <div class="well-value">
-      <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout">
+      <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout">
         {{hold.ucard_barcode}}
       </a>
     </div>
index d30526d..97a6ced 100644 (file)
         datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
 
       <ng-template #userBarcodeTmpl let-hold="row">
-        <a href="/eg/staff/circ/patron/{{hold.usr_id}}/checkout" target="_blank">
+        <a routerLink="/staff/circ/patron/{{hold.usr_id}}/checkout" target="_blank">
           {{hold.ucard_barcode}}
         </a>
       </ng-template>
index 2df39ad..8221b1d 100644 (file)
@@ -478,9 +478,11 @@ export class HoldsGridComponent implements OnInit {
     showPatron(rows: any[]) {
         const usrIds = Array.from(new Set( rows.map(r => r.usr_id).filter( usr_id => Boolean(usr_id)) ));
         usrIds.forEach( usrId => {
-            const url =
-                '/eg/staff/circ/patron/' + usrId + '/checkout';
-            window.open(url, '_blank');
+            window.open(
+                this.ngLocation.prepareExternalUrl(
+                   '/staff/circ/patron/' + usrId + '/checkout'
+                )
+            );
         });
     }
 
index b7af3cb..49d790f 100644 (file)
@@ -41,7 +41,7 @@
     label="[% l('Retrieve Patron') %]"></eg-grid-action>
   <eg-grid-field label="[% l('Barred') %]" path='usr.barred'></eg-grid-field>
   <eg-grid-field label="[% l('Barcode') %]" path="usr.card.barcode">
-    <a href="./circ/patron/{{item.usr.id()}}/checkout/" target="_blank">
+    <a href="/eg2/staff/circ/patron/{{item.usr.id()}}/checkout/">
       {{item.usr.card().barcode()}}
     </a>
   </eg-grid-field>
index 5e441d6..8b42568 100644 (file)
@@ -50,7 +50,7 @@
   <eg-grid-field label="[% l('First Name') %]" path="first_given_name" visible></eg-grid-field>
   <eg-grid-field label="[% l('Last Name') %]" path="family_name" visible></eg-grid-field>
   <eg-grid-field label="[% l('Barcode') %]"      path='card.barcode' visible>
-    <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item['id']}}/holds">
+    <a href="/eg2/staff/circ/patron/{{item['id']}}/holds">
       {{item['card.barcode']}}
     </a>
   </eg-grid-field>
index 45c0c4b..953c1ca 100644 (file)
@@ -21,7 +21,7 @@
   <eg-grid-field label="[% l('First Name') %]" path="first_given_name" visible></eg-grid-field>
   <eg-grid-field label="[% l('Last Name') %]" path="family_name" visible></eg-grid-field>
   <eg-grid-field label="[% l('Barcode') %]"      path='card.barcode' visible>
-    <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item['id']}}/holds">
+    <a href="/eg2/staff/circ/patron/{{item['id']}}/holds">
       {{item['card.barcode']}}
     </a>
   </eg-grid-field>
index 333f8ee..5935349 100644 (file)
@@ -9,7 +9,7 @@
   <span> / [% l('Created {{bucket().create_time() | date:egDateAndTimeFormat}}') %]</span>
   <span ng-show="bucket()._owner_name"> / 
     {{bucket()._owner_name}} 
-    <a target="_self" href="./circ/patron/{{bucket().owner()}}/checkout">
+    <a href="/eg2/staff/circ/patron/{{bucket().owner()}}/checkout">
       ({{bucket()._owner_ident}})
     </a>
     @ {{bucket()._owner_ou}}
index 036f3fe..ec68062 100644 (file)
@@ -22,8 +22,8 @@
 <div class="row" ng-show="!isMaxCircHistoryZero" ng-repeat="circ in circ_list">
   <div class="flex-row">
     <div class="flex-cell well">
-      <a ng-if="circ.usr()" target="_self"
-        href="./circ/patron/{{circ.usr().id()}}/checkout">
+      <a ng-if="circ.usr()"
+        href="/eg2/staff/circ/patron/{{circ.usr().id()}}/checkout">
         [% l('[_1], [_2] [_3] : [_4]', 
           '{{circ.usr().family_name()}}'
           '{{circ.usr().first_given_name()}}'
@@ -65,7 +65,7 @@
     <div class="flex-cell">[% l('Check Out Staff') %]</div>
     <div class="flex-cell well">
       <a ng-if="circ.circ_staff()" target="_blank"
-        href="./circ/patron/{{circ.circ_staff().id()}}/checkout">
+        href="/eg2/staff/circ/patron/{{circ.circ_staff().id()}}/checkout">
           {{circ.circ_staff().usrname()}}
       </a>
     </div>
index 2eb548d..412aec3 100644 (file)
@@ -13,8 +13,8 @@
   <div class="flex-row">
     <div class="flex-cell">[% l('Patron') %]</div>
     <div class="flex-cell well">
-      <a href="./circ/patron/{{prev_circ_usr.id()}}/checkout" 
-        ng-if="prev_circ_usr" target="_self">
+      <a href="/eg2/staff/circ/patron/{{prev_circ_usr.id()}}/checkout" 
+        ng-if="prev_circ_usr">
         [% l('[_1], [_2] [_3] : [_4]', 
         '{{prev_circ_usr.family_name()}}'
         '{{prev_circ_usr.first_given_name()}}'
   <div class="flex-row">
     <div class="flex-cell">[% l('Patron') %]</div>
     <div class="flex-cell well">
-      <a href="./circ/patron/{{circ.usr().id()}}/checkout" 
-        ng-if="circ.usr()" target="_self">
+      <a href="/eg2/staff/circ/patron/{{circ.usr().id()}}/checkout" 
+        ng-if="circ.usr()">
         [% l('[_1], [_2] [_3] : [_4]', 
           '{{circ.usr().family_name()}}'
           '{{circ.usr().first_given_name()}}'
index bb26920..77ab2f1 100644 (file)
@@ -12,8 +12,8 @@
   <div class="flex-row">
     <div class="flex-cell">[% l('Patron') %]</div>
     <div class="flex-cell well">
-      <a href="./circ/patron/{{hold.usr().id()}}/checkout" 
-        ng-if="hold" target="_self">
+      <a href="/eg2/staff/circ/patron/{{hold.usr().id()}}/checkout" 
+        ng-if="hold">
         [% l('[_1], [_2] [_3] : [_4]', 
           '{{hold.usr().family_name()}}'
           '{{hold.usr().first_given_name()}}'
@@ -25,8 +25,8 @@
   <div class="flex-row">
     <div class="flex-cell">[% l('Requestor') %]</div>
     <div class="flex-cell well">
-      <a href="./circ/patron/{{hold.requestor().id()}}/checkout" 
-        ng-if="hold" target="_self">
+      <a href="/eg2/staff/circ/patron/{{hold.requestor().id()}}/checkout" 
+        ng-if="hold">
         [% l('[_1], [_2] [_3] : [_4]', 
           '{{hold.requestor().family_name()}}'
           '{{hold.requestor().first_given_name()}}'
index 4431a3b..e01d4ba 100644 (file)
 
   <eg-grid-field label="[% l('Created By') %]"
     path="creator" hidden>
-    <a target="_blank" href="[% ctx.base_path %]/staff/circ/patron/{{item['creator.id']}}/checkout">
+    <a href="/eg2/staff/circ/patron/{{item['creator.id']}}/checkout">
       {{item['creator.usrname']}} <span ng-show="item['creator.id']" class="glyphicon glyphicon-new-window"></span>
     </a>
   </eg-grid-field>
index 0606ce7..0bdf0be 100644 (file)
     <span class="pad-horiz alert alert-danger">{{fine_total | currency}}</span>
     <span ng-if="billable_barcode">
       <!-- note: this forces a new tab -->
-      <a href='./circ/patron/{{billable_user_id}}/bills' target='_blank'>
+      <a href='/eg2/staff/circ/patron/{{billable_user_id}}/bills'>
         <span>[% l('Transaction for [_1] billed:', '{{billable_barcode}}') %]</span>
       </a>
       <span class="pad-horiz alert alert-danger">{{billable_amount | currency}}</span>
index 0690e73..d06f92a 100644 (file)
@@ -14,7 +14,7 @@
 
     <eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
     <eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
-      <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+      <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
         {{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
         <span class="glyphicon glyphicon-new-window"></span>
       </a>
index 5b2efa2..adbc93e 100644 (file)
@@ -14,7 +14,7 @@
 
     <eg-grid-field label="[% l('Delivery Date/Time') %]" path="slot.delivered" datatype="timestamp"></eg-grid-field>
     <eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled>
-      <a href="./circ/patron/{{item.slot.patron().id()}}/items_out" target="_blank">
+      <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/items_out" target="_blank">
         {{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
         <span class="glyphicon glyphicon-new-window"></span>
       </a>
index 1615553..96fe669 100644 (file)
@@ -14,7 +14,7 @@
 
     <eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
     <eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
-      <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+      <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
         {{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
         <span class="glyphicon glyphicon-new-window"></span>
       </a>
index 096c5b7..6f6a433 100644 (file)
@@ -14,7 +14,7 @@
 
     <eg-grid-field label="[% l('Pickup Date/Time') %]" path="slot.slot" datatype="timestamp"></eg-grid-field>
     <eg-grid-field label="[% l('Patron') %]" path="slot.patron" compiled handlers="gridCellHandlers">
-      <a href="./circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
+      <a href="/eg2/staff/circ/patron/{{item.slot.patron().id()}}/holds" target="_blank">
         {{item.slot.patron().family_name()}} / {{item.slot.patron().card().barcode()}}
         <span class="glyphicon glyphicon-new-window"></span>
       </a>
index 3a56286..912f7a4 100644 (file)
   <eg-grid-field name="patron_id" path="usr.id" hidden required></eg-grid-field>
   <eg-grid-field name="patron_barcode" path="usr.card.barcode" 
     hidden label="[% l('Patron Barcode') %]">
-    <a href="./circ/patron/{{item.patron_id}}/holds" target="_self">
+    <a href="/eg2/staff/circ/patron/{{item.patron_id}}/holds">
       {{item.patron_barcode}}
     </a>
   </eg-grid-field>
index d19e231..56a2663 100644 (file)
@@ -48,7 +48,7 @@
 
   <eg-grid-field label="[% l('Barcode') %]"
     path="card.barcode" visible>
-    <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item.id}}/edit">
+    <a href="/eg2/staff/circ/patron/{{item.id}}/edit">
       {{item['card.barcode']}}
     </a>
   </eg-grid-field>
index 22241fc..de002d6 100644 (file)
@@ -48,7 +48,7 @@ progress {
 
   <eg-grid-field label="[% l('Barcode') %]"
     path="card.barcode" visible>
-    <a target="_self" href="[% ctx.base_path %]/staff/circ/patron/{{item.id}}/edit">
+    <a href="/eg2/staff/circ/patron/{{item.id}}/edit">
       {{item['card.barcode']}}
     </a>
   </eg-grid-field>
index f3f1317..80489d9 100644 (file)
@@ -17,7 +17,7 @@
           <div ng-if="copy_barcode" class="strong-text-2">{{copy_barcode}}</div>
           {{evt.desc}}
           <div ng-if="evt.textcode == 'ITEM_ON_HOLDS_SHELF'">
-            <a target="_blank" href="[% ctx.base_path %]/staff/circ/patron/{{patronID}}/checkout">{{patronName}}</a>.
+            <a target="_blank" href="/eg2/staff/circ/patron/{{patronID}}/checkout">{{patronName}}</a>.
             <div>
               <label><input type="checkbox" ng-model="formdata.clearHold"/>
                 [% l('Cancel this hold upon checkout?') %]</label>
index 598f9ff..2556078 100644 (file)
@@ -15,7 +15,7 @@
         </div>
         <div class="panel-body">
           <div>
-            <a target="_self" href="./circ/patron/bcsearch">
+            <a href="/eg2/staff/circ/patron/bcsearch">
               <img src="[% ctx.media_prefix %]/images/portal/forward.png" alt="" role="presentation"/>
               [% l('Check Out Items') %]
             </a>
@@ -27,7 +27,7 @@
             </a>
           </div>
           <div>
-            <a target="_self" href="./circ/patron/search">
+            <a href="/eg2/staff/circ/patron/search">
               <img src="[% ctx.media_prefix %]/images/portal/retreivepatron.png" alt="" role="presentation"/>
               [% l('Search For Patron By Name') %]
             </a>