<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*
*/
}
// Verify user permission on related contact
- $employers = CRM_Contact_BAO_Relationship::getPermissionedEmployer($user);
- if (!isset($employers[$cid])) {
+ $organizations = CRM_Contact_BAO_Relationship::getPermissionedContacts($user, NULL, NULL, 'Organization');
+ if (!isset($organizations[$cid])) {
CRM_Utils_System::civiExit();
}
}
elseif ($htmlType == 'Select Date') {
$elements["onbehalf_{$key}"]['type'] = $htmlType;
- $elements["onbehalf_{$key}"]['value'] = $defaults[$key];
- $elements["onbehalf_{$key}_display"]['value'] = $defaults[$key];
+ //CRM-18349, date value must be ISO formatted before being set as a default value for crmDatepicker custom field
+ $elements["onbehalf_{$key}"]['value'] = CRM_Utils_Date::processDate($defaults[$key], NULL, FALSE, 'Y-m-d G:i:s');
}
else {
$elements["onbehalf_{$key}"]['type'] = $htmlType;