From 42bfd61cd69fb720b25dfbdfa21ca0a81978ea50 Mon Sep 17 00:00:00 2001 From: phasefx Date: Sun, 25 Sep 2005 04:02:43 +0000 Subject: [PATCH] toward spine labels git-svn-id: svn://svn.open-ils.org/ILS/trunk@1872 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../evergreen/cat/spine_label_wizard.xul | 57 +++++++++++++++++++ .../chrome/content/evergreen/cat/volume.js | 20 ++++++- .../content/evergreen/util/spawn_win.js | 5 ++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul b/Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul new file mode 100644 index 0000000000..ed3948553d --- /dev/null +++ b/Evergreen/staff_client/chrome/content/evergreen/cat/spine_label_wizard.xul @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js b/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js index 511250a3a5..fb3c9b9eb1 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js +++ b/Evergreen/staff_client/chrome/content/evergreen/cat/volume.js @@ -67,11 +67,13 @@ function page2_add_volume_row(ou,ti) { //cn_row.setAttribute('id','p2_'+ou.id()); cn_row.setAttribute('ou_name',ou.name()); cn_row.setAttribute('ou_id',ou.id()); + cn_row.setAttribute('spine_row','1'); rows.appendChild(cn_row); cn_row.appendChild( document.createElement('label') ); var cn_text1 = document.createElement('textbox'); cn_text1.setAttribute('size','20'); cn_text1.setAttribute('value','A Call Number'); + cn_text1.setAttribute('spine_cn','1'); cn_row.appendChild( cn_text1 ); var cn_text2 = document.createElement('textbox'); cn_text2.setAttribute('size','4'); @@ -80,6 +82,7 @@ function page2_add_volume_row(ou,ti) { var cn_text3 = document.createElement('textbox'); cn_text3.setAttribute('size','4'); cn_text3.setAttribute('value','0'); + cn_text3.setAttribute('spine_label_count','1'); cn_row.appendChild( cn_text3 ); } } @@ -101,12 +104,14 @@ function copy_add_page2_add_volume_row(ou,ti) { cn_row.setAttribute('ou_name',ou.name()); cn_row.setAttribute('ou_id',ou.id()); cn_row.setAttribute('volume_id',ti.getAttribute('volume_id')); + cn_row.setAttribute('spine_row','1'); rows.appendChild(cn_row); cn_row.appendChild( document.createElement('label') ); var cn_text1 = document.createElement('textbox'); cn_text1.setAttribute('size','20'); cn_text1.setAttribute('volume_id',ti.getAttribute('volume_id')); cn_text1.setAttribute('value',ti.getAttribute('callnumber')); + cn_text1.setAttribute('spine_cn','1'); cn_row.appendChild( cn_text1 ); cn_text1.disabled = true; var cn_text2 = document.createElement('textbox'); @@ -116,6 +121,7 @@ function copy_add_page2_add_volume_row(ou,ti) { var cn_text3 = document.createElement('textbox'); cn_text3.setAttribute('size','4'); cn_text3.setAttribute('value','0'); + cn_text3.setAttribute('spine_label_count','1'); cn_row.appendChild( cn_text3 ); } @@ -418,5 +424,17 @@ function submit_edited_volumes() { } function spine_labels() { - alert('wizard goes here'); + var nl = document.getElementsByTagName('row'); + var spine_labels = []; + for (var i = 0; i < nl.length; i++) { + var r = nl[i]; var cn = ''; var count = 0; + if (! r.getAttribute('spine_row')) continue; + for (var j = 0; j < r.childNodes.length; j++) { + var c = r.childNodes[j]; + if (c.getAttribute('spine_cn')) cn = c.value; + if (c.getAttribute('spine_label_count')) count = c.value; + } + spine_labels.push( [ cn, count ] ); + } + mw.spawn_spine_label_wizard(document,'new_window','',{ 'spine_labels' : spine_labels }); } diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js b/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js index ea2b10f292..65d28748cf 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js +++ b/Evergreen/staff_client/chrome/content/evergreen/util/spawn_win.js @@ -134,6 +134,11 @@ function spawn_receipt_template_editor(d,placement,place,passthru_params,clone) return spawn_interface(d,placement,place,chrome,getString('receipt_template_editor_interface_label'),passthru_params,clone); } +function spawn_spine_label_wizard(d,placement,place,passthru_params,clone) { + var chrome = 'chrome://evergreen/content/cat/spine_label_wizard.xul'; + return spawn_interface(d,placement,place,chrome,getString('spine_label_wizard'),passthru_params,clone); +} + /* legacy code, may be removed or refactored */ function spawn_batch_copy_editor(d,placement,place,passthru_params,clone) { -- 2.43.2