serials: Display existing item notes in the receiving modal
authorMike Rylander <mrylander@gmail.com>
Mon, 24 Jul 2017 20:41:08 +0000 (16:41 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 24 Jul 2017 20:41:08 +0000 (16:41 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/staff/serials/index.tt2
Open-ILS/src/templates/staff/serials/t_batch_receive.tt2
Open-ILS/web/js/ui/default/staff/serials/directives/view-items-grid.js
Open-ILS/web/js/ui/default/staff/serials/services/core.js

index 17f152b..040bc21 100644 (file)
@@ -37,6 +37,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
     s.SERIALS_SCAP_FAIL_DELETE = "[% l('Failed to delete serial prediction pattern') %]";
     s.SERIALS_ISSUANCE_FAIL_SAVE = "[% l('Failed to save issuance') %]";
     s.SERIALS_ISSUANCE_SUCCESS_SAVE = "[% l('Issuance saved') %]";
+    s.SERIALS_ITEM_NOTE_FAIL_SAVE = "[% l('Failed to save item notes') %]";
+    s.SERIALS_ITEM_NOTE_SUCCESS_SAVE = "[% l('Item notes saved') %]";
     s.SERIALS_DISTRIBUTION_SUCCESS_LINK_MFHD = "[% l('Distribution linked to MFHD') %]";
     s.SERIALS_DISTRIBUTION_FAIL_LINK_MFHD = "[% l('Failed to link distribution to MFHD') %]";
     s.SERIALS_DISTRIBUTION_SUCCESS_BINDING_TEMPLATE = "[% l('Binding unit template applied to Distribution') %]";
index 9ff469e..d688669 100644 (file)
@@ -38,6 +38,8 @@
   <div class="row">
     <div class="col-md-3">
       <b>[% l('Library : Distribution/Stream') %]</b>
+      <br/>
+      <dl class="dl-horizontal"><dt>[% l('Item notes') %]</dt></dl>
     </div>
     <div class="col-md-1">
       <b>[% l('Issuance') %]</b>
   <div class="row" ng-repeat="item in items">
     <div class="col-md-3">
       {{item.stream().distribution().holding_lib().name()}}: {{item.stream().distribution().label()}}/{{item.stream().routing_label()}}
+      <dl class="dl-horizontal">
+        <div ng-repeat="note in item.notes()">
+          <dt>{{note.title()}}</dt>
+          <dd>{{note.value()}}</dd>
+        </div>
+      <dl>
     </div>
     <div class="col-md-1">
       {{item.issuance().label()}}
index 627bb2c..f1b1b9c 100644 (file)
@@ -431,10 +431,9 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , orderByF
                 backdrop: 'static',
                 keyboard: false
             }).result.then(function(notes) {
-                console.log('results',notes);
                 egCore.pcrud.apply(notes).then(
-                    function(a) { console.log('toast here 1',a); },
-                    function(a) { console.log('toast here 2',a); }
+                    function(a) { ngToast.success(egCore.strings.SERIALS_ITEM_NOTE_SUCCESS_SAVE) },
+                    function(a) { ngToast.danger(egCore.strings.SERIALS_ITEM_NOTE_FAIL_SAVE) }
                 );
             });
         }
@@ -507,8 +506,6 @@ function($scope , $uibModalInstance , egCore , note_type , rows , notes ) {
         if (   (typeof note.title != 'undefined' && note.title != '')
             || (typeof note.value != 'undefined' && note.value != '')) {
             angular.forEach(rows, function (r) {
-                console.log('r',r);
-                window.my_r = r;
                 var n;
                 switch(note_type) {
                     case 'subscription':
@@ -538,7 +535,6 @@ function($scope , $uibModalInstance , egCore , note_type , rows , notes ) {
                 return_notes.push( n );
             }
         });
-        window.return_notes = return_notes;
         $uibModalInstance.close(return_notes);
     }
 
index 2d989a5..d7012b8 100644 (file)
@@ -233,7 +233,7 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm
             order_by : [{class:'sitem',field:'date_expected'}], // best aprox of pub date
             flesh : 1,
             flesh_fields : {
-                sitem : ['issuance','editor','creator','unit','url']
+                sitem : ['notes','issuance','editor','creator','unit','url']
             }
         });
         if (sort) {