<label>{{user_setting_types['opac.default_pickup_location'].label()}}</label>
</div>
<div class="col-md-3 reg-field-input">
- <eg-org-selector
- xonchange="field_modified"
- selected="patron.home_ou"></eg-org-selector>
+ <eg-org-selector nodefault
+ disable-test="disable_pulib"
+ selected="patron._pickup_lib"
+ onchange="handle_pulib_changed">
+ </eg-org-selector>
</div>
</div>
}
$scope.hold_notify_type.phone = true;
$scope.hold_notify_type.email = true;
- $scope.hold_notify_type.sms = false;
+ $scope.hold_notify_type.sms = false;
// staged users may be loaded w/ a profile.
$scope.set_expire_date();
$scope.user_settings = prs.user_settings;
prs.user_settings = {};
+ // If a default pickup lib is applied to the patron, apply it
+ // to the UI at page load time. Otherwise, leave the value unset.
+ if ($scope.user_settings['opac.default_pickup_location']) {
+ $scope.patron._pickup_lib = egCore.org.get(
+ $scope.user_settings['opac.default_pickup_location']);
+ }
+
extract_hold_notify();
if ($scope.patron.isnew)
set_new_patron_defaults(prs);
});
}
+ $scope.handle_pulib_changed = function(org) {
+ if (!$scope.user_settings) return; // still rendering
+ $scope.user_settings['opac.default_pickup_location'] = org.id();
+ }
+
// This is called with every character typed in a form field,
// since that's the only way to gaurantee something has changed.
// See handle_field_changed for ng-change vs. ng-blur.
);
}
+ // returns true (disable) for orgs that cannot have vols (for holds pickup)
+ $scope.disable_pulib = function(org_id) {
+ if (!org_id) return;
+ return !egCore.org.CanHaveVolumes(org_id);
+ }
+
// Returns true if the Save and Save & Clone buttons should be disabled.
$scope.edit_passthru.hide_save_actions = function() {
return $scope.patron.isnew ?