comment fixes
[civicrm-core.git] / CRM / Contact / Page / View / Note.php
index ff0ae35dd24247d1f9fdada8fd1cff3c2b1cafad..ffc3657c4bc754d4321dae7ca39f8f1ef73ecef1 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
  */
 
 /**
  * Main page for viewing Notes.
- *
  */
 class CRM_Contact_Page_View_Note extends CRM_Core_Page {
 
@@ -43,7 +40,6 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
    * The action links for notes that we need to display for the browse screen
    *
    * @var array
-   * @static
    */
   static $_links = NULL;
 
@@ -51,14 +47,11 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
    * The action links for comments that we need to display for the browse screen
    *
    * @var array
-   * @static
    */
   static $_commentLinks = NULL;
 
   /**
-   * View details of a note
-   *
-   * @return void
+   * View details of a note.
    */
   public function view() {
     $note = new CRM_Core_DAO_Note();
@@ -82,14 +75,12 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
   }
 
   /**
-   * This function is called when action is browse
-   *
-   * return null
+   * called when action is browse.
    */
   public function browse() {
-    $note               = new CRM_Core_DAO_Note();
+    $note = new CRM_Core_DAO_Note();
     $note->entity_table = 'civicrm_contact';
-    $note->entity_id    = $this->_contactId;
+    $note->entity_id = $this->_contactId;
 
     $note->orderBy('modified_date desc');
 
@@ -103,7 +94,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
     $mask = CRM_Core_Action::mask($permissions);
 
     $values = array();
-    $links  = self::links();
+    $links = self::links();
     $action = array_sum(array_keys($links)) & $mask;
 
     $note->find();
@@ -161,9 +152,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
   }
 
   /**
-   * This function is called when action is update or new
-   *
-   * return null
+   * called when action is update or new.
    */
   public function edit() {
     $controller = new CRM_Core_Controller_Simple('CRM_Note_Form_Note', ts('Contact Notes'), $this->_action);
@@ -177,8 +166,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
     $session->pushUserContext($url);
 
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean',
-        CRM_Core_DAO::$_nullObject
-      )) {
+      CRM_Core_DAO::$_nullObject
+    )
+    ) {
       CRM_Core_BAO_Note::del($this->_id);
       CRM_Utils_System::redirect($url);
     }
@@ -213,10 +203,10 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
   }
 
   /**
-   * This function is the main function that is called when the page loads,
+   * the main function that is called when the page loads,
    * it decides the which action has to be taken for the page.
    *
-   * return null
+   * @return null
    */
   public function run() {
     $this->preProcess();
@@ -237,19 +227,17 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
   }
 
   /**
-   * Delete the note object from the db
-   *
-   * @return void
+   * Delete the note object from the db.
    */
   public function delete() {
     CRM_Core_BAO_Note::del($this->_id);
   }
 
   /**
-   * Get action links
+   * Get action links.
    *
-   * @return array (reference) of action links
-   * @static
+   * @return array
+   *   (reference) of action links
    */
   public static function &links() {
     if (!(self::$_links)) {
@@ -286,10 +274,10 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
   }
 
   /**
-   * Get action links for comments
+   * Get action links for comments.
    *
-   * @return array (reference) of action links
-   * @static
+   * @return array
+   *   (reference) of action links
    */
   public static function &commentLinks() {
     if (!(self::$_commentLinks)) {
@@ -316,4 +304,5 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page {
     }
     return self::$_commentLinks;
   }
+
 }