[open-ils-commits] r18408 - in branches/rel_2_0/Open-ILS: web/js/ui/default/serial web/templates/default/serial xul/staff_client/chrome/content/cat (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 20 12:00:33 EDT 2010
Author: senator
Date: 2010-10-20 12:00:28 -0400 (Wed, 20 Oct 2010)
New Revision: 18408
Modified:
branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_stream.js
branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_subscription.js
branches/rel_2_0/Open-ILS/web/js/ui/default/serial/subscription.js
branches/rel_2_0/Open-ILS/web/templates/default/serial/list_stream.tt2
branches/rel_2_0/Open-ILS/web/templates/default/serial/list_subscription.tt2
branches/rel_2_0/Open-ILS/web/templates/default/serial/subscription.tt2
branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Log:
Backport r18407 from trunk: alt serials interface tweak
Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_stream.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_stream.js 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_stream.js 2010-10-20 16:00:28 UTC (rev 18408)
@@ -4,8 +4,11 @@
dojo.require("openils.widget.AutoGrid");
dojo.require("openils.widget.ProgressDialog");
dojo.require("openils.PermaCrud");
+dojo.require("openils.CGI");
var pcrud;
+var dist_id;
+var cgi;
function format_routing_label(routing_label) {
return routing_label ? routing_label : "[None]";
@@ -27,7 +30,13 @@
"sdist", dist_id, {
"onresponse": function(r) {
if (r = openils.Util.readResponse(r)) {
- dojo.byId("sdist_label_here").innerHTML = r.label();
+ var link = dojo.byId("sdist_label_here");
+ link.onclick = function() {
+ location.href = oilsBasePath +
+ "/eg/serial/subscription?id=" +
+ r.subscription() + "&tab=distributions";
+ }
+ link.innerHTML = r.label();
load_sdist_org_unit_display(r);
}
}
@@ -65,7 +74,10 @@
openils.Util.addOnLoad(
function() {
+ cgi = new openils.CGI();
pcrud = new openils.PermaCrud();
+
+ dist_id = cgi.param("distribution");
load_sdist_display();
load_sstr_grid();
}
Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_subscription.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_subscription.js 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/serial/list_subscription.js 2010-10-20 16:00:28 UTC (rev 18408)
@@ -2,9 +2,13 @@
dojo.require("openils.widget.AutoGrid");
dojo.require("openils.widget.OrgUnitFilteringSelect");
dojo.require("openils.BibTemplate");
+dojo.require("openils.CGI");
+var terms;
+var cgi;
+
function format_ssub_link(id) {
- return "<a href='" + oilsBasePath + "/serial/subscription/" +
+ return "<a href='" + oilsBasePath + "/serial/subscription?id=" +
id + "'>" + id + "</a>";
}
@@ -15,6 +19,16 @@
openils.Util.addOnLoad(
function() {
+ cgi = new openils.CGI();
+
+ terms = {
+ "owning_lib": aou.orgNodeTrail(
+ aou.findOrgUnit(openils.User.user.ws_ou()),
+ true /* asId */
+ ),
+ "record_entry": cgi.param("record_entry") || _fallback_record_entry
+ };
+
if (terms.record_entry)
new openils.BibTemplate({"record": terms.record_entry}).render();
Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/serial/subscription.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/serial/subscription.js 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/serial/subscription.js 2010-10-20 16:00:28 UTC (rev 18408)
@@ -10,9 +10,12 @@
dojo.require("openils.widget.ProgressDialog");
dojo.require("openils.widget.HoldingCode");
dojo.require("openils.PermaCrud");
+dojo.require("openils.CGI");
var pcrud;
+var cgi;
var sub;
+var sub_id;
/* typing save: add {get,set}Value() to all HTML <select> elements */
HTMLSelectElement.prototype.getValue = function() {
@@ -27,7 +30,7 @@
}
}
-function load_sub_grid(id) {
+function load_sub_grid(id, oncomplete) {
if (!pcrud) return; /* first run, onLoad hasn't fired yet */
if (!sub_grid._fresh) {
pcrud.retrieve(
@@ -42,6 +45,9 @@
);
sub_grid._fresh = true;
}
+ },
+ "oncomplete": function() {
+ if (oncomplete) oncomplete();
}
}
);
@@ -77,8 +83,9 @@
}
}
);
- return "<a href='" + oilsBasePath + "/serial/list_subscription/" +
- bib_id + "'>" + result + "</a>";
+ return "<a href='" + oilsBasePath +
+ "/serial/list_subscription?record_entry=" + bib_id + "'>" +
+ result + "</a>";
}
}
@@ -101,7 +108,7 @@
function format_sdist_label(blob) {
if (!blob.id) return "";
var link = "<a href='" +
- oilsBasePath + "/serial/list_stream/" + blob.id +
+ oilsBasePath + "/serial/list_stream?distribution=" + blob.id +
"'>" + (blob.label ? blob.label : "[None]") + "</a>" + /* XXX i18n */
"<span id='dist_link_" + blob.id + "'></span>";
@@ -147,7 +154,15 @@
openils.Util.addOnLoad(
function() {
+ cgi = new openils.CGI();
pcrud = new openils.PermaCrud();
- load_sub_grid(sub_id);
+
+ sub_id = cgi.param("id");
+ load_sub_grid(
+ sub_id,
+ (cgi.param("tab") == "distributions") ?
+ function() { tab_container.selectChild(distributions_tab); } :
+ null
+ );
}
);
Modified: branches/rel_2_0/Open-ILS/web/templates/default/serial/list_stream.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/serial/list_stream.tt2 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/templates/default/serial/list_stream.tt2 2010-10-20 16:00:28 UTC (rev 18408)
@@ -4,9 +4,6 @@
type="text/javascript"
src="[% ctx.media_prefix %]/js/ui/default/serial/list_stream.js">
</script>
-<script type="text/javascript">
- var dist_id = "[% ctx.page_args.0 %]";
-</script>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div dojoType="dijit.layout.ContentPane"
layoutAlign="top" class="oils-header-panel">
@@ -26,7 +23,7 @@
</div>
<div>
Showing streams attached to the distribution,
- <em id="sdist_label_here"></em>
+ <em><a href="javascript:void(0);" id="sdist_label_here"></a></em>
(<span id="sdist_org_unit_name_here"></span>).
</div>
<table jsId="sstr_grid"
Modified: branches/rel_2_0/Open-ILS/web/templates/default/serial/list_subscription.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/serial/list_subscription.tt2 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/templates/default/serial/list_subscription.tt2 2010-10-20 16:00:28 UTC (rev 18408)
@@ -5,15 +5,7 @@
src="[% ctx.media_prefix %]/js/ui/default/serial/list_subscription.js">
</script>
<script type="text/javascript">
- var terms = {
- "owning_lib": aou.orgNodeTrail(
- aou.findOrgUnit(openils.User.user.ws_ou()),
- true /* asId */
- )
- };
-
- if (docid = "[% ctx.page_args.0 %]") /* assignment intentional */
- terms.record_entry = docid;
+ var _fallback_record_entry = "[% ctx.page_args.0 %]";
</script>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div dojoType="dijit.layout.ContentPane"
Modified: branches/rel_2_0/Open-ILS/web/templates/default/serial/subscription.tt2
===================================================================
--- branches/rel_2_0/Open-ILS/web/templates/default/serial/subscription.tt2 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/web/templates/default/serial/subscription.tt2 2010-10-20 16:00:28 UTC (rev 18408)
@@ -1,7 +1,6 @@
[% WRAPPER "default/base.tt2" %]
<script>
var cap_editor;
- var sub_id = "[% ctx.page_args.0 %]";
</script>
<script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription.js">
</script>
@@ -19,7 +18,8 @@
</div>
</div>
-<div dojoType="dijit.layout.TabContainer" class="oils-serial-tab-container">
+<div dojoType="dijit.layout.TabContainer" jsId="tab_container"
+ class="oils-serial-tab-container">
<!-- Subscription Summary -->
<div dojoType="dijit.layout.ContentPane" title="Summary" selected="true">
@@ -51,7 +51,7 @@
</div>
<!-- Distributions -->
- <div dojoType="dijit.layout.ContentPane"
+ <div dojoType="dijit.layout.ContentPane" jsId="distributions_tab"
title="Distributions" layoutAlign="client">
<script type="dojo/connect" event="onShow">
if (!dist_grid._fresh) {
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js 2010-10-20 15:59:55 UTC (rev 18407)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js 2010-10-20 16:00:28 UTC (rev 18408)
@@ -321,7 +321,8 @@
].forEach(function(k) { content_params[k] = xulG[k]; });
var loc = urls.XUL_BROWSER + "?url=" + window.escape(
- xulG.url_prefix("/eg/serial/list_subscription/") + docid
+ xulG.url_prefix("/eg/serial/list_subscription?record_entry=") +
+ docid
);
xulG.new_tab(
loc, {
More information about the open-ils-commits
mailing list