Merge pull request #23050 from demeritcowboy/upmerge
[civicrm-core.git] / CRM / Contact / Page / View / Print.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Main page for viewing contact.
20 */
21 class CRM_Contact_Page_View_Print extends CRM_Contact_Page_View_Summary {
22
23 /**
24 * Heart of the viewing process.
25 *
26 * The runner gets all the meta data for the contact and calls the appropriate type of page to view.
27 */
28 public function run() {
29 $this->_print = CRM_Core_Smarty::PRINT_PAGE;
30
31 $this->preProcess();
32
33 $this->view();
34
35 return parent::run();
36 }
37
38 /**
39 * View summary details of a contact.
40 */
41 public function view() {
42 $params = [];
43 $defaults = [];
44 $ids = [];
45
46 $params['id'] = $params['contact_id'] = $this->_contactId;
47 $contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, $ids);
48
49 $this->assign('pageTitle', $contact->sort_name);
50
51 return parent::view();
52 }
53
54 }