INFRA-132 - Fix spacing of @return tag in comments
[civicrm-core.git] / CRM / Activity / Selector / Activity.php
index 2df5ddbc62408817dff5f139ac1c3c4d535c04dc..be0e34ba579bba8934e2ca796ed77af07014399c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -51,7 +51,6 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * ContactId - contact id of contact whose activies are displayed
    *
    * @var int
-   * @access protected
    */
   protected $_contactId;
 
@@ -66,8 +65,10 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
   /**
    * Class constructor
    *
-   * @param int $contactId - contact whose activities we want to display
-   * @param int $permission - the permission we have for this contact
+   * @param int $contactId
+   *   Contact whose activities we want to display.
+   * @param int $permission
+   *   The permission we have for this contact.
    *
    * @param bool $admin
    * @param string $context
@@ -76,11 +77,12 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * @return \CRM_Activity_Selector_Activity
   @access public
    */
-  function __construct($contactId,
-                       $permission,
-                       $admin           = FALSE,
-                       $context         = 'activity',
-                       $activityTypeIDs = NULL) {
+  function __construct(
+    $contactId,
+    $permission,
+    $admin = FALSE,
+    $context = 'activity',
+    $activityTypeIDs = NULL) {
     $this->_contactId = $contactId;
     $this->_permission = $permission;
     $this->_admin = $admin;
@@ -107,14 +109,14 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * @param null $compContext
    *
    * @return array
-   * @access public
    */
-  public static function actionLinks($activityTypeId,
-                                     $sourceRecordId      = NULL,
-                                     $accessMailingReport = FALSE,
-                                     $activityId          = NULL,
-                                     $key                 = NULL,
-                                     $compContext         = NULL) {
+  public static function actionLinks(
+    $activityTypeId,
+    $sourceRecordId = NULL,
+    $accessMailingReport = FALSE,
+    $activityId = NULL,
+    $key = NULL,
+    $compContext = NULL) {
     static $activityActTypes = NULL;
     //CRM-14277 added addtitional param to handle activity search
     $extraParams = "&searchContext=activity";
@@ -214,7 +216,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
     $actionLinks = array();
 
     if ($showView) {
-      $actionLinks += array(CRM_Core_Action::VIEW => array('name' => ts('View'),
+      $actionLinks += array(CRM_Core_Action::
+      VIEW => array(
+      'name' => ts('View'),
         'url' => $url,
         'qs' => $qsView,
         'title' => ts('View Activity'),
@@ -229,8 +233,10 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       elseif ($activityTypeName == 'Print PDF Letter') {
         $updateUrl = 'civicrm/activity/pdf/add';
       }
-      if ( CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE) ) {
-        $actionLinks += array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'),
+      if (CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::UPDATE)) {
+        $actionLinks += array(CRM_Core_Action::
+        UPDATE => array(
+        'name' => ts('Edit'),
           'url' => $updateUrl,
           'qs' => $qsUpdate,
           'title' => ts('Update Activity'),
@@ -242,7 +248,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       $activityTypeName &&
       CRM_Case_BAO_Case::checkPermission($activityId, 'File On Case', $activityTypeId)
     ) {
-      $actionLinks += array(CRM_Core_Action::ADD => array('name' => ts('File on Case'),
+      $actionLinks += array(CRM_Core_Action::
+      ADD => array(
+      'name' => ts('File on Case'),
         'url' => '#',
         'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"',
         'title' => ts('File on Case'),
@@ -253,7 +261,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
       if (!isset($delUrl) || !$delUrl) {
         $delUrl = $url;
       }
-      $actionLinks += array(CRM_Core_Action::DELETE => array('name' => ts('Delete'),
+      $actionLinks += array(CRM_Core_Action::
+      DELETE => array(
+      'name' => ts('Delete'),
         'url' => $delUrl,
         'qs' => $qsDelete,
         'title' => ts('Delete Activity'),
@@ -261,7 +271,9 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
     }
 
     if ($accessMailingReport) {
-      $actionLinks += array(CRM_Core_Action::BROWSE => array('name' => ts('Mailing Report'),
+      $actionLinks += array(CRM_Core_Action::
+      BROWSE => array(
+      'name' => ts('Mailing Report'),
         'url' => 'civicrm/mailing/report',
         'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector",
         'title' => ts('View Mailing Report'),
@@ -277,9 +289,8 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * @param $action
    * @param array $params
    *
-   * @access public
    */
-  function getPagerParams($action, &$params) {
+  public function getPagerParams($action, &$params) {
     $params['status']    = ts('Activities %%StatusMessage%%');
     $params['csvString'] = NULL;
     $params['rowCount']  = CRM_Utils_Pager::ROWCOUNT;
@@ -292,13 +303,15 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * Returns the column headers as an array of tuples:
    * (name, sortName (key to the sort array))
    *
-   * @param string $action the action being performed
-   * @param enum   $output what should the result set include (web/email/csv)
+   * @param string $action
+   *   The action being performed.
+   * @param enum $output
+   *   What should the result set include (web/email/csv).
    *
-   * @return array the column headers that need to be displayed
-   * @access public
+   * @return array
+   *   the column headers that need to be displayed
    */
-  function &getColumnHeaders($action = NULL, $output = NULL) {
+  public function &getColumnHeaders($action = NULL, $output = NULL) {
     if ($output == CRM_Core_Selector_Controller::EXPORT || $output == CRM_Core_Selector_Controller::SCREEN) {
       $csvHeaders = array(ts('Activity Type'), ts('Description'), ts('Activity Date'));
       foreach (self::_getColumnHeaders() as $column) {
@@ -316,14 +329,15 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
   /**
    * Returns total number of rows for the query.
    *
-   * @param string $action - action being performed
+   * @param string $action
+   *   Action being performed.
    *
    * @param null $case
    *
-   * @return int Total number of rows
-   * @access public
+   * @return int
+   *   Total number of rows
    */
-  function getTotalCount($action, $case = NULL) {
+  public function getTotalCount($action, $case = NULL) {
     $params = array(
       'contact_id' => $this->_contactId,
       'admin' => $this->_admin,
@@ -340,17 +354,23 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
   /**
    * Returns all the rows in the given offset and rowCount
    *
-   * @param enum $action the action being performed
-   * @param int $offset the row number to start from
-   * @param int $rowCount the number of rows to return
-   * @param string $sort the sql string that describes the sort order
-   * @param enum $output what should the result set include (web/email/csv)
+   * @param enum $action
+   *   The action being performed.
+   * @param int $offset
+   *   The row number to start from.
+   * @param int $rowCount
+   *   The number of rows to return.
+   * @param string $sort
+   *   The sql string that describes the sort order.
+   * @param enum $output
+   *   What should the result set include (web/email/csv).
    *
    * @param null $case
    *
-   * @return int   the total number of rows for this action
+   * @return int
+   *   the total number of rows for this action
    */
-  function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $case = NULL) {
+  public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $case = NULL) {
     $params = array(
       'contact_id' => $this->_contactId,
       'admin' => $this->_admin,
@@ -466,11 +486,13 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
   /**
    * Name of export file.
    *
-   * @param string $output type of output
+   * @param string $output
+   *   Type of output.
    *
-   * @return string name of the file
+   * @return string
+   *   name of the file
    */
-  function getExportFileName($output = 'csv') {
+  public function getExportFileName($output = 'csv') {
     return ts('CiviCRM Activity');
   }
 
@@ -478,21 +500,23 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
    * Get colunmn headers for search selector
    *
    *
-   * @return array $_columnHeaders
-   * @access private
+   * @return array
    */
   private static function &_getColumnHeaders() {
     if (!isset(self::$_columnHeaders)) {
       self::$_columnHeaders = array(
-        array('name' => ts('Type'),
+        array(
+      'name' => ts('Type'),
           'sort' => 'activity_type',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
-        array('name' => ts('Subject'),
+        array(
+      'name' => ts('Subject'),
           'sort' => 'subject',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
-        array('name' => ts('Added By'),
+        array(
+      'name' => ts('Added By'),
           'sort' => 'source_contact_name',
           'direction' => CRM_Utils_Sort::DONTCARE,
         ),
@@ -515,4 +539,3 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
     return self::$_columnHeaders;
   }
 }
-