Merge pull request #23172 from eileenmcnaughton/import_most
[civicrm-core.git] / CRM / Mailing / Page / Tab.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 * This class handle mailing and contact related functions
20 */
21 class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
22 /**
23 * The action links that we need to display for the browse screen.
24 *
25 * @var array
26 */
27 public static $_links = NULL;
28 public $_permission = NULL;
29 public $_contactId = NULL;
30
31 /**
32 * Called when action is browse.
33 */
34 public function browse() {
35 }
36
37 /**
38 * Build all the data structures needed to build the form.
39 */
40 public function preProcess() {
41 $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
42 $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
43
44 $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
45 $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
46
47 $this->assign('contactId', $this->_contactId);
48 $this->assign('displayName', $displayName);
49
50 // Check logged in url permission.
51 CRM_Contact_Page_View::checkUserPermission($this);
52
53 CRM_Utils_System::setTitle(ts('Mailings sent to %1', [1 => $displayName]));
54 }
55
56 /**
57 * The main function that is called when the page loads.
58 *
59 * It decides the which action has to be taken for the page.
60 */
61 public function run() {
62 $this->preProcess();
63 $this->browse();
64 parent::run();
65 }
66
67 }