]);
}
- # If user is logged in and has a default pickup location and phone for holds, grab them
+ # If user is logged in, get default hold pickup and notification info
if ($ctx->{user}) {
my $set_map = $self->ctx->{user_setting_map};
if ($$set_map{'opac.default_pickup_location'}) {
if ($$set_map{'opac.default_phone'}) {
$ctx->{default_phone} = $$set_map{'opac.default_phone'};
}
+ if ($$set_map{'opac.hold_notify'}) {
+ $ctx->{notify_method} = $$set_map{'opac.hold_notify'};
+ }
}
$self->ctx->{page} = 'getit'; # repair the page
INCLUDE build_org_selector name='pickup_lib'
value=def_lib id='pickup_lib' can_have_vols_only=1 hold_pickup_lib=1 %]
- <!-- HIDDEN FIELDS FOR DEFAULT EMAIL AND PHONE NUMBERS -->
+
+ <!-- HIDDEN FIELDS FOR DEFAULT NOTIFICATION PREFERENCES -->
+
[%- IF ctx.user.email -%]
- <input type="hidden" id="email_notify" name="email_notify" value="t"/>
+ [%- IF ctx.notify_method == 'email' OR ctx.notify_method == 'email|phone' -%]
+ <input type="hidden" id="email_notify" name="email_notify" value="t"/>
+ [%- END -%]
[%- END -%]
[%- IF allow_phone_notifications == 'true' -%]
- <input type="hidden" id="phone_notify_checkbox" name="phone_notify_checkbox" value="t"/>
- <input type="hidden" name="phone_notify" [% setting = 'opac.default_phone';
- IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
- [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [%- END -%]/>
+ [%- IF ctx.notify_method == 'phone' OR ctx.notify_method == 'email|phone' -%]
+ <input type="hidden" id="phone_notify_checkbox" name="phone_notify_checkbox" value="t"/>
+ <input type="hidden" name="phone_notify"
+ value='[% IF ctx.default_phone %][%- ctx.default_phone -%][% ELSE %][%- ctx.user.day_phone -%][% END %]'/>
+ [%- END -%]
[%- END -%]
</div>