<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
}
$note->copyValues($params);
- if (!CRM_Utils_Array::value('contact_id', $params)) {
+ if (empty($params['contact_id'])) {
if ($params['entity_table'] == 'civicrm_contact') {
$note->contact_id = $params['entity_id'];
}
* Given the list of params in the params array, fetch the object
* and store the values in the values array
*
- * @param array $params input parameters to find object
- * @param array $values output values of the object
- * @param array $ids the array that holds all the db ids
- * @param int $numNotes the maximum number of notes to return (0 if all)
+ * @param array $params input parameters to find object
+ * @param array $values output values of the object
+ * @param int $numNotes the maximum number of notes to return (0 if all)
*
+ * @internal param array $ids the array that holds all the db ids
* @return object $notes Object of CRM_Core_BAO_Note
* @access public
* @static
/**
* Function to delete the notes
*
- * @param int $id note id
+ * @param int $id note id
* @param boolean $showStatus do we need to set status or not
*
- * @return $return no of deleted notes on success, false otherwise
- *
- * @access public
+ * @return mixed|null $return no of deleted notes on success, false otherwise@access public
* @static
*/
static function del($id, $showStatus = TRUE) {
/**
* retrieve all records for this entity-id
*
- * @param int $id ID of the relationship for which records needs to be retrieved.
+ * @param int $id ID of the relationship for which records needs to be retrieved.
+ *
+ * @param string $entityTable
*
* @return array $viewNote array of note properties
*
/**
* Function to get log record count for a Contact
*
- * @param int $contactId Contact ID
+ * @param $contactID
+ *
+ * @internal param int $contactId Contact ID
*
* @return int $count count of log records
*
$tree[$note->id]['createdById'] = $createdById;
$tree[$note->id]['modified_date'] = CRM_Utils_Date::customFormat($tree[$note->id]['modified_date']);
+ // paper icon view for attachments part
+ $paperIconAttachmentInfo = CRM_Core_BAO_File::paperIconAttachment('civicrm_note', $note->id);
+ $tree[$note->id]['attachment'] = implode('', $paperIconAttachmentInfo);
+
if ($snippet) {
$tree[$note->id]['note'] = nl2br($tree[$note->id]['note']);
$tree[$note->id]['note'] = smarty_modifier_mb_truncate(
* function to delete all note related to contact when contact is deleted
*
* @param int $contactID contact id whose notes to be deleted
- * @param array $deleteNoteID to store all deleted note ids
+ *
+ * @internal param array $deleteNoteID to store all deleted note ids
*
* @return void
* @static