Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-28-11-04-58
[civicrm-core.git] / CRM / Admin / Page / ContactType.php
index 5ed8f35a9fff7513ad5470f4793514259aeaba09..14b1ee6021f449a9cd52b1bd5fb2b4e69834925d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -73,19 +75,13 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
         CRM_Core_Action::DISABLE =>
         array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' .
-          'CRM_Contact_BAO_ContactType' . '\',\'' . 'enable-disable' .
-          '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Contact Type'),
         ),
         CRM_Core_Action::ENABLE =>
         array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' .
-          'CRM_Contact_BAO_ContactType' . '\',\'' . 'disable-enable' .
-          '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Contact Type'),
         ),
         CRM_Core_Action::DELETE =>
@@ -114,12 +110,12 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
     $rows = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE);
     foreach ($rows as $key => $value) {
       $mask = NULL;
-      if (CRM_Utils_Array::value('is_reserved', $value)) {
+      if (!empty($value['is_reserved'])) {
         $mask = CRM_Core_Action::UPDATE;
       }
       else {
         $mask -= CRM_Core_Action::DELETE - 2;
-        if (CRM_Utils_Array::value('is_active', $value)) {
+        if (!empty($value['is_active'])) {
           $mask -= CRM_Core_Action::ENABLE;
         }
         else {
@@ -127,7 +123,12 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
         }
       }
       $rows[$key]['action'] = CRM_Core_Action::formLink(self::links(), $mask,
-        array('id' => $value['id'])
+        array('id' => $value['id']),
+        ts('more'),
+        FALSE,
+        'contactType.manage.action',
+        'ContactType',
+        $value['id']
       );
     }
     $this->assign('rows', $rows);