user feedback for catalog records - staff user/gmcharlt/catalog-record-feedback
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 1 May 2018 04:56:53 +0000 (00:56 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 1 May 2018 04:56:53 +0000 (00:56 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
Open-ILS/src/templates/staff/cat/share/t_view_feedback.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/cat/services/record.js

index c1e326e..b07be65 100644 (file)
                         [% l('View/Place Orders') %]
                    </a>
             </li>
+            <li role="menuitem">
+                   <a ng-click="view_feedback()" href="">
+                        [% l('View Feedback') %]
+                   </a>
+            </li>
         </ul>
         </div>
     </div>
index c98b087..fe96160 100644 (file)
     <div class="flex-cell strong-text">[% l('Bib Call #:') %]</div>
     <div class="flex-cell flex-2"><span tooltip-html-unsafe="{{bib_cn_tooltip}}">{{bib_cn}}<span></div>
 
-    <div class="flex-cell strong-text"></div>
-    <div class="flex-cell"></div>
+    <div class="flex-cell strong-text">[% l('Feedback?') %]</div>
+    <div class="flex-cell">{{feedback.present}}</div>
 
     <div class="flex-cell strong-text">[% l('Record Owner:') %]</div>
     <div class="flex-cell">{{record.owner().shortname()}}</div>
diff --git a/Open-ILS/src/templates/staff/cat/share/t_view_feedback.tt2 b/Open-ILS/src/templates/staff/cat/share/t_view_feedback.tt2
new file mode 100644 (file)
index 0000000..5aa6a7c
--- /dev/null
@@ -0,0 +1,19 @@
+<div>
+  <div class="modal-header">
+    <button type="button" class="close"
+      ng-click="cancel()" aria-hidden="true">&times;</button>
+    <h4 class="modal-title">[% l('View Record Feedback') %]</h4>
+  </div>
+  <div class="modal-body">
+    <div ng-repeat="f in feedback" class="row">
+        <div class="col-md-2">{{f.create_date() | date:egDateAndTimeFormat}}</div>
+        <div class="col-md-8" ng-class="{ acknowledged : f.acked() == 't' }">{{f.value()}}</div>
+        <div class="col-md-2"><button ng-click="f.acked('t')" class="btn btn-info btn-xs">[% l('Acknowledge') %]</button></div>
+    </div>
+  </div>
+  <div class="modal-footer">
+    <input type="submit" ng-click="ok()"
+        class="btn btn-primary" value="[% l('OK') %]"/>
+    <button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
+  </div>
+</div>
index 4b3d186..aaf24f8 100644 (file)
@@ -971,6 +971,39 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         $timeout(function() { $window.open(url, '_blank') });
     }
 
+    $scope.view_feedback = function() {
+        var recId = $scope.record_id;
+        $uibModal.open({
+            templateUrl : './cat/share/t_view_feedback',
+            backdrop : 'static',
+            animation : true,
+            controller:
+                       ['$scope','$uibModalInstance',
+                function($scope , $uibModalInstance) {
+                    $scope.feedback = [];
+                    egCore.pcrud.search('brf',
+                        { record : recId, acked : 'f' }, {}, { atomic : true }
+                    ).then(function(list) {
+                        $scope.feedback = list;
+                    });
+
+                    $scope.ok = function() {
+                        angular.forEach($scope.feedback, function(f) {
+                            if (f.acked() == 't') {
+                                egCore.pcrud.update(f);
+                            }
+                        });
+                        $uibModalInstance.close();
+                    }
+                    $scope.cancel = function($event) {
+                        $uibModalInstance.dismiss();
+                        $event.preventDefault();
+                    }
+                }
+            ]
+        });
+    }
+
     $scope.replaceBarcodes = function() {
         var copy_list = gatherSelectedRawCopies();
         if (copy_list.length == 0) return;
index 5560553..8201f32 100644 (file)
@@ -183,6 +183,14 @@ angular.module('egCoreMod')
                             $scope.bib_cn_tooltip = $sce.trustAsHtml(tooltip);
                         }
                     });
+                    $scope.feedback = {};
+                    egCore.pcrud.search('brf',
+                        { record : $scope.recordId, acked : 'f' },
+                        {},
+                        { atomic : true }
+                    ).then(function(list) {
+                        $scope.feedback['present'] = (list.length > 0) ? true : false;
+                    });
                 }
 
                 $scope.$watch('recordId',