LP1904036 Patron message Un-Archive option
authorBill Erickson <berickxx@gmail.com>
Thu, 24 Mar 2022 14:33:52 +0000 (10:33 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:42 +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/messages.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.ts

index 8bd7dd1..e0e9a90 100644 (file)
@@ -47,6 +47,8 @@
   [showDeclaredFieldsOnly]="true" persistKey="circ.patron.archived_messages">
   <eg-grid-toolbar-action (onClick)="remove($event)"
     label="Delete Selected" i18n-label></eg-grid-toolbar-action>
+  <eg-grid-toolbar-action (onClick)="unArchive($event)"
+    label="Un-Archive Selected" i18n-label></eg-grid-toolbar-action>
   <eg-grid-column path="set_date"
     i18n-label label="Applied On" [datePlusTime]="true"></eg-grid-column>
   <eg-grid-column i18n-label label="Label" path="standing_penalty.label">
index 1fed8df..2f373fb 100644 (file)
@@ -130,6 +130,16 @@ export class PatronMessagesComponent implements OnInit {
         });
     }
 
+    unArchive(penalties: IdlObject[]) {
+        penalties.forEach(p => p.stop_date(null));
+        this.pcrud.update(penalties).toPromise()
+        .then(_ => this.context.refreshPatron())
+        .then(_ => {
+            this.mainGrid.reload();
+            this.archiveGrid.reload();
+        });
+    }
+
     archive(penalties: IdlObject[]) {
         penalties.forEach(p => p.stop_date('now'));
         this.pcrud.update(penalties).toPromise()