Include reshelving count in multi-lib summary skin_tadlv4
authorJeff Godin <jgodin@tadl.org>
Mon, 23 Apr 2012 12:17:41 +0000 (08:17 -0400)
committerJeff Godin <jgodin@tadl.org>
Mon, 23 Apr 2012 12:17:41 +0000 (08:17 -0400)
Also include reshelving counts in multi-lib summary, so that
we don't say "0 available at Example Branch 1" without further
information "(plus 2 recently returned)".

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml
Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml

index 3cedebf..7ccb149 100644 (file)
                         // output the grouped-by-library summary
                         for (var libname in copySummaryObj) {
                             var copycount = 0;
+                            var copycount_reshelving = 0;
                             for (var loc in copySummaryObj[libname]) {
                                 for (var cn in copySummaryObj[libname][loc]) {
                                     copycount = copycount + copySummaryObj[libname][loc][cn]['count'];
+                                    copycount_reshelving = copycount_reshelving + copySummaryObj[libname][loc][cn]['count_reshelving'];
                                 }
                             }
                             var libdiv = dojo.create('div');
                             var libcontent = dojo.create('span', { "style": "font-weight: bold;" });
-                            var libtext = dojo.doc.createTextNode(copycount + ' available at ' + libname);
+                            var summary_text = copycount + ' available at ' + libname;
+                            if (copycount_reshelving) {
+                                summary_text += ' (plus ' + copycount_reshelving + ' recently returned)';
+                            }
+                            var libtext = dojo.doc.createTextNode(summary_text);
                             libcontent.appendChild(libtext);
                             libdiv.appendChild(libcontent);
                             output.appendChild(libdiv);
index 738971d..3077697 100644 (file)
                                     // output the grouped-by-library summary
                                     for (var libname in copySummaryObj) {
                                         var copycount = 0;
+                                        var copycount_reshelving = 0;
                                         for (var loc in copySummaryObj[libname]) {
                                             for (var cn in copySummaryObj[libname][loc]) {
                                                 copycount = copycount + copySummaryObj[libname][loc][cn]['count'];
+                                                copycount_reshelving = copycount_reshelving + copySummaryObj[libname][loc][cn]['count_reshelving'];
                                             }
                                         }
                                         var libdiv = dojo.create('div');
                                         var libcontent = dojo.create('span', { "style": "font-weight: bold;" });
-                                        var libtext = dojo.doc.createTextNode(copycount + ' available at ' + libname);
+                                        var summary_text = copycount + ' available at ' + libname;
+                                        if (copycount_reshelving) {
+                                            summary_text += ' (plus ' + copycount_reshelving + ' recently returned)';
+                                        }
+                                        var libtext = dojo.doc.createTextNode(summary_text);
                                         libcontent.appendChild(libtext);
                                         libdiv.appendChild(libcontent);
                                         output.appendChild(libdiv);