[open-ils-commits] [GIT] Evergreen ILS branch master updated. 24f13684703b56a4389db967b224074098d909cd

Evergreen Git git at git.evergreen-ils.org
Fri Sep 6 18:09:14 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  24f13684703b56a4389db967b224074098d909cd (commit)
       via  a31a8e86aae880febafa0fa94c1d013ca15c2275 (commit)
       via  7f8d2a1d4ca8c3baf157e03613cb0e57bf795de7 (commit)
      from  8aa6a5dfd7eb3ac2bec6fb8f6ad241050081e7dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 24f13684703b56a4389db967b224074098d909cd
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Fri Sep 6 18:09:05 2019 -0400

    LP#1068287: stamp database update
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index e7b9992dca..54d01e4874 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1183', :eg_version); -- mbucholtz/jeffdavis/gmcharlt
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1184', :eg_version); -- cesardv/phasefx/gmcharlt
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/1184.data.lp1068287_add_create_precat_permission.sql b/Open-ILS/src/sql/Pg/upgrade/1184.data.lp1068287_add_create_precat_permission.sql
new file mode 100644
index 0000000000..d12abedc29
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/1184.data.lp1068287_add_create_precat_permission.sql
@@ -0,0 +1,12 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('1184', :eg_version);
+
+INSERT INTO permission.perm_list(id, code, description)
+    VALUES (618, 'CREATE_PRECAT', 'Allows user to create a pre-catalogued copy');
+
+-- Add this new permission to any group with Staff login perm.
+-- Manually remove if needed
+INSERT INTO permission.grp_perm_map(perm, grp, depth) SELECT 618, map.grp, 0 FROM permission.grp_perm_map AS map WHERE map.perm = 2;
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql
deleted file mode 100644
index e960c5d785..0000000000
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql
+++ /dev/null
@@ -1,18 +0,0 @@
--- Evergreen DB patch XXXX.data.lp1068287_add_create_precat_perm.sql
---
--- Add a permission to prevent untrained/non-authorized staff from
--- adding pre-cat copies/items due to barcode misscans.
---
---BEGIN;
-
--- check whether patch can be applied
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-INSERT INTO permission.perm_list(id, code, description)
-    VALUES (618, 'CREATE_PRECAT', 'Allows user to create a pre-catalogued copy');
-
--- Add this new permission to any group with Staff login perm.
--- Manually remove if needed
-insert into permission.grp_perm_map(perm, grp, depth) select 618, map.grp, 0 from permission.grp_perm_map as map where map.perm = 2;
-
--- COMMIT;

commit a31a8e86aae880febafa0fa94c1d013ca15c2275
Author: Jason Etheridge <jason at equinoxinitiative.org>
Date:   Thu Sep 5 23:51:46 2019 -0400

    LP#1068287 UI tweak and renewal behavior
    
    Skips the CREATE_PRECAT permission check when renewing pre-cataloged items.
    
    Also disables all the elements except the Cancel button in the Pre-Cat dialog
    when the user lacks the CREATE_PRECAT permission, and repositions the explanatory
    text.
    
    Also includes release notes.
    
    Signed-off-by: Jason Etheridge <jason at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index edf05860d1..5c810d6826 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2427,7 +2427,7 @@ sub make_precat_copy {
     my $self = shift;
     my $copy = $self->copy;
     return $self->bail_on_events(OpenILS::Event->new('PERM_FAILURE'))
-       unless $self->editor->allowed('CREATE_PRECAT');
+       unless $self->editor->allowed('CREATE_PRECAT') || $self->is_renewal;
 
    if($copy) {
         $logger->debug("circulator: Pre-cat copy already exists in checkout: ID=" . $copy->id);
diff --git a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
index d28023a60d..e24db428ba 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
@@ -8,27 +8,34 @@
         <h4 class="modal-title">
           [% l('Barcode "{{precatArgs.copy_barcode}}" was mis-scanned or is a non-cataloged item.') %]
         </h4>
+        <div ng-show="!can_create_precats" class="alert alert-warning">
+            [% l('You do not have permission to create a pre-cataloged item with this barcode.') %]
+        </div>
       </div>
       <div class="modal-body">
         <div class="form-group">
           <label for="precat-title">[% l('Title') %]</label>
           <input type="text" class="form-control" focus-me='focusMe' required
+            ng-disabled="!can_create_precats"
             id="precat-title" ng-model="precatArgs.dummy_title" placeholder="[% l('Title...') %]"/>
         </div>
         <div class="form-group">
           <label for="precat-author">[% l('Author') %]</label>
           <input type="text" class="form-control" id="precat-author"
+            ng-disabled="!can_create_precats"
             ng-model="precatArgs.dummy_author" placeholder="[% l('Author...') %]"/>
         </div>
         <div class="form-group">
           <label for="precat-isbn">[% l('ISBN') %]</label>
           <input type="text" class="form-control" id="precat-isbn"
+            ng-disabled="!can_create_precats"
             ng-keydown="preventSubmit($event)"
             ng-model="precatArgs.dummy_isbn" placeholder="[% l('ISBN...') %]"/>
         </div>
         <div class="form-group">
           <label for="precat-circmod">[% l('Circulation Modifier') %]</label>
           <select class="form-control" id="precat-circmod" 
+            ng-disabled="!can_create_precats"
             ng-model="precatArgs.circ_modifier">
             <option value=""></option>
             <option ng-repeat="mod in circModifiers | orderBy:'name()'"
@@ -37,10 +44,9 @@
         </div>
       </div>
       <div class="modal-footer">
-        <div ng-show="!can_create_precats" class="alert alert-warning">
-            [% l('You do not have permission to complete this action.') %]
-        </div>
-        <input type="submit" class="btn btn-primary" value="[% l('Precat Checkout') %]"/>
+        <input type="submit" class="btn btn-primary" value="[% l('Precat Checkout') %]"
+            ng-disabled="!can_create_precats"
+        />
         <button class="btn btn-warning" ng-click="cancel()"
             ng-class="{disabled : actionPending}">[% l('Cancel') %]</button>
       </div>
diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/create-precat-permission.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/create-precat-permission.adoc
new file mode 100644
index 0000000000..cf04e15500
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/create-precat-permission.adoc
@@ -0,0 +1,13 @@
+New Permission: CREATE_PRECAT
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This permission is required to create (or re-create) a pre-cataloged item
+through the "Barcode ??? was mis-scanned or is a non-cataloged item."
+dialog.  All form elements in the pre-cat dialog other than the Cancel
+button will be disabled if the current user lacks the CREATE_PRECAT
+permission when an uncataloged (or already pre-cataloged item) is scanned.
+This permission is not needed to renew pre-cataloged items.
+
+The upgrade script for this feature will insert the permission into every
+permission group that has the STAFF_LOGIN permission, so out-of-the-box no
+behavior will change.

commit 7f8d2a1d4ca8c3baf157e03613cb0e57bf795de7
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Thu Dec 13 18:13:39 2018 -0500

    LP#1068287 - Add CREATE_PRECAT permission
    
    Add this permission to prevent untrained/un-authorized
    circ staff from creating pre-cat items due to mis-scanned
    barcodes. Added to all profiles by default, so that staff
    admins can pinpoint users who may not have it, i.e Volunteers, etc.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Jason Etheridge <jason at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index 7a2958a3ad..edf05860d1 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -262,7 +262,7 @@ sub run_method {
         # requesting a precat checkout implies that any required
         # overrides have been performed.  Go ahead and re-override.
         $circulator->skip_permit_key(1);
-        $circulator->override(1) if $circulator->request_precat;
+        $circulator->override(1) if ( $circulator->request_precat && $circulator->editor->allowed('CREATE_PRECAT') );
         $circulator->do_permit();
         $circulator->is_checkout(1);
         unless( $circulator->bail_out ) {
@@ -2426,6 +2426,8 @@ sub create_due_date {
 sub make_precat_copy {
     my $self = shift;
     my $copy = $self->copy;
+    return $self->bail_on_events(OpenILS::Event->new('PERM_FAILURE'))
+       unless $self->editor->allowed('CREATE_PRECAT');
 
    if($copy) {
         $logger->debug("circulator: Pre-cat copy already exists in checkout: ID=" . $copy->id);
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 364942aa74..ae42bdf0dc 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1929,7 +1929,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 616, 'IMPORT_USE_ORG_UNIT_COPIES', oils_i18n_gettext( 616,
     'Allows users to import records based on the number of org unit copies attached to a record', 'ppl', 'description' )),
  ( 617, 'IMPORT_ON_ORDER_CAT_COPY', oils_i18n_gettext( 617,
-    'Allows users to import copies based on the on-order items attached to a record', 'ppl', 'description' ))
+    'Allows users to import copies based on the on-order items attached to a record', 'ppl', 'description' )),
+ ( 618, 'CREATE_PRECAT', oils_i18n_gettext(618,
+    'Allows a user to create a pre-catalogued copy', 'ppl', 'description'))
 ;
 
 
@@ -2023,6 +2025,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 		aout.name = 'Consortium' AND
 		perm.code IN (
 			'CREATE_COPY_TRANSIT',
+			'CREATE_PRECAT',
 			'VIEW_BILLING_TYPE',
 			'VIEW_CIRCULATIONS',
 			'VIEW_COPY_NOTES',
@@ -2165,6 +2168,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 			'CREATE_BIB_IMPORT_QUEUE',
 			'CREATE_IMPORT_ITEM',
 			'CREATE_MARC',
+			'CREATE_PRECAT',
 			'CREATE_TITLE_NOTE',
 			'DELETE_BIB_IMPORT_QUEUE',
 			'DELETE_IMPORT_ITEM',
@@ -2258,6 +2262,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 			'CREATE_IMPORT_TRASH_FIELD',
 			'CREATE_MERGE_PROFILE',
 			'CREATE_MONOGRAPH_PART',
+			'CREATE_PRECAT',
 			'CREATE_VOLUME_PREFIX',
 			'CREATE_VOLUME_SUFFIX',
 			'DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF',
@@ -2333,6 +2338,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 			'ADMIN_BOOKING_RESOURCE_ATTR_VALUE',
 			'ADMIN_BOOKING_RESOURCE_TYPE',
 			'ASSIGN_GROUP_PERM',
+			'CREATE_PRECAT',
 			'MARK_ITEM_AVAILABLE',
 			'MARK_ITEM_BINDERY',
 			'MARK_ITEM_CHECKED_OUT',
@@ -2433,6 +2439,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 		perm.code IN (
 			'ADMIN_MAX_FINE_RULE',
 			'CREATE_CIRC_DURATION',
+			'CREATE_PRECAT',
 			'DELETE_CIRC_DURATION',
 			'MARK_ITEM_MISSING_PIECES',
 			'UPDATE_CIRC_DURATION',
@@ -2614,6 +2621,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 			'CREATE_INVOICE',
 			'CREATE_MARC',
 			'CREATE_PICKLIST',
+			'CREATE_PRECAT',
 			'CREATE_PURCHASE_ORDER',
 			'DELETE_BIB_IMPORT_QUEUE',
 			'DELETE_IMPORT_ITEM',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql
new file mode 100644
index 0000000000..e960c5d785
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1068287_add_create_precat_permission.sql
@@ -0,0 +1,18 @@
+-- Evergreen DB patch XXXX.data.lp1068287_add_create_precat_perm.sql
+--
+-- Add a permission to prevent untrained/non-authorized staff from
+-- adding pre-cat copies/items due to barcode misscans.
+--
+--BEGIN;
+
+-- check whether patch can be applied
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO permission.perm_list(id, code, description)
+    VALUES (618, 'CREATE_PRECAT', 'Allows user to create a pre-catalogued copy');
+
+-- Add this new permission to any group with Staff login perm.
+-- Manually remove if needed
+insert into permission.grp_perm_map(perm, grp, depth) select 618, map.grp, 0 from permission.grp_perm_map as map where map.perm = 2;
+
+-- COMMIT;
diff --git a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
index f9944b9d39..d28023a60d 100644
--- a/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
+++ b/Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2
@@ -37,6 +37,9 @@
         </div>
       </div>
       <div class="modal-footer">
+        <div ng-show="!can_create_precats" class="alert alert-warning">
+            [% l('You do not have permission to complete this action.') %]
+        </div>
         <input type="submit" class="btn btn-primary" value="[% l('Precat Checkout') %]"/>
         <button class="btn btn-warning" ng-click="cancel()"
             ng-class="{disabled : actionPending}">[% l('Cancel') %]</button>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
index acf9d9420f..8c104ccd13 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js
@@ -940,12 +940,14 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
             templateUrl: './circ/share/t_precat_dialog',
             backdrop: 'static',
             controller: 
-                ['$scope', '$uibModalInstance', 'circMods',
-                function($scope, $uibModalInstance, circMods) {
+                ['$scope', '$uibModalInstance', 'circMods', 'has_precat_perm',
+                function($scope, $uibModalInstance, circMods, has_precat_perm) {
                 $scope.focusMe = true;
                 $scope.precatArgs = {
                     copy_barcode : params.copy_barcode
                 };
+
+                $scope.can_create_precats = has_precat_perm;
                 $scope.circModifiers = circMods;
                 $scope.ok = function(args) { $uibModalInstance.close(args) }
                 $scope.cancel = function () { $uibModalInstance.dismiss() }
@@ -958,9 +960,8 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog,  egAddCopyAl
                 }
             }],
             resolve : {
-                circMods : function() { 
-                    return service.get_circ_mods();
-                }
+                circMods : function() { return service.get_circ_mods(); },
+                has_precat_perm : function(){ return egCore.perm.hasPermHere('CREATE_PRECAT'); }
             }
         }).result.then(
             function(args) {

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm  |  4 +++-
 Open-ILS/src/sql/Pg/002.schema.config.sql                   |  2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql                | 10 +++++++++-
 .../1184.data.lp1068287_add_create_precat_permission.sql    | 12 ++++++++++++
 Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2 | 11 ++++++++++-
 Open-ILS/web/js/ui/default/staff/circ/services/circ.js      | 11 ++++++-----
 .../Circulation/create-precat-permission.adoc               | 13 +++++++++++++
 7 files changed, 54 insertions(+), 9 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/1184.data.lp1068287_add_create_precat_permission.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/create-precat-permission.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list