X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FCore%2FPage%2FAJAX%2FLocation.php;h=4d128c1228866e60e50a6d6749cebff5d045f3ef;hb=21414b174527b076116279d274a3e385dfcf4c91;hp=1ef5d394db6c9ed821772bfba60d162087ab8ac1;hpb=d7f6c609b3af1dafb068fb3172056d0b58142b5e;p=civicrm-core.git diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index 1ef5d394db..4d128c1228 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2015 | + | Copyright CiviCRM LLC (c) 2004-2016 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2015 + * @copyright CiviCRM LLC (c) 2004-2016 * */ @@ -58,8 +58,8 @@ class CRM_Core_Page_AJAX_Location { } // 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(); } @@ -180,8 +180,8 @@ class CRM_Core_Page_AJAX_Location { } 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;