Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-05-11-07-08
[civicrm-core.git] / templates / CRM / common / CMSUser.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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 $showCMS }{*true if is_cms_user field is set *}
27 <fieldset class="crm-group crm_user-group">
28 <div class="messages help cms_user_help-section">
29 {if !$isCMS}
30 {ts}If you would like to create an account on this site, check the box below and enter a Username{/ts}{if $form.cms_pass} {ts}and a password{/ts}.{/if}
31 {else}
32 {ts}Please enter a Username to create an account.{/ts}
33 {/if}
34 {ts 1=$loginURL}If you already have an account <a href='%1'>please login</a> before completing this form.{/ts}
35 </div>
36 <div>{$form.cms_create_account.html} {$form.cms_create_account.label}</div>
37 <div id="details" class="crm_user_signup-section">
38
39 <div class="form-layout-compressed">
40 <div class="crm-section cms_name-section">
41 <div class="label">
42 <label for="cms_name">{$form.cms_name.label}</label>
43 </div>
44 <div class="content">
45 {$form.cms_name.html} <a id="checkavailability" href="#" onClick="return false;">{ts}<strong>Check Availability</strong>{/ts}</a>
46 <span id="msgbox" style="display:none"></span><br />
47 <span class="description">{ts}Punctuation is not allowed in a Username with the exception of periods, hyphens and underscores.{/ts}</span>
48 </div>
49 </div>
50
51 {if $form.cms_pass}
52 <div class="crm-section cms_pass-section">
53 <div class="label">
54 <label for="cms_pass">{$form.cms_pass.label}</label>
55 </div>
56 <div class="content">
57 {$form.cms_pass.html}
58 </div>
59 <div class="label">
60 <label for="crm_confirm_pass-section">{$form.cms_confirm_pass.label}</label>
61 </div>
62 <div class="content">
63 {$form.cms_confirm_pass.html}<br/>
64 <span class="description">{ts}Provide a password for the new account in both fields.{/ts}</span>
65 </div>
66 </div>
67 {/if}
68 </div>
69
70 </div>
71 </fieldset>
72
73 {literal}
74 <script type="text/javascript">
75 {/literal}
76 {if !$isCMS}
77 {literal}
78 if ( document.getElementsByName("cms_create_account")[0].checked ) {
79 cj('#details').show();
80 } else {
81 cj('#details').hide();
82 }
83 {/literal}
84 {/if}
85 {literal}
86 function showMessage( frm )
87 {
88 var cId = {/literal}'{$cId}'{literal};
89 if ( cId ) {
90 alert('{/literal}{ts escape="js"}You are logged-in user{/ts}{literal}');
91 frm.checked = false;
92 } else {
93 var siteName = {/literal}'{$config->userFrameworkBaseURL}'{literal};
94 alert('{/literal}{ts escape="js"}Please login if you have an account on this site with the link{/ts}{literal} ' + siteName );
95 }
96 }
97 {/literal}
98 {include file="CRM/common/checkUsernameAvailable.tpl"}
99 {literal}
100 </script>
101 {/literal}
102 {if !$isCMS}
103 {include file="CRM/common/showHideByFieldValue.tpl"
104 trigger_field_id ="cms_create_account"
105 trigger_value =""
106 target_element_id ="details"
107 target_element_type ="block"
108 field_type ="radio"
109 invert = 0
110 }
111 {/if}
112 {/if}