<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$image_URL = str_replace('http://', 'https://', $image_URL);
}
- list($imageWidth, $imageHeight) = getimagesize($image_URL);
+ list($imageWidth, $imageHeight) = getimagesize(CRM_Utils_String::unstupifyUrl($image_URL));
list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
$this->assign("imageWidth", $imageWidth);
$this->assign("imageHeight", $imageHeight);
$this->assign('displayName', $displayName);
$this->set('contactType', $contactType);
- $this->set('contactSubtype', $contactSubtype);
+
+ // note: there could still be multiple subtypes. We just trimming the outer separator.
+ $this->set('contactSubtype', trim($contactSubtype, CRM_Core_DAO::VALUE_SEPARATOR));
// add to recently viewed block
$isDeleted = (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'is_deleted');
'isDeleted' => $isDeleted,
);
- if (($session->get('userID') == $this->_contactId) ||
- CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)
- ) {
+ if (CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
$recentOther['editUrl'] = CRM_Utils_System::url('civicrm/contact/add', "reset=1&action=update&cid={$this->_contactId}");
}
// things easier in dashboard
$session = CRM_Core_Session::singleton();
- if ($session->get('userID') == $contactID) {
+ if ($session->get('userID') == $contactID && CRM_Core_Permission::check('edit my contact')) {
$page->assign('permission', 'edit');
$page->_permission = CRM_Core_Permission::EDIT;
// deleted contacts’ stuff should be (at best) only viewable