Merge branch 'CRM-13965' of git://github.com/pratik-joshi/civicrm-core into CRM-13965
[civicrm-core.git] / CRM / Tag / Form / Tag.php
index f87edd36774414480f295b48e44137f3b748fab9..cb1e8755ba73184f272182590da744e39aedbb4c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -45,7 +45,9 @@ class CRM_Tag_Form_Tag extends CRM_Core_Form {
    * @var int
    */
   protected $_entityID;
-  protected $_entityTable; function preProcess() {
+  protected $_entityTable;
+
+  function preProcess() {
     if ($this->get('entityID')) {
       $this->_entityID = $this->get('entityID');
     }
@@ -66,10 +68,13 @@ class CRM_Tag_Form_Tag extends CRM_Core_Form {
   /**
    * Function to build the form
    *
-   * @return None
+   * @return void
    * @access public
    */
   public function buildQuickForm() {
+    CRM_Core_Resources::singleton()
+      ->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)
+      ->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header');
     // get categories for the contact id
     $entityTag = CRM_Core_BAO_EntityTag::getTag($this->_entityID, $this->_entityTable);
     $this->assign('tagged', $entityTag);
@@ -81,14 +86,12 @@ class CRM_Tag_Form_Tag extends CRM_Core_Form {
     foreach ($allTag as $tagID => $varValue) {
       if (in_array($tagID, $entityTag)) {
         $tagAttribute = array(
-          'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
           'checked' => 'checked',
           'id' => "tag_{$tagID}",
         );
       }
       else {
         $tagAttribute = array(
-          'onclick' => "return changeRowColor(\"rowidtag_$tagID\")",
           'id' => "tag_{$tagID}",
         );
       }
@@ -131,7 +134,7 @@ class CRM_Tag_Form_Tag extends CRM_Core_Form {
    *
    * @access public
    *
-   * @return None
+   * @return void
    */
   public function postProcess() {
     CRM_Utils_System::flushCache('CRM_Core_DAO_Tag');