From: Jason Etheridge <jason@equinoxinitiative.org> Date: Fri, 6 Sep 2019 03:51:46 +0000 (-0400) Subject: LP#1068287 UI tweak and renewal behavior X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a31a8e86aae880febafa0fa94c1d013ca15c2275;p=evergreen%2Fjoelewis.git 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@equinoxinitiative.org> Signed-off-by: Galen Charlton <gmc@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.