Merge pull request #3063 from eileenmcnaughton/rebase
[civicrm-core.git] / templates / CRM / UF / Page / Field.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 $showBestResult }
27 <span class="font-red">{ts}For best results, the Country field should precede the State-Province field in your Profile form. You can use the up and down arrows on field listing page for this profile to change the order of these fields or manually edit weight for Country/State-Province Field.{/ts}</span>
28 {/if}
29
30 {if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8 }
31 {include file="CRM/UF/Form/Field.tpl"}
32 {elseif $action eq 1024 }
33 {include file="CRM/UF/Form/Preview.tpl"}
34 {else}
35 <div class="crm-content-block">
36 {if $ufField}
37 <div id="field_page">
38 {if not ($action eq 2 or $action eq 1)}
39 <div class="action-link">
40 <a href="{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Field{/ts}</span></a>{if !$isGroupReserved}<a href="{crmURL p="civicrm/admin/uf/group/update" q="action=update&id=`$gid`&reset=1&context=field"}" class="button"><span><div class="icon edit-icon"></div>{ts}Edit Settings{/ts}</span></a>{/if}<a href="{crmURL p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>{if !$skipCreate }<a href="{crmURL p="civicrm/profile/create" q="gid=$gid&reset=1"}" class="button"><span><div class="icon play-icon"></div>{ts}Use (create mode){/ts}</span></a>{/if}
41 <div class="clear"></div>
42 </div>
43 {/if}
44 {strip}
45 {* handle enable/disable actions*}
46 {include file="CRM/common/enableDisableApi.tpl"}
47 {include file="CRM/common/crmeditable.tpl"}
48 {include file="CRM/common/jsortable.tpl"}
49 <table id="options" class="display">
50 <thead>
51 <tr>
52 <th>{ts}Field Name{/ts}</th>
53 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
54 <th>{ts}Visibility{/ts}</th>
55 <th>{ts}Searchable?{/ts}</th>
56 <th>{ts}In Selector?{/ts}</th>
57 {/if}
58 <th id="order" class="sortable">{ts}Order{/ts}</th>
59 <th>{ts}Required{/ts}</th>
60 <th>{ts}View Only{/ts}</th>
61 <th>{ts}Reserved{/ts}</th>
62 <th></th>
63 <th class="hiddenElement"></th>
64 </tr>
65 </thead>
66 {foreach from=$ufField item=row}
67 <tr id="UFField-{$row.id}"class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
68 <td><span class="crmf-label crm-editable">{$row.label}</span>({$row.field_type})</td>
69 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
70 <td>{$row.visibility_display}</td>
71 <td class="crmf-is_searchable">{if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
72 <td class="crmf-in_selector">{if $row.in_selector eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
73 {/if}
74 <td class="nowrap">{$row.order}</td>
75 <td class="crmf-is_required">{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
76 <td>{if $row.is_view eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
77 <td>{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
78 <td>{$row.action|replace:'xx':$row.id}</td>
79 <td class="order hiddenElement">{$row.weight}</td>
80 </tr>
81 {/foreach}
82 </table>
83 {/strip}
84 {if not ($action eq 2 or $action eq 1)}
85 <div class="action-link">
86 <a href="{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Field{/ts}</span></a>{if !$isGroupReserved}<a href="{crmURL p="civicrm/admin/uf/group" q="action=update&id=`$gid`&reset=1&context=field"}" class="button"><span><div class="icon edit-icon"></div>{ts}Edit Settings{/ts}</span></a>{/if}<a href="{crmURL p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a>{if !$skipCreate }<a href="{crmURL p="civicrm/profile/create" q="gid=$gid&reset=1"}" class="button"><span><div class="icon play-icon"></div>{ts}Use (create mode){/ts}</span></a>{/if}
87 <div class="clear"></div>
88 </div>
89 {/if}
90
91 </div>
92 {else}
93 {if $action eq 16}
94 {capture assign=crmURL}{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}{/capture}
95 <div class="messages status no-popup">
96 <div class="icon inform-icon"></div>
97 {ts 1=$groupTitle 2=$crmURL}There are no CiviCRM Profile Fields for '%1', you can <a href='%2'>add one now</a>.{/ts}
98 </div>
99 {/if}
100 {/if}
101 </div>
102 {/if}