From 525faea3c99f2545600fcc3f12b2ca292f3a6ec8 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Fri, 28 Mar 2014 13:03:50 +0530 Subject: [PATCH] CRM-14327 : title fixes --- CRM/Contact/Form/CustomData.php | 5 +++++ CRM/Contact/Page/View/CustomData.php | 3 +++ CRM/Profile/Page/MultipleRecordFieldsListing.php | 6 +++--- templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index c67ee30b6c..2ce48819c4 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -133,6 +133,11 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { $this->_tableID = $this->_entityId; $this->_copyValueId = CRM_Utils_Request::retrieve('copyValueId', 'Positive', $this); + $groupTitle = CRM_Core_BAO_CustomGroup::getTitle($this->_groupID); + $mode = CRM_Utils_Request::retrieve('mode', 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET'); + $mode = ucfirst($mode); + CRM_Utils_System::setTitle(ts('%1 %2 Record', array(1 => $mode, 2 => $groupTitle))); + if (!empty($_POST['hidden_custom'])) { $this->assign('postedInfo', TRUE); } diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php index ae774e9e1f..85ca1413f6 100644 --- a/CRM/Contact/Page/View/CustomData.php +++ b/CRM/Contact/Page/View/CustomData.php @@ -152,6 +152,9 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { else { $recId = NULL; if ($this->_multiRecordDisplay == 'single') { + $groupTitle = CRM_Core_BAO_CustomGroup::getTitle($this->_groupId); + CRM_Utils_System::setTitle(ts('View %1 Record', array(1 => $groupTitle))); + $recId = $this->_recId; $this->assign('multiRecordDisplay', $this->_multiRecordDisplay); $this->assign('skipTitle', 1); diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index e38cc2d19c..3dfaabc4ee 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -107,11 +107,11 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { elseif ($this->_pageViewType == 'customDataView') { // custom data specific view links $links[CRM_Core_Action::VIEW]['url'] = 'civicrm/contact/view/cd'; - $links[CRM_Core_Action::VIEW]['qs'] = 'reset=1&gid=%%gid%%&cid=%%cid%%&recId=%%recId%%&multiRecordDisplay=single'; + $links[CRM_Core_Action::VIEW]['qs'] = 'reset=1&gid=%%gid%%&cid=%%cid%%&recId=%%recId%%&multiRecordDisplay=single&mode=view'; // custom data specific update links $links[CRM_Core_Action::UPDATE]['url'] = 'civicrm/contact/view/cd/edit'; - $links[CRM_Core_Action::UPDATE]['qs'] = 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%cgcount%%&multiRecordDisplay=single'; + $links[CRM_Core_Action::UPDATE]['qs'] = 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%cgcount%%&multiRecordDisplay=single&mode=edit'; // NOTE : links for DELETE action for customDataView is handled in browse // copy action @@ -119,7 +119,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { 'name' => ts('Copy'), 'title' => ts('Copy %1', array( 1 => $this->_customGroupTitle . ' record')), 'url' => 'civicrm/contact/view/cd/edit', - 'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%' + 'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%&mode=copy' ); } diff --git a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl index 13a9018f0d..015c3ccaf8 100644 --- a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl +++ b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl @@ -80,7 +80,7 @@ {if !$reachedMax} {if $pageViewType eq 'customDataView'} -
{ts 1=$customGroupTitle}Add %1 Record{/ts}
{else}