Merge pull request #12669 from eileenmcnaughton/dedupe_zero
[civicrm-core.git] / templates / CRM / Admin / Page / OptionGroup.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
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 {* Admin page for browsing Option Group *}
27 {if $action eq 1 or $action eq 2 or $action eq 8}
28 {include file="CRM/Admin/Form/OptionGroup.tpl"}
29 {else}
30 <div class="help">
31 {ts}CiviCRM stores configurable choices for various drop-down fields as 'option groups'. You can click <strong>Options</strong> to view the available choices.{/ts}
32 <p><i class="crm-i fa-exclamation-triangle"></i> {ts}WARNING: Many option groups are used programatically and values should be added or modified with caution.{/ts}</p>
33 </div>
34 {/if}
35
36 {if $rows}
37
38 <div id="browseValues">
39 {if $action ne 1 and $action ne 2}
40 <div class="action-link">
41 {crmButton q="action=add&reset=1" id="newOptionGroup" icon="plus-circle"}{ts}Add Option Group{/ts}{/crmButton}
42 {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
43 </div>
44 {/if}
45
46 {strip}
47 {* handle enable/disable actions*}
48 {include file="CRM/common/enableDisableApi.tpl"}
49 <table cellpadding="0" cellspacing="0" border="0">
50 <tr class="columnheader">
51 <th>{ts}Title{/ts}</th>
52 <th>{ts}Name{/ts}</th>
53 <th>{ts}Reserved{/ts}</th>
54 <th>{ts}Enabled?{/ts}</th>
55 <th></th>
56 </tr>
57 {foreach from=$rows item=row}
58 <tr id="optionGroup-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
59 <td class="crm-admin-optionGroup-title">{if $row.title}{$row.title}{else}( {ts}none{/ts} ){/if}</td>
60 <td class="crm-admin-optionGroup-name">{$row.name}</td>
61 <td class="crm-admin-optionGroup-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
62 <td class="crm-admin-optionGroup-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
63 <td>
64 <a href="{crmURL p="civicrm/admin/options" q="id=`$row.id`&action=update&reset=1"}" class="action-item crm-hover-button" title="{ts}OptionGroup settings{/ts}">{ts}Settings{/ts}</a>
65 <a href="{crmURL p="civicrm/admin/options" q="gid=`$row.id`&reset=1"}" class="action-item crm-hover-button" title="{ts}View and Edit Options{/ts}">{ts}Edit Options{/ts}</a>
66 </td>
67 </tr>
68 {/foreach}
69 </table>
70 {/strip}
71
72 {if $action ne 1 and $action ne 2}
73 <div class="action-link">
74 {crmButton q="action=add&reset=1" id="newOptionGroup" icon="plus-circle"}{ts}Add Option Group{/ts}{/crmButton}
75 {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
76 </div>
77 {/if}
78 </div>
79 {elseif $action ne 1 and $action ne 2}
80 <div class="messages status no-popup">
81 <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
82 {capture assign=crmURL}{crmURL p='civicrm/admin/optionGroup' q="action=add&reset=1"}{/capture}
83 {ts 1=$crmURL}There are no Option Groups entered. You can <a href='%1'>add one</a>.{/ts}
84 </div>
85 {/if}