From: Jason Boyer <jboyer@equinoxinitiative.org>
Date: Tue, 22 Oct 2019 13:18:29 +0000 (-0400)
Subject: LP1825403: Do not Include Tag Owner in Tag
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=65ee0cb4c23f9f1277bd37ef7d52e186e1b6a303;p=evergreen%2Fequinox.git

LP1825403: Do not Include Tag Owner in Tag

Copy tags were accidentally having their owning
location shortname included in the tag values,
this patch allows the owner to be displayed but
not included in the value used.

Signed-off-by: Jason Boyer <jboyer@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
---

diff --git a/Open-ILS/src/templates/staff/cat/bucket/copy/t_apply_tags.tt2 b/Open-ILS/src/templates/staff/cat/bucket/copy/t_apply_tags.tt2
index e218adee42..d60728d3d2 100644
--- a/Open-ILS/src/templates/staff/cat/bucket/copy/t_apply_tags.tt2
+++ b/Open-ILS/src/templates/staff/cat/bucket/copy/t_apply_tags.tt2
@@ -21,7 +21,7 @@
           <div class="form-group">
             <label for="tagLabel">[% l('Tag') %]</label>
             <input name="tabLabel" type="text" ng-model="selectedLabel" placeholder="[% l('Enter tag label...') %]"
-                uib-typeahead="tag for tag in getTags($viewValue)" typeahead-editable="false"
+                uib-typeahead="tag.value as tag.display for tag in getTags($viewValue)" typeahead-editable="false"
                 class="form-control" autocomplete="off"></input>
           </div>
           <button type="button" class="btn btn-sm btn-default" ng-click="addTag()">[% l('Add Tag') %]</button>
diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_tags.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_tags.tt2
index 13194cbb1a..25e5d96ea6 100644
--- a/Open-ILS/src/templates/staff/cat/volcopy/t_copy_tags.tt2
+++ b/Open-ILS/src/templates/staff/cat/volcopy/t_copy_tags.tt2
@@ -21,7 +21,7 @@
           <div class="form-group">
             <label for="tagLabel">[% l('Tag') %]</label>
             <input name="tabLabel" type="text" ng-model="selectedLabel" placeholder="[% l('Enter tag label...') %]"
-                uib-typeahead="tag for tag in getTags($viewValue)"
+                uib-typeahead="tag.value as tag.display for tag in getTags($viewValue)"
                 class="form-control" autocomplete="off"></input>
           </div>
           <button type="button" class="btn btn-sm btn-default" ng-click="addTag()">[% l('Add Tag') %]</button>
diff --git a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
index e5cc7f4738..bebb642c56 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js
@@ -863,7 +863,7 @@ function($scope,  $q , $routeParams , $timeout , $window , $uibModal , bucketSvc
                         { order_by : { 'acpt' : ['label'] } }, { atomic: true }
                     ).then(function(list) {
                         return list.map(function(item) {
-                            return item.label();
+                            return { value: item.label(), display: item.label() + " (" + egCore.org.get(item.owner()).shortname() + ")" };
                         });
                     });
                 }
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index 9b5b57e98d..20b819e066 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -2198,7 +2198,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         { order_by : { 'acpt' : ['label'] } }, { atomic: true }
                     ).then(function(list) {
                         return list.map(function(item) {
-                            return item.label() + " (" + egCore.org.get(item.owner()).shortname() + ")";
+                            return { value: item.label(), display: item.label() + " (" + egCore.org.get(item.owner()).shortname() + ")" };
                         });
                     });
                 }