From: Bill Erickson Date: Wed, 22 May 2013 18:49:04 +0000 (-0400) Subject: LP1182519 Per-Hold Behind Desk UI X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=819136e3761f8c5d3b61e40d8539ace270161e25;p=evergreen%2Fequinox.git LP1182519 Per-Hold Behind Desk UI Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index ec7bb9658a..2cc2dba1b7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -399,6 +399,28 @@ sub load_myopac_prefs_settings { my $stat = $self->_load_user_with_prefs; return $stat if $stat; + # if behind-desk holds are supported and the user + # setting which controls the value is opac-visible, + # add the setting to the list of settings to manage. + # note: this logic may need to be changed later to + # check whether behind-the-desk holds are supported + # anywhere the patron may select as a pickup lib. + my $e = $self->editor; + my $bdous = $self->ctx->{get_org_setting}->( + $e->requestor->home_ou, + 'circ.holds.behind_desk_pickup_supported'); + + if ($bdous) { + my $setting = + $e->retrieve_config_usr_setting_type( + 'circ.holds_behind_desk'); + + if ($U->is_true($setting->opac_visible)) { + push(@user_prefs, 'circ.holds_behind_desk'); + $self->ctx->{behind_desk_supported} = 1; + } + } + return Apache2::Const::OK unless $self->cgi->request_method eq 'POST'; diff --git a/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 b/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 index 7b27be7fe9..4896a7b66e 100644 --- a/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 +++ b/Open-ILS/src/templates/opac/myopac/prefs_settings.tt2 @@ -87,6 +87,16 @@ [% IF ctx.user_setting_map.$setting %] checked='checked' [% END %]/> + [%- setting = 'circ.holds_behind_desk'; IF ctx.behind_desk_supported -%] + + + + + + + [% END %] +