3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 * Main page for activity dashlet
24 class CRM_Dashlet_Page_Activity
extends CRM_Core_Page
{
27 * List activities as dashlet.
31 public function run() {
32 $session = CRM_Core_Session
::singleton();
33 $contactID = $session->get('userID');
34 $this->assign('contactID', $contactID);
35 $this->assign('contactId', $contactID);
37 $context = CRM_Utils_Request
::retrieve('context', 'Alphanumeric', $this, FALSE, 'dashlet');
38 $this->assign('context', $context);
40 // a user can always view their own activity
41 // if they have access CiviCRM permission
42 $permission = CRM_Core_Permission
::VIEW
;
44 // make the permission edit if the user has edit permission on the contact
45 if (CRM_Contact_BAO_Contact_Permission
::allow($contactID, CRM_Core_Permission
::EDIT
)) {
46 $permission = CRM_Core_Permission
::EDIT
;
49 $admin = CRM_Core_Permission
::check('view all activities') || CRM_Core_Permission
::check('administer CiviCRM');
51 $this->assign('admin', $admin);
53 // also create the form element for the activity filter box
54 $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_ActivityFilter',
55 ts('Activity Filter'), NULL
57 $controller->setEmbedded(TRUE);