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:
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:
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>