[open-ils-commits] r13649 - in trunk/Open-ILS/web: js/dojo/openils/opac/nls opac/common/js opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 21 01:31:29 EDT 2009
Author: dbs
Date: 2009-07-21 01:31:25 -0400 (Tue, 21 Jul 2009)
New Revision: 13649
Modified:
trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
trunk/Open-ILS/web/opac/common/js/config.js
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
Add a basic UI for creating and deleting MFHD records to the record display in the staff client
Modified: trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2009-07-21 05:29:29 UTC (rev 13648)
+++ trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2009-07-21 05:31:25 UTC (rev 13649)
@@ -1,5 +1,10 @@
{
- "EDIT_LABEL": "Edit",
+ "CREATE_MFHD": "Add MFHD record",
+ "CREATED_MFHD_RECORD": "Created MFHD record for ${0}",
+ "DELETED_MFHD_RECORD": "Deleted MFHD record ${0}",
+ "EDIT_MFHD_RECORD": "Edit MFHD Record",
+ "EDIT_MFHD_MENU": "Edit Holdings",
+ "EDIT_PROPERTIES": "Edit Propeties",
"HOLDINGS": "Previous volumes",
"INDEXES": "Previous indexes",
"CURRENT_HOLDINGS": "Current volume",
Modified: trunk/Open-ILS/web/opac/common/js/config.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/config.js 2009-07-21 05:29:29 UTC (rev 13648)
+++ trunk/Open-ILS/web/opac/common/js/config.js 2009-07-21 05:31:25 UTC (rev 13649)
@@ -291,6 +291,8 @@
var SEARCH_MRS_QUERY = 'open-ils.search:open-ils.search.metabib.multiclass.query:1';
var SEARCH_RS_QUERY = 'open-ils.search:open-ils.search.biblio.multiclass.query:1';
var FETCH_SEARCH_RIDS = "open-ils.search:open-ils.search.biblio.record.class.search:1";
+var CREATE_MFHD_RECORD = "open-ils.cat:open-ils.cat.serial.record.xml.create";
+var DELETE_MFHD_RECORD = "open-ils.cat:open-ils.cat.serial.record.delete";
var FETCH_MFHD_SUMMARY = "open-ils.search:open-ils.search.serial.record.bib.retrieve";
var FETCH_MRMODS = "open-ils.search:open-ils.search.biblio.metarecord.mods_slim.retrieve";
var FETCH_MODS_FROM_COPY = "open-ils.search:open-ils.search.biblio.mods_from_copy";
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-07-21 05:29:29 UTC (rev 13648)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-07-21 05:31:25 UTC (rev 13649)
@@ -12,7 +12,7 @@
var rdetailShowCopyLocation = true;
var rdetailGoogleBookPreview = true;
var rdetailDisplaySerialHoldings = true;
-var rdetailEnableRefWorks = true;
+var rdetailEnableRefWorks = false;
var rdetailRefWorksHost = 'http://www.refworks.com';
/* vars vars vars */
@@ -44,6 +44,10 @@
/* serials are currently the only use of Dojo strings in the OPAC */
if (rdetailDisplaySerialHoldings) {
+ if (isXUL()) {
+ dojo.require("dijit.Menu");
+ dojo.require("dijit.form.Button");
+ }
dojo.requireLocalization("openils.opac", "opac");
opac_strings = dojo.i18n.getLocalization("openils.opac", "opac");
}
@@ -129,6 +133,17 @@
var req = new Request(FETCH_MFHD_SUMMARY, getRid());
req.callback(_holdingsDraw);
req.send();
+ if (isXUL()) {
+ var here = findOrgUnit(getLocation());
+ dojo.place("<div id='mfhd_ad_menu></div>", "rdetail_details_table", "after");
+ var mfhd_add = new dijit.Menu({style:"float: right;"});
+ new dijit.MenuItem({onClick:function(){
+ var req = new Request(CREATE_MFHD_RECORD, G.user.session, 1, here.id(), getRid());
+ var res = req.send();
+ alert(dojo.string.substitute(opac_strings.CREATED_MFHD_RECORD, [here.name()]));
+ }, label:opac_strings.CREATE_MFHD}).placeAt(mfhd_add);
+ mfhd_add.placeAt(mfhd_ad_menu);
+ }
}
detachAllEvt("result", "idsReceived");
@@ -226,9 +241,11 @@
if (!holdings) { return null; }
dojo.forEach(holdings, _holdingsDrawMFHD);
+
}
function _holdingsDrawMFHD(holdings, entryNum) {
+
var here = findOrgUnit(getLocation());
if (getDepth() > 0 || getDepth === 0 ) {
while (getDepth() < findOrgDepth(here))
@@ -251,17 +268,22 @@
if ( hh.length == 0 && hch.length == 0 && hs.length == 0 &&
hcs.length == 0 && hi.length == 0 && hci.length == 0 &&
- ho.length == 0 && hm.length == 0 && hinc.length == 0 && !isXUL()
+ ho.length == 0 && hm.length == 0 && hinc.length == 0
) {
- /*
- * If we have a record, but nothing to show for it, then the
- * record is likely empty or corrupt. This gives cataloguers a
- * chance to add holdings or correct the record
- */
- hh = 'PLACEHOLDER';
+
+ if (isXUL()) {
+ /*
+ * If we have a record, but nothing to show for it, then the
+ * record is likely empty or corrupt. This gives cataloguers a
+ * chance to add holdings or correct the record
+ */
+ hh = 'PLACEHOLDER';
+ } else {
+ return null;
+ }
}
- dojo.place("<table style='width: 100%;'><caption id='mfhdHoldingsCaption' class='rdetail_header color_1'>" +
+ dojo.place("<table style='width: 100%;'><caption id='mfhdHoldingsCaption" + entryNum + "' class='rdetail_header color_1'>" +
dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [hloc]) +
"</caption><tbody id='rdetail_holdings_tbody_" + entryNum +
"'></tbody></table>", "rdetail_details_table", "after"
@@ -279,10 +301,17 @@
if (isXUL()) {
dojo.require('openils.Event');
dojo.require('openils.PermaCrud');
- dojo.place("<span> - </span><a class='classic_link' href='javascript:loadMarcEditor(" +
- holdings.id() + ")'>" + opac_strings.EDIT_LABEL + "</a>",
- "mfhdHoldingsCaption", "last"
- );
+ var mfhd_edit = new dijit.Menu({});
+ new dijit.MenuItem({onClick: function(){loadMarcEditor(holdings.id())}, label:opac_strings.EDIT_MFHD_RECORD}).placeAt(mfhd_edit, "first");
+ new dijit.MenuItem({onClick:function(){
+ var req = new Request(DELETE_MFHD_RECORD, G.user.session, holdings.id());
+ var res = req.send();
+ alert(dojo.string.substitute(opac_strings.DELETED_MFHD_RECORD, [holdings.id()]));
+ }, label:"Delete"}).placeAt(mfhd_edit, "last");
+ // new dijit.MenuItem({onClick:function(){alert("Edit properties " + holdings.id());}, label:opac_strings.EDIT_PROPERTIES}).placeAt(mfhd_edit, "last");
+ var mfhd_mb = new dijit.form.DropDownButton({dropDown: mfhd_edit, label:opac_strings.EDIT_MFHD_MENU, style:"float:right"});
+ mfhd_mb.placeAt("mfhdHoldingsCaption" + entryNum, "last");
+ mfhd_edit.startup();
}
}
More information about the open-ils-commits
mailing list