]> git.evergreen-ils.org Git - Evergreen.git/commit
lp944947, receipt template per hold list interface
authorJason Etheridge <jason@esilibrary.com>
Fri, 2 Mar 2012 16:45:53 +0000 (11:45 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 7 Mar 2012 19:17:12 +0000 (14:17 -0500)
commita0fdeb77d15a979d80d3f4ea2e83c3e46cfe4157
tree221ba92085fdb76951c076f3ab6a76d7573a14a4
parent5bf477798a9c9834824057de0e8ded4077a60f6a
lp944947, receipt template per hold list interface

Spec as follows:

Individual screens use its own settings for receipt templates

There are several XUL-based holds list that are all implemented with the same
holds.js file:

Actions for this Record -> View Holds
Patron Display -> Holds
Circulation -> Browse Hold Shelf
Circulation -> Pull List for Hold Requests

The main Print action (from the “Print” button next to the List Actions menu)
uses the same template, “holds”, for all incarnations of the interface.  We will
change this behavior in holds.js (specifically in the cmd_holds_print method)
such that each interface variation will use its own template.  The new templates
will be:

holds_on_bib
holds_for_patron
holds_shelf
holds_pull_list

We will keep the “holds” template for backwards compatibility and as a fallback
for when these new templates have not yet been configured.  These new templates
will be stubbed in data.js (in the print_list_defaults method) so that they will
appear in the Receipt Template Editor, but by default they will not have any
defined content for their headers, footers, and line items.  Instead, we will
use a new field called “inherit”, and have each new template use “holds”
(referring to the original template) as the value for their inherit fields.

So, for example, the current default ‘holds’ template is defined like this:

'holds' : {
  'type' : 'holds',
  'header' : 'Welcome to %LIBRARY%!<br/>\r\nYou have the following titles on hold:<hr/><ol>',
  'line_item' : '<li>%title%\r\n',
  'footer' : '</ol><hr />%SHORTNAME% %TODAY_TRIM%<br/>\r\nYou were helped by %STAFF_FIRSTNAME%<br/>\r\n<br/>\r\n'
},

The new ‘holds_for_patron’ template will be defined as a peer like this:

'holds_for_patron' : {
  'type' : 'holds',
  'inherit' : 'holds'
},

We will modify the _print_tree method in list.js and the post_init method in
print_list_template_editor.js such that they will react to any value in a
template’s inherit field and allow it to redirect them to use the contents of
the inherited template.  For this particular use-case, we only need to support
one level of indirection, but we may opt to support chains of inheritance for
future use.

We will modify the save_template method in print_list_template_editor.js so that
the inherit field for a given template will be cleared if that specific template
is saved, breaking the link and associating the displayed (and possibly edited)
header, footer, and line item with the template.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
Open-ILS/xul/staff_client/server/patron/holds.js