Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {* Admin page for browsing Option Group *} | |
11 | {if $action eq 1 or $action eq 2 or $action eq 8} | |
12 | {include file="CRM/Admin/Form/OptionGroup.tpl"} | |
13 | {else} | |
f6eedce7 | 14 | <div class="help"> |
6a488035 | 15 | {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} |
bc8360e1 | 16 | <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> |
6a488035 TO |
17 | </div> |
18 | {/if} | |
19 | ||
20 | {if $rows} | |
21 | ||
22 | <div id="browseValues"> | |
3593e0f8 MW |
23 | {if $action ne 1 and $action ne 2} |
24 | <div class="action-link"> | |
25 | {crmButton q="action=add&reset=1" id="newOptionGroup" icon="plus-circle"}{ts}Add Option Group{/ts}{/crmButton} | |
26 | {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton} | |
27 | </div> | |
28 | {/if} | |
29 | ||
30 | {strip} | |
6a488035 | 31 | {* handle enable/disable actions*} |
4d17a233 | 32 | {include file="CRM/common/enableDisableApi.tpl"} |
6a488035 TO |
33 | <table cellpadding="0" cellspacing="0" border="0"> |
34 | <tr class="columnheader"> | |
3593e0f8 MW |
35 | <th>{ts}Title{/ts}</th> |
36 | <th>{ts}Name{/ts}</th> | |
37 | <th>{ts}Reserved{/ts}</th> | |
38 | <th>{ts}Enabled?{/ts}</th> | |
39 | <th></th> | |
6a488035 TO |
40 | </tr> |
41 | {foreach from=$rows item=row} | |
3593e0f8 MW |
42 | <tr id="optionGroup-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
43 | <td class="crm-admin-optionGroup-title">{if $row.title}{$row.title}{else}( {ts}none{/ts} ){/if}</td> | |
44 | <td class="crm-admin-optionGroup-name">{$row.name}</td> | |
45 | <td class="crm-admin-optionGroup-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> | |
46 | <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> | |
62fbdfc0 MW |
47 | <td> |
48 | <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> | |
49 | <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> | |
50 | </td> | |
6a488035 TO |
51 | </tr> |
52 | {/foreach} | |
53 | </table> | |
54 | {/strip} | |
55 | ||
56 | {if $action ne 1 and $action ne 2} | |
57 | <div class="action-link"> | |
80bc2820 AH |
58 | {crmButton q="action=add&reset=1" id="newOptionGroup" icon="plus-circle"}{ts}Add Option Group{/ts}{/crmButton} |
59 | {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton} | |
3593e0f8 | 60 | </div> |
6a488035 TO |
61 | {/if} |
62 | </div> | |
3593e0f8 | 63 | {elseif $action ne 1 and $action ne 2} |
6a488035 TO |
64 | <div class="messages status no-popup"> |
65 | <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/> | |
66 | {capture assign=crmURL}{crmURL p='civicrm/admin/optionGroup' q="action=add&reset=1"}{/capture} | |
67 | {ts 1=$crmURL}There are no Option Groups entered. You can <a href='%1'>add one</a>.{/ts} | |
68 | </div> | |
69 | {/if} |