Merge pull request #3363 from jitendrapurohit/CRM14315
[civicrm-core.git] / CRM / Member / Form / MembershipView.php
index c3c9dd11bf0b22b4e48981b0f1fbf2598d264a21..38aa3b744fa9dc426e7dac60cff8a141c673760a 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$
  *
  */
@@ -222,9 +222,7 @@ END AS 'relType'
 
       $this->assign('has_related', FALSE);
       // if membership can be granted, and we are the owner of the membership
-      if (CRM_Utils_Array::value('relationship_type_id', $membershipType)
-        && !CRM_Utils_Array::value('owner_membership_id', $values)
-      ) {
+      if (!empty($membershipType['relationship_type_id']) && empty($values['owner_membership_id'])) {
         // display related contacts/membership block
         $this->assign('has_related', TRUE);
         $this->assign('max_related', CRM_Utils_Array::value('max_related', $values, ts('Unlimited')));
@@ -286,7 +284,12 @@ SELECT r.id, c.id as cid, c.display_name as name, c.job_title as comment,
                 'id' => CRM_Utils_Request::retrieve('id', 'Positive', $this),
                 'cid' => $row['cid'],
                 'mid' => $row['mid'],
-              )
+              ),
+              ts('more'),
+              FALSE,
+              'membership.relationship.action',
+              'Relationship',
+              CRM_Utils_Request::retrieve('id', 'Positive', $this)
             );
           }
           else {
@@ -296,7 +299,12 @@ SELECT r.id, c.id as cid, c.display_name as name, c.job_title as comment,
                   'id' => CRM_Utils_Request::retrieve('id', 'Positive', $this),
                   'cid' => $row['cid'],
                   'rid' => $row['cid'],
-                )
+                ),
+                ts('more'),
+                FALSE,
+                'membership.relationship.action',
+                'Relationship',
+                CRM_Utils_Request::retrieve('id', 'Positive', $this)
               );
             }
           }
@@ -365,7 +373,7 @@ SELECT r.id, c.id as cid, c.display_name as name, c.job_title as comment,
       $autoRenew = $isRecur ? TRUE : FALSE;
     }
 
-    if (CRM_Utils_Array::value('is_test', $values)) {
+    if (!empty($values['is_test'])) {
       $values['membership_type'] .= ' (test) ';
     }
 
@@ -384,7 +392,7 @@ SELECT r.id, c.id as cid, c.display_name as name, c.job_title as comment,
   /**
    * Function to build the form
    *
-   * @return None
+   * @return void
    * @access public
    */
   public function buildQuickForm() {