4 SELECT evergreen.upgrade_deps_block_check('1139', :eg_version);
6 ALTER TABLE actor.usr ADD COLUMN guardian TEXT;
8 CREATE INDEX actor_usr_guardian_idx
9 ON actor.usr (evergreen.lowercase(guardian));
10 CREATE INDEX actor_usr_guardian_unaccent_idx
11 ON actor.usr (evergreen.unaccent_and_squash(guardian));
13 -- Modify auditor tables accordingly.
14 SELECT auditor.update_auditors();
16 -- clear the guardian field on delete
17 CREATE OR REPLACE FUNCTION actor.usr_delete(
22 old_profile actor.usr.profile%type;
23 old_home_ou actor.usr.home_ou%type;
24 new_profile actor.usr.profile%type;
25 new_home_ou actor.usr.home_ou%type;
27 new_dob actor.usr.dob%type;
30 id || '-PURGED-' || now(),
44 -- Quit if no such user
46 IF old_profile IS NULL THEN
50 perform actor.usr_purge_data( src_usr, dest_usr );
52 -- Find the root grp_tree and the root org_unit. This would be simpler if we
53 -- could assume that there is only one root. Theoretically, someday, maybe,
54 -- there could be multiple roots, so we take extra trouble to get the right ones.
61 permission.grp_ancestors( old_profile )
70 actor.org_unit_ancestors( old_home_ou )
74 -- Truncate date of birth
76 IF new_dob IS NOT NULL THEN
77 new_dob := date_trunc( 'year', new_dob );
84 profile = new_profile,
87 passwd = random()::text,
92 FROM config.identification_type
97 net_access_level = DEFAULT,
100 first_given_name = new_name,
102 family_name = new_name,
107 evening_phone = NULL,
109 mailing_address = NULL,
110 billing_address = NULL,
111 home_ou = new_home_ou,
114 master_account = DEFAULT,
115 super_user = DEFAULT,
120 claims_returned_count = DEFAULT,
121 credit_forward_balance = DEFAULT,
122 last_xact_id = DEFAULT,
123 alert_message = NULL,
131 INSERT into config.org_unit_setting_type (name, label, description, datatype)
133 'ui.patron.edit.au.guardian.show',
135 'ui.patron.edit.au.guardian.show',
136 'GUI: Show guardian field on patron registration',
140 'ui.patron.edit.au.guardian.show',
141 'The guardian field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.',
142 'coust', 'description'
146 'ui.patron.edit.au.guardian.suggest',
148 'ui.patron.edit.au.guardian.suggest',
149 'GUI: Suggest guardian field on patron registration',
153 'ui.patron.edit.au.guardian.suggest',
154 'The guardian field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
155 'coust', 'description'),
158 'ui.patron.edit.guardian_required_for_juv',
160 'ui.patron.edit.guardian_required_for_juv',
161 'GUI: Juvenile account requires parent/guardian',
165 'ui.patron.edit.guardian_required_for_juv',
166 'Require a value for the parent/guardian field in the patron editor for patrons marked as juvenile',
167 'coust', 'description'),