[open-ils-commits] r18124 - in trunk/Open-ILS: examples/apache src/perlmods/OpenILS/Application/Circ web/opac/extras web/opac/extras/circ web/opac/locale/en-US xul/staff_client/server/patron (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Oct 1 15:45:32 EDT 2010
Author: senator
Date: 2010-10-01 15:45:27 -0400 (Fri, 01 Oct 2010)
New Revision: 18124
Added:
trunk/Open-ILS/web/opac/extras/circ/
trunk/Open-ILS/web/opac/extras/circ/alt_pull_list.html
Modified:
trunk/Open-ILS/examples/apache/eg_vhost.conf
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
Offer yet another pull list printing pathway
If you have pull lists long enough to make A/T groan, perhaps this will work
better for you.
Modified: trunk/Open-ILS/examples/apache/eg_vhost.conf
===================================================================
--- trunk/Open-ILS/examples/apache/eg_vhost.conf 2010-10-01 19:39:51 UTC (rev 18123)
+++ trunk/Open-ILS/examples/apache/eg_vhost.conf 2010-10-01 19:45:27 UTC (rev 18124)
@@ -395,6 +395,17 @@
allow from all
</Location>
+<Location /opac/extras/circ>
+ SetHandler perl-script
+ PerlSetVar OILSProxyTitle "Circ Extras Login"
+ PerlSetVar OILSProxyDescription "Please log in with an authorized staff account to export records"
+ PerlSetVar OILSProxyPermissions "STAFF_LOGIN"
+ PerlHandler OpenILS::WWW::Proxy
+ Options +ExecCGI
+ PerlSendHeader On
+ allow from all
+</Location>
+
# ----------------------------------------------------------------------------------
# Reporting output lives here
# ----------------------------------------------------------------------------------
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-10-01 19:39:51 UTC (rev 18123)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-10-01 19:45:27 UTC (rev 18124)
@@ -1310,10 +1310,124 @@
undef, "ahr.format.pull_list", $sorted_holds,
$org_id, undef, undef, $client
);
+
}
+__PACKAGE__->register_method(
+ method => "print_hold_pull_list_stream",
+ stream => 1,
+ api_name => "open-ils.circ.hold_pull_list.print.stream",
+ signature => {
+ desc => 'Returns a stream of fleshed holds',
+ params => [
+ { desc => 'Authtoken', type => 'string'},
+ { desc => 'Hash of optional param: Org unit ID (defaults to workstation org unit), limit, offset, sort (array of: acplo.position, call_number, request_time)',
+ type => 'object'
+ },
+ ],
+ return => {
+ desc => 'A stream of fleshed holds',
+ type => 'object'
+ }
+ }
+);
+sub print_hold_pull_list_stream {
+ my($self, $client, $auth, $params) = @_;
+ my $e = new_editor(authtoken=>$auth);
+ return $e->die_event unless $e->checkauth;
+
+ delete($$params{org_id}) unless (int($$params{org_id}));
+ delete($$params{limit}) unless (int($$params{limit}));
+ delete($$params{offset}) unless (int($$params{offset}));
+
+ $$params{org_id} = (defined $$params{org_id}) ? $$params{org_id}: $e->requestor->ws_ou;
+ return $e->die_event unless $e->allowed('VIEW_HOLD', $$params{org_id });
+
+ my $sort = [];
+ if ($$params{sort} && @{ $$params{sort} }) {
+ for my $s (@{ $$params{sort} }) {
+ if ($s eq 'acplo.position') {
+ push @$sort, {
+ "class" => "acplo", "field" => "position",
+ "transform" => "coalesce", "params" => [999]
+ };
+ } elsif ($s eq 'call_number') {
+ push @$sort, {"class" => "acn", "field" => "label"};
+ } elsif ($s eq 'request_time') {
+ push @$sort, {"class" => "ahr", "field" => "request_time"};
+ }
+ }
+ } else {
+ push @$sort, {"class" => "ahr", "field" => "request_time"};
+ }
+
+ my $holds_ids = $e->json_query(
+ {
+ "select" => {"ahr" => ["id"]},
+ "from" => {
+ "ahr" => {
+ "acp" => {
+ "field" => "id",
+ "fkey" => "current_copy",
+ "filter" => {
+ "circ_lib" => $$params{org_id}, "status" => [0,7]
+ },
+ "join" => {
+ "acn" => {
+ "field" => "id",
+ "fkey" => "call_number"
+ },
+ "acplo" => {
+ "field" => "org",
+ "fkey" => "circ_lib",
+ "type" => "left",
+ "filter" => {
+ "location" => {"=" => {"+acp" => "location"}}
+ }
+ }
+ }
+ }
+ }
+ },
+ "where" => {
+ "+ahr" => {
+ "capture_time" => undef,
+ "cancel_time" => undef,
+ "-or" => [
+ {"expire_time" => undef },
+ {"expire_time" => {">" => "now"}}
+ ]
+ }
+ },
+ (@$sort ? (order_by => $sort) : ()),
+ ($$params{limit} ? (limit => $$params{limit}) : ()),
+ ($$params{offset} ? (offset => $$params{offset}) : ())
+ }, {"subquery" => 1}
+ ) or return $e->die_event;
+
+ $logger->info("about to stream back " . scalar(@$holds_ids) . " holds");
+
+ $client->respond(
+ $e->retrieve_action_hold_request([
+ $_->{"id"}, {
+ "flesh" => 3,
+ "flesh_fields" => {
+ "ahr" => ["usr", "current_copy"],
+ "acp" => ["location", "call_number"],
+ "acn" => ["record"]
+ }
+ }
+ ])
+ ) foreach @$holds_ids;
+
+ $e->disconnect;
+ undef;
+}
+
+
+
__PACKAGE__->register_method(
method => 'fetch_hold_notify',
api_name => 'open-ils.circ.hold_notification.retrieve_by_hold',
Added: trunk/Open-ILS/web/opac/extras/circ/alt_pull_list.html
===================================================================
--- trunk/Open-ILS/web/opac/extras/circ/alt_pull_list.html (rev 0)
+++ trunk/Open-ILS/web/opac/extras/circ/alt_pull_list.html 2010-10-01 19:45:27 UTC (rev 18124)
@@ -0,0 +1,139 @@
+<html>
+ <head>
+ <title>Printable Pull List</title>
+ <style type="text/css">
+ @import url('/js/dojo/dojo/resources/dojo.css');
+ @import url('/js/dojo/dijit/themes/tundra/tundra.css');
+ @import url('/js/dojo/dojox/widget/Toaster/Toaster.css');
+ @import url('/opac/skin/default/css/layout.css');
+ </style>
+ <style type="text/css">
+ /* html, body {
+ height: 100%;
+ width: 100%;
+ margin: 0px 0px 0px 0px;
+ padding: 0px 0px 0px 0px;
+ overflow: hidden;
+ } */
+ td {
+ padding-right: 1em;
+ padding-bottom: 1em;
+ border-bottom: 1px #999 dashed;
+ }
+ th {
+ text-align: left; font-weight: bold;
+ border-bottom: 1px #000 solid;
+ border-right: 1px #000 solid;
+ padding: 0.5em;
+ }
+ </style>
+ <!-- The OpenSRF API writ JS -->
+ <script language='javascript' src='/opac/common/js/utils.js' type='text/javascript'></script>
+ <script language='javascript' src='/opac/common/js/Cookies.js' type='text/javascript'></script>
+ <script language='javascript' src='/opac/common/js/CGI.js' type='text/javascript'></script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js' type='text/javascript'></script>
+ <!-- Dojo goodness -->
+ <script type="text/javascript">
+ var djConfig = {parseOnLoad:true,isDebug:false,AutoIDL:['aou','aout','pgt','ahr','acp','acn']};
+ var sort_order = ["acplo.position", "call_number", "request_time"];
+ </script>
+ <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
+ <script type="text/javascript" src="/js/dojo/dojo/openils_dojo.js"></script>
+ <script type="text/javascript" src="/js/dojo/dijit/dijit.js"></script>
+ <script type="text/javascript" src="/js/dojo/openils/AutoIDL.js"></script>
+ <script type="text/javascript" src="/js/dojo/openils/User.js"></script>
+ <script type="text/javascript" src="/js/dojo/openils/Util.js"></script>
+ <script type="text/javascript">
+ dojo.require("dojo.cookie");
+ dojo.require("dojox.xml.parser");
+ dojo.require("openils.BibTemplate");
+ dojo.require("openils.widget.ProgressDialog");
+
+ function my_init() {
+ var cgi = new CGI();
+ var ses = (typeof ses == "function" ? ses() : 0) ||
+ cgi.param("ses") || dojo.cookie("ses");
+ var user = new openils.User({"authtoken": ses});
+
+ progress_dialog.show(true);
+ fieldmapper.standardRequest(
+ ['open-ils.circ','open-ils.circ.hold_pull_list.print.stream'],
+ { async : true,
+ params: [
+ user.authtoken,
+ { org_id : cgi.param('o'),
+ limit : cgi.param('limit'),
+ offset : cgi.param('offset'),
+ sort : sort_order
+ }
+ ],
+ onresponse : function (r) {
+ var hold_fm = openils.Util.readResponse(r);
+
+ // hashify the hold
+ var hold = hold_fm.toHash(true);
+ hold.current_copy = hold_fm.current_copy().toHash(true);
+ hold.current_copy.location = hold_fm.current_copy().location().toHash(true);
+ hold.current_copy.call_number = hold_fm.current_copy().call_number().toHash(true);
+ hold.current_copy.call_number.record = hold_fm.current_copy().call_number().record().toHash(true);
+
+ // clone the template's html
+ var tr = dojo.clone(
+ dojo.query("tr", dojo.byId('template'))[0]
+ );
+ dojo.query("td:not([type])", tr).forEach(
+ function(td) {
+ td.innerHTML =
+ dojo.string.substitute(td.innerHTML, hold);
+ }
+ );
+
+ new openils.BibTemplate({
+ root : tr,
+ xml : dojox.xml.parser.parse(hold.current_copy.call_number.record.marc),
+ delay: false
+ });
+
+ dojo.place(tr, "target");
+
+
+ },
+ oncomplete : function () {
+ progress_dialog.hide(); window.print() }
+ }
+ );
+ }
+ dojo.addOnLoad(my_init);
+ </script>
+ </head>
+ <body class='tundra'>
+
+ <div dojoType="openils.widget.ProgressDialog" jsId="progress_dialog"></div>
+<!-- START OF TEMPLATE SECTION -->
+
+ <table>
+ <tbody id='target'>
+ <tr>
+ <th>Title</th>
+ <th>Author</th>
+ <th>Shelving Location</th>
+ <th>Call Number</th>
+ <th>Barcode</th>
+ </tr>
+ </tbody>
+ <tbody id='template' class='hide_me'>
+ <tr>
+ <td type='opac/slot-data' query='datafield[tag=245]'></td>
+ <td type='opac/slot-data' query='datafield[tag^=1]' limit='1'> </td>
+ <td>${current_copy.location.name}</td>
+ <td>${current_copy.call_number.label}</td>
+ <td>${current_copy.barcode}</td>
+ </tr>
+ </tbody>
+ </table>
+
+<!-- END OF TEMPLATE SECTION -->
+
+
+ </body>
+</html>
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2010-10-01 19:39:51 UTC (rev 18123)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2010-10-01 19:45:27 UTC (rev 18124)
@@ -2993,6 +2993,8 @@
<!ENTITY staff.patron.holds_overlay.print.accesskey "P">
<!ENTITY staff.patron.holds_overlay.print_full_pull_list.label "Print Full Pull List">
<!ENTITY staff.patron.holds_overlay.print_full_pull_list.accesskey "u">
+<!ENTITY staff.patron.holds_overlay.print_alt_pull_list.label "Print Full Pull List (Alternate strategy)">
+<!ENTITY staff.patron.holds_overlay.print_alt_pull_list.accesskey "y">
<!ENTITY staff.patron.holds_overlay.place_hold.label "Place Hold">
<!ENTITY staff.patron.holds_overlay.place_hold.accesskey "H">
<!ENTITY staff.patron.holds_overlay.show_cancelled_holds.label "Show Cancelled Holds">
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2010-10-01 19:39:51 UTC (rev 18123)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2010-10-01 19:45:27 UTC (rev 18124)
@@ -327,6 +327,43 @@
}
}
],
+ 'cmd_holds_print_alt' : [
+ ['command'],
+ function() {
+ try {
+ var content_params = {
+ "session": ses(),
+ "authtime": ses("authtime"),
+ "no_xulG": false,
+ "show_nav_buttons": true,
+ "show_print_button": false
+ };
+ ["url_prefix", "new_tab", "set_tab",
+ "close_tab", "new_patron_tab",
+ "set_patron_tab", "volume_item_creator",
+ "get_new_session",
+ "holdings_maintenance_tab", "set_tab_name",
+ "open_chrome_window", "url_prefix",
+ "network_meter", "page_meter",
+ "set_statusbar", "set_help_context"
+ ].forEach(function(k) {
+ content_params[k] = xulG[k];
+ });
+
+ var loc = urls.XUL_BROWSER + "?url=" + window.escape(
+ xulG.url_prefix("/opac/extras/circ/alt_pull_list.html")
+ );
+ xulG.new_tab(
+ loc, {
+ "tab_name": "Printable Pull List", /* XXX i18n */
+ "browser": false
+ }, content_params
+ );
+ } catch (E) {
+ g.error.sdump("D_ERROR", E);
+ }
+ }
+ ],
'cmd_holds_print' : [
['command'],
function() {
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2010-10-01 19:39:51 UTC (rev 18123)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2010-10-01 19:45:27 UTC (rev 18124)
@@ -19,6 +19,7 @@
<command id="cmd_csv_to_file" />
<command id="cmd_holds_print" />
<command id="cmd_holds_print_full" />
+ <command id="cmd_holds_print_alt" />
<command id="cmd_show_catalog" />
<command id="cmd_retrieve_patron" />
<command id="cmd_holds_edit_desire_mint_condition" />
@@ -188,6 +189,7 @@
<button id="holds_print" label="&staff.patron.holds_overlay.print.label;" command="cmd_holds_print" accesskey="&staff.patron.holds_overlay.print.accesskey;" />
<button id="print_full_btn" hidden="true" label="&staff.patron.holds_overlay.print_full_pull_list.label;" command="cmd_holds_print_full" accesskey="&staff.patron.holds_overlay.print_full_pull_list.accesskey;" />
+ <button id="print_alt_btn" label="&staff.patron.holds_overlay.print_alt_pull_list.label;" command="cmd_holds_print_alt" accesskey="&staff.patron.holds_overlay.print_alt_pull_list.accesskey;" />
<spacer flex="1"/>
</hbox>
More information about the open-ils-commits
mailing list