send most action links thru hook_civicrm_links
[civicrm-core.git] / CRM / Financial / Page / FinancialTypeAccount.php
index af2060edf2312e17645b35c117ec77f4f6b4f4f6..346d783628789ced730fcf349877b5c7b26d6cab 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -52,7 +51,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
    * @var array
    * @static
    */
-  static $_aid = null;
+  protected $_aid = null;
 
   /**
    * Get BAO Name
@@ -138,8 +137,8 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
       $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' "));
       $this->_title = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $this->_aid, 'name');
       CRM_Utils_System::setTitle($this->_title .' - '.ts( 'Assigned Financial Accounts'));
-      $financialAccountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type');
-      $accountRelationship = CRM_Core_PseudoConstant::accountOptionValues('account_relationship');
+      $financialAccountType = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialAccount', 'financial_account_type_id');
+      $accountRelationship = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
       $dao->copyValues($params);
       $dao->find();
       while ($dao->fetch()) {
@@ -160,7 +159,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
           if (!empty($financialAccount->financial_account_type_id)) {
             $optionGroupName = 'financial_account_type';
             $financialType[$dao->id]['financial_account_type'] = CRM_Utils_Array::value($financialAccount->financial_account_type_id, $financialAccountType);
-            
+
           }
           if (!empty($dao->account_relationship)) {
             $optionGroupName = 'account_relationship';
@@ -170,7 +169,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
         // form all action links
         $action = array_sum(array_keys($this->links()));
         $links = self::links();
-        
+
         //CRM-12492
         if ($dao->account_relationship == $relationTypeId) {
           unset($links[CRM_Core_Action::DELETE]);
@@ -179,7 +178,12 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page {
           array(
             'id' => $dao->id,
             'aid'=> $dao->entity_id,
-          )
+          ),
+          ts('more'),
+          FALSE,
+          'financialTypeAccount.manage.action',
+          'FinancialTypeAccount',
+          $dao->id
         );
       }
       $this->assign('rows', $financialType);