return $session->get('userID');
}
+ /**
+ * Get display name of the logged in user.
+ *
+ * @return string
+ *
+ * @throws CiviCRM_API3_Exception
+ */
+ public function getLoggedInContactDisplayName() {
+ $userContactID = CRM_Core_Session::singleton()->getLoggedInContactID();
+ if (!$userContactID) {
+ return '';
+ }
+ return civicrm_api3('Contact', 'getvalue', array('id' => $userContactID, 'return' => 'display_name'));
+ }
+
/**
* Check if session is empty.
*
$this->_createNew = TRUE;
$this->_params = $this->_formValues;
$this->_params['view_mode'] = 'criteria';
- $this->_params['title'] = ts('(copy)') . $this->getTitle();
+ $this->_params['title'] = $this->getTitle() . ts(' (copy created by %1 on %2)', array(
+ CRM_Core_Session::singleton()->getLoggedInContactDisplayName(),
+ CRM_Utils_Date::customFormat(date('Y-m-d H:i')),
+ ));
// Do not pass go. Do not collect another chance to re-run the same query.
CRM_Report_Form_Instance::postProcess($this);
}