[open-ils-commits] SPAM: r9057 - in
trunk/Open-ILS/xul/staff_client: chrome/content/main
server/cat server/locale/en-US
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 16 15:50:00 EDT 2008
Author: phasefx
Date: 2008-03-16 15:16:04 -0400 (Sun, 16 Mar 2008)
New Revision: 9057
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
simple search for record bucket interface.. uses an OPAC method that can handle author: title: etc in the search string. Need to move it to staged search
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2008-03-16 17:58:53 UTC (rev 9056)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2008-03-16 19:16:04 UTC (rev 9057)
@@ -134,6 +134,7 @@
'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false },
'FM_BRE_RETRIEVE_VIA_ID.authoritative' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve.authoritative', 'secure' : false },
'FM_BRE_ID_SEARCH_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.find_by_barcode', 'secure' : false },
+ 'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.multiclass.query.staff' },
'FM_BRE_ID_SEARCH_VIA_TCN' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.tcn', 'secure' : false },
'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false },
'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false },
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2008-03-16 17:58:53 UTC (rev 9056)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2008-03-16 19:16:04 UTC (rev 9057)
@@ -70,6 +70,7 @@
cat.record_buckets.prototype = {
+ 'selection_list0' : [],
'selection_list1' : [],
'selection_list2' : [],
'bucket_id_name_map' : {},
@@ -131,6 +132,35 @@
return row;
}
+ obj.list0 = new util.list('record_query_list');
+ obj.list0.init(
+ {
+ 'columns' : columns,
+ 'map_row_to_columns' : circ.util.std_map_row_to_columns(),
+ 'retrieve_row' : retrieve_row,
+ 'on_select' : function(ev) {
+ try {
+ JSAN.use('util.functional');
+ var sel = obj.list0.retrieve_selection();
+ obj.controller.view.sel_clip1.setAttribute('disabled', sel.length < 1 ? "true" : "false");
+ obj.selection_list0 = util.functional.map_list(
+ sel,
+ function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
+ );
+ obj.error.sdump('D_TRACE','circ/record_buckets: selection list 0 = ' + js2JSON(obj.selection_list1) );
+ if (obj.selection_list0.length == 0) {
+ obj.controller.view.cmd_add_sel_query_to_pending.setAttribute('disabled','true');
+ } else {
+ obj.controller.view.cmd_add_sel_query_to_pending.setAttribute('disabled','false');
+ }
+ } catch(E) {
+ alert('FIXME: ' + E);
+ }
+ },
+
+ }
+ );
+
obj.list1 = new util.list('pending_records_list');
obj.list1.init(
{
@@ -148,9 +178,9 @@
);
obj.error.sdump('D_TRACE','circ/record_buckets: selection list 1 = ' + js2JSON(obj.selection_list1) );
if (obj.selection_list1.length == 0) {
- obj.controller.view.cmd_record_buckets_sel_add.setAttribute('disabled','true');
+ obj.controller.view.cmd_add_sel_pending_to_record_bucket.setAttribute('disabled','true');
} else {
- obj.controller.view.cmd_record_buckets_sel_add.setAttribute('disabled','false');
+ obj.controller.view.cmd_add_sel_pending_to_record_bucket.setAttribute('disabled','false');
}
} catch(E) {
alert('FIXME: ' + E);
@@ -180,10 +210,10 @@
obj.error.sdump('D_TRACE','circ/record_buckets: selection list 2 = ' + js2JSON(obj.selection_list2) );
if (obj.selection_list2.length == 0) {
obj.controller.view.cmd_record_buckets_delete_item.setAttribute('disabled','true');
- obj.controller.view.cmd_pending_buckets_to_record_buckets.setAttribute('disabled','true');
+ obj.controller.view.cmd_record_buckets_to_pending_buckets.setAttribute('disabled','true');
} else {
obj.controller.view.cmd_record_buckets_delete_item.setAttribute('disabled','false');
- obj.controller.view.cmd_pending_buckets_to_record_buckets.setAttribute('disabled','false');
+ obj.controller.view.cmd_record_buckets_to_pending_buckets.setAttribute('disabled','false');
}
} catch(E) {
alert('FIXME: ' + E);
@@ -204,6 +234,10 @@
['command'],
function() { obj.list1.save_columns(); }
],
+ 'save_columns0' : [
+ ['command'],
+ function() { obj.list0.save_columns(); }
+ ],
'sel_clip2' : [
['command'],
function() { obj.list2.clipboard(); }
@@ -212,6 +246,23 @@
['command'],
function() { obj.list1.clipboard(); }
],
+ 'sel_clip0' : [
+ ['command'],
+ function() { obj.list0.clipboard(); }
+ ],
+ 'record_query_input' : [
+ ['render'],
+ function(ev) {
+ ev.addEventListener('keypress',function(ev){
+ if (ev.target.tagName != 'textbox') return;
+ if (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* enter on a mac */) setTimeout( function() { obj.submit(); }, 0);
+ },false);
+ }
+ ],
+ 'cmd_submit_query' : [
+ ['command'],
+ function() { obj.submit(); }
+ ],
'record_buckets_menulist_placeholder' : [
['render'],
function(e) {
@@ -310,7 +361,6 @@
var items = bucket.items() || [];
obj.list2.clear();
var x = document.getElementById('bucket_item_count');
- var catStrings = document.getElementById('catStrings');
if (x && catStrings) x.setAttribute('value',catStrings.getFormattedString('cat.total_bucket_items_in_bucket',[items.length]));
for (var i = 0; i < items.length; i++) {
var item = obj.prep_record_for_list(
@@ -338,9 +388,45 @@
}
],
- 'cmd_record_buckets_add' : [
+ 'cmd_add_all_query_to_pending' : [
['command'],
function() {
+ obj.list0.select_all();
+ for (var i = 0; i < obj.selection_list0.length; i++) {
+ var docid = obj.selection_list0[i].docid;
+ try {
+ var item = obj.prep_record_for_list( docid );
+ if (!item) continue;
+ obj.list1.append( item );
+ obj.record_ids.push( docid );
+ } catch(E) {
+ alert( js2JSON(E) );
+ }
+ }
+ }
+ ],
+
+ 'cmd_add_sel_query_to_pending' : [
+ ['command'],
+ function() {
+ for (var i = 0; i < obj.selection_list0.length; i++) {
+ var docid = obj.selection_list0[i].docid;
+ try {
+ var item = obj.prep_record_for_list( docid );
+ if (!item) continue;
+ obj.list1.append( item );
+ obj.record_ids.push( docid );
+ } catch(E) {
+ alert( js2JSON(E) );
+ }
+ }
+ }
+ ],
+
+
+ 'cmd_add_all_pending_to_record_bucket' : [
+ ['command'],
+ function() {
var bucket_id = obj.controller.view.bucket_menulist.value;
if (!bucket_id) return;
for (var i = 0; i < obj.record_ids.length; i++) {
@@ -364,7 +450,7 @@
}
}
],
- 'cmd_record_buckets_sel_add' : [
+ 'cmd_add_sel_pending_to_record_bucket' : [
['command'],
function() {
var bucket_id = obj.controller.view.bucket_menulist.value;
@@ -392,7 +478,7 @@
}
],
- 'cmd_pending_buckets_to_record_buckets' : [
+ 'cmd_record_buckets_to_pending_buckets' : [
['command'],
function() {
for (var i = 0; i < obj.selection_list2.length; i++) {
@@ -502,10 +588,13 @@
}
],
+ 'cmd_record_query_csv_to_clipboard' : [ ['command'], function() { obj.list0.dump_csv_to_clipboard(); } ],
'cmd_pending_buckets_csv_to_clipboard' : [ ['command'], function() { obj.list1.dump_csv_to_clipboard(); } ],
'cmd_record_buckets_csv_to_clipboard' : [ ['command'], function() { obj.list2.dump_csv_to_clipboard(); } ],
+ 'cmd_record_query_csv_to_printer' : [ ['command'], function() { obj.list0.dump_csv_to_printer(); } ],
'cmd_pending_buckets_csv_to_printer' : [ ['command'], function() { obj.list1.dump_csv_to_printer(); } ],
'cmd_record_buckets_csv_printer' : [ ['command'], function() { obj.list2.dump_csv_to_printer(); } ],
+ 'cmd_record_query_csv_to_file' : [ ['command'], function() { obj.list0.dump_csv_to_file( { 'defaultFileName' : 'pending_records.txt' } ); } ],
'cmd_pending_buckets_csv_to_file' : [ ['command'], function() { obj.list1.dump_csv_to_file( { 'defaultFileName' : 'pending_records.txt' } ); } ],
'cmd_record_buckets_csv_file' : [ ['command'], function() { obj.list2.dump_csv_to_file( { 'defaultFileName' : 'bucket_records.txt' } ); } ],
@@ -740,6 +829,48 @@
}
},
+ 'submit' : function() {
+ try {
+ var obj = this;
+ obj.list0.clear();
+ var x = document.getElementById('record_query_input');
+ if (x.value == '') return;
+ var y = document.getElementById('query_status');
+ x.disabled = true;
+ if (y) y.value = 'Searching...';
+ obj.network.simple_request(
+ 'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY',
+ [ {}, x.value, 1 ],
+ function(req) {
+ try {
+ var resp = req.getResultObject();
+ if (y) y.value = catStrings.getFormattedString('cat.results_returned',[resp.count]);
+ x.disabled = false;
+ if (resp.count > 0) {
+ JSAN.use('util.exec'); var exec = new util.exec();
+ var funcs = [];
+ for (var i = 0; i < resp.ids.length; i++) {
+ funcs.push(
+ function(b){
+ return function() {
+ obj.list0.append(obj.prep_record_for_list(b));
+ };
+ }(resp.ids[i][0])
+ );
+ }
+ exec.chain( funcs );
+ }
+ obj.controller.view.record_query_input.focus();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('submit_query_callback',E);
+ }
+ }
+ );
+ } catch(E) {
+ this.error.standard_unexpected_error_alert('submit_query',E);
+ }
+ },
+
'prep_record_for_list' : function(docid,bucket_item_id) {
var obj = this;
try {
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2008-03-16 17:58:53 UTC (rev 9056)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2008-03-16 19:16:04 UTC (rev 9057)
@@ -32,6 +32,8 @@
<script type="text/javascript" src="/xul/server/main/JSAN.js"/>
<script>
<![CDATA[
+ var catStrings;
+
function my_init() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
@@ -39,6 +41,8 @@
/* ugly hack so we don't have to upgrade the chrome for quick buckets */
if (typeof xulG == 'undefined') location.href = String(location.href).replace(/record_buckets.xul/,'record_buckets_quick.xul');
+ catStrings = document.getElementById('catStrings');
+
if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
JSAN.errorLevel = "die"; // none, warn, or die
JSAN.addRepository('/xul/server/');
@@ -83,11 +87,17 @@
<messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale' -->/cat.properties"/>
<commandset id="record_buckets_cmds">
+ <command id="sel_clip0" disabled="true"/>
<command id="sel_clip1" disabled="true"/>
<command id="sel_clip2" disabled="true"/>
+ <command id="save_columns0" />
<command id="save_columns1" />
<command id="save_columns2" />
+ <command id="cmd_record_query_csv_to_printer" />
+ <command id="cmd_record_query_csv_to_clipboard" />
+ <command id="cmd_record_query_csv_to_file" />
+
<command id="cmd_pending_buckets_csv_to_printer" />
<command id="cmd_pending_buckets_csv_to_clipboard" />
<command id="cmd_pending_buckets_csv_to_file" />
@@ -97,15 +107,18 @@
<command id="cmd_record_buckets_refresh" disabled="true"/>
<command id="cmd_record_buckets_delete_item" />
- <command id="cmd_pending_buckets_to_record_buckets" />
+ <command id="cmd_record_buckets_to_pending_buckets" />
<command id="cmd_record_buckets_csv_to_printer" />
<command id="cmd_record_buckets_csv_to_clipboard" />
<command id="cmd_record_buckets_csv_to_file" />
- <command id="cmd_record_buckets_add" />
- <command id="cmd_record_buckets_sel_add" />
+ <command id="cmd_add_all_query_to_pending" />
+ <command id="cmd_add_sel_query_to_pending" />
+ <command id="cmd_add_all_pending_to_record_bucket" />
+ <command id="cmd_add_sel_pending_to_record_bucket" />
+
<command id="cmd_merge_records" disabled="true" />
<command id="cmd_export_records_usmarc" />
<command id="cmd_export_records_unimarc" />
@@ -113,6 +126,8 @@
<command id="cmd_export_records_bre" />
<command id="cmd_delete_records" disabled="true" />
<command id="cmd_sel_opac" disabled="true" />
+
+ <command id="cmd_submit_query" />
</commandset>
<box id="record_buckets_main" />
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul 2008-03-16 17:58:53 UTC (rev 9056)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul 2008-03-16 19:16:04 UTC (rev 9057)
@@ -22,6 +22,13 @@
</tabs>
<tabpanels flex="1">
<tabpanel id="record_query_panel">
+ <groupbox flex="1">
+ <caption label="Record Query" />
+ <hbox id="record_query_top_ui" />
+ <label id="query_status"/>
+ <tree id="record_query_list" flex="1" enableColumnDrag="true"/>
+ <hbox id="record_query_bottom_ui" />
+ </groupbox>
</tabpanel>
<tabpanel id="pending_records_panel">
<groupbox flex="1">
@@ -58,6 +65,26 @@
</tabbox>
</vbox>
+<hbox id="record_query_top_ui">
+ <textbox id="record_query_input" flex="1"/>
+ <button command="cmd_submit_query" label="Submit" accesskey="S"/>
+</hbox>
+
+<hbox id="record_query_bottom_ui">
+ <button id="record_query_list_actions" label="List Actions" type="menu" allowevents="true">
+ <menupopup id="record_query_list_actions_popup">
+ <menuitem command="sel_clip0" label="Copy Field from selected row to Clipboard" disabled="true" />
+ <menuitem command="cmd_record_query_csv_to_printer" label="Print List CSV" />
+ <menuitem command="cmd_record_query_csv_to_clipboard" label="Copy List CSV to Clipboard" accesskey=""/>
+ <menuitem command="cmd_record_query_csv_to_file" label="Save List CSV to File" accesskey=""/>
+ <menuitem command="save_columns0" label="Save List Configuration" />
+ </menupopup>
+ </button>
+ <spacer flex="1"/>
+ <button command="cmd_add_all_query_to_pending" label="Add All to Pending Records" accesskey="" image="/xul/server/skin/media/images/right_arrow.png"/>
+ <button command="cmd_add_sel_query_to_pending" label="Add Selected to Pending Records" accesskey="" image="/xul/server/skin/media/images/right_arrow.png"/>
+</hbox>
+
<hbox id="pending_buckets_bottom_ui">
<button id="pending_buckets_list_actions" label="List Actions" type="menu" allowevents="true">
<menupopup id="pending_buckets_list_actions_popup">
@@ -69,13 +96,13 @@
</menupopup>
</button>
<spacer flex="1"/>
- <button command="cmd_record_buckets_add" label="Add All to current Bucket" accesskey="A" image="/xul/server/skin/media/images/right_arrow.png"/>
- <button command="cmd_record_buckets_sel_add" label="Add Selected to current Bucket" accesskey="" image="/xul/server/skin/media/images/right_arrow.png"/>
+ <button command="cmd_add_all_pending_to_record_bucket" label="Add All to current Bucket" accesskey="A" image="/xul/server/skin/media/images/right_arrow.png"/>
+ <button command="cmd_add_sel_pending_to_record_bucket" label="Add Selected to current Bucket" accesskey="" image="/xul/server/skin/media/images/right_arrow.png"/>
</hbox>
<hbox id="record_buckets_top_ui">
<button command="cmd_record_buckets_delete_item" label="Remove Selected from Bucket" disabled="true" image="/xul/server/skin/media/images/icon_delete.gif"/>
- <button command="cmd_pending_buckets_to_record_buckets" label="Add Selected to Pending Records" disabled="true" image="/xul/server/skin/media/images/left_arrow.png"/>
+ <button command="cmd_record_buckets_to_pending_buckets" label="Add Selected to Pending Records" disabled="true" image="/xul/server/skin/media/images/left_arrow.png"/>
</hbox>
<hbox id="info_box" hidden="true" style="font-size: large;">
@@ -99,7 +126,7 @@
<spacer flex="1"/>
<hbox style="background: grey">
<vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>
- <button command="cmd_sel_opac" label="Show All in Catalog" accesskey="S"/>
+ <button command="cmd_sel_opac" label="Show All in Catalog" accesskey=""/>
<button command="cmd_delete_records" label="Delete All Records"/>
<button command="cmd_merge_records" label="Merge All Records"/>
<button id="record_buckets_export_records" label="Export All Records" type="menu" allowevents="true" disabled="true">
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2008-03-16 17:58:53 UTC (rev 9056)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2008-03-16 19:16:04 UTC (rev 9057)
@@ -2,3 +2,4 @@
cat.batch_operation_failed=The whole batch operation failed. %1$s
cat.copy_buckets.tab=Copy Buckets
cat.total_bucket_items_in_bucket=Contains %1$s bucket items
+cat.results_returned=Returning %1$s hits
More information about the open-ils-commits
mailing list