<?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 {
* The action links for notes that we need to display for the browse screen
*
* @var array
- * @static
*/
static $_links = NULL;
* 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();
}
/**
- * 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');
$mask = CRM_Core_Action::mask($permissions);
$values = array();
- $links = self::links();
+ $links = self::links();
$action = array_sum(array_keys($links)) & $mask;
$note->find();
}
/**
- * 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);
$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);
}
}
/**
- * 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();
}
/**
- * 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)) {
}
/**
- * 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)) {
}
return self::$_commentLinks;
}
+
}