diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index 0b002b6637d31730de663ffea67230d7f20b7495..9ddaa3edb3030fb8fc49ac7fda3a0311b6bd0828 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -29,7 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ * */ @@ -46,7 +45,7 @@ class CRM_Core_Page_AJAX_Location { * This method is used by on-behalf-of form to dynamically generate poulate the * location field values for selected permissioned contact. */ - function getPermissionedLocation() { + static function getPermissionedLocation() { $cid = CRM_Utils_Type::escape($_GET['cid'], 'Integer'); if ($_GET['ufId']) { $ufId = CRM_Utils_Type::escape($_GET['ufId'], 'Integer'); @@ -220,8 +219,9 @@ class CRM_Core_Page_AJAX_Location { CRM_Utils_System::civiExit(); } - function jqState($config) { - if (!isset($_GET['_value']) || + static function jqState($config) { + if ( + !isset($_GET['_value']) || empty($_GET['_value']) ) { CRM_Utils_System::civiExit(); @@ -229,9 +229,11 @@ class CRM_Core_Page_AJAX_Location { $result = CRM_Core_PseudoConstant::stateProvinceForCountry($_GET['_value']); - $elements = array(array('name' => ts('- select a state -'), + $elements = array( + array('name' => ts('- select a state -'), 'value' => '', - )); + ) + ); foreach ($result as $id => $name) { $elements[] = array( 'name' => $name, @@ -243,19 +245,18 @@ class CRM_Core_Page_AJAX_Location { CRM_Utils_System::civiExit(); } - function jqCounty($config) { + static function jqCounty($config) { if (CRM_Utils_System::isNull($_GET['_value'])) { - $elements = array(array('name' => ts('- select state -'), - 'value' => '', - )); + $elements = array( + array('name' => ts('- select state -'), 'value' => '') + ); } else { - $result = CRM_Core_PseudoConstant::countyForState($_GET['_value']); - $elements = array(array('name' => ts('- select -'), - 'value' => '', - )); + $elements = array( + array('name' => ts('- select -'), 'value' => '') + ); foreach ($result as $id => $name) { $elements[] = array( 'name' => $name, @@ -265,9 +266,9 @@ class CRM_Core_Page_AJAX_Location { if ($elements == array( array('name' => ts('- select -'), 'value' => ''))) { - $elements = array(array('name' => ts('- no counties -'), - 'value' => '', - )); + $elements = array( + array('name' => ts('- no counties -'), 'value' => '') + ); } } @@ -275,7 +276,7 @@ class CRM_Core_Page_AJAX_Location { CRM_Utils_System::civiExit(); } - function getLocBlock() { + static function getLocBlock() { // i wish i could retrieve loc block info based on loc_block_id, // Anyway, lets retrieve an event which has loc_block_id set to 'lbid'. if ($_POST['lbid']) { diff --git a/CRM/Friend/BAO/Friend.php b/CRM/Friend/BAO/Friend.php index 92690dc439dc511c172eccaa697f246069d9ac5d..2977a2afbc1c3e22f5814612d9b3f12bf31e6e48 100644 --- a/CRM/Friend/BAO/Friend.php +++ b/CRM/Friend/BAO/Friend.php @@ -236,7 +236,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend { * @return None * @access public */ - function buildFriendForm($form) { + static function buildFriendForm($form) { $form->addElement('checkbox', 'tf_is_active', ts('Tell a Friend enabled?'), NULL, array('onclick' => "friendBlock(this)")); // name $form->add('text', 'tf_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'title'), TRUE);