Merge pull request #15808 from civicrm/5.20
[civicrm-core.git] / templates / CRM / UF / Page / Field.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2020 |
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
27 {if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8 }
28 {include file="CRM/UF/Form/Field.tpl"}
29 {elseif $action eq 1024 }
30 {include file="CRM/UF/Form/Preview.tpl"}
31 {else}
32 <div class="crm-content-block">
33 {if $ufField}
34 <div id="field_page">
35 {if not ($action eq 2 or $action eq 1)}
36 <div class="action-link">
37 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="plus-circle"}{ts}Add Field{/ts}{/crmButton}{if !$isGroupReserved}{crmButton p="civicrm/admin/uf/group/update" q="action=update&id=`$gid`&reset=1&context=field" icon="wrench"}{ts}Edit Settings{/ts}{/crmButton}{/if}{crmButton p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}{if !$skipCreate }{crmButton p="civicrm/profile/create" q="gid=$gid&reset=1" icon="play-circle"}{ts}Use (create mode){/ts}{/crmButton}{/if}
38 <div class="clear"></div>
39 </div>
40 {/if}
41 {strip}
42 {* handle enable/disable actions*}
43 {include file="CRM/common/enableDisableApi.tpl"}
44 <table id="options" class="row-highlight">
45 <thead>
46 <tr>
47 <th>{ts}Field Name{/ts}</th>
48 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
49 <th>{ts}Visibility{/ts}</th>
50 <th>{ts}Searchable?{/ts}</th>
51 <th>{ts}Results Column?{/ts}</th>
52 {/if}
53 <th>{ts}Order{/ts}</th>
54 <th>{ts}Required{/ts}</th>
55 <th>{ts}View Only{/ts}</th>
56 <th>{ts}Reserved{/ts}</th>
57 <th></th>
58 </tr>
59 </thead>
60 {foreach from=$ufField item=row}
61 <tr id="UFField-{$row.id}" data-action="setvalue" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
62 <td><span class="crmf-label crm-editable">{$row.label}</span>({$row.field_type})</td>
63 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
64 <td class="crm-editable crmf-visibility" data-type="select">{$row.visibility_display}</td>
65 <td class="crm-editable crmf-is_searchable" data-type="boolean">{if $row.is_searchable eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
66 <td class="crm-editable crmf-in_selector" data-type="boolean">{if $row.in_selector eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
67 {/if}
68 <td class="nowrap">{$row.weight}</td>
69 <td class="crm-editable crmf-is_required" data-type="boolean">{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
70 <td class="crm-editable crmf-is_view" data-type="boolean">{if $row.is_view eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
71 <td>{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
72 <td>{$row.action|replace:'xx':$row.id}</td>
73 </tr>
74 {/foreach}
75 </table>
76 {/strip}
77 {if not ($action eq 2 or $action eq 1)}
78 <div class="action-link">
79 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="plus-circle"}{ts}Add Field{/ts}{/crmButton}{if !$isGroupReserved}{crmButton p="civicrm/admin/uf/group" q="action=update&id=`$gid`&reset=1&context=field" icon="wrench"}{ts}Edit Settings{/ts}{/crmButton}{/if}{crmButton p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}{if !$skipCreate }{crmButton p="civicrm/profile/create" q="gid=$gid&reset=1" icon="play-circle"}{ts}Use (create mode){/ts}{/crmButton}{/if}
80 <div class="clear"></div>
81 </div>
82 {/if}
83
84 </div>
85 {else}
86 {if $action eq 16}
87 {capture assign=crmURL}{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}{/capture}
88 <div class="messages status no-popup crm-empty-table">
89 <div class="icon inform-icon"></div>
90 {ts}None found.{/ts}
91 </div>
92 <div class="action-link">
93 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="plus-circle"}{ts}Add Field{/ts}{/crmButton}
94 </div>
95 {/if}
96 {/if}
97 </div>
98 {/if}