From 0949913f3e28b98e7397d8beac24950a2f3ad67f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 1 May 2014 10:40:14 -0700 Subject: [PATCH] Contact Dashboard - cleanup and remove unused code --- CRM/Contact/BAO/Contact/Utils.php | 46 ++---------------- CRM/Contact/Form/RelatedContact.php | 3 +- templates/CRM/Contact/Form/OnBehalfOf.tpl | 58 ----------------------- 3 files changed, 4 insertions(+), 103 deletions(-) diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 7a5556547e..af58ad11d5 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -461,23 +461,13 @@ WHERE id={$contactId}; "; * @static * */ - static function buildOnBehalfForm(&$form, - $contactType = 'Individual', - $countryID = NULL, - $stateID = NULL, - $title = 'Contact Information', - $contactEditMode = FALSE, - $maxLocationBlocks = 1 - ) { - if ($title == 'Contact Information') { - $title = ts('Contact Information'); - } + static function buildOnBehalfForm(&$form, $contactType, $countryID, $stateID, $title) { $config = CRM_Core_Config::singleton(); $form->assign('contact_type', $contactType); $form->assign('fieldSetTitle', $title); - $form->assign('contactEditMode', $contactEditMode); + $form->assign('contactEditMode', TRUE); $attributes = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact'); if ($form->_contactId) { @@ -486,41 +476,11 @@ WHERE id={$contactId}; "; switch ($contactType) { case 'Organization': - $session = CRM_Core_Session::singleton(); - $contactID = $session->get('userID'); - - if ($contactID) { - $employers = CRM_Contact_BAO_Relationship::getPermissionedEmployer($contactID); - } - - $locDataURL = CRM_Utils_System::url('civicrm/ajax/permlocation', 'cid=', FALSE, NULL, FALSE); - $form->assign('locDataURL', $locDataURL); - - if (!$contactEditMode && $contactID && (count($employers) >= 1)) { - - $dataURL = CRM_Utils_System::url('civicrm/ajax/employer', - 'cid=' . $contactID, - FALSE, NULL, FALSE - ); - $form->assign('employerDataURL', $dataURL); - - $form->add('text', 'organization_id', ts('Select an existing related Organization OR Enter a new one')); - $form->add('hidden', 'onbehalfof_id', '', array('id' => 'onbehalfof_id')); - $orgOptions = array('0' => ts('Create new organization'), - '1' => ts('Select existing organization'), - ); - $orgOptionExtra = array('onclick' => "showHideByValue('org_option','true','select_org','table-row','radio',true);showHideByValue('org_option','true','create_org','table-row','radio',false);"); - $form->addRadio('org_option', ts('options'), $orgOptions, $orgOptionExtra); - $form->assign('relatedOrganizationFound', TRUE); - } - $form->add('text', 'organization_name', ts('Organization Name'), $attributes['organization_name'], TRUE); break; case 'Household': - $form->add('text', 'household_name', ts('Household Name'), - $attributes['household_name'] - ); + $form->add('text', 'household_name', ts('Household Name'), $attributes['household_name']); break; default: diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index a685e6343c..03edc2abfb 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -140,8 +140,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { $this->_contactType, $countryID, $stateID, - 'Contact Information', - TRUE + ts('Contact Information') ); $this->addButtons(array( diff --git a/templates/CRM/Contact/Form/OnBehalfOf.tpl b/templates/CRM/Contact/Form/OnBehalfOf.tpl index b8a074e90f..38e0a294bd 100644 --- a/templates/CRM/Contact/Form/OnBehalfOf.tpl +++ b/templates/CRM/Contact/Form/OnBehalfOf.tpl @@ -69,15 +69,6 @@
{/if}
- {if $relatedOrganizationFound} -
-
{$form.org_option.html}
-
-
-
{$form.organization_name.label}
-
{$form.organization_id.html|crmAddClass:big}
-
- {/if}
{$form.organization_name.label}
{$form.organization_name.html|crmAddClass:big}
@@ -229,52 +220,3 @@ invert = "false" } {/if} - -{literal} - -{/literal} -- 2.25.1