{* +--------------------------------------------------------------------+ | CiviCRM version 4.4 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2013 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | | CiviCRM is free software; you can copy, modify, and distribute it | | under the terms of the GNU Affero General Public License | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | | | CiviCRM is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | See the GNU Affero General Public License for more details. | | | | You should have received a copy of the GNU Affero General Public | | License and the CiviCRM Licensing Exception along | | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *}
{if $action eq 4}{* when action is view *} {if $notes}

{ts}View Note{/ts}

{if $currentAttachmentInfo} {include file="CRM/Form/attachment.tpl"} {/if}
{ts}Subject{/ts}{$note.subject}
{ts}Date:{/ts}{$note.modified_date|crmDate}
{ts}Privacy:{/ts}{$note.privacy}
{$note.note|nl2br}
{if $comments}
{ts}Comments{/ts} {foreach from=$comments item=comment} {/foreach}
{ts}Comment{/ts}{ts}Created By{/ts}{ts}Date{/ts}
{$comment.note}{$comment.createdBy}{$comment.modified_date}
{/if}
{/if} {elseif $action eq 1 or $action eq 2} {* action is add or update *}

{if $parentId} {if $action eq 1}{ts}New Comment{/ts}{else}{ts}Edit Comment{/ts}{/if} {else} {if $action eq 1}{ts}New Note{/ts}{else}{ts}Edit Note{/ts}{/if} {/if}

{include file="CRM/common/formButtons.tpl" location="top"}
{$form.subject.label} {$form.subject.html}
{$form.privacy.label} {$form.privacy.html}
{$form.note.label} {$form.note.html}
{include file="CRM/Form/attachment.tpl"}
{include file="CRM/common/formButtons.tpl" location="bottom"}
{* include jscript to warn if unsaved form field changes *} {include file="CRM/common/formNavigate.tpl"} {/if} {if ($action eq 8)}
{ts}Delete Note{/ts}
{ts 1=$notes.$id.note}Are you sure you want to delete the note '%1'?{/ts}
{include file="CRM/common/formButtons.tpl"}
{/if} {if $permission EQ 'edit' AND ($action eq 16 or $action eq 4 or $action eq 8)}
{/if}
{if $notes}
{* show browse table for any action *}
{strip} {include file="CRM/common/jsortable.tpl"} {foreach from=$notes item=note} {/foreach}
{ts}Note{/ts} {ts}Subject{/ts} {ts}Date{/ts} {ts}Created By{/ts}
{if $note.comment_count} {else} {/if} {$note.note|mb_truncate:80:"...":false|nl2br} {* Include '(more)' link to view entire note if it has been truncated *} {assign var="noteSize" value=$note.note|count_characters:true} {if $noteSize GT 80} {ts}(more){/ts} {/if} {$note.subject} {$note.modified_date|crmDate} {$note.createdBy} {$note.action|replace:'xx':$note.id}
{/strip}
{elseif ! ($action eq 1)}
{capture assign=crmURL}{crmURL p='civicrm/contact/view/note' q="cid=`$contactId`&action=add"}{/capture} {ts 1=$crmURL}There are no Notes for this contact. You can add one.{/ts}
{/if}