From b17ad30b4f9b6b7a18f434b4dee21318b895ec7e Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Mon, 23 Apr 2012 07:11:41 -0400 Subject: [PATCH] Fix logic -- no more "additional copies" repeating Fix logic for max_lines handling to avoid repeated output of "additional copies" message. Also, remove max_lines limit on record detail page. Signed-off-by: Jeff Godin --- Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml | 5 ++++- Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml b/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml index 222cda5a1c..94c76f1d26 100644 --- a/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml +++ b/Open-ILS/web/opac/skin/tadlv4/xml/rdetail/rdetail_summary.xml @@ -149,7 +149,7 @@ var item_cnt = 0; var max_items = 0; - var max_lines = 3; + var max_lines = 0; var copySummaryObj = new Object(); var count_copies_unavail = 0; var count_copies_avail = 0; @@ -263,13 +263,16 @@ var sumdiv = dojo.create('div', { "style": "font-weight: bold;" }); // output the grouped-by-location summary for (var sumlib in copySummaryObj) { + var reached_max_lines = false; //output the "at lib" var atlib = dojo.create('div', null, sumdiv); atlib.appendChild(dojo.doc.createTextNode('At ' + sumlib)); for (var sumloc in copySummaryObj[sumlib]) { + if (reached_max_lines) { break; } for (var sumcn in copySummaryObj[sumlib][sumloc]) { // available copies in each location, by cn label if (max_lines && lines_output >= max_lines) { + reached_max_lines = true; var morediv = dojo.create('div', { "style": "font-weight: bold;" }, sumdiv); morediv.appendChild(dojo.doc.createTextNode("additional copies available - click title for details")); } else { diff --git a/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml b/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml index dd24d90ef5..92c5e5d363 100644 --- a/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml +++ b/Open-ILS/web/opac/skin/tadlv4/xml/result/result_table.xml @@ -258,13 +258,16 @@ var sumdiv = dojo.create('div', { "style": "font-weight: bold;" }); // output the grouped-by-location summary for (var sumlib in copySummaryObj) { + var reached_max_lines = false; //output the "at lib" var atlib = dojo.create('div', null, sumdiv); atlib.appendChild(dojo.doc.createTextNode('At ' + sumlib)); for (var sumloc in copySummaryObj[sumlib]) { + if (reached_max_lines) { break; } for (var sumcn in copySummaryObj[sumlib][sumloc]) { // available copies in each location, by cn label if (max_lines && lines_output >= max_lines) { + reached_max_lines = true; var morediv = dojo.create('div', { "style": "font-weight: bold;" }, sumdiv); morediv.appendChild(dojo.doc.createTextNode("additional copies available - click title for details")); } else { -- 2.11.0