{*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
{if $form.onbehalf.$phone_ext_field.html}
{$form.onbehalf.$phone_ext_field.html}
{/if}
+ {/if}
+ {if $onBehalfOfFields.$fieldName.data_type eq 'Date'}
+ {assign var=elementName value=onbehalf[$fieldName]}
+ {include file="CRM/common/jcalendar.tpl" elementName=$elementName elementId=onbehalf_$fieldName}
{/if}
{if $onBehalfOfFields.$fieldName.help_post}
<br /><span class='description'>{$onBehalfOfFields.$fieldName.help_post}</span>
showOnBehalf({/literal}"{$onBehalfRequired}"{literal});
cj( "#mode" ).hide( );
- cj( "#mode" ).attr( 'checked', 'checked' );
- if ( cj( "#mode" ).attr( 'checked' ) && !{/literal}"{$reset}"{literal} ) {
+ cj( "#mode" ).prop('checked', true );
+ if ( cj( "#mode" ).prop('checked' ) && !{/literal}"{$reset}"{literal} ) {
$text = ' {/literal}{ts escape="js"}Use existing organization{/ts}{literal} ';
cj( "#createNewOrg" ).text( $text );
- cj( "#mode" ).removeAttr( 'checked' );
+ cj( "#mode" ).prop('checked', false );
}
function showOnBehalf(onBehalfRequired) {
- if ( cj( "#is_for_organization" ).attr( 'checked' ) || onBehalfRequired ) {
+ if ( cj( "#is_for_organization" ).prop( 'checked' ) || onBehalfRequired ) {
var urlPath = {/literal}"{crmURL p=$urlPath h=0 q="snippet=4&onbehalf=1&id=$contributionPageID&qfKey=$qfKey"}";
{if $mode eq 'test'}
urlPath += '&action=preview';
}
function createNew( ) {
- if (cj("#mode").attr('checked')) {
+ if (cj("#mode").prop('checked')) {
var textMessage = ' {/literal}{ts escape="js"}Use existing organization{/ts}{literal} ';
cj("#onbehalf_organization_name").removeAttr('readonly');
+ cj("#mode").prop('checked', false);
cj("#mode").removeAttr('checked');
resetValues();
}
else {
var textMessage = ' {/literal}{ts escape="js"}Enter a new organization{/ts}{literal} ';
- cj("#mode").attr('checked', 'checked');
+ cj("#mode").prop('checked', true);
setOrgName( );
}
cj("#createNewOrg").text(textMessage);
for (var ele in data) {
if (data[ele].type == 'Radio') {
if (data[ele].value) {
- cj("input[name='"+ ele +"']").filter("[value=" + data[ele].value + "]").attr('checked', 'checked');
+ cj("input[name='"+ ele +"']").filter("[value=" + data[ele].value + "]").prop('checked', true);
}
}
else if (data[ele].type == 'CheckBox') {
if (data[ele].value) {
- cj("input[name='"+ ele +"']").attr('checked','checked');
+ cj("input[name='"+ ele +"']").prop('checked','checked');
}
}
else if (data[ele].type == 'Multi-Select') {
for (var selectedOption in data[ele].value) {
- cj('#' + ele + " option[value='" + selectedOption + "']").attr('selected', 'selected');
+ cj('#' + ele + " option[value='" + selectedOption + "']").prop('selected', true);
}
}
else if (data[ele].type == 'Autocomplete-Select') {
function selectCreateOrg( orgOption, reset ) {
if (orgOption == 0) {
cj("#onbehalfof_id").show().change();
- cj("input#onbehalf_organization_name").hide()
+ cj("input#onbehalf_organization_name").hide();
}
else if ( orgOption == 1 ) {
cj("input#onbehalf_organization_name").show();
{* If mid present in the url, take the required action (poping up related existing contact ..etc) *}
{if $membershipContactID}
{literal}
- cj( function( ) {
- cj('#organization_id').val("{/literal}{$membershipContactName}{literal}");
- cj('#organization_name').val("{/literal}{$membershipContactName}{literal}");
- cj('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
+ CRM.$(function($) {
+ $('#organization_id').val("{/literal}{$membershipContactName}{literal}");
+ $('#organization_name').val("{/literal}{$membershipContactName}{literal}");
+ $('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
setLocationDetails( "{/literal}{$membershipContactID}{literal}" );
});
{/literal}