LP#1778522 Precat item creation should be more intentional
authorDan Briem <dbriem@wlsmail.org>
Wed, 18 Nov 2020 21:50:06 +0000 (16:50 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 25 Nov 2020 17:47:35 +0000 (12:47 -0500)
Precat items can be created before all of the info is entered.
The dialog autofocuses the title field, so a double barcode scan
will populate the title field and createt the precat without
giving an opportunity to fill in the other fields.

This prevents form submission unless you click the Precat
Checkout button.

To test:
1. Try to check out a barcode that doesn't exist to any patron
2. On the precat dialog, enter a value into the title field
3. Note the precat is created
4. Apply patch
5. Repeat steps 1-3 and note the precat isn't created until
   the Precat Checkout button is clicked

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/staff/circ/share/t_precat_dialog.tt2

index 52181ec..06bf6da 100644 (file)
@@ -1,5 +1,5 @@
 <!-- edit bucket dialog -->
-<form ng-submit="ok(precatArgs)" role="form">
+<form role="form">
   <div class="">
     <div class="modal-content">
       <div class="modal-header">
@@ -30,8 +30,7 @@
           <label for="precat-isbn">[% l('Call Number') %]</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('Call Number...') %]"/>
+            ng-model="precatArgs.dummy_isbn" placeholder="[% l('ISBN...') %]"/>
         </div>
         <div class="form-group">
           <label for="precat-circmod">[% l('Circulation Modifier') %]</label>
         </div>
       </div>
       <div class="modal-footer">
-        <input type="submit" class="btn btn-primary" value="[% l('Precat Checkout') %]"
-            ng-disabled="!can_create_precats"
-        />
-        <button class="btn btn-warning" ng-click="cancel()"
+        <button type="button" class="btn btn-primary" ng-click="ok(precatArgs)"
+            ng-disabled="!can_create_precats">[% l('Precat Checkout') %]</button>
+        <button type="button" class="btn btn-warning" ng-click="cancel()"
             ng-class="{disabled : actionPending}">[% l('Cancel') %]</button>
       </div>
     </div> <!-- modal-content -->