LP1746536: cannot edit vol/call number in item status
authora. bellenir <ab@grpl.org>
Wed, 27 Jun 2018 18:48:56 +0000 (14:48 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 23 Oct 2018 17:48:56 +0000 (13:48 -0400)
spawnHoldingsEdit was disabling record summary by passing record_id: 0
this change will provided the record_id if exactly one record is selected.
behavior is unchanged if multiple records are selected.

Signed-off-by: a. bellenir <ab@grpl.org>
Signed-off-by: cesar velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Conflicts:
Open-ILS/web/js/ui/default/staff/circ/services/item.js

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index 3bb09b0..c39f038 100644 (file)
@@ -732,18 +732,22 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         angular.forEach(items, function(i){
            item_ids.push(i.id);
         });
-       
-       egCore.net.request(
-           'open-ils.actor',
-           'open-ils.actor.anon_cache.set_value',
-           null,
-           'edit-these-copies',
-           {
-               record_id: 0,  // disables record summary
-               copies: item_ids,
-               raw: {},
-               hide_vols : hide_vols,
-               hide_copies : hide_copies
+
+        // provide record_id iff one record is selected.
+        // 0 disables record summary
+        var record_ids = service.gatherSelectedRecordIds(items);
+        var record_id  = record_ids.length === 1 ? record_ids[0] : 0;
+        egCore.net.request(
+            'open-ils.actor',
+            'open-ils.actor.anon_cache.set_value',
+            null,
+            'edit-these-copies',
+            {
+                record_id: record_id,
+                copies: item_ids,
+                raw: {},
+                hide_vols : hide_vols,
+                hide_copies : hide_copies
             }).then(function(key) {
                if (key) {
                    var url = egCore.env.basePath + 'cat/volcopy/' + key;