<!ENTITY staff.circ.print_list.top_ui.name.label "Name">
<!ENTITY staff.circ.print_list.top_ui.name.accesskey "N">
<!ENTITY staff.circ.print_list.top_ui.type.label "Type">
+<!ENTITY staff.circ.print_list.top_ui.context.label "Force Context">
<!ENTITY staff.circ.print_list.top_ui.actions.label "Actions">
<!ENTITY staff.circ.print_list.top_ui.preview.label "Preview">
<!ENTITY staff.circ.print_list.top_ui.preview.accesskey "P">
'holds',
/* 'patrons' */
];
+ // We define this for the benefit of the editor.
+ // We don't assign them here, leaving that to the user.
+ // Without one assigned per template the context the util.print was created with will be used instead.
+ obj.print_list_contexts = [
+ 'default',
+ 'receipt',
+ 'label',
+ 'mail',
+ 'offline',
+ ];
obj.print_list_templates = {
'item_status' : {
'type' : 'items',
}
var cols = [];
var s = '';
+ if (params.context) this.set_context(params.context);
if (params.header) s += this.template_sub( params.header, cols, params );
if (params.list) {
// Pre-templating sort
} else {
this.simple(s,params);
}
+ if(this.context != this.default_context) this.set_context(this.default_context);
},
'template_sub' : function( msg, cols, params ) {
'footer' : data.print_list_templates.item_status.footer,
'type' : data.print_list_templates.item_status.type,
'list' : obj.list2.dump_with_keys(),
+ 'context' : data.print_list_templates.item_status.context,
};
JSAN.use('util.print'); var print = new util.print();
print.tree_list( p );
obj.controller.view.header.value = tmp.header;
obj.controller.view.line_item.value = tmp.line_item;
obj.controller.view.footer.value = tmp.footer;
+ obj.controller.view.template_context_menu.value = tmp.context;
obj.preview();
}, 0
);
obj.controller.view.header.value = tmp.header;
obj.controller.view.line_item.value = tmp.line_item;
obj.controller.view.footer.value = tmp.footer;
+ obj.controller.view.template_context_menu.value = tmp.context;
obj.preview();
},
false
obj.controller.view.template_type_menu = ml;
}
}
+ ],
+ 'template_context_menu_placeholder' : [
+ ['render'],
+ function(e) {
+ return function() {
+ JSAN.use('util.widgets'); JSAN.use('util.functional');
+ util.widgets.remove_children(e);
+ var ml = util.widgets.make_menulist(
+ [['',null]].concat(
+ util.functional.map_list(
+ obj.data.print_list_contexts,
+ function(o) { return [o,o]; }
+ )
+ )
+ );
+ ml.setAttribute('id','template_context_menu');
+ e.appendChild(ml);
+ obj.controller.view.template_context_menu = ml;
+ }
+ }
]
+
}
}
);
obj.data.print_list_templates[name].line_item = obj.controller.view.line_item.value;
obj.data.print_list_templates[name].footer = obj.controller.view.footer.value;
obj.data.print_list_templates[name].type = obj.controller.view.template_type_menu.value;
+ obj.data.print_list_templates[name].context = obj.controller.view.template_context_menu.value;
obj.data.stash( 'print_list_templates' );
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
JSAN.use('util.file'); var file = new util.file('print_list_templates');
<hbox>
<label value="&staff.circ.print_list.top_ui.type.label;" />
<hbox id="template_type_menu_placeholder" />
+ <label value="&staff.circ.print_list.top_ui.context.label;" />
+ <hbox id="template_context_menu_placeholder" />
</hbox>
</groupbox>
<groupbox orient="horizontal">
'footer' : data.print_list_templates[ template ].footer,
'type' : data.print_list_templates[ template ].type,
'list' : print_list,
- 'data' : print_data
+ 'data' : print_data,
+ 'context' : data.print_list_templates[ template ].context,
};
if ($('printer_prompt')) {
if (! $('printer_prompt').checked) { parms.no_prompt = true; }
'footer' : data.print_list_templates[ template ].footer,
'type' : data.print_list_templates[ template ].type,
'list' : print_list,
- 'data' : print_data
+ 'data' : print_data,
+ 'context' : data.print_list_templates[ template ].context,
};
if ($('printer_prompt')) {
if (! $('printer_prompt').checked) { parms.no_prompt = true; }
};
}
),
- 'data' : g.previous_summary
+ 'data' : g.previous_summary,
+ 'context' : g.data.print_list_templates[template].context,
};
g.error.sdump('D_DEBUG',js2JSON(params));
if ($('printer_prompt').hasAttribute('checked')) {