Merge pull request #5499 from colemanw/CRM-16155
[civicrm-core.git] / templates / CRM / Profile / Page / MultipleRecordFieldsListing.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
39de6fd5 3 | CiviCRM version 4.6 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26{if $showListing}
e41f4660
PJ
27 {if $dontShowTitle neq 1}<h1>{ts}{$customGroupTitle}{/ts}</h1>{/if}
28 {if $pageViewType eq 'customDataView'}
29 {assign var='dialogId' value='custom-record-dialog'}
30 {else}
31 {assign var='dialogId' value='profile-dialog'}
32 {/if}
f8c36033 33 {if $records and $headers}
6a488035 34 {include file="CRM/common/jsortable.tpl"}
4411002f 35 <div id="custom-{$customGroupId}-table-wrapper" {if $pageViewType eq 'customDataView'}class="crm-entity" data-entity="contact" data-id="{$contactId}"{/if}>
f8c36033 36 <div>
6a488035
TO
37 {strip}
38 <table id="records" class="display">
f8c36033 39 <thead>
7253f198 40 <tr>
f8c36033
KJ
41 {foreach from=$headers key=recId item=head}
42 <th>{ts}{$head}{/ts}</th>
7253f198 43 {/foreach}
f8c36033 44 <th></th>
b05a0fb6
PJ
45 {foreach from=$dateFields key=fieldId item=v}
46 <th class='hiddenElement'></th>
47 {/foreach}
7253f198 48 </tr>
f8c36033
KJ
49 </thead>
50 {foreach from=$records key=recId item=rows}
51 <tr class="{cycle values="odd-row,even-row"}">
52 {foreach from=$headers key=hrecId item=head}
b05a0fb6 53 {if $dateFieldsVals.$hrecId.$recId}
4411002f 54 <td {crmAttributes a=$attributes.$hrecId.$recId}>{$rows.$hrecId|crmDate:"%b %d, %Y %l:%M %P"}</td>
b05a0fb6 55 {else}
4411002f 56 <td {crmAttributes a=$attributes.$hrecId.$recId}>{$rows.$hrecId}</td>
b05a0fb6 57 {/if}
f8c36033
KJ
58 {/foreach}
59 <td>{$rows.action}</td>
b05a0fb6 60 {foreach from=$dateFieldsVals key=fid item=rec}
b05a0fb6 61 <td class='crm-field-{$fid}_date hiddenElement'>{$rec.$recId}</td>
b05a0fb6 62 {/foreach}
f8c36033 63 </tr>
6a488035 64 {/foreach}
6a488035
TO
65 </table>
66 {/strip}
6a488035 67 </div>
f8c36033 68 </div>
e41f4660 69 <div id='{$dialogId}' class="hiddenElement"></div>
f8c36033
KJ
70 {elseif !$records}
71 <div class="messages status no-popup">
72 <div class="icon inform-icon"></div>
73 &nbsp;
e5e3f1ad 74 {ts 1=$customGroupTitle}No records of type '%1' found.{/ts}
f8c36033 75 </div>
e41f4660 76 <div id='{$dialogId}' class="hiddenElement"></div>
f8c36033 77 {/if}
6a488035 78
f8c36033 79 {if !$reachedMax}
e41f4660 80 {if $pageViewType eq 'customDataView'}
ebf2b57b 81 <br/><a accesskey="N" title="{ts 1=$customGroupTitle}Add %1 Record{/ts}" href="{crmURL p='civicrm/contact/view/cd/edit' q="reset=1&type=$ctype&groupID=$customGroupId&entityID=$contactId&cgcount=$cgcount&multiRecordDisplay=single&mode=add"}"
52604b19 82 class="button action-item"><span><div class="icon ui-icon-circle-plus"></div>{ts 1=$customGroupTitle}Add %1 Record{/ts}</span></a>
e41f4660 83 {else}
bd470b69 84 <a accesskey="N" href="{crmURL p='civicrm/profile/edit' q="reset=1&id=`$contactId`&multiRecord=add&gid=`$gid`&context=multiProfileDialog&onPopupClose=`$onPopupClose`"}"
52604b19 85 class="button action-item"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add New Record{/ts}</span></a>
e41f4660 86 {/if}
f8c36033 87 {/if}
3cc60a06 88{/if}