<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$this->_defaultMemTypeId = $membership->membership_type_id;
if ($membership->contact_id != $this->_contactID) {
$employers = CRM_Contact_BAO_Relationship::getPermissionedEmployer($this->_userID);
- if (array_key_exists($membership->contact_id, $employers)) {
- $this->_membershipContactID = $membership->contact_id;
- $this->assign('membershipContactID', $this->_membershipContactID);
- $this->assign('membershipContactName', $employers[$this->_membershipContactID]['name']);
+ if (!empty($employers)) {
+ if (array_key_exists($membership->contact_id, $employers)) {
+ $this->_membershipContactID = $membership->contact_id;
+ $this->assign('membershipContactID', $this->_membershipContactID);
+ $this->assign('membershipContactName', $employers[$this->_membershipContactID]['name']);
+ }
+ else {
+ CRM_Core_Session::setStatus(ts("Oops. The membership you're trying to renew appears to be invalid. Contact your site administrator if you need assistance. If you continue, you will be issued a new membership."), ts('Membership Invalid'), 'alert');
+ }
}
else {
- CRM_Core_Session::setStatus(ts("Oops. The membership you're trying to renew appears to be invalid. Contact your site administrator if you need assistance. If you continue, you will be issued a new membership."), ts('Membership Invalid'), 'alert');
+ $this->_membershipContactID = $membership->contact_id;
}
}
}
$this->_params[$v] = $frequencyUnits[$this->_params[$v]];
}
}
- if ($v == "amount") {
- $this->_params[$v] = CRM_Utils_Money::format($this->_params[$v], ' ');
+ if ($v == "amount" && $this->_params[$v] === 0) {
+ $this->_params[$v] = CRM_Utils_Money::format($this->_params[$v], NULL, NULL, TRUE);
}
$this->assign($v, $this->_params[$v]);
}