Skip to content

Commit

Permalink
Merge pull request #22909 from eileenmcnaughton/relview
Browse files Browse the repository at this point in the history
Add created & modified dates to "View Relationship" screen
  • Loading branch information
totten authored Mar 8, 2022
2 parents 194c41b + 57315c8 commit 88e3bfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CRM/Contact/BAO/Relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ public static function makeURLClause($contactId, $status, $numRelationship, $cou
civicrm_relationship_type.id as civicrm_relationship_type_id,
civicrm_relationship.start_date as start_date,
civicrm_relationship.end_date as end_date,
civicrm_relationship.created_date as created_date,
civicrm_relationship.modified_date as modified_date,
civicrm_relationship.description as description,
civicrm_relationship.is_active as is_active,
civicrm_relationship.is_permission_a_b as is_permission_a_b,
Expand Down Expand Up @@ -1230,9 +1232,7 @@ public static function getRelationship(
// building the query string
$queryString = $select1 . $from1 . $where1 . $select2 . $from2 . $where2;

$relationship = new CRM_Contact_DAO_Relationship();

$relationship->query($queryString . $order . $limit);
$relationship = CRM_Core_DAO::executeQuery($queryString . $order . $limit);
$row = [];
if ($count) {
$relationshipCount = 0;
Expand Down Expand Up @@ -1309,6 +1309,8 @@ public static function getRelationship(
$values[$rid]['state'] = $relationship->state;
$values[$rid]['start_date'] = $relationship->start_date;
$values[$rid]['end_date'] = $relationship->end_date;
$values[$rid]['created_date'] = $relationship->created_date;
$values[$rid]['modified_date'] = $relationship->modified_date;
$values[$rid]['description'] = $relationship->description;
$values[$rid]['is_active'] = $relationship->is_active;
$values[$rid]['is_permission_a_b'] = $relationship->is_permission_a_b;
Expand Down
3 changes: 3 additions & 0 deletions templates/CRM/Contact/Page/View/ViewRelationship.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
</td>
</tr>
<tr><td class="label">{ts}Status{/ts}</td><td>{if $row.is_active}{ts}Enabled{/ts}{else}{ts}Disabled{/ts}{/if}</td></tr>
<tr><td class="label">{ts}Created Date{/ts}</td><td>{$row.created_date|crmDate}</td></tr>
<tr><td class="label">{ts}Modified Date{/ts}</td><td>{$row.modified_date|crmDate}</td></tr>

{/foreach}
</table>
{include file="CRM/Custom/Page/CustomDataView.tpl"}
Expand Down

0 comments on commit 88e3bfd

Please sign in to comment.