From b43697eadf7cc0cac243ef46c4dd9f31753b5fee Mon Sep 17 00:00:00 2001 From: pines Date: Fri, 18 Aug 2006 18:15:01 +0000 Subject: [PATCH] form feed after each spine label, and persist settings git-svn-id: svn://svn.open-ils.org/ILS/trunk@5589 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/cat/copy_browser.js | 18 +++++------- .../xul/staff_client/server/cat/spine_labels.xul | 33 ++++++++++++++-------- Open-ILS/xul/staff_client/server/cat/util.js | 8 ++++-- .../staff_client/server/cat/volume_copy_creator.js | 10 +++++-- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index f15a1fa084..56fc29ab84 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -202,9 +202,9 @@ cat.copy_browser.prototype = { +'&ou_ids=' + window.escape( js2JSON(list) ) +'©_shortcut=' + window.escape( js2JSON(copy_shortcut) ), title, - 'chrome,modal,resizable' + 'chrome,resizable' ); - obj.refresh_list(); + w.refresh = function() { obj.refresh_list(); } } catch(E) { obj.error.standard_unexpected_error_alert('copy browser -> add copies',E); } @@ -367,14 +367,10 @@ cat.copy_browser.prototype = { } ); + obj.data.temp_barcodes_for_labels = util.functional.map_list( list, function(o){return o.barcode();}) ; + obj.data.stash('temp_barcodes_for_labels'); xulG.new_tab( - xulG.url_prefix( urls.XUL_SPINE_LABEL ) + '?barcodes=' - + js2JSON( - util.functional.map_list( - list, - function(o){return o.barcode();} - ) - ), + xulG.url_prefix( urls.XUL_SPINE_LABEL ), { 'tab_name' : 'Spine Labels' }, {} ); @@ -429,10 +425,10 @@ cat.copy_browser.prototype = { +'?doc_id=' + window.escape(obj.docid) +'&ou_ids=' + window.escape( js2JSON(list) ), title, - 'chrome,modal,resizable' + 'chrome,resizable' ); - obj.refresh_list(); + w.refresh = function() { obj.refresh_list() }; } catch(E) { obj.error.standard_unexpected_error_alert('copy browser -> add volumes',E); } diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.xul b/Open-ILS/xul/staff_client/server/cat/spine_labels.xul index c5c686f039..68312ce052 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.xul +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.xul @@ -44,7 +44,16 @@ g.cgi = new CGI(); - g.barcodes = JSON2js(g.cgi.param('barcodes')); + g.barcodes = []; + if (g.cgi.param('barcodes')) { + g.barcodes = g.barcodes.concat( JSON2js(g.cgi.param('barcodes')) ); + } + JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve(); + if (g.data.temp_barcodes_for_labels) { + g.barcodes = g.barcodes.concat( g.data.temp_barcodes_for_labels ); + g.data.temp_barcodes_for_labels = null; g.data.stash('temp_barcodes_for_labels'); + } + g.copies = []; g.volumes = {}; g.volume_count = {}; @@ -134,21 +143,23 @@ var sbl = Number($('sbl').value); if (sbl == NaN) sbl = 2; //alert('pt = ' + pt + ' lm = ' + lm + ' lw = ' + lw + ' ll = ' + ll + ' sbl = ' + sbl); var html = "Spine Labels
\n";
+					html += "pt; page-break-after: always;}'>Spine Labels\n";
 					var nl = document.getElementsByAttribute('name','template');
 					for (var i = 0; i < nl.length; i++) {
 						var count = Number( nl[i].getElementsByAttribute('name','count')[0].value ); if (count == NaN) count = 1;
 						for (var j = 0; j < count; j++) {
+							html += '
\n';
 							var gb = nl[i].childNodes[1];
 							var nl2 = gb.getElementsByTagName('textbox');
 							for (var k = 0; k < nl2.length; k++) {
 								for (var m = 0; m < lm; m++) html += ' ';
 								html += nl2[k].value + '\n';
 							}
-							for (var k = 0; k < sbl; k++) html += '\n';
+							//for (var k = 0; k < sbl; k++) html += '\n';
+							html += '
\n'; } } - html += '
'; + html += ''; JSAN.use('util.window'); var win = new util.window(); var loc = ( urls.XUL_REMOTE_BROWSER ) + '?url=' + window.escape( 'data:text/html,' + window.escape(html) ) + '&show_print_button=1&alternate_print=1&no_xulG=1&title=' + window.escape('Spine Labels'); var w = win.open( loc, 'spine_preview', 'chrome,resizable,width=750,height=550'); @@ -164,23 +175,23 @@ - - - - - - diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index ea107e00e1..82b55eb6ab 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -79,9 +79,11 @@ cat.util.spawn_spine_editor = function(selection_list) { JSAN.use('util.error'); var error = new util.error(); try { JSAN.use('util.functional'); + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve(); + data.temp_barcodes_for_labels = util.functional.map_list( selection_list, function(o){return o.barcode;}) ; + data.stash('temp_barcodes_for_labels'); xulG.new_tab( - xulG.url_prefix( urls.XUL_SPINE_LABEL ) + '?barcodes=' - + js2JSON( util.functional.map_list(selection_list,function(o){return o.barcode;}) ), + xulG.url_prefix( urls.XUL_SPINE_LABEL ), { 'tab_name' : 'Spine Labels' }, {} ); @@ -141,7 +143,7 @@ cat.util.add_copies_to_bucket = function(selection_list) { win.open( xulG.url_prefix(urls.XUL_COPY_BUCKETS_QUICK), 'sel_bucket_win' + win.window_name_increment(), - 'chrome,resizable,modal,center' + 'chrome,resizable,center' ); } diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js index 6050cd07b6..4b54207790 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js @@ -411,11 +411,13 @@ g.stash_and_close = function() { } else { if (copies.length > 0 && $('print_labels').checked) { JSAN.use('util.functional'); + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve(); + data.temp_barcodes_for_labels = util.functional.map_list( copies, function(o){return o.barcode();}) ; + data.stash('temp_barcodes_for_labels'); var w = win.open( - urls.XUL_SPINE_LABEL - + '?barcodes=' + window.escape( js2JSON( util.functional.map_list(copies,function(o){return o.barcode();}) ) ), + urls.XUL_SPINE_LABEL, 'spine_labels', - 'chrome,modal,resizable,width=750,height=550' + 'chrome,resizable,width=750,height=550' ); } } @@ -423,6 +425,8 @@ g.stash_and_close = function() { g.error.standard_unexpected_error_alert('volume tree update 2',E); } + if (typeof window.refresh == 'function') window.refresh(); + window.close(); } catch(E) { -- 2.11.0