From d5cafca05f3c013f60a3c84bae59fb48443949d4 Mon Sep 17 00:00:00 2001
From: Mark Bucholtz <mbucholtz@sitka.bclibraries.ca>
Date: Mon, 1 Apr 2019 07:45:20 -0700
Subject: [PATCH] LP#1823255: optionally require ident_value

Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Mark Bucholtz <mbucholtz@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
---
 Open-ILS/src/sql/Pg/950.data.seed-values.sql            |  9 +++++++++
 .../sql/Pg/upgrade/XXXX.data.ident_value_required.sql   | 17 +++++++++++++++++
 Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js  |  1 +
 3 files changed, 27 insertions(+)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.ident_value_required.sql

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 4bf6099e8b..364942aa74 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -4911,6 +4911,15 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'bool', null)
 
+,( 'ui.patron.edit.au.ident_value.require', 'gui',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.require',
+        'require ident_value field on patron registration',
+        'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.require',
+        'The ident_value field will be required on the patron registration screen.',
+        'coust', 'description'),
+    'bool', null)
+
 ,( 'ui.patron.edit.au.ident_value.show', 'gui',
     oils_i18n_gettext('ui.patron.edit.au.ident_value.show',
         'Show ident_value field on patron registration',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.ident_value_required.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.ident_value_required.sql
new file mode 100644
index 0000000000..89e3d1217b
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.ident_value_required.sql
@@ -0,0 +1,17 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class ) VALUES
+( 'ui.patron.edit.au.ident_value.require', 'gui',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.require',
+        'require ident_value field on patron registration',
+        'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.require',
+        'The ident_value field will be required on the patron registration screen.',
+        'coust', 'description'),
+    'bool', null);
+
+COMMIT;
+
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
index b987d0bc51..bcfbab817d 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
@@ -353,6 +353,7 @@ angular.module('egCoreMod')
             'ui.patron.edit.au.juvenile.show',
             'ui.patron.edit.au.juvenile.suggest',
             'ui.patron.edit.au.ident_value.show',
+            'ui.patron.edit.au.ident_value.require',
             'ui.patron.edit.au.ident_value.suggest',
             'ui.patron.edit.au.ident_value2.show',
             'ui.patron.edit.au.ident_value2.suggest',
-- 
2.11.0