}
/**
- * Wrapper for contact relationship selector.
- *
- * @param array $params
- * Associated array for params record id.
- *
- * @return array
- * associated array of contact relationships
- * @throws \Exception
+ * DELETEME only-used-by-user-dashboard
*/
public static function getContactRelationshipSelector(&$params) {
// format the params
}
/**
- * @return array
+ * DELETEME only-used-by-user-dashboard
*/
public static function getColumnHeaders() {
return [
}
/**
- * Retrieve contact relationships.
+ * DELETEME only-used-by-user-dashboard
*/
public static function getContactRelationships() {
$contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
);
}
- /**
- * called when action is browse.
- *
- */
- public function browse() {
- // do nothing :) we are using datatable for rendering relationship selectors
- $columnHeaders = CRM_Contact_BAO_Relationship::getColumnHeaders();
- $selector = NULL;
- $contactRelationships = [];
- CRM_Utils_Hook::searchColumns('relationship.columns', $columnHeaders, $contactRelationships, $selector);
- $this->assign('columnHeaders', $columnHeaders);
- }
-
/**
* called when action is update or new.
*
$this->edit();
}
- // if this is called from case view, suppress browse relationships form
- else {
- $this->browse();
- }
-
return parent::run();
}
}
/**
- * Get action links.
+ * DELETEME only-used-by-user-dashboard
*
* @return array
* (reference) of action links
'weight' => 70,
'icon' => 'crm-i fa-tasks',
],
- [
- 'id' => 'rel',
- 'title' => ts('Relationships'),
- 'class' => 'livePage',
- 'weight' => 80,
- 'icon' => 'crm-i fa-handshake-o',
- ],
[
'id' => 'group',
'title' => ts('Groups'),
}
}
- // CRM-16512 - Hide related contact table if user lacks permission to view self
+ // Relationship section
+ // FIXME - this used to share code with the contact summary "Relationships" tab
+ // now that tab has been switched to use SearchKit, and this ought to be switched as well;
+ // then remove all code commented with "DELETEME only-used-by-user-dashboard"
if (!empty($dashboardOptions['Permissioned Orgs']) && CRM_Core_Permission::check('view my contact')) {
$columnHeaders = CRM_Contact_BAO_Relationship::getColumnHeaders();
$contactRelationships = $selector = NULL;
<page_callback>CRM_Contact_Form_Task_SMS</page_callback>
<access_arguments>send SMS</access_arguments>
</item>
+ <!-- DELETEME only-used-by-user-dashboard -->
<item>
<path>civicrm/ajax/contactrelationships</path>
<page_callback>CRM_Contact_Page_AJAX::getContactRelationships</page_callback>
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{* Relationship tab within View Contact - browse, and view relationships for a contact *}
+{* Overloaded template for viewing, editing and deleting a relationship *}
{if $action eq 4} {* action = view *}
{include file="CRM/Contact/Page/View/ViewRelationship.tpl"}
-{elseif $action neq 16} {* add, update *}
+{else} {* add, update, delete *}
{include file="CRM/Contact/Form/Relationship.tpl"}
-{else}
- <div id="contact-summary-relationship-tab" class="view-content">
- {if $permission EQ 'edit'}
- <div class="action-link">
- {crmButton accesskey="N" p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1" icon="plus-circle"}{ts}Add Relationship{/ts}{/crmButton}
- </div>
- {/if}
-
- {* display current relationships *}
- <h3>{ts}Current Relationships{/ts}</h3>
- <div id="permission-legend" class="help">
- <span class="crm-label">{ts}Permissioned Relationships: {/ts}</span>
- {include file="CRM/Contact/Page/View/RelationshipPerm.tpl" permType=1 afterText=true}
- </div>
- {include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="current"}
-
- <div class="spacer"></div>
- {* display past relationships *}
- <h3 class="font-red">{ts}Inactive Relationships{/ts}</h3>
- <div class="help">{ts}These relationships are Disabled OR have a past End Date.{/ts}</div>
- {include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="past"}
- </div>
-
- {include file="CRM/common/enableDisableApi.tpl"}
- {literal}
- <script type="text/javascript">
- CRM.$(function($) {
- // Changing relationships may affect related members and contributions. Ensure they are refreshed.
- $('#contact-summary-relationship-tab').on('crmPopupFormSuccess', function() {
- CRM.tabHeader.resetTab('#tab_contribute');
- CRM.tabHeader.resetTab('#tab_member');
- });
- });
- </script>
- {/literal}
-{/if} {* close of custom data else*}
+{/if}
{ts 1=$permDisplayName 2=$otherDisplayName}<strong>%1</strong> can view information about <strong>%2</strong>.{/ts}
{/if}
{/if}
-
-{* Used for legend on relationships tab *}
-{if $afterText}
-{if $permType eq 1}
-{ts}This contact can be edited by the other.{/ts}
-{else}
-{ts}This contact can be viewed by the other.{/ts}
-{/if}
-{/if}
}
}
+ // Changing relationships may affect related members and contributions. Ensure they are refreshed.
+ $('#contact-rel').on('crmPopupFormSuccess', function() {
+ CRM.tabHeader.resetTab('#tab_contribute');
+ CRM.tabHeader.resetTab('#tab_member');
+ });
+
onResize();
$(window).resize(onResize);
});