From 7d041da358d60a04b51163e7e5a25b2e8a23f5c3 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Thu, 5 Sep 2013 14:03:12 +0530 Subject: [PATCH] CRM-13336 : disable inline edit on contact summary view page while in print mode ---------------------------------------- * CRM-13336: remove inline edit from contact summary in print mode http://issues.civicrm.org/jira/browse/CRM-13336 --- CRM/Contact/Page/View/Summary.php | 3 ++- templates/CRM/Contact/Page/View/Summary.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index ef0e841399..88efbea7be 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -136,7 +136,8 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { CRM_Core_Resources::singleton() ->addScriptFile('civicrm', 'templates/CRM/Contact/Page/View/Summary.js') ->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE) - ->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header'); + ->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header') + ->addSetting(array('summaryPrint' => array('mode' => $this->_print))); $session = CRM_Core_Session::singleton(); $url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId); $session->pushUserContext($url); diff --git a/templates/CRM/Contact/Page/View/Summary.js b/templates/CRM/Contact/Page/View/Summary.js index 562985a2ba..82a46c4ce6 100644 --- a/templates/CRM/Contact/Page/View/Summary.js +++ b/templates/CRM/Contact/Page/View/Summary.js @@ -156,6 +156,12 @@ } $('document').ready(function() { + // don't perform inline edit during print mode + if (CRM.summaryPrint.mode) { + $('div').removeClass('crm-inline-edit'); + $('.crm-inline-block-content > div.crm-edit-help').remove(); + $('div.crm-inline-block-content').removeAttr('title'); + } // Set page title var oldName = 'CiviCRM'; var nameTitle = $('#crm-remove-title'); -- 2.25.1