CRM-16643 - Revert to setvalue for inline editing of the entities whose APIs do not...
[civicrm-core.git] / templates / CRM / UF / Page / Field.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="circle-plus"}{ts}Add Field{/ts}{/crmButton}{if !$isGroupReserved}{crmButton p="civicrm/admin/uf/group/update" q="action=update&id=`$gid`&reset=1&context=field" icon="pencil"}{ts}Edit Settings{/ts}{/crmButton}{/if}{crmButton p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field" icon="zoomin"}{ts}Preview (all fields){/ts}{/crmButton}{if !$skipCreate }{crmButton p="civicrm/profile/create" q="gid=$gid&reset=1" icon="play"}{ts}Use (create mode){/ts}{/crmButton}{/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 <table id="options" class="row-highlight">
48 <thead>
49 <tr>
50 <th>{ts}Field Name{/ts}</th>
51 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
52 <th>{ts}Visibility{/ts}</th>
53 <th>{ts}Searchable?{/ts}</th>
54 <th>{ts}In Selector?{/ts}</th>
55 {/if}
56 <th>{ts}Order{/ts}</th>
57 <th>{ts}Required{/ts}</th>
58 <th>{ts}View Only{/ts}</th>
59 <th>{ts}Reserved{/ts}</th>
60 <th></th>
61 </tr>
62 </thead>
63 {foreach from=$ufField item=row}
64 <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}">
65 <td><span class="crmf-label crm-editable">{$row.label}</span>({$row.field_type})</td>
66 {if in_array("Profile",$otherModules) or in_array("Search Profile",$otherModules) }
67 <td class="crm-editable crmf-visibility" data-type="select">{$row.visibility_display}</td>
68 <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>
69 <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>
70 {/if}
71 <td class="nowrap">{$row.weight}</td>
72 <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>
73 <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>
74 <td>{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
75 <td>{$row.action|replace:'xx':$row.id}</td>
76 </tr>
77 {/foreach}
78 </table>
79 {/strip}
80 {if not ($action eq 2 or $action eq 1)}
81 <div class="action-link">
82 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="circle-plus"}{ts}Add Field{/ts}{/crmButton}{if !$isGroupReserved}{crmButton p="civicrm/admin/uf/group" q="action=update&id=`$gid`&reset=1&context=field" icon="pencil"}{ts}Edit Settings{/ts}{/crmButton}{/if}{crmButton p="civicrm/admin/uf/group" q="action=preview&id=`$gid`&reset=1&field=0&context=field" icon="zoomin"}{ts}Preview (all fields){/ts}{/crmButton}{if !$skipCreate }{crmButton p="civicrm/profile/create" q="gid=$gid&reset=1" icon="play"}{ts}Use (create mode){/ts}{/crmButton}{/if}
83 <div class="clear"></div>
84 </div>
85 {/if}
86
87 </div>
88 {else}
89 {if $action eq 16}
90 {capture assign=crmURL}{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}{/capture}
91 <div class="messages status no-popup crm-empty-table">
92 <div class="icon inform-icon"></div>
93 {ts}None found.{/ts}
94 </div>
95 <div class="action-link">
96 {crmButton p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid" icon="circle-plus"}{ts}Add Field{/ts}{/crmButton}
97 </div>
98 {/if}
99 {/if}
100 </div>
101 {/if}