CRM-21499: Add filter to manage tags page
authordeb.monish <monish.deb@jmaconsulting.biz>
Thu, 30 Nov 2017 13:22:57 +0000 (18:52 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Thu, 30 Nov 2017 13:22:57 +0000 (18:52 +0530)
templates/CRM/Tag/Page/Tag.tpl

index 81729b5fd8ac3452b9a2c90a45218ec0545fa345..3182d28866153c9573038c969a3816316dc39cbe 100644 (file)
@@ -53,6 +53,7 @@
       <div class="help">
         {ts}Organize the tag hierarchy by clicking and dragging. Shift-click to select multiple tags to merge/move/delete.{/ts}
       </div>
+      <input class="crm-form-text big" name="filter_tag_tree" placeholder="{ts}Filter List{/ts}" allowclear="1"/>
     </div>
     {foreach from=$tagsets item=set}
       <div id="tagset-{$set.id}">
             }
           });
 
-        plugins = ['wholerow', 'changed'];
+        plugins = ['wholerow', 'changed', 'search'];
         if (!tagset) {
           // Allow drag-n-drop nesting of the tag tree
           plugins.push('dnd');
               },
               check_callback: true
             },
+            'search': {
+              'case_insensitive' : true,
+              'show_only_matches': true
+            },
             plugins: plugins,
             dnd: {
               copy: false
         });
 
       renderTree($('#tree'));
+      $('input[name=filter_tag_tree]').on('keyup change', function() {
+        $(".tag-tree").jstree("search", $(this).val());
+      });
 
       // Prevent the info box from scrolling offscreen
       $window.on('scroll resize', function () {