LP#1402797 Separate stock and custom penalty type models
authorMike Rylander <mrylander@gmail.com>
Wed, 12 Nov 2014 15:46:43 +0000 (10:46 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 12 Feb 2015 16:58:27 +0000 (11:58 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/circ/share/t_new_message_dialog.tt2
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 420c358..a656e38 100644 (file)
           </ul>
         </div>
         <div class="col-md-4 pull-right">
-          <select class="form-control" ng-model="args.penalty">
-            <option ng-selected="args.penalty = ''" value="">[% l('Penalty Type') %]</option>
+          <select class="form-control" ng-model="args.custom_penalty">
+            <option disabled="disabled" ng-selected="args.custom_penalty = ''" value="">[% l('Penalty Type') %]</option>
             <option ng-repeat="penalty in penalties" 
-              ng-selected="args.penalty = penalty.id"
+              ng-selected="args.custom_penalty = penalty.id"
               value="{{penalty.id()}}">{{penalty.label()}}</option>
           </select>
         </div>
index edf975a..9a0b8a7 100644 (file)
@@ -1440,7 +1440,11 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
                 pen.usr(user_id);
                 pen.org_unit(egCore.auth.user().ws_ou());
                 pen.note(args.note);
-                pen.standing_penalty(args.penalty);
+                if (args.custom_penalty) {
+                    pen.standing_penalty(args.custom_penalty);
+                } else {
+                    pen.standing_penalty(args.penalty);
+                }
                 pen.staff(egCore.auth.user().id());
                 pen.set_date('now');
                 return egCore.pcrud.create(pen);