patron holds / hold notifications
authorBill Erickson <berick@esilibrary.com>
Mon, 7 Jul 2014 21:15:12 +0000 (17:15 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 7 Jul 2014 21:15:12 +0000 (17:15 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/share/t_hold_details.tt2
Open-ILS/web/js/ui/default/staff/circ/services/holds.js

index 475a9d0..1117ae1 100644 (file)
@@ -58,8 +58,8 @@
     <a href ng-click="detail_tab = 'notes'">[% l('Notes') %]</a>
   </li>
   <li ng-class="{active : detail_tab == 'notify'}">
-    <a href ng-click="detail_tab = 'notify'">
-      [% l('Manual Notifications') %]
+    <a href ng-click="show_notify_tab()">
+      [% l('Staff Notifications') %]
     </a>
   </li>
 </ul>
       </div>
     </div><!-- notes tab content -->
 
+    <div ng-if="detail_tab == 'notify'">
+      
+      <button class="btn btn-default" ng-click="new_notification()">
+        [% l('Add Record of Notification') %]
+      </button>
+
+      <div class="row pad-vert" 
+          ng-repeat="notify in hold.notifications()">
+        <div class="col-md-12">
+          <div class="row">
+            <div class="col-md-6 strong-text">{{notify.method()}}</div>
+            <div class="col-md-6">
+              <div class="pull-right">
+                <span class="pad-horiz">{{notify.notify_time() | date:'short'}}</span>
+                <span>[% l('Created by [_1]', '{{notify.notify_staff().usrname()}}') %]</span>
+              </div>
+            </div>
+          </div>
+          <div class="row">
+            <!-- hmm, not sure why the margin-left is needed.. the well? -->
+            <div class="col-md-12 well" style="margin-left:12px">
+              <div class="row">
+                <div class="col-md-8">
+                  <div class="">{{notify.note()}}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div><!-- notes tab content -->
+
   </div><!-- tab pane -->
 </div><!-- tab-content -->
 
index f6063b0..5b67f83 100644 (file)
@@ -379,6 +379,17 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog , egAlertDialog)
                     });
                 }
 
+                $scope.show_notify_tab = function() {
+                    $scope.detail_tab = 'notify';
+                    egCore.pcrud.search('ahn',
+                        {hold : $scope.hold.id()}, 
+                        {flesh : 1, flesh_fields : {ahn : ['notify_staff']}}, 
+                        {atomic : true}
+                    ).then(function(nots) {
+                        $scope.hold.notifications(nots);
+                    });
+                }
+
                 $scope.delete_note = function(note) {
                     egCore.pcrud.remove(note).then(function() {
                         // remove the deleted note from the locally fleshed notes