From 02a8eda81e95fa087068e864cc0c0db42da0c380 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 3 Jan 2014 16:26:03 -0800 Subject: [PATCH] Remove unused fn buildAddressBlock --- CRM/Core/Form.php | 92 ----------------------------------------------- 1 file changed, 92 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 9809e49584..3319f2c4b8 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -991,98 +991,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } } - function buildAddressBlock($locationId, $title, $phone, - $alternatePhone = NULL, $addressRequired = NULL, - $phoneRequired = NULL, $altPhoneRequired = NULL, - $locationName = NULL - ) { - if (!$locationName) { - $locationName = "location"; - } - - $config = CRM_Core_Config::singleton(); - $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Address'); - - $location[$locationId]['address']['street_address'] = $this->addElement('text', "{$locationName}[$locationId][address][street_address]", $title, - $attributes['street_address'] - ); - if ($addressRequired) { - $this->addRule("{$locationName}[$locationId][address][street_address]", ts("Please enter the Street Address for %1.", array(1 => $title)), 'required'); - } - - $location[$locationId]['address']['supplemental_address_1'] = $this->addElement('text', "{$locationName}[$locationId][address][supplemental_address_1]", ts('Supplemental Address 1'), - $attributes['supplemental_address_1'] - ); - $location[$locationId]['address']['supplemental_address_2'] = $this->addElement('text', "{$locationName}[$locationId][address][supplemental_address_2]", ts('Supplemental Address 2'), - $attributes['supplemental_address_2'] - ); - - $location[$locationId]['address']['city'] = $this->addElement('text', "{$locationName}[$locationId][address][city]", ts('City'), - $attributes['city'] - ); - if ($addressRequired) { - $this->addRule("{$locationName}[$locationId][address][city]", ts("Please enter the City for %1.", array(1 => $title)), 'required'); - } - - $location[$locationId]['address']['postal_code'] = $this->addElement('text', "{$locationName}[$locationId][address][postal_code]", ts('Zip / Postal Code'), - $attributes['postal_code'] - ); - if ($addressRequired) { - $this->addRule("{$locationName}[$locationId][address][postal_code]", ts("Please enter the Zip/Postal Code for %1.", array(1 => $title)), 'required'); - } - - $location[$locationId]['address']['postal_code_suffix'] = $this->addElement('text', "{$locationName}[$locationId][address][postal_code_suffix]", ts('Add-on Code'), - array('size' => 4, 'maxlength' => 12) - ); - $this->addRule("{$locationName}[$locationId][address][postal_code_suffix]", ts('Zip-Plus not valid.'), 'positiveInteger'); - - if ($config->includeCounty) { - $location[$locationId]['address']['county_id'] = $this->addElement('select', "{$locationName}[$locationId][address][county_id]", ts('County'), - array('' => ts('- select -')) + CRM_Core_PseudoConstant::county() - ); - } - - $location[$locationId]['address']['state_province_id'] = $this->addElement('select', "{$locationName}[$locationId][address][state_province_id]", ts('State / Province'), - array('' => ts('- select -')) + CRM_Core_PseudoConstant::stateProvince() - ); - - $location[$locationId]['address']['country_id'] = $this->addElement('select', "{$locationName}[$locationId][address][country_id]", ts('Country'), - array('' => ts('- select -')) + CRM_Core_PseudoConstant::country() - ); - if ($addressRequired) { - $this->addRule("{$locationName}[$locationId][address][country_id]", ts("Please select the Country for %1.", array(1 => $title)), 'required'); - } - - - if ($phone) { - $location[$locationId]['phone'][1]['phone'] = $this->addElement('text', - "{$locationName}[$locationId][phone][1][phone]", - $phone, - CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', - 'phone' - ) - ); - if ($phoneRequired) { - $this->addRule("{$locationName}[$locationId][phone][1][phone]", ts('Please enter a value for %1', array(1 => $phone)), 'required'); - } - $this->addRule("{$locationName}[$locationId][phone][1][phone]", ts('Please enter a valid number for %1', array(1 => $phone)), 'phone'); - } - - if ($alternatePhone) { - $location[$locationId]['phone'][2]['phone'] = $this->addElement('text', - "{$locationName}[$locationId][phone][2][phone]", - $alternatePhone, - CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', - 'phone' - ) - ); - if ($alternatePhoneRequired) { - $this->addRule("{$locationName}[$locationId][phone][2][phone]", ts('Please enter a value for %1', array(1 => $alternatePhone)), 'required'); - } - $this->addRule("{$locationName}[$locationId][phone][2][phone]", ts('Please enter a valid number for %1', array(1 => $alternatePhone)), 'phone'); - } - } - public function getRootTitle() { return NULL; } -- 2.25.1