oils_i18n_gettext( 'org.patron_opt_default', 'Circ: Patron Opt-In Default', 'coust', 'label'),
oils_i18n_gettext( 'org.patron_opt_default', 'This is the default depth at which a patron is opted in; it is calculated as an org unit relative to the current workstation.', 'coust', 'label'),
'integer')
-
+,(
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ oils_i18n_gettext(
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ 'GUI: Uncheck bills by default in the patron billing interface',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ 'Uncheck bills by default in the patron billing interface,'
+ || ' and focus on the Uncheck All button instead of the'
+ || ' Payment Received field.',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ )
;
UPDATE config.org_unit_setting_type
--- /dev/null
+-- Evergreen DB patch XXXX.data.org-setting-ui.circ.billing.uncheck_bills_and_unfocus_payment_box.sql
+--
+-- New org setting ui.circ.billing.uncheck_bills_and_unfocus_payment_box
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ oils_i18n_gettext(
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ 'GUI: Uncheck bills by default in the patron billing interface',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
+ 'Uncheck bills by default in the patron billing interface,'
+ || ' and focus on the Uncheck All button instead of the'
+ || ' Payment Received field.',
+ 'coust',
+ 'description'
+ ),
+ 'bool'
+ );
+
+COMMIT;
$('credit_forward').setAttribute('value',util.money.sanitize( g.patron.credit_forward_balance() ));
}
- default_focus();
-
- tally_all();
+ if (g.data.hash.aous['ui.circ.billing.uncheck_bills_and_unfocus_payment_box']) {
+ g.funcs.push(
+ function() {
+ $('uncheck_all').focus();
+ tally_all();
+ }
+ );
+ } else {
+ g.funcs.push(
+ function() {
+ default_focus();
+ tally_all();
+ }
+ );
+ }
} catch(E) {
var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/bill2.xul', E]);
function gen_list_append_func(r) {
return function() {
- if (typeof r == 'object') { g.row_map[ r.id() ] = g.bill_list.append( { 'retrieve_id' : r.id(), 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true, 'mbts' : r } } } );
- } else { g.row_map[r] = g.bill_list.append( { 'retrieve_id' : r, 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true } } } ); }
+ var default_check_state = g.data.hash.aous[
+ 'ui.circ.billing.uncheck_bills_and_unfocus_payment_box'
+ ] ? false : true;
+ if (typeof r == 'object') {
+ g.row_map[ r.id() ] = g.bill_list.append( {
+ 'retrieve_id' : r.id(),
+ 'flesh_immediately' : true,
+ 'row' : {
+ 'my' : {
+ 'checked' : default_check_state,
+ 'mbts' : r
+ }
+ }
+ } );
+ } else {
+ g.row_map[r] = g.bill_list.append( {
+ 'retrieve_id' : r,
+ 'flesh_immediately' : true,
+ 'row' : {
+ 'my' : {
+ 'checked' : default_check_state
+ }
+ }
+ } );
+ }
}
}
<hbox>
<hbox id="bill_list_actions" />
<button label="&staff.patron.bills_overlay.check_all.label;" accesskey="&staff.patron.bills_overlay.check_all.accesskey;" oncommand="check_all();"/>
- <button label="&staff.patron.bills_overlay.uncheck_all.label;" accesskey="&staff.patron.bills_overlay.uncheck_all.accesskey;" oncommand="uncheck_all();"/>
+ <button id="uncheck_all" label="&staff.patron.bills_overlay.uncheck_all.label;" accesskey="&staff.patron.bills_overlay.uncheck_all.accesskey;" oncommand="uncheck_all();"/>
<button label="&staff.patron.bills_overlay.check_all_refunds.label;" accesskey="&staff.patron.bills_overlay.check_all_refunds.accesskey;" oncommand="check_all_refunds();"/>
<button id="print" label="&staff.patron.bills_overlay.print_bills.label;" accesskey="&staff.patron.bills_overlay.print_bills.accesskey;" oncommand="print_bills();"/>
<spacer flex="1"/>