Add function to set Control Set by Thesaurus Code
authorMike Rylander <mrylander@gmail.com>
Mon, 27 Jun 2011 14:12:33 +0000 (10:12 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 11 Jul 2011 17:48:30 +0000 (13:48 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/dojo/openils/AuthorityControlSet.js

index 9993c72..ae650af 100644 (file)
@@ -173,6 +173,15 @@ if(!dojo._hasResource["openils.AuthorityControlSet"]) {
             return openils.AuthorityControlSet._controlsets[''+this.controlSetId(x)];
         },
 
+        controlSetByThesaurusCode: function (x) {
+            var thes = dojo.filter(
+                openils.AuthorityControlSet._thesaurus_list,
+                function (at) { return at.code() == x }
+            )[0];
+
+            return this.controlSet(thes.controlSet());
+        },
+
         bibFieldByTag: function (x) {
             var me = this;
             return dojo.filter(