Bug fix for Launchpad #1109316 user/catalystit/Bug1109316
authorKyle Tomita <ktomita@catalystitservices.com>
Tue, 29 Jan 2013 23:04:05 +0000 (15:04 -0800)
committerKyle Tomita <ktomita@catalystitservices.com>
Tue, 29 Jan 2013 23:04:05 +0000 (15:04 -0800)
Fixed the display of Hold Note(s) Count and Hold Note(s) Text.

Signed-off-by: Kyle Tomita <ktomita@catalystitservices.com>
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/patron/hold_details.js
Open-ILS/xul/staff_client/server/patron/holds.js

index 5e766b2..968efd8 100644 (file)
@@ -2692,7 +2692,7 @@ circ.util.hold_columns = function(modify,params) {
             'hidden' : true,
             'editable' : false, 'render' : function(my) {
                 var s = '';
-                var notes = my.ahr.notes();
+                var notes = my.ahrn_note;
                 for (var i = 0; i < notes.length; i++) {
                     s += notes[i].title() + ':' + notes[i].body() + '; \n';
                 }
index be34911..b3b6889 100644 (file)
@@ -41,6 +41,7 @@ function fetch_and_render_all(do_not_refresh_parent_interface) {
             render_patron();
         }
 
+        retrieve_notes();
         a_list_of_one();
 
         var x = document.getElementById('bib_brief_box'); while (x.firstChild) x.removeChild(x.lastChild);
@@ -147,7 +148,8 @@ function a_list_of_one() {
                         'queue_position' : g.blob.queue_position,
                         'potential_copies' : g.blob.potential_copies,
                         'estimated_wait' : g.blob.estimated_wait,
-                        'ahrn_count' : g.blob.hold.notes().length,
+                        'ahrn_count' : g.notes.length,
+                        'ahrn_note' : g.notes,
                         'blob' : g.blob
                     }
                 },
index 9b15aef..a4470ea 100644 (file)
@@ -52,6 +52,9 @@ patron.holds.prototype = {
 
         var progressmeter = document.getElementById('progress');
 
+        dojo.require('openils.PermaCrud');
+        g.pcrud = new openils.PermaCrud({authtoken :ses()});
+
         JSAN.use('circ.util');
         var columns = circ.util.hold_columns(
             {
@@ -112,7 +115,10 @@ patron.holds.prototype = {
                                     row.my.queue_position = blob.queue_position;
                                     row.my.potential_copies = blob.potential_copies;
                                     row.my.estimated_wait = blob.estimated_wait;
-                                    row.my.ahrn_count = blob.hold.notes().length;
+                                    g.notes = g.pcrud.search('ahrn', {'hold':row.my.hold_id});
+                                    g.notes = g.notes.reverse();
+                                    row.my.ahrn_count = g.notes.length;
+                                    row.my.ahrn_note = g.notes;
 
                                     var copy_id = row.my.ahr.current_copy();
                                     if (typeof copy_id == 'object') {