| 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 $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8 or $action eq 64 or $action eq 16384} |
| 27 | {* Add or edit Profile Group form *} |
| 28 | {include file="CRM/UF/Form/Group.tpl"} |
| 29 | {elseif $action eq 1024} |
| 30 | {* Preview Profile Group form *} |
| 31 | {include file="CRM/UF/Form/Preview.tpl"} |
| 32 | {elseif $action eq 8192} |
| 33 | {* Display HTML Form Snippet Code *} |
| 34 | <div id="help"> |
| 35 | {ts}The HTML code below will display a form consisting of the active fields in this Profile. You can copy this HTML code and paste it into any block or page on ANY website where you want to collect contact information.{/ts} {help id='standalone'} |
| 36 | </div> |
| 37 | <br /> |
| 38 | <form name="html_code" action="{crmURL p='civicrm/admin/uf/group' q="action=profile&gid=$gid"}"> |
| 39 | <div id="standalone-form"> |
| 40 | <textarea rows="20" cols="80" name="profile" id="profile">{$profile}</textarea> |
| 41 | <div class="spacer"></div> |
| 42 | <a href="#" onclick="html_code.profile.select(); return false;" class="button"><span>Select HTML Code</span></a> |
| 43 | </div> |
| 44 | <div class="action-link"> |
| 45 | <a href="{crmURL p='civicrm/admin/uf/group' q="reset=1"}">» {ts}Back to Profile Listings{/ts}</a> |
| 46 | </div> |
| 47 | </form> |
| 48 | |
| 49 | {else} |
| 50 | <div id="help"> |
| 51 | {ts}CiviCRM Profile(s) allow you to aggregate groups of fields and include them in your site as input forms, contact display pages, and search and listings features. They provide a powerful set of tools for you to collect information from constituents and selectively share contact information.{/ts} {help id='profile_overview'} |
| 52 | </div> |
| 53 | |
| 54 | {if NOT ($action eq 1 or $action eq 2)} |
| 55 | <div class="crm-submit-buttons"> |
| 56 | <a href="{crmURL p='civicrm/admin/uf/group/add' q="action=add&reset=1"}" id="newCiviCRMProfile-top" class="button"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add Profile{/ts}</span></a> |
| 57 | </div> |
| 58 | {/if} |
| 59 | {if $rows} |
| 60 | <div id='mainTabContainer'> |
| 61 | <ul> |
| 62 | <li id='tab_user'> <a href='#user-profiles' title='{ts}User-defined Profile{/ts}'>{ts}User-defined Profiles{/ts}</a></li> |
| 63 | <li id='tab_reserved'><a href='#reserved-profiles' title='{ts}Reserved Profiles{/ts}'>{ts}Reserved Profiles{/ts}</a></li> |
| 64 | </ul> |
| 65 | |
| 66 | {* handle enable/disable actions*} |
| 67 | {include file="CRM/common/enableDisableApi.tpl"} |
| 68 | {include file="CRM/common/jsortable.tpl"} |
| 69 | <div id="user-profiles"> |
| 70 | <div class="crm-content-block"> |
| 71 | <table class="display"> |
| 72 | <thead> |
| 73 | <tr> |
| 74 | <th id="sortable">{ts}Profile Title{/ts}</th> |
| 75 | <th>{ts}Created By{/ts}</th> |
| 76 | <th>{ts}Description{/ts}</th> |
| 77 | <th>{ts}Type{/ts}</th> |
| 78 | <th>{ts}ID{/ts}</th> |
| 79 | <th id="nosort">{ts}Used For{/ts}</th> |
| 80 | <th></th> |
| 81 | </tr> |
| 82 | </thead> |
| 83 | <tbody> |
| 84 | {foreach from=$rows item=row} |
| 85 | {if !$row.is_reserved } |
| 86 | <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}"> |
| 87 | <td class="crmf-title crm-editable">{$row.title}</td> |
| 88 | <td> |
| 89 | {if $row.created_id && $row.created_by} |
| 90 | <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a> |
| 91 | {/if} |
| 92 | </td> |
| 93 | <td class="crmf-description crm-editable" data-type="textarea">{$row.description}</td> |
| 94 | <td>{$row.group_type}</td> |
| 95 | <td>{$row.id}</td> |
| 96 | <td>{$row.module}</td> |
| 97 | <td>{$row.action|replace:'xx':$row.id}</td> |
| 98 | </tr> |
| 99 | {/if} |
| 100 | {/foreach} |
| 101 | </tbody> |
| 102 | </table> |
| 103 | |
| 104 | {if NOT ($action eq 1 or $action eq 2)} |
| 105 | <div class="crm-submit-buttons"> |
| 106 | <a href="{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}" id="newCiviCRMProfile-bottom" class="button"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add Profile{/ts}</span></a> |
| 107 | </div> |
| 108 | {/if} |
| 109 | </div> |
| 110 | </div>{* user profile*} |
| 111 | |
| 112 | <div id="reserved-profiles"> |
| 113 | <div class="crm-content-block"> |
| 114 | <table class="display"> |
| 115 | <thead> |
| 116 | <tr> |
| 117 | <th id="sortable">{ts}Profile Title{/ts}</th> |
| 118 | <th>{ts}Created By{/ts}</th> |
| 119 | <th>{ts}Description{/ts}</th> |
| 120 | <th>{ts}Type{/ts}</th> |
| 121 | <th>{ts}ID{/ts}</th> |
| 122 | <th id="nosort">{ts}Used For{/ts}</th> |
| 123 | <th></th> |
| 124 | </tr> |
| 125 | </thead> |
| 126 | <tbody> |
| 127 | {foreach from=$rows item=row} |
| 128 | {if $row.is_reserved} |
| 129 | <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}"> |
| 130 | <td>{$row.title}</td> |
| 131 | <td> |
| 132 | {if $row.created_id && $row.created_by} |
| 133 | <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a> |
| 134 | {/if} |
| 135 | </td> |
| 136 | <td>{$row.description}</td> |
| 137 | <td>{$row.group_type}</td> |
| 138 | <td>{$row.id}</td> |
| 139 | <td>{$row.module}</td> |
| 140 | <td>{$row.action|replace:'xx':$row.id}</td> |
| 141 | </tr> |
| 142 | {/if} |
| 143 | {/foreach} |
| 144 | </tbody> |
| 145 | </table> |
| 146 | |
| 147 | {if NOT ($action eq 1 or $action eq 2)} |
| 148 | <div class="crm-submit-buttons"> |
| 149 | <a href="{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}" id="newCiviCRMProfile-bottom" class="button"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add Profile{/ts}</span></a> |
| 150 | </div> |
| 151 | {/if} |
| 152 | </div> |
| 153 | </div>{* reserved profile*} |
| 154 | |
| 155 | </div> {* maincontainer*} |
| 156 | <script type='text/javascript'> |
| 157 | CRM.$(function($) {ldelim} |
| 158 | var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}'; |
| 159 | var tabIndex = $('#tab_' + selectedTab).prevAll().length; |
| 160 | {literal} |
| 161 | $("#mainTabContainer").tabs( {active: tabIndex} ); |
| 162 | }); |
| 163 | {/literal} |
| 164 | </script> |
| 165 | |
| 166 | {else} |
| 167 | {if $action ne 1} {* When we are adding an item, we should not display this message *} |
| 168 | <div class="messages status no-popup"> |
| 169 | <div class="icon inform-icon"></div> |
| 170 | {capture assign=crmURL}{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}{/capture}{ts 1=$crmURL}No CiviCRM Profiles have been created yet. You can <a href='%1'>add one now</a>.{/ts} |
| 171 | </div> |
| 172 | {/if} |
| 173 | {/if} |
| 174 | {/if} |