[open-ils-commits] r18307 - branches/rel_1_6/Open-ILS/xul/staff_client/server/cat (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 13 04:34:03 EDT 2010
Author: phasefx
Date: 2010-10-13 04:33:58 -0400 (Wed, 13 Oct 2010)
New Revision: 18307
Added:
branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay_vertical.xul
branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul
branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.js
branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul
Log:
missed some pieces for r18306. A vertical version of the xul bib summary and the multi-bib side by side UI
Copied: branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay_vertical.xul (from rev 18288, trunk/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay_vertical.xul)
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay_vertical.xul (rev 0)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay_vertical.xul 2010-10-13 08:33:58 UTC (rev 18307)
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!DOCTYPE overlay PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+<overlay id="bib_brief_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <script type="text/javascript" src="/xul/server/cat/bib_brief_overlay.js"/>
+
+ <grid id="bib_brief_grid" flex="0">
+ <columns>
+ <column />
+ <column />
+ </columns>
+ <rows id="bib_brief_grid_rows">
+ <row id="bib_brief_grid_row1" position="1">
+ <label value="&staff.cat.bib_brief.title.label;" accesskey="&staff.cat.bib_brief.title.accesskey;" control="title" class="emphasis"/>
+ <textbox id="title" name="title" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.author.label;" accesskey="&staff.cat.bib_brief.author.accesskey;" control="author" class="emphasis"/>
+ <textbox id="author" name="author" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row position="2">
+ <label value="&staff.cat.bib_brief.edition.label;" accesskey="&staff.cat.bib_brief.edition.accesskey;" control="edition" class="emphasis"/>
+ <textbox id="edition" name="edition" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.pub_date.label;" accesskey="&staff.cat.bib_brief.pub_date.accesskey;" control="pubdate" class="emphasis"/>
+ <textbox id="pubdate" name="pubdate" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label id="bib_call_number_label" value="&staff.cat.bib_brief.call_number.label;" accesskey="&staff.cat.bib_brief.call_number.accesskey;" control="bib_call_number" class="emphasis"/>
+ <textbox id="bib_call_number" name="bib_call_number" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row id="bib_brief_grid_row3" position="3">
+ <label value="&staff.cat.bib_brief.title_control_number.label;" accesskey="&staff.cat.bib_brief.title_control_number.accesskey;" control="tcn" class="emphasis"/>
+ <textbox id="tcn" name="tcn" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.biblio_record_entry_id.label;" accesskey="&staff.cat.bib_brief.biblio_record_entry_id.accesskey;" control="mvr_doc_id" class="emphasis"/>
+ <textbox id="mvr_doc_id" name="mvr_doc_id" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.biblio_record_entry_owner.label;" accesskey="&staff.cat.bib_brief.biblio_record_entry_owner.accesskey;" control="owner" class="emphasis"/>
+ <textbox id="owner" name="owner" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.created_by.label;" accesskey="&staff.cat.bib_brief.created_by.accesskey;" control="creator" class="emphasis"/>
+ <textbox id="creator" name="creator" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.last_edited_by.label;" accesskey="&staff.cat.bib_brief.last_edited_by.accesskey;" control="editor" class="emphasis"/>
+ <textbox id="editor" name="editor" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ <row>
+ <label value="&staff.cat.bib_brief.last_edited_on.label;" accesskey="&staff.cat.bib_brief.last_edited_on.accesskey;" control="edit_date" class="emphasis"/>
+ <textbox id="edit_date" name="edit_date" readonly="true" context="clipboard" class="plain" onfocus="this.select()"/>
+ </row>
+ </rows>
+ </grid>
+</overlay>
Copied: branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul (from rev 18288, trunk/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul)
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul (rev 0)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bib_brief_vertical.xul 2010-10-13 08:33:58 UTC (rev 18307)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Brief Bib Display -->
+<!--
+vim: noet:sw=4:ts=4:
+-->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+<?xul-overlay href="/xul/server/cat/bib_brief_overlay_vertical.xul"?>
+
+<window id="cat_bib_brief_win"
+ onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- BEHAVIOR -->
+ <script type="text/javascript">
+ var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
+ </script>
+ <scripts id="openils_util_scripts"/>
+
+ <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+ <script type="text/javascript" src="/xul/server/cat/bib_brief.js"/>
+
+ <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties"/>
+ <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties"/>
+
+ <groupbox id="groupbox" flex="1">
+ <caption id="caption"><label value="&staff.cat.bib_brief.record_summary;"/>(<label value="&staff.cat.bib_brief.view_marc;" class="click_link" onclick="view_marc();"/>)</caption>
+ <grid id="bib_brief_grid" />
+ </groupbox>
+
+</window>
+
Copied: branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.js (from rev 18289, trunk/Open-ILS/xul/staff_client/server/cat/bibs_abreast.js)
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.js (rev 0)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.js 2010-10-13 08:33:58 UTC (rev 18307)
@@ -0,0 +1,207 @@
+var error;
+var network;
+var record_ids;
+var lead_record;
+
+function my_init() {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+ JSAN.errorLevel = "die"; // none, warn, or die
+ JSAN.addRepository('/xul/server/');
+ JSAN.use('util.error'); error = new util.error();
+ error.sdump('D_TRACE','my_init() for bibs_abreast.xul');
+ JSAN.use('util.functional');
+ JSAN.use('util.widgets');
+ JSAN.use('cat.util');
+ JSAN.use('util.network');
+
+ network = new util.network();
+
+ record_ids = xul_param('record_ids') || [];
+ record_ids = util.functional.unique_list_values( record_ids );
+
+ // Merge UI
+ if (xul_param('merge')) {
+ var x = document.getElementById('merge_bar');
+ x.hidden = false;
+ var y = document.getElementById('merge_button');
+ y.addEventListener('command', merge_records, false);
+ var z = document.getElementById('cancel_button');
+ z.addEventListener('command', function() {
+ x.hidden = true;
+ y.disabled = true;
+ var merge_bars = util.widgets.find_descendants_by_name(document,'merge_bar');
+ for (var i = 0; i < merge_bars.length; i++) { merge_bars[i].hidden = true; }
+ }, false);
+ }
+
+ // Display the records
+ for (var i = 0; i < record_ids.length; i++) {
+ render_bib(record_ids[i]);
+ }
+
+ /*if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
+ try { window.xulG.set_tab_name('Test'); } catch(E) { alert(E); }
+ }*/
+
+ } catch(E) {
+ try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); }
+ }
+}
+
+function render_bib(record_id) {
+ var main = document.getElementById('main');
+ var template = main.firstChild;
+ var new_node = template.cloneNode(true);
+ main.appendChild(new_node);
+ new_node.hidden = false;
+
+ var splitter_template = template.nextSibling;
+ var splitter = splitter_template.cloneNode(true);
+ main.appendChild(splitter);
+ splitter.hidden = false;
+
+ render_bib_brief(new_node,record_id);
+
+ var xul_deck = util.widgets.find_descendants_by_name(new_node,'bib_deck')[0];
+ var deck = new util.deck(xul_deck);
+
+ // merge UI
+ if (xul_param('merge')) {
+ var merge_bar = util.widgets.find_descendants_by_name(new_node,'merge_bar')[0];
+ merge_bar.hidden = false;
+ var lead_button = util.widgets.find_descendants_by_name(new_node,'lead_button')[0];
+ lead_button.addEventListener('click', function() {
+ lead_record = record_id;
+ dump('record_id = ' + record_id + '\n');
+ document.getElementById('merge_button').disabled = false;
+ }, false);
+ }
+
+ // remove_me button
+ var remove_me = util.widgets.find_descendants_by_name(new_node,'remove_me')[0];
+ remove_me.addEventListener('command', function() {
+ if (lead_record == record_id) {
+ lead_record = undefined;
+ document.getElementById('merge_button').disabled = true;
+ }
+ record_ids = util.functional.filter_list( record_ids, function(o) { return o != record_id; } );
+ main.removeChild(new_node);
+ main.removeChild(splitter);
+ if (main.childNodes.length == 4) {
+ document.getElementById('merge_bar').hidden = true;
+ document.getElementById('merge_button').disabled = true;
+ var merge_bars = util.widgets.find_descendants_by_name(document,'merge_bar');
+ for (var i = 0; i < merge_bars.length; i++) { merge_bars[i].hidden = true; }
+ }
+ if (main.childNodes.length == 2) { xulG.close_tab(); }
+ }, false);
+
+ // radio buttons
+ var view_bib = util.widgets.find_descendants_by_name(new_node,'view_bib')[0];
+ var edit_bib = util.widgets.find_descendants_by_name(new_node,'edit_bib')[0];
+ var holdings = util.widgets.find_descendants_by_name(new_node,'holdings')[0];
+
+ view_bib.addEventListener('command', function() {
+ set_view_pane(deck,record_id);
+ }, false);
+
+ edit_bib.addEventListener('command', function() {
+ set_edit_pane(deck,record_id);
+ }, false);
+
+ holdings.addEventListener('command', function() {
+ set_item_pane(deck,record_id);
+ }, false);
+
+ set_view_pane(deck,record_id);
+
+}
+
+function render_bib_brief(new_node,record_id) {
+ // iframe
+ var bib_brief = util.widgets.find_descendants_by_name(new_node,'bib_brief')[0];
+ bib_brief.setAttribute('src', urls.XUL_BIB_BRIEF_VERTICAL);
+ get_contentWindow(bib_brief).xulG = { 'docid' : record_id };
+}
+
+function set_view_pane(deck,record_id) {
+ deck.set_iframe( urls.XUL_MARC_VIEW, {}, { 'docid' : record_id } );
+}
+
+function set_item_pane(deck,record_id) {
+ var my_xulG = { 'docid' : record_id }; for (var i in xulG) { my_xulG[i] = xulG[i]; }
+ deck.set_iframe( urls.XUL_COPY_VOLUME_BROWSE, {}, my_xulG );
+}
+
+function set_edit_pane(deck,record_id) {
+ var my_xulG = {
+ 'record' : { 'url' : '/opac/extras/supercat/retrieve/marcxml/record/' + record_id, "id": record_id, "rtype": "bre" },
+ 'fast_add_item' : function(doc_id,cn_label,cp_barcode) {
+ try {
+ return cat.util.fast_item_add(doc_id,cn_label,cp_barcode);
+ } catch(E) {
+ alert('Error in bibs_abreast.js, set_edit_pane, fast_item_add: ' + E);
+ }
+ },
+ 'save' : {
+ 'label' : document.getElementById('offlineStrings').getString('cat.save_record'),
+ 'func' : function (new_marcxml) {
+ try {
+ var r = network.simple_request('MARC_XML_RECORD_UPDATE', [ ses(), record_id, new_marcxml ]);
+ if (typeof r.ilsevent != 'undefined') {
+ throw(r);
+ } else {
+ return {
+ 'id' : r.id(),
+ 'oncomplete' : function() {}
+ };
+ }
+ } catch(E) {
+ alert('Error in bibs_abreast.js, set_edit_pane, save: ' + E);
+ }
+ }
+ }
+ };
+ for (var i in xulG) { my_xulG[i] = xulG[i]; }
+ deck.set_iframe( urls.XUL_MARC_EDIT, {}, my_xulG );
+}
+
+function merge_records() {
+ try {
+ var robj = network.simple_request('MERGE_RECORDS',
+ [
+ ses(),
+ lead_record,
+ util.functional.filter_list( record_ids,
+ function(o) {
+ return o != lead_record;
+ }
+ )
+ ]
+ );
+ if (typeof robj.ilsevent != 'undefined') {
+ switch(robj.ilsevent) {
+ case 5000 /* PERM_FAILURE */: break;
+ default: throw(robj);
+ }
+ }
+ if (typeof xulG.on_merge == 'function') {
+ xulG.on_merge(robj);
+ }
+ var opac_url = xulG.url_prefix( urls.opac_rdetail ) + '?r=' + lead_record;
+ var content_params = {
+ 'session' : ses(),
+ 'authtime' : ses('authtime'),
+ 'opac_url' : opac_url,
+ };
+ xulG.set_tab(
+ xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
+ {'tab_name':'Retrieving title...'},
+ content_params
+ );
+ } catch(E) {
+ alert('Error in bibs_abreast.js, merge_records(): ' + E);
+ }
+}
Copied: branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul (from rev 18289, trunk/Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul)
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul (rev 0)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/cat/bibs_abreast.xul 2010-10-13 08:33:58 UTC (rev 18307)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Example Template for remote xul -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- STYLESHEETS -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="main_bibs_abreast"
+ onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- BEHAVIOR -->
+ <script type="text/javascript">
+ var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true;
+ </script>
+ <scripts id="openils_util_scripts"/>
+
+ <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+ <script type="text/javascript" src="bibs_abreast.js"/>
+
+ <hbox id="merge_bar" hidden="true">
+ <description>&staff.cat.record_buckets.merge_records.merge_lead;</description>
+ <button id="merge_button" disabled="true"
+ label="&staff.cat.record_buckets.merge_records.button.label;"
+ accesskey="&staff.cat.record_buckets.merge_records.button.accesskey;"
+ />
+ <button id="cancel_button"
+ label="&staff.cat.record_buckets.merge_records.cancel_button.label;"
+ accesskey="&staff.cat.record_buckets.merge_records.cancel_button.accesskey;"
+ />
+ </hbox>
+ <hbox id="main" class="my_overflow" flex="1">
+ <vbox name="template" hidden="true" flex="1">
+ <hbox name="merge_bar" hidden="true">
+ <input name="lead_button" type="radio" xmlns="http://www.w3.org/1999/xhtml"></input>
+ &staff.cat.record_buckets.merge_records.lead;
+ </hbox>
+ <iframe name="bib_brief" flex="1" />
+ <hbox>
+ <radiogroup flex="0" orient="horizontal">
+ <radio name="view_bib" label="View Bib" />
+ <radio name="edit_bib" label="Edit Bib" />
+ <radio name="holdings" label="Holdings" />
+ </radiogroup>
+ <spacer flex="1"/>
+ <button name="remove_me"
+ image="/xul/server/skin/media/images/icon_delete.gif"
+ label="&staff.cat.record_buckets.merge_records.remove_from_consideration;" />
+ </hbox>
+ <deck name="bib_deck" flex="3" />
+ </vbox>
+ <splitter name="template2" hidden="true"><grippy /></splitter>
+ </hbox>
+
+</window>
+
More information about the open-ils-commits
mailing list