From 5049ccf3084643762a79f59af75f8be56a4d98d3 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 24 Mar 2010 17:32:37 +0000 Subject: [PATCH] Acq: Add access to lineitem worksheet from LI table interfaces. git-svn-id: svn://svn.open-ils.org/ILS/trunk@15951 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/css/skin/default/acq.css | 4 ++++ Open-ILS/web/js/dojo/openils/acq/nls/acq.js | 3 ++- Open-ILS/web/js/ui/default/acq/common/li_table.js | 3 +++ .../web/js/ui/default/acq/lineitem/worksheet.js | 22 ++++++++++++++++++++++ .../web/templates/default/acq/common/li_table.tt2 | 1 + .../templates/default/acq/lineitem/worksheet.tt2 | 7 +++++++ 6 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/web/js/ui/default/acq/lineitem/worksheet.js create mode 100644 Open-ILS/web/templates/default/acq/lineitem/worksheet.tt2 diff --git a/Open-ILS/web/css/skin/default/acq.css b/Open-ILS/web/css/skin/default/acq.css index d1a2bd41cd..f5496c4103 100644 --- a/Open-ILS/web/css/skin/default/acq.css +++ b/Open-ILS/web/css/skin/default/acq.css @@ -149,6 +149,10 @@ label[for="attr_search_type_scalar"] { vertical-align: top; } .acq-lit-distrib-applied-row th { border-bottom: 1px #999 solid;padding-bottom: 4px;} .acq-lit-table-spacer { height:20px; } .acq-lit-row td[name="selector"] { width:1.5em; font-weight:bold; color:blue; font-size:110%;} +span[name="worksheet"] { padding: 0 6px; } + +#acq-worksheet-contents thead th { font-weight: bold; background-color: #ccc; text-align: center; border-bottom: 1px #000 solid; border-right: 1px #000 solid; padding: 0 6px; } +#acq-worksheet-contents tbody td { text-align: left; vertical-align: top; border: 1px #999 inset; padding: 0 2px; } .acq-menu-bar {width:99%; text-align:left; border:1px solid #aaa; margin:5px 0px 10px 0px;} .acq-notes-note-row { margin: 6px 0; } diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js index 4eeab76cf6..8f43d7fa78 100644 --- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js +++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js @@ -37,5 +37,6 @@ 'NO' : "No", 'VENDOR_SAYS_PREPAY_NOT_NEEDED': "The selected vendor does not necessarily require prepayment, according\nto records. Require prepayment on this PO anyway?", 'VENDOR_SAYS_PREPAY_NEEDED': "The selected vendor requires prepayment, according to records.\nProceed anyway without required prepayment on this PO?", - 'PREPAYMENT_REQUIRED_REMINDER': "This PO requires prepayment. Are you certain you're ready to activate it?" + 'PREPAYMENT_REQUIRED_REMINDER': "This PO requires prepayment. Are you certain you're ready to activate it?", + 'LI_FORMAT_ERROR': "Unexpected error retrieving formatted lineitem information." } diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index b4f97d4046..31bdd7306c 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -205,6 +205,9 @@ function AcqLiTable() { dojo.query('[name=jacket]', row)[0].setAttribute('src', '/opac/extras/ac/jacket/small/' + isbn); } + nodeByName("worksheet_link", row).href = + "/eg/acq/lineitem/worksheet/" + li.id(); + dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())}; dojo.query('[name=copieslink]', row)[0].onclick = function() {self.drawCopies(li.id())}; dojo.query('[name=noteslink]', row)[0].onclick = function() {self.drawLiNotes(li)}; diff --git a/Open-ILS/web/js/ui/default/acq/lineitem/worksheet.js b/Open-ILS/web/js/ui/default/acq/lineitem/worksheet.js new file mode 100644 index 0000000000..c9eacd400b --- /dev/null +++ b/Open-ILS/web/js/ui/default/acq/lineitem/worksheet.js @@ -0,0 +1,22 @@ +dojo.require("openils.Util"); + +function load() { + fieldmapper.standardRequest( + ["open-ils.acq", "open-ils.acq.lineitem.format"], { + "params": [openils.User.authtoken, liId, "html"], + "async": true, + "oncomplete": function(r) { + r = openils.Util.readResponse(r); + var d = dojo.byId("acq-worksheet-contents"); + if (r.template_output()) + d.innerHTML = r.template_output().data(); + else if (r.error_output()) + d.innerHTML = r.error_output().data(); + else + d.innerHTML = localeStrings.LI_FORMAT_ERROR; + } + } + ); +} + +openils.Util.addOnLoad(load); diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index 3617fbbe51..ad4f0af38d 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -76,6 +76,7 @@ + () diff --git a/Open-ILS/web/templates/default/acq/lineitem/worksheet.tt2 b/Open-ILS/web/templates/default/acq/lineitem/worksheet.tt2 new file mode 100644 index 0000000000..e3f5c30fa4 --- /dev/null +++ b/Open-ILS/web/templates/default/acq/lineitem/worksheet.tt2 @@ -0,0 +1,7 @@ +[% WRAPPER "default/base.tt2" %] +[% ctx.page_title = "Lineitem Worksheet" %] + + +

Lineitem Worksheet

+
+[% END %] -- 2.11.0