LP#1727487 Webstaff In-House-Use uses display fields
authorBill Erickson <berickxx@gmail.com>
Thu, 26 Oct 2017 19:17:45 +0000 (15:17 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 28 Feb 2018 21:17:37 +0000 (16:17 -0500)
Replace reporter.simple_record data with metabib display fields.

Use flat_display_entries instead of wide_display_entry partially as an
example, but also because it requires slightly less data munging on the
DB side.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Conflicts:
Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/templates/staff/circ/in_house_use/index.tt2
Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js

index 9889557..df39540 100644 (file)
@@ -8,6 +8,7 @@
 [% BLOCK APP_JS %]
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/record.js"></script>
 [% INCLUDE 'staff/circ/share/circ_strings.tt2' %]
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/circ/in_house_use/app.js"></script>
 [% END %]
index 6d0d352..8899aca 100644 (file)
@@ -8,8 +8,10 @@ angular.module('egInHouseUseApp',
 })
 
 .controller('InHouseUseCtrl',
-       ['$scope','egCore','egGridDataProvider','egConfirmDialog', 'egAlertDialog',
-function($scope,  egCore,  egGridDataProvider , egConfirmDialog, egAlertDialog) {
+       ['$scope','egCore','egGridDataProvider','egConfirmDialog', 
+        'egAlertDialog','egBibDisplay',
+function($scope , egCore , egGridDataProvider , egConfirmDialog, 
+         egAlertDialog , egBibDisplay) {
 
     var countCap;
     var countMax;
@@ -95,7 +97,10 @@ function($scope,  egCore,  egGridDataProvider , egConfirmDialog, egAlertDialog)
                     flesh_fields : {
                         acp : ['call_number','location'],
                         acn : ['record', 'prefix', 'suffix'],
-                        bre : ['simple_record']
+                        // We don't need to display a wide range of bib
+                        // fields in this UI.  Fetch the flat display since
+                        // it requires less DB-side munging (and as an example).  
+                        bre : ['flat_display_entries']
                     },
                     select : { bre : ['id'] } // avoid fleshing MARC
                 }
@@ -109,6 +114,11 @@ function($scope,  egCore,  egGridDataProvider , egConfirmDialog, egAlertDialog)
 
                 coArgs.copyid = copy.id();
 
+                copy.call_number().record().flat_display_entries(
+                    egBibDisplay.mfdeToHash(
+                        copy.call_number().record().flat_display_entries())
+                );
+
                 // LP1507807: Display the copy alert if the setting is on.
                 if ($scope.copyAlert && copy.alert_message()) {
                     egAlertDialog.open(copy.alert_message()).result;
@@ -152,7 +162,7 @@ function($scope,  egCore,  egGridDataProvider , egConfirmDialog, egAlertDialog)
             var item = {num_uses : resp.length};
             item.copy = data.copy;
             item.title = data.title || 
-                data.copy.call_number().record().simple_record().title();
+                data.copy.call_number().record().flat_display_entries().title;
             item.index = checkouts.length;
 
             checkouts.unshift(item);