$map = CRM_Core_SelectValues::mapProvider();
$geo = CRM_Core_SelectValues::geoProvider();
- $this->addElement('select', 'mapProvider', ts('Mapping Provider'), array('' => '- select -') + $map, array('onChange' => 'showHideMapAPIkey( this.value );'));
+ $this->addElement('select', 'mapProvider', ts('Mapping Provider'), array('' => '- select -') + $map, array('class' => 'crm-select2'));
$this->add('text', 'mapAPIKey', ts('Map Provider Key'), NULL);
- $this->addElement('select', 'geoProvider', ts('Geocoding Provider'), array('' => '- select -') + $geo);
+ $this->addElement('select', 'geoProvider', ts('Geocoding Provider'), array('' => '- select -') + $geo, array('class' => 'crm-select2'));
$this->add('text', 'geoAPIKey', ts('Geo Provider Key'), NULL);
parent::buildQuickForm();
$this->assign('entityID', $this->_id);
if ($this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
+ $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
}
if ($this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
+ $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
}
$showAdditionalInfo = FALSE;
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('.crm-accordion-body').each( function() {
+ $('.crm-accordion-body').each( function() {
//open tab if form rule throws error
- if ( cj(this).children( ).find('span.crm-error').text( ).length > 0 ) {
- cj(this).parent('.collapsed').crmAccordionToggle();
+ if ( $(this).children( ).find('span.crm-error').text( ).length > 0 ) {
+ $(this).parent('.collapsed').crmAccordionToggle();
}
});
$('#swap_target_assignee').click(function() {
{literal}
<script type="text/javascript">
CRM.$(function($) {
- var roleId = cj('input[name=activity_role]:checked', '#Search').val();
+ var roleId = $('input[name=activity_role]:checked', '#Search').val();
if (roleId) {
- cj('.description .option-' + roleId).show();
+ $('.description .option-' + roleId).show();
}
+ $('[name=activity_role]:input').change(function() {
+ $('.description .contact-name-option').hide();
+ if ($(this).is(':checked')) {
+ $('.description .option-' + $(this).val()).show();
+ }
+ }).change();
});
- cj('[name=activity_role]:input').change(function () {
- cj('.description .contact-name-option').hide();
- if (cj(this).is(':checked')) {
- cj('.description .option-' + cj(this).val()).show();
- }
- }).change();
</script>
{/literal}
CRM.$(function($) {
//Searchable activity custom fields which extend ALL activity types are always displayed in the form
//hence hide remaining activity custom data
- cj('#activityCustom').children( ).each( function( ) {
- cj('#'+cj(this).attr('id')+' div').each( function( ) {
- if (cj(this).children( ).attr('id')) {
- var activityCustomdataGroup = cj(this).attr('id'); //div id
- var fieldsetId = cj(this).children( ).attr('id'); // fieldset id
+ $('#activityCustom').children( ).each( function( ) {
+ $('#'+$(this).attr('id')+' div').each( function( ) {
+ if ($(this).children( ).attr('id')) {
+ var activityCustomdataGroup = $(this).attr('id'); //div id
+ var fieldsetId = $(this).children( ).attr('id'); // fieldset id
var splitFieldsetId = fieldsetId.split("\ 1");
var splitFieldsetLength = splitFieldsetId.length; //length of fieldset
var show = 0;
//setdefault activity custom data group if corresponding activity type is checked
- cj('#Activity div').each(function( ) {
- var checkboxId = cj(this).children().attr('id'); //activity type element name
+ $('#Activity div').each(function( ) {
+ var checkboxId = $(this).children().attr('id'); //activity type element name
if (document.getElementById( checkboxId ).checked ) {
var element = checkboxId.split('[');
var splitElement = element[1].split(']'); // get activity type id
}
});
if (show < 1) {
- cj('#'+activityCustomdataGroup).hide( );
+ $('#'+activityCustomdataGroup).hide( );
}
}
});
});
});
-</script>
-
-
-<script type="text/javascript">
function showCustomData(chkbox) {
if (document.getElementById(chkbox).checked) {
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj("#contactEditBlocks").sortable({
- placeholder: 'ui-state-highlight',
- update: getSorting
- });
- cj("#contactEditOptions").sortable({
- placeholder: 'ui-state-highlight',
- update: getSorting
- });
- });
-
- function getSorting(e, ui) {
- var params = new Array();
- var y = 0;
- var items = cj("#contactEditBlocks li");
- if (items.length > 0) {
- for (var y = 0; y < items.length; y++) {
- var idState = items[y].id.split('-');
- params[y + 1] = idState[1];
+ function getSorting(e, ui) {
+ var params = [];
+ var y = 0;
+ var items = $("#contactEditBlocks li");
+ if (items.length > 0) {
+ for (var y = 0; y < items.length; y++) {
+ var idState = items[y].id.split('-');
+ params[y + 1] = idState[1];
+ }
}
- }
- items = cj("#contactEditOptions li");
- if (items.length > 0) {
- for (var x = 0; x < items.length; x++) {
- var idState = items[x].id.split('-');
- params[x + y + 1] = idState[1];
+ items = $("#contactEditOptions li");
+ if (items.length > 0) {
+ for (var x = 0; x < items.length; x++) {
+ var idState = items[x].id.split('-');
+ params[x + y + 1] = idState[1];
+ }
}
+ $('#contact_edit_preferences').val(params.toString());
}
- cj('#contact_edit_preferences').val(params.toString());
- }
+
+ $("#contactEditBlocks, #contactEditOptions").sortable({
+ placeholder: 'ui-state-highlight',
+ update: getSorting
+ });
+ });
</script>
{/literal}
{/if}
var entityMapping = eval({/literal}{$entityMapping}{literal});
var recipientMapping = eval({/literal}{$recipientMapping}{literal});
- cj('#absolute_date_display').change( function() {
- if(cj('#absolute_date_display').val()) {
- cj('#relativeDate').hide();
- cj('#relativeDateRepeat').hide();
- cj('#repeatFields').hide();
- } else {
- cj('#relativeDate').show();
- cj('#relativeDateRepeat').show();
- }
- });
CRM.$(function($) {
- if (cj('#absolute_date_display').val()) {
- cj('#relativeDate').hide();
- cj('#relativeDateRepeat').hide();
- cj('#repeatFields').hide();
- }
+ $('#absolute_date_display').change(function() {
+ if($('#absolute_date_display').val()) {
+ $('#relativeDate').hide();
+ $('#relativeDateRepeat').hide();
+ $('#repeatFields').hide();
+ } else {
+ $('#relativeDate').show();
+ $('#relativeDateRepeat').show();
+ }
+ });
+
+ if ($('#absolute_date_display').val()) {
+ $('#relativeDate, #relativeDateRepeat, #repeatFields').hide();
+ }
- cj('#entity_0').change( function( ) {
- buildSelect("start_action_date");
+ $('#entity_0').change( function( ) {
+ buildSelect("start_action_date");
buildSelect("end_date");
buildSelect1("recipient");
- });
- });
+ showHideLimitTo();
+ });
- CRM.$(function($) {
- loadMsgBox();
- cj('#mode').change(function () {
loadMsgBox();
- });
+ $('#mode').change(loadMsgBox);
- showHideLimitTo();
- cj('#entity_0').change(function () {
showHideLimitTo();
+
+ if ($('#is_recipient_listing').val()) {
+ $('#recipientList').show();
+ }
+ else {
+ $('#recipientList').hide();
+ }
+ $('#recipient').change(populateRecipient);
});
- });
function loadMsgBox() {
if (cj('#mode').val() == 'Email' || cj('#mode').val() == 0){
}
}
- CRM.$(function($) {
- if (cj('#is_recipient_listing').val()) {
- cj('#recipientList').show();
- }
- else {
- cj('#recipientList').hide();
- }
- cj('#recipient').change(function () {
- populateRecipient();
- });
- });
-
function populateRecipient( ) {
var recipient = cj("#recipient option:selected").val();
var entity = cj("#entity_0 option:selected").val();
{literal}
<script type="text/javascript">
CRM.$(function($) {
- showHideMapAPIkey( cj('#mapProvider').val( ) );
-});
-function showHideMapAPIkey( mapProvider ) {
- if ( mapProvider && ( mapProvider == 'OpenStreetMaps' ) ) {
- cj('#Mapping tr.crm-map-form-block-mapAPIKey').hide( );
- } else {
- cj('#Mapping tr.crm-map-form-block-mapAPIKey').show( );
+ function showHideMapAPIkey() {
+ var mapProvider = $(this).val();
+ if ( !mapProvider || ( mapProvider === 'OpenStreetMaps' ) ) {
+ $('#Mapping tr.crm-map-form-block-mapAPIKey').hide( );
+ } else {
+ $('#Mapping tr.crm-map-form-block-mapAPIKey').show( );
+ }
}
-}
+ $('#mapProvider').each(showHideMapAPIkey).change(showHideMapAPIkey);
+});
</script>
{/literal}
{literal}
<script type="text/javascript">
CRM.$(function($) {
- var mailSetting = cj("input[name='outBound_option']:checked").val( );
+ var mailSetting = $("input[name='outBound_option']:checked").val( );
var archiveWarning = "{/literal}{ts escape='js'}WARNING: You are switching from a testing mode (Redirect to Database) to a live mode. Check Mailings > Archived Mailings, and delete any test mailings that are not in Completed status prior to running the mailing cron job for the first time. This will ensure that test mailings are not actually sent out.{/ts}{literal}"
- showHideMailOptions( cj("input[name='outBound_option']:checked").val( ) ) ;
+ showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ;
function showHideMailOptions( value ) {
switch( value ) {
case "0":
- cj("#bySMTP").show( );
- cj("#bySendmail").hide( );
- cj("#_qf_Smtp_refresh_test").show( );
+ $("#bySMTP").show( );
+ $("#bySendmail").hide( );
+ $("#_qf_Smtp_refresh_test").show( );
if (mailSetting == '5') {
alert(archiveWarning);
}
break;
case "1":
- cj("#bySMTP").hide( );
- cj("#bySendmail").show( );
- cj("#_qf_Smtp_refresh_test").show( );
+ $("#bySMTP").hide( );
+ $("#bySendmail").show( );
+ $("#_qf_Smtp_refresh_test").show( );
if (mailSetting == '5') {
alert(archiveWarning);
}
break;
case "3":
- cj('.mailoption').hide();
- cj("#_qf_Smtp_refresh_test").show( );
+ $('.mailoption').hide();
+ $("#_qf_Smtp_refresh_test").show( );
if (mailSetting == '5') {
alert(archiveWarning);
}
break;
default:
- cj("#bySMTP").hide( );
- cj("#bySendmail").hide( );
- cj("#_qf_Smtp_refresh_test").hide( );
+ $("#bySMTP").hide( );
+ $("#bySendmail").hide( );
+ $("#_qf_Smtp_refresh_test").hide( );
}
}
- cj("input[name='outBound_option']").click( function( ) {
- showHideMailOptions( cj(this).val( ) );
+ $("input[name='outBound_option']").click( function( ) {
+ showHideMailOptions( $(this).val( ) );
});
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('.collapsed').click( function( ) {
- var currentObj = cj( this );
+ $('.collapsed').click( function( ) {
+ var currentObj = $( this );
if ( currentObj.hasClass( 'expanded') ) {
currentObj.removeClass( 'expanded' );
currentObj.parent( ).parent( ).next( ).hide( );
{literal}
CRM.$(function($) {
- var tabIndex = cj('#tab_' + selectedTab).prevAll().length;
- cj("#mainTabContainer").tabs({active: tabIndex});
- cj(".crm-tab-button").addClass("ui-corner-bottom");
+ var tabIndex = $('#tab_' + selectedTab).prevAll().length;
+ $("#mainTabContainer").tabs({active: tabIndex});
+ $(".crm-tab-button").addClass("ui-corner-bottom");
});
{/literal}
</script>
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('.crm-extensions-refresh').click(function(event){
+ $('.crm-extensions-refresh').click(function(event){
event.stopPropagation();
CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0});
CRM.api('Extension', 'refresh', {}, {
{if $selectedChild}selectedTab = '{$selectedChild}';{/if}
{literal}
CRM.$(function($) {
- var tabIndex = cj('#tab_' + selectedTab).prevAll().length
- cj("#mainTabContainer").tabs( {active: tabIndex} );
+ var tabIndex = $('#tab_' + selectedTab).prevAll().length
+ $("#mainTabContainer").tabs( {active: tabIndex} );
});
{/literal}
</script>
}
</style>
<script type="text/javascript">
- CRM.$(function($) {
- cj("#navigation-tree").jstree({
- plugins : [ "themes", "json_data", "dnd","ui", "crrm","contextmenu" ],
- json_data : {
- ajax:{
- dataType : "json",
- url : {/literal}"{crmURL p='civicrm/ajax/menu' h=0 q='key='}{crmKey name='civicrm/ajax/menu'}"{literal}
- },
- progressive_render: true
- },
- themes: {
- "theme": 'classic',
- "dots": true,
- "icons": false,
- "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css'
- },
- rules : {
- droppable : [ "tree-drop" ],
- multiple : true,
- deletable : "all",
- draggable : "all"
- },
- crrm : {
- move: {
- check_move: function(m) {
- var homeMenuId = {/literal}"{$homeMenuId}"{literal};
- if ( cj( m.r[0] ).attr('id').replace("node_","") == homeMenuId ||
- cj( m.o[0] ).attr('id').replace("node_","") == homeMenuId ) {
- return false;
- } else {
- return true;
+ CRM.$(function($) {
+ $("#navigation-tree").jstree({
+ plugins: [ "themes", "json_data", "dnd","ui", "crrm","contextmenu" ],
+ json_data: {
+ ajax:{
+ dataType: "json",
+ url: {/literal}"{crmURL p='civicrm/ajax/menu' h=0 q='key='}{crmKey name='civicrm/ajax/menu'}"{literal}
+ },
+ progressive_render: true
+ },
+ themes: {
+ "theme": 'classic',
+ "dots": true,
+ "icons": false,
+ "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css'
+ },
+ rules: {
+ droppable: [ "tree-drop" ],
+ multiple: true,
+ deletable: "all",
+ draggable: "all"
+ },
+ crrm: {
+ move: {
+ check_move: function(m) {
+ var homeMenuId = {/literal}"{$homeMenuId}"{literal};
+ if ( $( m.r[0] ).attr('id').replace("node_","") == homeMenuId ||
+ $( m.o[0] ).attr('id').replace("node_","") == homeMenuId ) {
+ return false;
+ } else {
+ return true;
+ }
+ }
}
- }
- }
- },
- contextmenu : {
- items: {
- create : false,
- ccp : {
- label : "{/literal}{ts escape='js'}Edit{/ts}{literal}",
- visible : function (node, obj) { if(node.length != 1) return false;
- return obj.check("renameable", node); },
- action : function (node, obj) {
- var nid = cj(node).prop('id');
- var nodeID = nid.substr( 5 );
- var editURL = {/literal}"{crmURL p='civicrm/admin/menu' h=0 q='action=update&reset=1&id='}"{literal} + nodeID;
- CRM.loadForm(editURL).on('crmFormSuccess', function() {
- cj("#navigation-tree").jstree('refresh');
- cj("#reset-menu").show( );
- });
- },
- submenu : false
+ },
+ contextmenu: {
+ items: {
+ create: false,
+ ccp: {
+ label : "{/literal}{ts escape='js'}Edit{/ts}{literal}",
+ visible: function (node, obj) { if(node.length != 1) return false;
+ return obj.check("renameable", node); },
+ action: function (node, obj) {
+ var nid = $(node).prop('id');
+ var nodeID = nid.substr( 5 );
+ var editURL = {/literal}"{crmURL p='civicrm/admin/menu' h=0 q='action=update&reset=1&id='}"{literal} + nodeID;
+ CRM.loadForm(editURL).on('crmFormSuccess', function() {
+ $("#navigation-tree").jstree('refresh');
+ $("#reset-menu").show( );
+ });
+ },
+ submenu: false
+ }
}
- }
- }
-
- }).bind("rename.jstree", function ( e,node ) {
- var nodeID = node.rslt.obj.attr('id').replace("node_","");
- var newName = node.rslt.new_name;
- var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
- cj.get( postURL + '&type=rename&id=' + nodeID + '&data=' + newName,
- function (data) {
- cj("#reset-menu").show( );
}
- );
-
- }).bind("remove.jstree", function ( e,node ) {
- var menuName = node.rslt.obj.find('a').first( ).text( );
- var nodeID = node.rslt.obj.attr('id').replace("node_","");
- // don't allow deleting of home
- var homeMenuId = {/literal}"{$homeMenuId}"{literal};
- if ( nodeID == homeMenuId ) {
- var cannotDeleteMsg = {/literal}"{ts escape='js'}You cannot delete this menu item:{/ts}" + " "{literal} + menuName;
- CRM.alert( cannotDeleteMsg, {/literal}"{ts escape='js'}Cannot Delete{/ts}"{literal} );
- cj("#navigation-tree").jstree('refresh');
- return false;
- }
- var deleteMsg = {/literal}"{ts escape='js'}Are you sure you want to delete this menu item:{/ts}" + " "{literal} + menuName + {/literal}" ? {ts}This action can not be undone.{/ts}"{literal};
- var isDelete = confirm( deleteMsg );
- if ( isDelete ) {
+ }).bind("rename.jstree", function ( e,node ) {
+ var nodeID = node.rslt.obj.attr('id').replace("node_","");
+ var newName = node.rslt.new_name;
var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
- cj.get( postURL + '&type=delete&id=' + nodeID,
+ $.get( postURL + '&type=rename&id=' + nodeID + '&data=' + newName,
function (data) {
- cj("#reset-menu").show( );
+ $("#reset-menu").show( );
}
);
- } else {
- cj("#navigation-tree").jstree('refresh');
- }
- }).bind("move_node.jstree", function ( e,node ) {
- node.rslt.o.each(function (i) {
- var nodeID = node.rslt.o.attr('id').replace("node_","");
- var refID = node.rslt.np.attr('id').replace("node_","");
- if (isNaN( refID ) ){ refID =''; }
- var ps = node.rslt.cp+i;
- var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
- cj.get( postURL + '&type=move&id=' + nodeID + '&ref_id=' + refID + '&ps='+ps,
- function (data) {
- cj("#reset-menu").show( );
- });
+ }).bind("remove.jstree", function( e,node ) {
+ var menuName = node.rslt.obj.find('a').first( ).text( );
+ var nodeID = node.rslt.obj.attr('id').replace("node_","");
+
+ // don't allow deleting of home
+ var homeMenuId = {/literal}"{$homeMenuId}"{literal};
+ if ( nodeID == homeMenuId ) {
+ var cannotDeleteMsg = {/literal}"{ts escape='js'}You cannot delete this menu item:{/ts}" + " "{literal} + menuName;
+ CRM.alert( cannotDeleteMsg, {/literal}"{ts escape='js'}Cannot Delete{/ts}"{literal} );
+ $("#navigation-tree").jstree('refresh');
+ return false;
+ }
+ var deleteMsg = {/literal}"{ts escape='js'}Are you sure you want to delete this menu item:{/ts}" + " "{literal} + menuName + {/literal}" ? {ts}This action can not be undone.{/ts}"{literal};
+ var isDelete = confirm( deleteMsg );
+ if ( isDelete ) {
+ var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
+ $.get( postURL + '&type=delete&id=' + nodeID,
+ function (data) {
+ $("#reset-menu").show( );
+ }
+ );
+ } else {
+ $("#navigation-tree").jstree('refresh');
+ }
+
+ }).bind("move_node.jstree", function ( e,node ) {
+ node.rslt.o.each(function (i) {
+ var nodeID = node.rslt.o.attr('id').replace("node_","");
+ var refID = node.rslt.np.attr('id').replace("node_","");
+ if (isNaN( refID ) ){ refID =''; }
+ var ps = node.rslt.cp+i;
+ var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
+ $.get( postURL + '&type=move&id=' + nodeID + '&ref_id=' + refID + '&ps='+ps,
+ function (data) {
+ $("#reset-menu").show( );
+ });
+ });
});
- });
- $('#new-menu-item a.button')
- .on('click', CRM.popup)
- .on('crmPopupFormSuccess', function() {
+ $('#new-menu-item a.button')
+ .on('click', CRM.popup)
+ .on('crmPopupFormSuccess', function() {
$("#navigation-tree").jstree('refresh');
$("#reset-menu").show();
- });
- });
+ });
+ });
</script>
{/literal}
{/if}
$("input[name=select_merge_tag]", this).crmError(ts('Select a tag'));
return false;
}
- /* send synchronous request so that disabling any actions for slow servers*/
var postUrl = {/literal}"{crmURL p='civicrm/ajax/mergeTags' h=0 }"{literal};
var data = {fromId: tag.id, toId: toId, key:{/literal}"{crmKey name='civicrm/ajax/mergeTags'}"{literal}};
- cj.ajax({
+ $.ajax({
type: "POST",
url: postUrl,
data: data,
//@todo functions partially moved from tpl but still need an enclosure / cleanup
// jslinting etc
CRM.$(function($) {
- cj('.selector-rows').change(function () {
+ $('.selector-rows').change(function () {
var options = {
'url': CRM.url('civicrm/ajax/batch')
};
- cj("#Entry").ajaxSubmit(options);
+ $("#Entry").ajaxSubmit(options);
// validate rows
- checkColumns(cj(this));
+ checkColumns($(this));
});
- cj('input[name^="soft_credit_contact["]').change(function(){
- var rowNum = cj(this).attr('id').replace('soft_credit_contact_','');
- var totalAmount = cj('#field_'+rowNum+'_total_amount').val();
+ $('input[name^="soft_credit_contact["]').change(function(){
+ var rowNum = $(this).attr('id').replace('soft_credit_contact_','');
+ var totalAmount = $('#field_'+rowNum+'_total_amount').val();
//assign total amount as default soft credit amount
- cj('#soft_credit_amount_'+ rowNum).val(totalAmount);
+ $('#soft_credit_amount_'+ rowNum).val(totalAmount);
//assign soft credit type default value if any
- cj('#field_'+rowNum+'_soft_credit_type').val(cj('#sct_default_id').val());
+ $('#field_'+rowNum+'_soft_credit_type').val($('#sct_default_id').val());
});
// validate rows
//calculate the actual total for the batch
calculateActualTotal();
- cj('input[id*="_total_amount"]').bind('keyup change', function () {
+ $('input[id*="_total_amount"]').bind('keyup change', function () {
calculateActualTotal();
});
hideSendReceipt();
// hide the receipt date if send receipt is checked
- cj('input[id*="][send_receipt]"]').change(function () {
- showHideReceipt(cj(this));
+ $('input[id*="][send_receipt]"]').change(function () {
+ showHideReceipt($(this));
});
}
else{
- cj('select[id^="member_option_"]').each(function () {
- if (cj(this).val() == 1) {
- cj(this).prop('disabled', true);
+ $('select[id^="member_option_"]').each(function () {
+ if ($(this).val() == 1) {
+ $(this).prop('disabled', true);
}
});
// set payment info accord to membership type
- cj('select[id*="_membership_type_0"]').change(function () {
- setPaymentBlock(cj(this), null);
+ $('select[id*="_membership_type_0"]').change(function () {
+ setPaymentBlock($(this), null);
});
- cj('select[id*="_membership_type_1"]').change(function () {
- setPaymentBlock(cj(this), cj(this).val());
+ $('select[id*="_membership_type_1"]').change(function () {
+ setPaymentBlock($(this), $(this).val());
});
}
// line breaks between radio buttons and checkboxes
- cj('input.form-radio').next().after('<br />');
- cj('input.form-checkbox').next().after('<br />');
+ $('input.form-radio').next().after('<br />');
+ $('input.form-checkbox').next().after('<br />');
//set the focus on first element
- cj('#primary_contact_1').focus();
+ $('#primary_contact_1').focus();
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('.selector-rows').change(function () {
+ $('.selector-rows').change(function () {
var options = {
'url': {/literal}"{crmURL p='civicrm/ajax/batch' h=0}"{literal}
};
- cj("#Entry").ajaxSubmit(options);
+ $("#Entry").ajaxSubmit(options);
});
- cj('#crm-container').on('keyup change', '*.selector-rows', function () {
+ $('#crm-container').on('keyup change', '*.selector-rows', function () {
// validate rows
- checkColumns(cj(this));
+ checkColumns($(this));
});
// validate rows
//calculate the actual total for the batch
calculateActualTotal();
- cj('input[id*="_total_amount"]').bind('keyup change', function () {
+ $('input[id*="_total_amount"]').bind('keyup change', function () {
calculateActualTotal();
});
hideSendReceipt();
// hide the receipt date if send receipt is checked
- cj('input[id*="][send_receipt]"]').change(function () {
- showHideReceipt(cj(this));
+ $('input[id*="][send_receipt]"]').change(function () {
+ showHideReceipt($(this));
});
{/literal}{else}{literal}
- cj('select[id^="member_option_"]').each(function () {
- if (cj(this).val() == 1) {
- cj(this).prop('disabled', true);
+ $('select[id^="member_option_"]').each(function () {
+ if ($(this).val() == 1) {
+ $(this).prop('disabled', true);
}
});
// set payment info accord to membership type
- cj('select[id*="_membership_type_0"]').change(function () {
- setPaymentBlock(cj(this), null);
+ $('select[id*="_membership_type_0"]').change(function () {
+ setPaymentBlock($(this), null);
});
- cj('select[id*="_membership_type_1"]').change(function () {
- setPaymentBlock(cj(this), cj(this).val());
+ $('select[id*="_membership_type_1"]').change(function () {
+ setPaymentBlock($(this), $(this).val());
});
{/literal}{/if}{literal}
// line breaks between radio buttons and checkboxes
- cj('input.form-radio').next().after('<br />');
- cj('input.form-checkbox').next().after('<br />');
+ $('input.form-radio').next().after('<br />');
+ $('input.form-checkbox').next().after('<br />');
//set the focus on first element
- cj('#primary_contact_1').focus();
+ $('#primary_contact_1').focus();
});
var contactId = cj(contactHiddenElement).val();
var returnProperties = '';
- var profileFields = new Array();
+ var profileFields = [];
{/literal}
{if $contactFields}
{foreach from=$contactFields item=val key=fldName}
{literal}
<script type="text/javascript">
CRM.$(function($) {
- if (cj('#crm-recently-viewed').offset().left > 150) {
- cj('#crm-recently-viewed').removeClass('left').addClass('right');
- }
+ if ($('#crm-recently-viewed').offset().left > 150) {
+ $('#crm-recently-viewed').removeClass('left').addClass('right');
+ }
});
</script>
{/literal}
var dataLength = aoData.length;
var count = 1;
- var searchCriteria = new Array( 'campaign_search_voter_for' );
+ var searchCriteria = ['campaign_search_voter_for'];
//get the search criteria.
var searchParams = {/literal}{$searchParams}{literal};
//show edit profile field links
CRM.$(function($) {
// show edit for both contact and activity profile
- cj('select[id$="profile_id"]').change(function () {
- buildLinks(cj(this), cj(this).val());
+ $('select[id$="profile_id"]').change(function () {
+ buildLinks($(this), $(this).val());
});
// make sure we set edit links for both profiles when form loads
- cj('select[id$="profile_id"]').each(function (e) {
- buildLinks(cj(this), cj(this).val());
+ $('select[id$="profile_id"]').each(function (e) {
+ buildLinks($(this), $(this).val());
});
});
</script>
{literal}
<script type="text/javascript">
-cj(document).ready(function(){
- cj('#selector tr:even').addClass('odd-row ');
- cj('#selector tr:odd ').addClass('even-row');
+CRM.$(function($) {
+ $('#selector tr:even').addClass('odd-row ');
+ $('#selector tr:odd ').addClass('even-row');
});
</script>
</tr>
<script type="text/javascript">
- var showRows = new Array({$showBlocks});
- var hideBlocks = new Array({$hideBlocks});
+ var showRows = [{$showBlocks}];
+ var hideBlocks = [{$hideBlocks}];
var rowcounter = 0;
var surveyId = {if $surveyId}{$surveyId}{else}''{/if};
noRecordFoundMsg += '<div class="qill">';
var count = 0;
- var searchQill = new Array();
+ var searchQill = [];
for (param in searchParams) {
if (val = CRM.$('#' + param).val()) {
if (param == 'status_id') {
var dataLength = aoData.length;
var count = 1;
- var searchCriteria = new Array();
+ var searchCriteria = [];
//get the search criteria.
var searchParams = {/literal}{$searchParams}{literal};
noRecordFoundMsg += '<div class="qill">';
var count = 0;
- var searchQill = new Array( );
+ var searchQill = [];
for ( param in searchParams ) {
if ( val = CRM.$( '#' + param ).val( ) ) {
if ( param == 'petition_campaign_id' ) val = campaigns[val];
var dataLength = aoData.length;
var count = 1;
- var searchCriteria = new Array( );
+ var searchCriteria = [];
//get the search criteria.
var searchParams = {/literal}{$searchParams}{literal};
noRecordFoundMsg += '<div class="qill">';
var count = 0;
- var searchQill = new Array( );
+ var searchQill = [];
for ( param in searchParams ) {
if ( val = CRM.$( '#' + param ).val( ) ) {
if ( param == 'activity_type_id' ) val = surveyTypes[val];
var dataLength = aoData.length;
var count = 1;
- var searchCriteria = new Array( );
+ var searchCriteria = [];
//get the search criteria.
var searchParams = {/literal}{$searchParams}{literal};
//show edit profile field links
CRM.$(function($) {
// show edit for profile
- cj('select[id="profile_id"]').change( function( ) {
- buildLinks( cj(this), cj(this).val());
+ $('select[id="profile_id"]').change( function( ) {
+ buildLinks( $(this), $(this).val());
});
// show edit links on form loads
- var profileField = cj('select[id="profile_id"]');
+ var profileField = $('select[id="profile_id"]');
buildLinks( profileField, profileField.val());
});
</script>
{include file="CRM/common/customData.tpl" includeWysiwygEditor=true}
{literal}
<script type="text/javascript">
- cj(document).ready(function() {
+ CRM.$(function($) {
{/literal}
CRM.buildCustomData( 'Survey' );
{literal}
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('.crm-with-contact').click(function(){
- cj('#with-contacts-widget').toggle();
- cj('#with-clients').toggle();
+ $('.crm-with-contact').click(function() {
+ $('#with-contacts-widget').toggle();
+ $('#with-clients').toggle();
return false;
});
});
$el.load(CRM.url('civicrm/case/changeactivitystatus'), data, function() {
$el.unblock().trigger('crmLoad');
- cj("#activity_change_status").val(current_status_id);
+ $("#activity_change_status").val(current_status_id);
});
CRM.confirm({
CRM.$(function($) {
var fields = new Array( 'postal_greeting', 'addressee', 'email_greeting');
for ( var i = 0; i < 3; i++ ) {
- cj( "#" + fields[i] + "_id").change( function( ) {
- var fldName = cj(this).attr( 'id' );
- if ( cj(this).val( ) == 4 ) {
- cj("#greetings1").show( );
- cj("#greetings2").show( );
- cj( "#" + fldName + "_html").show( );
- cj( "#" + fldName + "_label").show( );
+ $( "#" + fields[i] + "_id").change( function( ) {
+ var fldName = $(this).attr( 'id' );
+ if ( $(this).val( ) == 4 ) {
+ $("#greetings1").show( );
+ $("#greetings2").show( );
+ $( "#" + fldName + "_html").show( );
+ $( "#" + fldName + "_label").show( );
} else {
- cj( "#" + fldName + "_html").hide( );
- cj( "#" + fldName + "_label").hide( );
- cj( "#" + fldName.slice(0, -3) + "_custom" ).val('');
+ $( "#" + fldName + "_html").hide( );
+ $( "#" + fldName + "_label").hide( );
+ $( "#" + fldName.slice(0, -3) + "_custom" ).val('');
}
});
}
});
function showGreeting( element ) {
- cj("#" + element ).show( );
- cj("#" + element + '_display' ).hide( );
+ $("#" + element ).show( );
+ $("#" + element + '_display' ).hide( );
// TO DO fix for custom greeting
var fldName = '#' + element + '_id';
- if ( cj( fldName ).val( ) == 4 ) {
- cj("#greetings1").show( );
- cj("#greetings2").show( );
- cj( fldName + "_html").show( );
- cj( fldName + "_label").show( );
+ if ( $( fldName ).val( ) == 4 ) {
+ $("#greetings1").show( );
+ $("#greetings2").show( );
+ $( fldName + "_html").show( );
+ $( fldName + "_label").show( );
}
}
{literal}
<script type="text/javascript">
CRM.$(function($) {
- if (cj('#update_modified_date').length == 0) {
+ if ($('#update_modified_date').length == 0) {
return;
}
- cj('<br>')
- .appendTo(cj('#update_modified_date'));
- cj('<button>')
+ $('<br>')
+ .appendTo($('#update_modified_date'));
+ $('<button>')
.text("{/literal}{ts}Save Anyway{/ts}{literal}")
.click(function() {
- cj('input[name="modified_date"]').val(
- cj('#update_modified_date').attr('data:latest_modified_date')
+ $('input[name="modified_date"]').val(
+ $('#update_modified_date').attr('data:latest_modified_date')
);
- cj('.crm-form-block .crm-form-submit.default').first().click();
+ $('.crm-form-block .crm-form-submit.default').first().click();
return false;
})
- .appendTo(cj('#update_modified_date'))
+ .appendTo($('#update_modified_date'))
;
- cj('<button>')
+ $('<button>')
.text("{/literal}{ts}Reload Page{/ts}{literal}")
.click(function() {
window.location.href = CRM.url('civicrm/contact/add', {
});
return false;
})
- .appendTo(cj('#update_modified_date'))
+ .appendTo($('#update_modified_date'))
;
});
</script>
{literal}
<script type="text/javascript">
CRM.$(function($) {
- var fields = new Array( 'postal_greeting', 'addressee', 'email_greeting');
+ var fields = ['postal_greeting', 'addressee', 'email_greeting'];
for ( var i = 0; i < 3; i++ ) {
- cj( "#" + fields[i] + "_id").change( function( ) {
- var fldName = cj(this).attr( 'id' );
- if ( cj(this).val( ) == 4 ) {
- cj("#greetings1").show( );
- cj("#greetings2").show( );
- cj( "#" + fldName + "_html").show( );
- cj( "#" + fldName + "_label").show( );
+ $( "#" + fields[i] + "_id").change( function( ) {
+ var fldName = $(this).attr( 'id' );
+ if ( $(this).val( ) == 4 ) {
+ $("#greetings1").show( );
+ $("#greetings2").show( );
+ $( "#" + fldName + "_html").show( );
+ $( "#" + fldName + "_label").show( );
} else {
- cj( "#" + fldName + "_html").hide( );
- cj( "#" + fldName + "_label").hide( );
- cj( "#" + fldName.slice(0, -3) + "_custom" ).val('');
+ $( "#" + fldName + "_html").hide( );
+ $( "#" + fldName + "_label").hide( );
+ $( "#" + fldName.slice(0, -3) + "_custom" ).val('');
}
});
}
{literal}
<script type="text/javascript">
-cj(document).ready(function(){
- cj('table td input.form-checkbox').each(function() {
+ CRM.$(function($) {
+ $('table td input.form-checkbox').each(function() {
var ele = null;
- var element = cj(this).attr('id').split('_',3);
+ var element = $(this).attr('id').split('_',3);
switch ( element['1'] ) {
case 'addressee':
}
if( ele ) {
- cj(this).on('click', function() {
- var val = cj(this).prop('checked');
- cj('input' + ele + ', input' + ele + '_custom').prop('checked', val);
+ $(this).on('click', function() {
+ var val = $(this).prop('checked');
+ $('input' + ele + ', input' + ele + '_custom').prop('checked', val);
});
}
});
-});
+ });
</script>
{/literal}
<script type="text/javascript">
CRM.$(function($) {
function showGroupSearch(){
- cj('#grouptypeselect').hide();
- cj('#groupselect').show();
- cj('#group_type').select2('val', '');
+ $('#grouptypeselect').hide();
+ $('#groupselect').show();
+ $('#group_type').select2('val', '');
}
function showGroupTypeSearch(){
- cj('#groupselect').hide();
- cj('#grouptypeselect').show();
- cj('#group').select2('val', '');
+ $('#groupselect').hide();
+ $('#grouptypeselect').show();
+ $('#group').select2('val', '');
}
- cj('#searchbygrouptype').click(function() {
+ $('#searchbygrouptype').click(function() {
showGroupTypeSearch();
});
- cj('#searchbygroup').click(function() {
+ $('#searchbygroup').click(function() {
showGroupSearch();
});
- if (cj('#group_type').val() ) {
+ if ($('#group_type').val() ) {
showGroupTypeSearch();
}
else {
{literal}
<script type="text/javascript">
CRM.$(function($) {
+ function updateChangeLogLabels() {
+ var changeType = $('input[name=log_date]:checked').val();
+ if (changeType == 2) {
+ $('.addedBy').hide();
+ $('.modifiedBy').show();
+ }
+ else {
+ if (changeType == 1) {
+ $('.addedBy').show();
+ $('.modifiedBy').hide();
+ }
+ }
+ }
+ $('[name=log_date]:input').change(updateChangeLogLabels);
updateChangeLogLabels();
});
- cj('[name=log_date]:input').change(function () {
- updateChangeLogLabels();
- });
- function updateChangeLogLabels() {
- var changeType = cj('input[name=log_date]:checked').val();
- if (changeType == 2) {
- cj('.addedBy').hide();
- cj('.modifiedBy').show();
- }
- else {
- if (changeType == 1) {
- cj('.addedBy').show();
- cj('.modifiedBy').hide();
- }
- }
- }
</script>
{/literal}
}
CRM.$(function($) {
- if ( cj('#street_name').val( ).length > 0 ||
- cj('#street_unit').val( ).length > 0 ||
- cj('#street_number').val( ).length > 0 ) {
+ if ( $('#street_name').val( ).length > 0 ||
+ $('#street_unit').val( ).length > 0 ||
+ $('#street_number').val( ).length > 0 ) {
processAddressFields( 'addressElements', 1 );
}
}
{literal}
<script type="text/javascript">
- function showHideSharedAddress( blockNo, showSelect ) {
- // based on checkbox, show or hide
- if ( cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).prop('checked') ) {
- if ( showSelect && cj( '#shared-address-display-' + blockNo ).length == 0 ) {
- cj( '#shared-address-' + blockNo ).show( );
+ CRM.$(function($) {
+
+ function showHideSharedAddress( blockNo, showSelect ) {
+ // based on checkbox, show or hide
+ if ( $( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).prop('checked') ) {
+ if ( showSelect && $( '#shared-address-display-' + blockNo ).length == 0 ) {
+ $( '#shared-address-' + blockNo ).show( );
+ }
+ $( 'table#address_table_' + blockNo ).hide( );
+ $( '#shared-address-display-' + blockNo ).show( );
+ $( '#shared-address-display-name-' + blockNo ).show( );
+ $( '#shared-address-display-cancel-' + blockNo ).hide( );
+ $( '.crm-address-custom-set-block-' + blockNo).hide( );
+ } else {
+ $( '#shared-address-' + blockNo ).hide( );
+ $( 'table#address_table_' + blockNo ).show( );
+ $( '#shared-address-display-' + blockNo ).hide( );
+ $( '#shared-address-display-name-' + blockNo ).hide( );
+ $( '#shared-address-display-cancel-' + blockNo ).hide( );
+ $( '.crm-address-custom-set-block-' + blockNo).show( );
}
- cj( 'table#address_table_' + blockNo ).hide( );
- cj( '#shared-address-display-' + blockNo ).show( );
- cj( '#shared-address-display-name-' + blockNo ).show( );
- cj( '#shared-address-display-cancel-' + blockNo ).hide( );
- cj( '.crm-address-custom-set-block-' + blockNo).hide( );
- } else {
- cj( '#shared-address-' + blockNo ).hide( );
- cj( 'table#address_table_' + blockNo ).show( );
- cj( '#shared-address-display-' + blockNo ).hide( );
- cj( '#shared-address-display-name-' + blockNo ).hide( );
- cj( '#shared-address-display-cancel-' + blockNo ).hide( );
- cj( '.crm-address-custom-set-block-' + blockNo).show( );
}
- }
-
-CRM.$(function($) {
var blockNo = {/literal}{$blockId}{literal};
// call this when form loads
showHideSharedAddress( blockNo, true );
// handle check / uncheck of checkbox
- cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).click( function( ) {
+ $( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).click( function( ) {
showHideSharedAddress( blockNo, true );
});
var contactHiddenElement = 'input[name="address[' + blockNo +'][master_contact_id]"]';
// observe changes
- cj( contactHiddenElement ).change(function( ) {
- var sharedContactId = cj( this ).val( );
+ $( contactHiddenElement ).change(function( ) {
+ var sharedContactId = $( this ).val( );
if ( !sharedContactId || isNaN( sharedContactId ) ) {
return;
}
var addressHTML = '';
var postUrl = {/literal}"{crmURL p='civicrm/ajax/inline' h=0}"{literal};
- cj.post( postUrl, {
- 'contact_id': sharedContactId,
- 'type': 'method',
- 'async': false,
- 'class_name': 'CRM_Contact_Page_AJAX',
- 'fn_name': 'getAddressDisplay'
+ $.post( postUrl, {
+ 'contact_id': sharedContactId,
+ 'type': 'method',
+ 'async': false,
+ 'class_name': 'CRM_Contact_Page_AJAX',
+ 'fn_name': 'getAddressDisplay'
},
function( response ) {
if ( response ) {
var selected = 'checked';
var addressExists = false;
- cj.each( response, function( i, val ) {
+ $.each( response, function( i, val ) {
if ( i > 1 ) {
selected = '';
} else {
- cj( 'input[name="address[' + blockNo + '][master_id]"]' ).val( val.id );
+ $( 'input[name="address[' + blockNo + '][master_id]"]' ).val( val.id );
}
addressHTML = addressHTML + '<input type="radio" name="selected_shared_address-'+ blockNo +'" value=' + val.id + ' ' + selected +'>' + val.display_text + '<br/>';
});
if ( addressExists ) {
- cj( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
- cj( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + addressHTML + '</td></tr>');
- cj( 'input[name^=selected_shared_address-]' ).click( function( ) {
+ $( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
+ $( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + addressHTML + '</td></tr>');
+ $( 'input[name^=selected_shared_address-]' ).click( function( ) {
- // get the block id
- var elemId = cj(this).attr( 'name' ).split('-');
- cj( 'input[name="address[' + elemId[1] + '][master_id]"]' ).val( cj(this).val( ) );
+ // get the block id
+ var elemId = $(this).attr( 'name' ).split('-');
+ $( 'input[name="address[' + elemId[1] + '][master_id]"]' ).val( $(this).val( ) );
});
} else {
var helpText = {/literal}"{ts escape='js'}Selected contact does not have an address. Please edit that contact to add an address, or select a different contact.{/ts}"{literal};
- cj( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
- cj( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + helpText + '</td></tr>');
+ $( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
+ $( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + helpText + '</td></tr>');
}
}
},'json');
});
-});
+ });
</script>
{/literal}
CRM.$(function($) {
var defaultLocationType = "{/literal}{$defaultLocationType}{literal}";
if (defaultLocationType.length) {
- cj('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
- var select = cj(this).next();
- cj('option', select).each(function() {
- if (cj(this).attr('value') == defaultLocationType
- && cj(this).text() == "{/literal}{$defaultLocationTypeLabel}{literal}") {
+ $('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
+ var select = $(this).next();
+ $('option', select).each(function() {
+ if ($(this).attr('value') == defaultLocationType
+ && $(this).text() == "{/literal}{$defaultLocationTypeLabel}{literal}") {
select.val(defaultLocationType);
}
});
<script type="text/javascript">
CRM.$(function($) {
var currentReSortEvent;
- cj(".dash-column").sortable({
+ $(".dash-column").sortable({
connectWith: '.dash-column',
update: saveSorting
});
- cj(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
+ $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
.find(".portlet-header")
.addClass("ui-widget-header ui-corner-all")
.end()
.find(".portlet-content");
- cj(".dash-column").disableSelection();
+ $(".dash-column").disableSelection();
function saveSorting(e, ui) {
// this is to prevent double post call
dashletColumns = Array();
// build post params
- cj('div[id^=existing-dashlets-col-]').each( function( i ) {
- cj(this).find('.portlet-header').each( function( j ) {
+ $('div[id^=existing-dashlets-col-]').each( function( i ) {
+ $(this).find('.portlet-header').each( function( j ) {
var elementID = this.id;
var idState = elementID.split('-');
params['columns[' + i + '][' + idState[0] + ']'] = idState[1];
var postUrl = {/literal}"{crmURL p='civicrm/ajax/dashboard' h=0 }"{literal};
params['op'] = 'save_columns';
params['key'] = {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal};
- cj.post( postUrl, params, function(response, status) {
+ $.post( postUrl, params, function(response, status) {
// TO DO show done / disable escape action
});
}
}
- cj('.delete-dashlet').click( function( ) {
+ $('.delete-dashlet').click( function( ) {
var message = {/literal}'{ts escape="js"}Do you want to remove this dashlet as an "Available Dashlet", AND delete it from all user dashboards?{/ts}'{literal};
if ( confirm( message) ) {
- var dashletID = cj(this).parent().attr('id');
+ var dashletID = $(this).parent().attr('id');
var idState = dashletID.split('-')
// Build a list of params to post to the server.
var postUrl = {/literal}"{crmURL p='civicrm/ajax/dashboard' h=0 }"{literal};
params['op'] = 'delete_dashlet';
params['key'] = {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal};
- cj.post( postUrl, params, function(response, status) {
+ $.post( postUrl, params, function(response, status) {
// delete dom object
- cj('#' + dashletID ).parent().remove();
+ $('#' + dashletID ).parent().remove();
});
}
});
var min_amount = document.getElementById("min_amount");
- var amount = new Array();
+ var amount = [];
amount[0] = '';
if( product_id > 0 ) {
<td class="font-size12pt label"><strong><strong>{ts}Contributor{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
</tr>
{else}
- {if !$contributionMode and !$email and $outBound_option != 2}
- {assign var='profileCreateCallback' value=1 }
- {/if}
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
{/if}
{if $context eq 'standalone' and $outBound_option != 2 }
{literal}
CRM.$(function($) {
- cj("#contact_id").change( function( ) {
- checkEmail( );
- });
+
+ var $form = $("#{/literal}{$form.formName}{literal}");
+ $("#contact_id", $form).change(checkEmail);
checkEmail( );
+
+ function checkEmail( ) {
+ var data = $("#contact_id", $form).select2('data');
+ if (data && data.extra && data.extra.email && data.extra.email.length) {
+ $("#email-receipt", $form).show();
+ $("#email-address", $form).html(data.extra.email);
+ }
+ else {
+ $("#email-receipt", $form).hide();
+ }
+ }
+
showHideByValue( 'is_email_receipt', '', 'receiptDate', 'table-row', 'radio', true);
showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
});
- function checkEmail( ) {
- var contactID = cj("#contact_id").val();
- if (contactID) {
- var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}";
- cj.post( postUrl, {contact_id: contactID},
- function (response) {
- if (response) {
- cj("#email-receipt").show( );
- cj("#email-address").html(response);
- }
- else {
- cj("#email-receipt").hide( );
- }
- }
- );
- }
- else {
- cj("#email-receipt").hide( );
- }
- }
-
- function profileCreateCallback( blockNo ) {
- checkEmail( );
- }
{/literal}
{/if}
</script>
CRM.$(function($) {
//if price set is set we use below below code to show for showing auto renew
var autoRenewOption = {/literal}'{$autoRenewOption}'{literal};
- cj('#allow_auto_renew').hide();
+ $('#allow_auto_renew').hide();
if ( autoRenewOption == 1 ) {
- cj('#allow_auto_renew').show();
+ $('#allow_auto_renew').show();
} else if ( autoRenewOption == 2 ) {
- var autoRenew = cj("#auto_renew");
+ var autoRenew = $("#auto_renew");
autoRenew.prop('checked', true );
autoRenew.attr( 'readonly', true );
- cj('#allow_auto_renew').show();
+ $('#allow_auto_renew').show();
}
});
</script>
{if $membershipContactID}
{literal}
CRM.$(function($) {
- cj('#organization_id').val("{/literal}{$membershipContactName}{literal}");
- cj('#organization_name').val("{/literal}{$membershipContactName}{literal}");
- cj('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
+ $('#organization_id').val("{/literal}{$membershipContactName}{literal}");
+ $('#organization_name').val("{/literal}{$membershipContactName}{literal}");
+ $('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
setLocationDetails( "{/literal}{$membershipContactID}{literal}" );
});
{/literal}
// select a new premium
function select_premium(premium_id) {
- if(cj(premium_id).length) {
+ if($(premium_id).length) {
// hide other active premium
- cj('.premium-full').hide();
- cj('.premium-short').show();
+ $('.premium-full').hide();
+ $('.premium-short').show();
// show this one
- cj('.premium-short', cj(premium_id)).hide();
- cj('.premium-full', cj(premium_id)).show();
+ $('.premium-short', $(premium_id)).hide();
+ $('.premium-full', $(premium_id)).show();
// record this one
var id_parts = premium_id.split('-');
- cj('#selectProduct').val(id_parts[1]);
+ $('#selectProduct').val(id_parts[1]);
}
}
// click premium to select
- cj('.premium-short').click(function(){
- select_premium( '#'+cj(cj(this).parent()).attr('id') );
+ $('.premium-short').click(function(){
+ select_premium( '#'+$($(this).parent()).attr('id') );
});
// select the default premium
- var premium_id = cj('#selectProduct').val();
+ var premium_id = $('#selectProduct').val();
if(premium_id == '') premium_id = 'no_thanks';
select_premium('#premium_id-'+premium_id);
}
// see if other amount exists and has a value
- if(cj('.other_amount-content input').length) {
- amount = Number(cj('.other_amount-content input').val());
+ if($('.other_amount-content input').length) {
+ amount = Number($('.other_amount-content input').val());
if(isNaN(amount))
amount = 0;
}
function check_price_set(price_set_radio_buttons) {
if (!amount) {
- cj(price_set_radio_buttons).each(function(){
- if (cj(this).prop('checked')) {
- amount = cj(this).attr('data-amount');
+ $(price_set_radio_buttons).each(function(){
+ if ($(this).prop('checked')) {
+ amount = $(this).attr('data-amount');
if (typeof amount !== "undefined") {
amount = Number(amount);
}
function update_premiums() {
var amount = get_amount();
- cj('.premium').each(function(){
- var min_contribution = cj(this).attr('min_contribution');
+ $('.premium').each(function(){
+ var min_contribution = $(this).attr('min_contribution');
if(amount < min_contribution) {
- cj(this).addClass('premium-disabled');
+ $(this).addClass('premium-disabled');
} else {
- cj(this).removeClass('premium-disabled');
+ $(this).removeClass('premium-disabled');
}
});
}
- cj('.other_amount-content input').change(update_premiums);
- cj('input, #priceset').change(update_premiums);
+ $('.other_amount-content input').change(update_premiums);
+ $('input, #priceset').change(update_premiums);
update_premiums();
// build a list of price sets
var amounts = [];
var price_sets = {};
- cj('input, #priceset select,#priceset').each(function(){
+ $('input, #priceset select,#priceset').each(function(){
if (this.tagName == 'SELECT') {
- var selectID = cj(this).attr('id');
- var selectvalues = JSON.parse(cj(this).attr('price'));
+ var selectID = $(this).attr('id');
+ var selectvalues = JSON.parse($(this).attr('price'));
Object.keys(selectvalues).forEach(function (key) {
var option = selectvalues[key].split(optionSep);
amount = Number(option[0]);
});
}
else {
- var amount = Number(cj(this).attr('data-amount'));
+ var amount = Number($(this).attr('data-amount'));
if (!isNaN(amount)) {
amounts.push(amount);
- var id = cj(this).attr('id');
+ var id = $(this).attr('id');
price_sets[amount] = '#'+id;
}
}
amounts.sort(function(a,b){return a - b});
// make contribution instead buttons work
- cj('.premium-full-disabled input').click(function(){
- var amount = Number(cj(this).attr('amount'));
+ $('.premium-full-disabled input').click(function(){
+ var amount = Number($(this).attr('amount'));
if (price_sets[amount]) {
- if (!cj(price_sets[amount]).length) {
+ if (!$(price_sets[amount]).length) {
var option = price_sets[amount].split('-');
- cj(option[0]).val(option[1]);
- cj(option[0]).trigger('change');
+ $(option[0]).val(option[1]);
+ $(option[0]).trigger('change');
}
- else if (cj(price_sets[amount]).attr('type') == 'checkbox') {
- cj(price_sets[amount]).prop("checked",true);
+ else if ($(price_sets[amount]).attr('type') == 'checkbox') {
+ $(price_sets[amount]).prop("checked",true);
if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
if (totalfee > 0) {
totalfee += amount;
}
}
else {
- cj(price_sets[amount]).click();
- cj(price_sets[amount]).trigger('click');
+ $(price_sets[amount]).click();
+ $(price_sets[amount]).trigger('click');
}
} else {
// is there an other amount input box?
- if(cj('.other_amount-section input').length) {
+ if($('.other_amount-section input').length) {
// is this a membership form with separate payment?
if(is_separate_payment) {
var current_amount = 0;
- if(cj('#priceset input[type="radio"]:checked').length) {
- current_amount = Number(cj('#priceset input[type="radio"]:checked').attr('data-amount'));
+ if($('#priceset input[type="radio"]:checked').length) {
+ current_amount = Number($('#priceset input[type="radio"]:checked').attr('data-amount'));
if(!current_amount) current_amount = 0;
}
var new_amount = amount - current_amount;
- cj('.other_amount-section input').val(new_amount.toFixed(2));
+ $('.other_amount-section input').val(new_amount.toFixed(2));
} else {
- cj('.other_amount-section input').click();
- cj('.other_amount-section input').val(cj(this).attr('amount'));
+ $('.other_amount-section input').click();
+ $('.other_amount-section input').val($(this).attr('amount'));
}
} else {
// find the next best price set
selected_price_set = amounts[amounts.length-1];
}
- if (!cj(price_sets[selected_price_set]).length) {
+ if (!$(price_sets[selected_price_set]).length) {
var option = price_sets[selected_price_set].split('-');
- cj(option[0]).val(option[1]);
- cj(option[0]).trigger('change');
+ $(option[0]).val(option[1]);
+ $(option[0]).trigger('change');
}
- else if (cj(price_sets[selected_price_set]).attr('type') == 'checkbox') {
- cj(price_sets[selected_price_set]).prop("checked",true);
+ else if ($(price_sets[selected_price_set]).attr('type') == 'checkbox') {
+ $(price_sets[selected_price_set]).prop("checked",true);
if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
if (totalfee > 0) {
totalfee += amount;
}
}
else {
- cj(price_sets[selected_price_set]).click();
- cj(price_sets[selected_price_set]).trigger('click');
+ $(price_sets[selected_price_set]).click();
+ $(price_sets[selected_price_set]).trigger('click');
}
}
}
// validation of premiums
var error_message = '{/literal}{ts escape="js"}You must contribute more to get that item{/ts}{literal}';
- cj.validator.addMethod('premiums', function(value, element, params){
- var premium_id = cj('#selectProduct').val();
- var premium$ = cj('#premium_id-'+premium_id);
+ $.validator.addMethod('premiums', function(value, element, params){
+ var premium_id = $('#selectProduct').val();
+ var premium$ = $('#premium_id-'+premium_id);
if(premium$.length) {
if(premium$.hasClass('premium-disabled')) {
return false;
// add validation rules
CRM.validate.functions.push(function(){
- cj('#selectProduct').rules('add', 'premiums');
+ $('#selectProduct').rules('add', 'premiums');
});
// need to use jquery validate's ignore option, so that it will not ignore hidden fields
{/if} {* $action ne view *}
</div>
-<script language="JavaScript" type="text/javascript">
+<script type="text/javascript">
{literal}
-function getFinancialType()
-{
-{/literal}
- productID = "#product_id";
- financialTypeID = "#financial_type_id"
- callbackURL = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialType'}"
-{literal}
-
- var check = cj(productID).val();
- callbackURL = callbackURL+"&_value="+check;
- cj.ajax({
- url: callbackURL,
- context: document.body,
- success: function( data, textStatus ){
- data = eval(data);//get json array
- if ( data != null ) {
- cj(financialTypeID).val(data);
-
- }
-
- }
- });
- }
+ CRM.$(function($) {
-cj(document).ready(function(){
+ function getFinancialType() {
+ var callbackURL = CRM.url('civicrm/ajax/rest', {
+ className: 'CRM_Financial_Page_AJAX',
+ fnName: 'jqFinancialType',
+ _value: $("#product_id").val()
+ });
+ $.ajax({
+ url: callbackURL,
+ success: function( data, textStatus ){
+ data = eval(data);//get json array
+ if ( data != null ) {
+ $("#financial_type_id").val(data);
+
+ }
+
+ }
+ });
+
+ }
getFinancialType();
- cj("#product_id").change( function(){
- getFinancialType();
- });
+ $("#product_id").change(getFinancialType);
});
{/literal}
</script>
{literal}
<script type="text/javascript">
- var paymentProcessorMapper = new Array( );
+ var paymentProcessorMapper = [];
{/literal}
{if $recurringPaymentProcessor}
{foreach from=$recurringPaymentProcessor item="paymentProcessor" key="index"}{literal}
CRM.$(function($) {
// bind click event to premiums_active checkbox
- cj('#premiums_active').click(function () {
+ $('#premiums_active').click(function () {
premiumBlock();
});
// hide premium setting if premium block is not enabled
- if (!cj('#premiums_active').prop('checked')) {
- cj('#premiumSettings').hide();
+ if (!$('#premiums_active').prop('checked')) {
+ $('#premiumSettings').hide();
}
});
{literal}
<script type='text/javascript'>
CRM.$(function($) {
- if (cj("#payment-info").length) {
+ if ($("#payment-info").length) {
var dataUrl = {/literal}'{crmURL p="civicrm/payment/view" h=0 q="action=browse&id=$participantId&cid=`$contactId`&component=event&context=payment_info&snippet=4"}'{literal};
- cj.ajax({
+ $.ajax({
url: dataUrl,
async: false,
success: function(html) {
- cj("#payment-info").html(html).trigger('crmLoad');
+ $("#payment-info").html(html).trigger('crmLoad');
}
});
- cj('.total_amount-section').remove();
+ $('.total_amount-section').remove();
}
});
</script>
var address_fields = {/literal}{$profileAddressFields|@json_encode}{literal};
var input_ids = {};
var select_ids = {};
- var orig_id = field = field_name = null;
+ var orig_id, field, field_name;
// build input ids
- cj('.billing_name_address-section input').each(function(i){
- orig_id = cj(this).attr('id');
+ $('.billing_name_address-section input').each(function(i){
+ orig_id = $(this).attr('id');
field = orig_id.split('-');
field_name = field[0].replace('billing_', '');
if(field[1]) {
}
}
});
- if(cj('#first_name').length)
+ if($('#first_name').length)
input_ids['#first_name'] = '#billing_first_name';
- if(cj('#middle_name').length)
+ if($('#middle_name').length)
input_ids['#middle_name'] = '#billing_middle_name';
- if(cj('#last_name').length)
+ if($('#last_name').length)
input_ids['#last_name'] = '#billing_last_name';
// build select ids
- cj('.billing_name_address-section select').each(function(i){
- orig_id = cj(this).attr('id');
+ $('.billing_name_address-section select').each(function(i){
+ orig_id = $(this).attr('id');
field = orig_id.split('-');
field_name = field[0].replace('billing_', '').replace('_id', '');
if(field[1]) {
// detect if billing checkbox should default to checked
var checked = true;
for(var id in input_ids) {
- var orig_id = input_ids[id];
- if(cj(id).val() != cj(orig_id).val()) {
+ orig_id = input_ids[id];
+ if($(id).val() != $(orig_id).val()) {
checked = false;
break;
}
}
for(var id in select_ids) {
- var orig_id = select_ids[id];
- if(cj(id).val() != cj(orig_id).val()) {
+ orig_id = select_ids[id];
+ if($(id).val() != $(orig_id).val()) {
checked = false;
break;
}
}
if(checked) {
- cj('#billingcheckbox').prop('checked', true);
- cj('.billing_name_address-group').hide();
+ $('#billingcheckbox').prop('checked', true);
+ $('.billing_name_address-group').hide();
}
// onchange handlers for non-billing fields
for(var id in input_ids) {
- var orig_id = input_ids[id];
- cj(id).change(function(){
- var id = '#'+cj(this).attr('id');
+ orig_id = input_ids[id];
+ $(id).change(function(){
+ var id = '#'+$(this).attr('id');
var orig_id = input_ids[id];
// if billing checkbox is active, copy other field into billing field
- if(cj('#billingcheckbox').prop('checked')) {
- cj(orig_id).val( cj(id).val() );
- };
+ if($('#billingcheckbox').prop('checked')) {
+ $(orig_id).val( $(id).val() );
+ }
});
- };
+ }
for(var id in select_ids) {
- var orig_id = select_ids[id];
- cj(id).change(function(){
- var id = '#'+cj(this).attr('id');
+ orig_id = select_ids[id];
+ $(id).change(function(){
+ var id = '#'+$(this).attr('id');
var orig_id = select_ids[id];
// if billing checkbox is active, copy other field into billing field
- if(cj('#billingcheckbox').prop('checked')) {
- cj(orig_id+' option').prop('selected', false);
- cj(orig_id+' option[value="'+cj(id).val()+'"]').prop('selected', true);
- };
+ if($('#billingcheckbox').prop('checked')) {
+ $(orig_id+' option').prop('selected', false);
+ $(orig_id+' option[value="'+$(id).val()+'"]').prop('selected', true);
+ }
if(orig_id == '#billing_country_id-5') {
- cj(orig_id).change();
+ $(orig_id).change();
}
});
- };
+ }
// toggle show/hide
- cj('#billingcheckbox').click(function(){
+ $('#billingcheckbox').click(function(){
if(this.checked) {
- cj('.billing_name_address-group').hide(200);
+ $('.billing_name_address-group').hide(200);
// copy all values
for(var id in input_ids) {
- var orig_id = input_ids[id];
- cj(orig_id).val( cj(id).val() );
- };
+ orig_id = input_ids[id];
+ $(orig_id).val( $(id).val() );
+ }
for(var id in select_ids) {
- var orig_id = select_ids[id];
- cj(orig_id+' option').prop('selected', false);
- cj(orig_id+' option[value="'+cj(id).val()+'"]').prop('selected', true);
- };
+ orig_id = select_ids[id];
+ $(orig_id+' option').prop('selected', false);
+ $(orig_id+' option[value="'+$(id).val()+'"]').prop('selected', true);
+ }
} else {
- cj('.billing_name_address-group').show(200);
+ $('.billing_name_address-group').show(200);
}
});
// remove spaces, dashes from credit card number
- cj('#credit_card_number').change(function(){
- var cc = cj('#credit_card_number').val()
+ $('#credit_card_number').change(function(){
+ var cc = $('#credit_card_number').val()
.replace(/ /g, '')
.replace(/-/g, '');
- cj('#credit_card_number').val(cc);
+ $('#credit_card_number').val(cc);
});
});
{/literal}
</div>
{literal}
<script type="text/Javascript">
- var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
- var singleValOps = new Array('Text', 'Select', 'Radio', 'Autocomplete-Select');
- var multiValOps = new Array('CheckBox', 'Multi-Select', 'AdvMulti-Select');
function checkCustomDataField( ) {
+ var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
+ var singleValOps = ['Text', 'Select', 'Radio', 'Autocomplete-Select'];
+ var multiValOps = ['CheckBox', 'Multi-Select', 'AdvMulti-Select'];
var dstHtmlType = cj('#dst_html_type').val( );
if ( !dstHtmlType ) {
return true;
CRM.$(function($) {
showHideStyle();
- cj('#extends_0').change(function() {
+ $('#extends_0').change(function() {
showHideStyle();
});
if (isGroupEmpty) {
showRange(true);
}
- cj('#is_multiple').click(function() {
+ $('#is_multiple').click(function() {
showRange();
});
function showHideStyle() {
var isShow = false;
- var extend = cj('#extends_0').val();
+ var extend = $('#extends_0').val();
var contactTypes = {/literal}{$contactTypes}{literal};
var showStyle = "{/literal}{$showStyle}{literal}";
var showMultiple = "{/literal}{$showMultiple}{literal}";
var showMaxMultiple = "{/literal}{$showMaxMultiple}{literal}";
- if (cj.inArray(extend, contactTypes) >= 0) {
+ if ($.inArray(extend, contactTypes) >= 0) {
isShow = true;
}
if (isShow) {
- cj("tr#style").show();
- cj("tr#is_multiple").show();
- if (cj('#is_multiple :checked').length) {
- cj("tr#multiple").show();
+ $("tr#style").show();
+ $("tr#is_multiple").show();
+ if ($('#is_multiple :checked').length) {
+ $("tr#multiple").show();
}
}
else {
- cj("tr#style").hide();
- cj("tr#is_multiple").hide();
- cj("tr#multiple").hide();
+ $("tr#style").hide();
+ $("tr#is_multiple").hide();
+ $("tr#multiple").hide();
}
if (showStyle) {
- cj("tr#style").show();
+ $("tr#style").show();
}
if (showMultiple) {
- cj("tr#style").show();
- cj("tr#is_multiple").show();
+ $("tr#style").show();
+ $("tr#is_multiple").show();
}
if (!showMaxMultiple) {
- cj("tr#multiple").hide();
+ $("tr#multiple").hide();
}
- else if(cj( '#is_multiple').prop('checked')) {
- cj("tr#multiple").show();
+ else if($( '#is_multiple').prop('checked')) {
+ $("tr#multiple").show();
}
}
function showRange(onFormLoad) {
- if(cj("#is_multiple :checked").length) {
- cj("tr#multiple").show();
- cj('#collapse_display').prop('checked', '');
- cj("select#style option[value='Tab with table']").prop("selected", true);
+ if($("#is_multiple :checked").length) {
+ $("tr#multiple").show();
+ $('#collapse_display').prop('checked', '');
+ $("select#style option[value='Tab with table']").prop("selected", true);
}
else {
- cj('#collapse_display').prop('checked', 'checked');
- cj("tr#multiple").hide();
+ $('#collapse_display').prop('checked', 'checked');
+ $("tr#multiple").hide();
if (!onFormLoad) {
- cj("select#style option[value='Inline']").prop("selected", true);
+ $("select#style option[value='Inline']").prop("selected", true);
}
}
}
<script type="text/javascript">
{literal}
CRM.$(function($) {
- cj("#contact_id").change( function( ) {
+ $("#contact_id").change( function( ) {
checkEmail( );
} );
checkEmail( );
<script type="text/javascript">
{literal}
CRM.$(function($) {
- cj('#discounted_label_1').focus( );
+ $('#discounted_label_1').focus( );
});
{/literal}
</script>
<script type='text/javascript'>
CRM.$(function($) {
populateRecipient();
- cj('#recipient').click( function( ) {
+ $('#recipient').click( function( ) {
populateRecipient();
});
});
{literal}
<script type="text/javascript">
- var fieldOptionsFull = new Array( );
+ var fieldOptionsFull = [];
{/literal}
{foreach from=$priceSet.fields item=fldElement key=fldId}
{if $fldElement.options}
{foreach from=$fldElement.options item=fldOptions key=opId}
{if $fldOptions.is_full}
{literal}
- fieldOptionsFull[{/literal}{$fldId}{literal}] = new Array( );
+ fieldOptionsFull[{/literal}{$fldId}{literal}] = [];
fieldOptionsFull[{/literal}{$fldId}{literal}][{/literal}{$opId}{literal}] = 1;
{/literal}
{/if}
if ( fieldOptionsFull.length > 0 ) {
CRM.$(function($) {
- cj("input,#priceset select,#priceset").each(function () {
- if ( cj(this).attr('price') ) {
- switch( cj(this).attr('type') ) {
+ $("input,#priceset select,#priceset").each(function () {
+ if ( $(this).attr('price') ) {
+ switch( $(this).attr('type') ) {
case 'checkbox':
case 'radio':
- cj(this).click( function() {
+ $(this).click( function() {
validatePriceField(this);
});
break;
case 'select-one':
- cj(this).change( function() {
+ $(this).change( function() {
validatePriceField(this);
});
break;
case 'text':
- cj(this).bind( 'keyup', function() { validatePriceField(this) });
+ $(this).bind( 'keyup', function() { validatePriceField(this) });
break;
}
}
<td class="font-size12pt view-value">{$displayName} </td>
</tr>
{else}
- {if !$participantMode and !$email and $outBound_option != 2 }
- {assign var='profileCreateCallback' value=1}
- {/if}
<tr class="crm-participant-form-contact-id">
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
}
{/literal}
- {if $profileCreateCallback}
- {literal}
- function profileCreateCallback( blockNo ) {
- if( cj('#event_id').val( ) && cj('#email-receipt').length > 0 ) {
- checkEmail( );
- }
- }
- {/literal}
- {/if}
</script>
{/if} {* end of main event block*}
}
CRM.$(function($) {
- var updatedFeeUnFormatted = cj('#pricevalue').text();
+ var updatedFeeUnFormatted = $('#pricevalue').text();
var updatedAmt = parseFloat(updatedFeeUnFormatted.replace(/[^0-9-.]/g, ''));
populatebalanceFee(updatedAmt, true);
* Function to update participant status
*/
CRM.$(function($) {
- cj('#status_change').change( function() {
- if ( cj(this).val() ) {
- cj('.crm-copy-fields [name^="field["][name*="[participant_status]"]').val( cj(this).val() );
+ $('#status_change').change( function() {
+ if ( $(this).val() ) {
+ $('.crm-copy-fields [name^="field["][name*="[participant_status]"]').val( $(this).val() );
}
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('input[name="export_format"]').filter('[value=IIF]').prop('checked', true);
- cj('#_qf_Export_next').click(function(){
- cj(this).hide();
- cj('#_qf_Export_cancel').val('{/literal}{ts}Done{/ts}{literal}');
+ $('input[name="export_format"]').filter('[value=IIF]').prop('checked', true);
+ $('#_qf_Export_next').click(function(){
+ $(this).hide();
+ $('#_qf_Export_cancel').val('{/literal}{ts}Done{/ts}{literal}');
});
});
</script>
</div>
{literal}
<script type="text/javascript">
-cj("#popupContainer").hide();
-cj("#button").click(function(){
- cj("#popupContainer").dialog({
- title: "Selected Contacts",
- width:700,
- height:500,
- modal: true,
- overlay: {
- opacity: 0.5,
- background: "black"
- }
- });
- });
-
- CRM.$(function($) {
- var count = 0; var columns=''; var sortColumn = '';
- cj('#selectedRecords th').each( function( ) {
- if ( cj(this).attr('class') == 'contact_details' ) {
- sortColumn += '[' + count + ', "asc" ],';
- columns += '{"sClass": "contact_details"},';
- } else {
- columns += '{ "bSortable": false },';
- }
- count++;
- });
+ CRM.$(function($) {
+ $("#popupContainer").hide();
+ $("#button").click(function() {
+ $("#popupContainer").dialog({
+ title: "Selected Contacts",
+ width:700,
+ height:500,
+ modal: true
+ });
+ });
+ var count = 0; var columns=''; var sortColumn = '';
- columns = columns.substring(0, columns.length - 1 );
- sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
- eval('sortColumn =[' + sortColumn + ']');
- eval('columns =[' + columns + ']');
+ $('#selectedRecords th').each( function( ) {
+ if ( $(this).attr('class') == 'contact_details' ) {
+ sortColumn += '[' + count + ', "asc" ],';
+ columns += '{"sClass": "contact_details"},';
+ } else {
+ columns += '{ "bSortable": false },';
+ }
+ count++;
+ });
- //load jQuery data table.
- cj('#selectedRecords').dataTable( {
- "sPaginationType": "full_numbers",
- "bJQueryUI" : true,
- "aaSorting" : sortColumn,
- "aoColumns" : columns,
- "bFilter" : false
- });
+ columns = columns.substring(0, columns.length - 1 );
+ sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
+ eval('sortColumn =[' + sortColumn + ']');
+ eval('columns =[' + columns + ']');
+ //load jQuery data table.
+ $('#selectedRecords').dataTable( {
+ "sPaginationType": "full_numbers",
+ "bJQueryUI" : true,
+ "aaSorting" : sortColumn,
+ "aoColumns" : columns,
+ "bFilter" : false
});
+ });
+
</script>
{/literal}
{/if}
{literal}
CRM.$(function($) {
if ( isMailing ) {
- cj('div.html').hover(
+ $('div.html').hover(
function( ) {
if ( tinyMCE.get(html_message) ) {
tinyMCE.get(html_message).onKeyUp.add(function() {
{literal}
CRM.$(function($) {
if ( isMailing ) {
- cj('div.html').hover(
+ $('div.html').hover(
verify,
verify
);
}
}
else {
- cj( "#"+ html_message ).replaceSelection( token );
+ $( "#"+ html_message ).replaceSelection( token );
}
}
placeholder: '{/literal}{ts escape='js'}Insert Token{/ts}{literal}'
});
- cj('.accordion .head').addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ");
- cj('.resizable-textarea textarea').css( 'width', '99%' );
- cj('.grippie').css( 'margin-right', '3px');
- cj('.accordion .head').hover( function() { cj(this).addClass( "ui-state-hover");
- }, function() { cj(this).removeClass( "ui-state-hover");
+ $('.accordion .head').addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ");
+ $('.resizable-textarea textarea').css( 'width', '99%' );
+ $('.grippie').css( 'margin-right', '3px');
+ $('.accordion .head').hover( function() { $(this).addClass( "ui-state-hover");
+ }, function() { $(this).removeClass( "ui-state-hover");
}).bind('click', function() {
- var checkClass = cj(this).find('span').attr( 'class' );
+ var checkClass = $(this).find('span').attr( 'class' );
var len = checkClass.length;
if ( checkClass.substring( len - 1, len ) == 's' ) {
- cj(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-e');
- cj("span#help"+cj(this).find('span').attr('id')).hide();
+ $(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-e');
+ $("span#help"+$(this).find('span').attr('id')).hide();
}
else {
- cj(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
- cj("span#help"+cj(this).find('span').attr('id')).show();
+ $(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
+ $("span#help"+$(this).find('span').attr('id')).show();
}
- cj(this).next().toggle(); return false;
+ $(this).next().toggle(); return false;
}).next().hide();
- cj('span#html').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
- cj("div.html").show();
+ $('span#html').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
+ $("div.html").show();
if ( !isMailing ) {
- cj("div.text").show();
+ $("div.text").show();
}
function setSignature() {
}, 'json');
}
}
- if (!cj().find('div.crm-error').text()) {
- cj(window).load(function () {
+ if (!$().find('div.crm-error').text()) {
+ $(window).load(function () {
setSignature();
});
}
- cj("#fromEmailAddress").change( function( ) {
+ $("#fromEmailAddress").change( function( ) {
setSignature( );
});
});
<script type="text/javascript">
{literal}
CRM.$(function($) {
- cj('#start_date_display').change( function( ) {
- if ( cj(this).val( ) ) {
- cj('#now').prop('checked', false );
+ $('#start_date_display').change( function( ) {
+ if ( $(this).val( ) ) {
+ $('#now').prop('checked', false );
}
});
- cj('#now').change( function( ) {
- if ( cj('#now').prop('checked', true ) ) {
- cj('#start_date_display').val( '' );
- cj('#start_date').val( '' );
- cj('#start_date_time').val( '' );
+ $('#now').change( function( ) {
+ if ( $('#now').prop('checked', true ) ) {
+ $('#start_date_display').val( '' );
+ $('#start_date').val( '' );
+ $('#start_date_time').val( '' );
}
});
});
CRM.$(function($) {
// hide all the selects that contains only one option
- cj('.crm-message-select select').each(function (){
- if (cj(this).find('option').size() == 1) {
- cj(this).parent().parent().hide();
+ $('.crm-message-select select').each(function (){
+ if ($(this).find('option').size() == 1) {
+ $(this).parent().parent().hide();
}
});
- if (!cj('#override_verp').prop('checked')){
- cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').hide();
+ if (!$('#override_verp').prop('checked')){
+ $('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').hide();
}
- cj('#override_verp').click(function(){
- cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').toggle();
- if (!cj('#override_verp').prop('checked')) {
- cj('#forward_replies, #auto_responder').prop('checked', false);
+ $('#override_verp').click(function(){
+ $('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').toggle();
+ if (!$('#override_verp').prop('checked')) {
+ $('#forward_replies, #auto_responder').prop('checked', false);
}
});
<script type="text/javascript">
var totalPages = {/literal}{$pager->_totalPages}{literal};
CRM.$(function($) {
- cj("#crm-container .crm-pager input.crm-form-submit").click(function () {
+ $("#crm-container .crm-pager input.crm-form-submit").click(function () {
submitPagerData(this);
});
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- var membershipValues = new Array;
+ var membershipValues = [];
{/literal}{foreach from=$optionsMembershipTypes item=memType key=opId}{literal}
membershipValues[{/literal}{$opId}{literal}] = {/literal}{$memType}{literal};
{/literal}{/foreach}{literal}
<td class="font-size12pt label"><strong>{ts}Member{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
</tr>
{else}
- {if !$membershipMode and !$emailExists and $outBound_option != 2}
- {assign var='profileCreateCallback' value=1 }
- {/if}
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
{/if}
}
}
- var lastMembershipTypes = new Array;
- var optionsMembershipTypes = new Array;
+ var lastMembershipTypes = [];
+ var optionsMembershipTypes = [];
// function to load custom data for selected membership types through priceset
function processMembershipPriceset( membershipValues, autoRenewOption, reload ) {
- var currentMembershipType = new Array;
+ var currentMembershipType = [];
var count = 0;
var loadCustomData = 0;
if ( membershipValues ) {
}
if ( reload ) {
- lastMembershipTypes = new Array;
+ lastMembershipTypes = [];
{/literal}{if $allowAutoRenew}{literal}
cj('#autoRenew').hide();
var autoRenew = cj("#auto_renew");
CRM.$(function($) {
//show/hide membership block
showHideMembershipBlock();
- cj('#member_is_active').click( function() {
+ $('#member_is_active').click( function() {
showHideMembershipBlock();
});
//show/ hide blocks if price set is selected
checkIfPriceSetIsSelected( );
- cj('#member_price_set_id').change( function(){
+ $('#member_price_set_id').change( function(){
checkIfPriceSetIsSelected( );
});
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('#membershipOrgType').hide();
- cj('#changeNumTerms').hide();
+ $('#membershipOrgType').hide();
+ $('#changeNumTerms').hide();
{/literal}
CRM.buildCustomData('{$customDataType}');
{if $customDataSubType}
<script type="text/javascript">
CRM.$(function($) {
showHidePeriodSettings();
- cj('#duration_unit').change(function(){
+ $('#duration_unit').change(function(){
showHidePeriodSettings();
});
- cj('#period_type').change(function(){
+ $('#period_type').change(function(){
showHidePeriodSettings();
});
{/literal}
{if $action eq 2}
{literal}
- showHideMaxRelated(cj('#relationship_type_id').val());
- cj('#relationship_type_id').change(function(){
- showHideMaxRelated(cj('#relationship_type_id').val());
+ showHideMaxRelated($('#relationship_type_id').val());
+ $('#relationship_type_id').change(function(){
+ showHideMaxRelated($('#relationship_type_id').val());
});
{/literal}{else}{literal}
- showHideMaxRelated(cj('#relationship_type_id :selected').val());
- cj('#relationship_type_id').change(function(){
- showHideMaxRelated(cj('#relationship_type_id :selected').val());
+ showHideMaxRelated($('#relationship_type_id :selected').val());
+ $('#relationship_type_id').change(function(){
+ showHideMaxRelated($('#relationship_type_id :selected').val());
});
{/literal}{/if}{literal}
});
{else}
<table class="form-layout-compressed">
{if $context eq 'standalone'}
- {if !$email and $outBound_option != 2}
- {assign var='profileCreateCallback' value=1 }
- {/if}
<tr class="crm-pledge-form-contact-id">
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
{if $context eq 'standalone' and $outBound_option != 2 }
{literal}
CRM.$(function($) {
- cj("#contact_1").blur( function( ) {
- checkEmail( );
- });
- checkEmail( );
- showHideByValue( 'is_acknowledge', '', 'acknowledgeDate', 'table-row', 'radio', true);
- showHideByValue( 'is_acknowledge', '', 'fromEmail', 'table-row', 'radio', false );
+ var $form = $("#{/literal}{$form.formName}{literal}");
+ $("#contact_id", $form).change(checkEmail);
+ checkEmail( );
+
+ function checkEmail( ) {
+ var data = $("#contact_id", $form).select2('data');
+ if (data && data.extra && data.extra.email && data.extra.email.length) {
+ $("#acknowledgment-receipt", $form).show();
+ $("#email-address", $form).html(data.extra.email);
+ }
+ else {
+ $("#acknowledgment-receipt", $form).hide();
+ }
+ }
+
+ showHideByValue( 'is_acknowledge', '', 'acknowledgeDate', 'table-row', 'radio', true);
+ showHideByValue( 'is_acknowledge', '', 'fromEmail', 'table-row', 'radio', false );
});
- function checkEmail( ) {
- var contactID = cj("input[name='contact_select_id[1]']").val();
- if ( contactID ) {
- var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}";
- cj.post( postUrl, {contact_id: contactID},
- function ( response ) {
- if ( response ) {
- cj("#acknowledgment-receipt").show( );
- cj("#email-address").html( response );
- } else {
- cj("#acknowledgment-receipt").hide( );
- }
- }
- );
- } else {
- cj("#acknowledgment-receipt").hide( );
- }
- }
- function profileCreateCallback( blockNo ) {
- checkEmail( );
- }
{/literal}
{/if}
</script>
<td class="left"><h5 class='editPayment'></h5>
{literal}
<script type="text/javascript">
-cj(document).ready(function(){
+CRM.$(function($) {
cj(document).on('blur', '.distribute', function() {
var totalAmount = 0;
cj('.distribute').each(function (){
{literal}
<script type="text/javascript">
-cj(document).ready(function(){
+CRM.$(function($) {
cj('#selector tr:even').addClass('odd-row ');
cj('#selector tr:odd ').addClass('even-row');
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('#selector tr:even').addClass('odd-row ');
- cj('#selector tr:odd ').addClass('even-row');
+ $('#selector tr:even').addClass('odd-row ');
+ $('#selector tr:odd ').addClass('even-row');
});
</script>
{/literal}
}
var pct = 100 * queueRunnerData.completed / (queueRunnerData.completed + queueRunnerData.numberOfItems);
- cj("#crm-queue-runner-progress").progressbar({ value: pct });
+ $("#crm-queue-runner-progress").progressbar({ value: pct });
if (data.is_error) {
- cj("#crm-queue-runner-buttonset").show();
+ $("#crm-queue-runner-buttonset").show();
if (queueRunnerData.isEnded) {
- cj('#crm-queue-runner-skip').button('disable');
+ $('#crm-queue-runner-skip').button('disable');
}
- cj('#crm-queue-runner-title').text('Error: ' + data.last_task_title);
+ $('#crm-queue-runner-title').text('Error: ' + data.last_task_title);
} else if (!data.is_continue && queueRunnerData.numberOfItems == 0) {
- cj('#crm-queue-runner-title').text('Done');
+ $('#crm-queue-runner-title').text('Done');
} else {
- cj('#crm-queue-runner-title').text('Executed: ' + data.last_task_title);
+ $('#crm-queue-runner-title').text('Executed: ' + data.last_task_title);
}
if (data.exception) {
- cj('#crm-queue-runner-message').html('');
- cj('<div></div>').html(data.exception).prependTo('#crm-queue-runner-message');
+ $('#crm-queue-runner-message').html('');
+ $('<div></div>').html(data.exception).prependTo('#crm-queue-runner-message');
}
};
var handleError = function(jqXHR, textStatus, errorThrown) {
// Do this regardless of whether the response was well-formed
- cj("#crm-queue-runner-buttonset").show();
+ $("#crm-queue-runner-buttonset").show();
- var data = cj.parseJSON(jqXHR.responseText)
+ var data = $.parseJSON(jqXHR.responseText)
if (data) {
displayResponseData(data);
}
// Dequeue and execute the next item
var runNext = function() {
- cj.ajax({
+ $.ajax({
type: 'POST',
url: (queueRunnerData.isEnded ? queueRunnerData.onEndAjax : queueRunnerData.runNextAjax),
data: {
},
dataType: 'json',
beforeSend: function(jqXHR, settings) {
- cj("#crm-queue-runner-buttonset").hide();
+ $("#crm-queue-runner-buttonset").hide();
},
error: handleError,
success: handleSuccess
}
var retryNext = function() {
- cj('#crm-queue-runner-message').html('');
+ $('#crm-queue-runner-message').html('');
runNext();
}
// Dequeue and the next item, then move on to runNext for the subsequent items
var skipNext = function() {
- cj.ajax({
+ $.ajax({
type: 'POST',
url: queueRunnerData.skipNextAjax,
data: {
},
dataType: 'json',
beforeSend: function(jqXHR, settings) {
- cj('#crm-queue-runner-message').html('');
- cj("#crm-queue-runner-buttonset").hide();
+ $('#crm-queue-runner-message').html('');
+ $("#crm-queue-runner-buttonset").hide();
},
error: handleError,
success: handleSuccess
// Set up the UI
- cj("#crm-queue-runner-progress").progressbar({ value: 0 });
+ $("#crm-queue-runner-progress").progressbar({ value: 0 });
if (queueRunnerData.buttons.retry == 1) {
- cj("#crm-queue-runner-retry").button({
+ $("#crm-queue-runner-retry").button({
text: false,
icons: {primary: 'ui-icon-refresh'}
}).click(retryNext);
} else {
- cj("#crm-queue-runner-retry").remove();
+ $("#crm-queue-runner-retry").remove();
}
if (queueRunnerData.buttons.skip == 1) {
- cj("#crm-queue-runner-skip").button({
+ $("#crm-queue-runner-skip").button({
text: false,
icons: {primary: 'ui-icon-seek-next'}
}).click(skipNext);
} else {
- cj("#crm-queue-runner-skip").remove();
+ $("#crm-queue-runner-skip").remove();
}
- cj("#crm-queue-runner-buttonset").buttonset();
- cj("#crm-queue-runner-buttonset").hide();
+ $("#crm-queue-runner-buttonset").buttonset();
+ $("#crm-queue-runner-buttonset").hide();
window.setTimeout(runNext, 50);
});
}
}
- cj(document).ready(function(){
- cj('.crm-report-criteria-groupby input:checkbox').click(function() {
- cj('#fields_' + this.id.substr(10)).prop('checked', this.checked);
+ CRM.$(function($) {
+ $('.crm-report-criteria-groupby input:checkbox').click(function() {
+ $('#fields_' + this.id.substr(10)).prop('checked', this.checked);
});
{/literal}{if $displayToggleGroupByFields}{literal}
- cj('.crm-report-criteria-field input:checkbox').click(function() {
- cj('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
+ $('.crm-report-criteria-field input:checkbox').click(function() {
+ $('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
});
{/literal}{/if}{literal}
});
{literal}
<script type="text/javascript">
- cj(document).ready(function(){
- cj('#birth_date_from').attr('startOffset',200);
- cj('#birth_date_from').attr('endoffset',0);
- cj('#birth_date_to').attr('startOffset',200);
- cj('#birth_date_to').attr('endoffset',0);
+ CRM.$(function($) {
+ $('#birth_date_from, #birth_date_to').attr({startOffset: '200', endoffset: '0'});
});
</script>
{/literal}
});
CRM.$(function($) {
var formName = {/literal}"{$form.formName}"{literal};
- cj('#_qf_' + formName + '_submit_save').click (
+ $('#_qf_' + formName + '_submit_save').click (
function(){
- if ( cj('#is_navigation').prop('checked') && cj('#parent_id').val() == '') {
+ if ( $('#is_navigation').prop('checked') && $('#parent_id').val() == '') {
var confirmMsg = {/literal}'{ts escape="js"}You have chosen to include this report in the Navigation Menu without selecting a Parent Menu item from the dropdown. This will add the report to the top level menu bar. Are you sure you want to continue?{/ts}'{literal}
return confirm(confirmMsg);
}
}
);
- cj('#_qf_' + formName + '_submit_next').click (
+ $('#_qf_' + formName + '_submit_next').click (
function(){
- if ( cj('#title').data('initial_value') == cj('#title').val() ) {
+ if ( $('#title').data('initial_value') == $('#title').val() ) {
var confirmMsg = {/literal}'{ts escape="js"}You are saving a copy of this report with the same report title. Are you sure you want to continue?{/ts}'{literal}
return confirm(confirmMsg);
}
CRM.$(function($) {
buildChart( );
- cj("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
+ $("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
// image creator php file path and append image name
var url = CRM.url('civicrm/report/chart', 'name=' + '{/literal}{$chartId}{literal}' + '.png');
{literal}
CRM.$(function($) {
- cj('#start_date_display').change( function( ) {
- if ( cj(this).val( ) ) {
- cj('#now').prop('checked', false );
+ $('#start_date_display').change( function( ) {
+ if ( $(this).val( ) ) {
+ $('#now').prop('checked', false );
}
});
- cj('#now').change( function( ) {
- if ( cj('#now').prop('checked', true ) ) {
- cj('#start_date_display').val( '' );
- cj('#start_date').val( '' );
- cj('#start_date_time').val( '' );
+ $('#now').change( function( ) {
+ if ( $('#now').prop('checked', true ) ) {
+ $('#start_date_display').val( '' );
+ $('#start_date').val( '' );
+ $('#start_date_time').val( '' );
}
});
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- cj('#selector tr:even').addClass('odd-row ');
- cj('#selector tr:odd ').addClass('even-row');
+ $('#selector tr:even').addClass('odd-row');
+ $('#selector tr:odd ').addClass('even-row');
});
</script>
{/literal}
{literal}
<script type="text/javascript">
-var otherModule = new Array( );
-{/literal}{foreach from=$otherModules item="mval" key="mkey"}{literal}
-otherModule[{/literal}{$mkey}{literal}] = '{/literal}{$mval}{literal}';
-{/literal}{/foreach}{literal}
CRM.$(function($) {
+ var otherModule = {/literal}{$otherModules|@json_encode}{literal};
if ( $.inArray( "Profile", otherModule ) > -1 && $.inArray( "Search Profile", otherModule ) == -1 ){
$('#profile_visibility').show();
}
<script type='text/javascript'>
CRM.$(function($) {ldelim}
var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}';
- var tabIndex = cj('#tab_' + selectedTab).prevAll().length;
+ var tabIndex = $('#tab_' + selectedTab).prevAll().length;
{literal}
- cj("#mainTabContainer").tabs( {active: tabIndex} );
+ $("#mainTabContainer").tabs( {active: tabIndex} );
});
{/literal}
</script>
CRM.$(function($) {
{/literal}
{foreach from=$trackingFields key=trackingFieldName item=dontCare}
- cj("#{$trackingFieldName}").parent().parent().hide( );
+ $("#{$trackingFieldName}").parent().parent().hide( );
{/foreach}
{literal}
}
}
function getAddressBlock( position ) {
- var addressBlockIds = new Array();
+ var addressBlockIds = [];
var i = 0;
switch ( position ) {
case 'last':
{literal}
<script type="text/javascript">
CRM.$(function($) {
- //bind the click event for action icon
- cj('.action-icon').click( function( ) {
- copyFieldValues( cj(this).attr('fname') );
- });
- });
-
- /**
- * This function use to copy fieldsi
- *
- * @param fname string field name
- * @return void
- */
- function copyFieldValues( fname ) {
- // this is the most common pattern for elements, so first check if it exits
- // this check field starting with "field[" and contains [fname] and is not
- // hidden ( for checkbox hidden element is created )
- var elementId = cj('.crm-copy-fields [name^="field["][name*="[' + fname +']"][type!=hidden]');
-
- // get the first element and it's value
- var firstElement = elementId.eq(0);
- var firstElementValue = firstElement.val();
-
- //console.log( elementId );
- //console.log( firstElement );
- //console.log( firstElementValue );
-
- //check if it is date element
- var isDateElement = elementId.attr('format');
-
- // check if it is wysiwyg element
- var editor = elementId.attr('editor');
-
- //get the element type
- var elementType = elementId.attr('type');
-
- // set the value for all the elements, elements needs to be handled are
- // select, checkbox, radio, date fields, text, textarea, multi-select
- // wysiwyg editor, advanced multi-select ( to do )
- if ( elementType == 'radio' ) {
- firstElementValue = elementId.filter(':checked').eq(0).val();
- elementId.filter("[value=" + firstElementValue + "]").prop("checked",true).change();
- }
- else if ( elementType == 'checkbox' ) {
- // handle checkbox
- // get the entity id of first element
- var firstEntityId = cj('.crm-copy-fields > tbody > tr');
-
- if ( firstEntityId.length == 0 ) {
- firstEntityId = firstElement.closest('div.crm-grid-row');
+ /**
+ * This function use to copy fields
+ *
+ * @param fname string field name
+ * @return void
+ */
+ function copyFieldValues( fname ) {
+ // this is the most common pattern for elements, so first check if it exits
+ // this check field starting with "field[" and contains [fname] and is not
+ // hidden ( for checkbox hidden element is created )
+ var elementId = $('.crm-copy-fields [name^="field["][name*="[' + fname +']"][type!=hidden]');
+
+ // get the first element and it's value
+ var firstElement = elementId.eq(0);
+ var firstElementValue = firstElement.val();
+
+ //check if it is date element
+ var isDateElement = elementId.attr('format');
+
+ // check if it is wysiwyg element
+ var editor = elementId.attr('editor');
+
+ //get the element type
+ var elementType = elementId.attr('type');
+
+ // set the value for all the elements, elements needs to be handled are
+ // select, checkbox, radio, date fields, text, textarea, multi-select
+ // wysiwyg editor, advanced multi-select ( to do )
+ if ( elementType == 'radio' ) {
+ firstElementValue = elementId.filter(':checked').eq(0).val();
+ elementId.filter("[value=" + firstElementValue + "]").prop("checked",true).change();
}
+ else if ( elementType == 'checkbox' ) {
+ // handle checkbox
+ // get the entity id of first element
+ var firstEntityId = $('.crm-copy-fields > tbody > tr');
- firstEntityId = firstEntityId.attr('entity_id');
+ if ( firstEntityId.length == 0 ) {
+ firstEntityId = firstElement.closest('div.crm-grid-row');
+ }
- var firstCheckElement = cj('.crm-copy-fields [type=checkbox][name^="field['+ firstEntityId +']['+ fname +']"][type!=hidden]');
+ firstEntityId = firstEntityId.attr('entity_id');
- if ( firstCheckElement.length > 1 ) {
- // lets uncheck all the checkbox except first one
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').prop('checked', false);
+ var firstCheckElement = $('.crm-copy-fields [type=checkbox][name^="field['+ firstEntityId +']['+ fname +']"][type!=hidden]');
- //here for each checkbox for first row, check if it is checked and set remaining checkboxes
- firstCheckElement.each(function() {
- if (cj(this).prop('checked') ) {
- var elementName = cj(this).attr('name');
- var correctIndex = elementName.split('field['+ firstEntityId +']['+ fname +'][');
- correctIndexValue = correctIndex[1].replace(']', '');
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').prop('checked',true).change();
- }
- });
- }
- else {
- if ( firstCheckElement.prop('checked') ) {
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change();
+ if ( firstCheckElement.length > 1 ) {
+ // lets uncheck all the checkbox except first one
+ $('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').prop('checked', false);
+
+ //here for each checkbox for first row, check if it is checked and set remaining checkboxes
+ firstCheckElement.each(function() {
+ if ($(this).prop('checked') ) {
+ var elementName = $(this).attr('name');
+ var correctIndex = elementName.split('field['+ firstEntityId +']['+ fname +'][');
+ correctIndexValue = correctIndex[1].replace(']', '');
+ $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').prop('checked',true).change();
+ }
+ });
}
else {
- cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change();
+ if ( firstCheckElement.prop('checked') ) {
+ $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change();
+ }
+ else {
+ $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change();
+ }
}
}
- }
- else if ( editor ) {
+ else if ( editor ) {
var firstElementId = firstElement.attr('id');
switch ( editor ) {
case 'ckeditor':
// copy first element content to all the elements
elementId.each( function() {
- var elemtId = cj(this).attr('id');
+ var elemtId = $(this).attr('id');
oEditor = CKEDITOR.instances[elemtId];
oEditor.setData( htmlContent );
});
// copy first element content to all the elements
elementId.each( function() {
- var elemtId = cj(this).attr('id');
+ var elemtId = $(this).attr('id');
tinyMCE.get( elemtId ).setContent( htmlContent );
});
break;
if (elementId.is('select') === true && firstElement.parent().find(':input').select().index() >= 1 && firstElement.parent().find('select').select().index < 1) {
// its a multiselect case
firstElement.parent().find(':input').select().each( function(count) {
- var firstElementValue = cj(this).val();
- var elementId = cj('.crm-copy-fields [name^="field["][name*="[' + fname +'][' + count + '"][type!=hidden]');
+ var firstElementValue = $(this).val();
+ var elementId = $('.crm-copy-fields [name^="field["][name*="[' + fname +'][' + count + '"][type!=hidden]');
elementId.val(firstElementValue).not(":first").change();
});
}
}
}
- // since we use different display field for date we also need to set it.
- // also check for date time field and set the value correctly
- if ( isDateElement ) {
- copyValuesDate( fname );
+ // since we use different display field for date we also need to set it.
+ // also check for date time field and set the value correctly
+ if ( isDateElement ) {
+ copyValuesDate( fname );
+ }
+ }
+
+ /**
+ * Special function to handle setting values for date fields
+ *
+ * @param fname string field name
+ * @return void
+ */
+ function copyValuesDate(fname) {
+ var fnameDisplay = fname + '_display';
+ var fnameTime = fname + '_time';
+
+ var displayElement = $('.crm-copy-fields [name^="field_"][name$="_' + fnameDisplay +'"][type!=hidden]');
+ var timeElement = $('.crm-copy-fields [name^="field["][name*="[' + fnameTime +']"][type!=hidden]');
+
+ displayElement.val( displayElement.eq(0).val() );
+ timeElement.val( timeElement.eq(0).val() );
}
- }
-
- /**
- * Special function to handle setting values for date fields
- *
- * @param fname string field name
- * @return void
- */
- function copyValuesDate(fname) {
- var fnameDisplay = fname + '_display';
- var fnameTime = fname + '_time';
-
- var displayElement = cj('.crm-copy-fields [name^="field_"][name$="_' + fnameDisplay +'"][type!=hidden]');
- var timeElement = cj('.crm-copy-fields [name^="field["][name*="[' + fnameTime +']"][type!=hidden]');
-
- displayElement.val( displayElement.eq(0).val() );
- timeElement.val( timeElement.eq(0).val() );
- }
+
+ //bind the click event for action icon
+ $('.action-icon').click(function( ) {
+ copyFieldValues($(this).attr('fname'));
+ });
+ });
+
</script>
{/literal}
var element_time = "#{$elementId}_time";
{if $timeElement}
element_time = "#{$timeElement}";
- var time_format = cj( element_time ).attr('timeFormat');
+ var time_format = $( element_time ).attr('timeFormat');
{literal}
- cj(element_time).timeEntry({ show24Hours : time_format, spinnerImage: '' });
+ $(element_time).timeEntry({ show24Hours : time_format, spinnerImage: '' });
{/literal}
{/if}
var currentYear = new Date().getFullYear();
var alt_field = '#{$elementId}';
- cj( alt_field ).hide();
- var date_format = cj( alt_field ).attr('format');
+ $( alt_field ).hide();
+ var date_format = $( alt_field ).attr('format');
var altDateFormat = 'mm/dd/yy';
{literal}
}
if ( !( ( date_format == 'M yy' ) || ( date_format == 'yy' ) || ( date_format == 'yy-mm' ) ) ) {
- cj( element_date ).addClass( 'dpDate' );
+ $( element_date ).addClass( 'dpDate' );
}
{/literal}
- var yearRange = currentYear - parseInt( cj( alt_field ).attr('startOffset') );
+ var yearRange = currentYear - parseInt( $( alt_field ).attr('startOffset') );
yearRange += ':';
- yearRange += currentYear + parseInt( cj( alt_field ).attr('endOffset' ) );
+ yearRange += currentYear + parseInt( $( alt_field ).attr('endOffset' ) );
{literal}
- var startRangeYr = currentYear - parseInt( cj( alt_field ).attr('startOffset') );
- var endRangeYr = currentYear + parseInt( cj( alt_field ).attr('endOffset' ) );
+ var startRangeYr = currentYear - parseInt( $( alt_field ).attr('startOffset') );
+ var endRangeYr = currentYear + parseInt( $( alt_field ).attr('endOffset' ) );
var lcMessage = {/literal}"{$config->lcMessages}"{literal};
var localisation = lcMessage.split('_');
- var dateValue = cj(alt_field).val( );
- cj(element_date).datepicker({
+ var dateValue = $(alt_field).val( );
+ $(element_date).datepicker({
closeAtTop : true,
dateFormat : date_format,
changeMonth : true,
// set default value to display field, setDefault param for datepicker
// is not working hence using below logic
// parse the date
- var displayDateValue = cj.datepicker.parseDate( altDateFormat, dateValue );
+ var displayDateValue = $.datepicker.parseDate( altDateFormat, dateValue );
// format date according to display field
- displayDateValue = cj.datepicker.formatDate( date_format, displayDateValue );
- cj( element_date).val( displayDateValue );
+ displayDateValue = $.datepicker.formatDate( date_format, displayDateValue );
+ $( element_date).val( displayDateValue );
//support unsaved-changes warning: CRM-14353
- cj( element_date).data('crm-initial-value', displayDateValue);
+ $( element_date).data('crm-initial-value', displayDateValue);
- cj(element_date).click( function( ) {
+ $(element_date).click( function( ) {
hideYear( this );
});
- cj('.ui-datepicker-trigger').click( function( ) {
- hideYear( cj(this).prev() );
+ $('.ui-datepicker-trigger').click( function( ) {
+ hideYear( $(this).prev() );
});
function hideYear( element ) {
- var format = cj( element ).attr('format');
+ var format = $( element ).attr('format');
if ( format == 'dd-mm' || format == 'mm/dd' ) {
- cj(".ui-datepicker-year").css('display', 'none');
+ $(".ui-datepicker-year").css('display', 'none');
}
}
- cj(alt_field + ',' + element_date + ',' + element_time).on('blur change', function() {
- var vis = cj(alt_field).val() || cj(element_time).val() ? '' : 'hidden';
- cj(this).siblings('.crm-clear-link').css('visibility', vis);
+ $(alt_field + ',' + element_date + ',' + element_time).on('blur change', function() {
+ var vis = $(alt_field).val() || $(element_time).val() ? '' : 'hidden';
+ $(this).siblings('.crm-clear-link').css('visibility', vis);
});
- cj(alt_field).change();
+ $(alt_field).change();
});
{/literal}
*}
{literal}
<script type="text/javascript">
-CRM.$(function($) {
-// for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget
-var useAjax = {/literal}{if $useAjax}1{else}0{/if}{literal};
-var sortEnabled = true;
-var sourceUrl = '';
-var useClass = 'display';
+ CRM.$(function($) {
-var tcount =1;
-if ( useAjax ) {
- {/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal}
- useClass = 'pagerDisplay';
- tcount =5;
-}
+ function getElementClass(element) {
+ return $(element).attr('class') || '';
+ }
-var tableId = '';
-var count = 1;
+ // fetch the occurrence of element
+ function getRowId(row,str) {
+ var optionId;
+ $.each( row, function(i, n) {
+ if( str === $(n).attr('class') ) {
+ optionId = i;
+ }
+ });
+ return optionId;
+ }
+
+ // for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget
+ var useAjax = {/literal}{if $useAjax}1{else}0{/if}{literal};
+ var sortEnabled = true;
+ var sourceUrl = '';
+ var useClass = 'display';
-//rename id of table with sequence
-//and create the object for navigation
-cj('table.' + useClass).each(function(){
- cj(this).attr('id','option' + tcount + count);
- tableId += count + ',';
- count++;
-});
+ var tcount =1;
+ if ( useAjax ) {
+ {/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal}
+ useClass = 'pagerDisplay';
+ tcount =5;
+ }
+
+ var tableId = '';
+ var count = 1;
+
+ //rename id of table with sequence
+ //and create the object for navigation
+ $('table.' + useClass).each(function(){
+ $(this).attr('id','option' + tcount + count);
+ tableId += count + ',';
+ count++;
+ });
-//remove last comma
-tableId = tableId.substring(0, tableId.length - 1 );
-eval('tableId =[' + tableId + ']');
+ //remove last comma
+ tableId = tableId.substring(0, tableId.length - 1 );
+ eval('tableId =[' + tableId + ']');
- cj.each(tableId, function(i,n){
- tabId = '#option' + tcount + n;
- //get the object of first tr data row.
- tdObject = cj(tabId + ' tr:nth(1) td');
- var id = -1; var count = 0; var columns=''; var sortColumn = '';
- //build columns array for sorting or not sorting
- cj(tabId + ' th').each( function( ) {
- var option = cj(this).prop('id').split("_");
+ $.each(tableId, function(i,n){
+ tabId = '#option' + tcount + n;
+ //get the object of first tr data row.
+ tdObject = $(tabId + ' tr:nth(1) td');
+ var id = -1; var count = 0; var columns=''; var sortColumn = '';
+ //build columns array for sorting or not sorting
+ $(tabId + ' th').each( function( ) {
+ var option = $(this).prop('id').split("_");
option = ( option.length > 1 ) ? option[1] : option[0];
stype = 'numeric';
switch( option ) {
- case 'sortable':
- sortColumn += '[' + count + ', "asc" ],';
- columns += '{"sClass": "'+ getElementClass( this ) +'"},';
+ case 'sortable':
+ sortColumn += '[' + count + ', "asc" ],';
+ columns += '{"sClass": "'+ getElementClass( this ) +'"},';
break;
- case 'date':
- stype = 'date';
- case 'order':
- if ( cj(this).attr('class') == 'sortable' ){
- sortColumn += '[' + count + ', "asc" ],';
- }
- sortId = getRowId(tdObject, cj(this).attr('id') +' hiddenElement' );
- sortEnabled = true;
- columns += '{ "render": function ( data, type, row ) { return "<div style=\'display:none\'>"+ data +"</div>" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},';
+ case 'date':
+ stype = 'date';
+ case 'order':
+ if ( $(this).attr('class') == 'sortable' ){
+ sortColumn += '[' + count + ', "asc" ],';
+ }
+ sortId = getRowId(tdObject, $(this).attr('id') +' hiddenElement' );
+ sortEnabled = true;
+ columns += '{ "render": function ( data, type, row ) { return "<div style=\'display:none\'>"+ data +"</div>" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},';
break;
- case 'nosort':
- columns += '{ "bSortable": false, "sClass": "'+ getElementClass( this ) +'"},';
+ case 'nosort':
+ columns += '{ "bSortable": false, "sClass": "'+ getElementClass( this ) +'"},';
break;
- case 'currency':
- columns += '{ "sType": "currency" },';
+ case 'currency':
+ columns += '{ "sType": "currency" },';
break;
- case 'link':
- columns += '{"sType": "html"},';
+ case 'link':
+ columns += '{"sType": "html"},';
break;
- default:
- if ( cj(this).text() ) {
- columns += '{"sClass": "'+ getElementClass( this ) +'"},';
- } else {
- columns += '{ "bSortable": false },';
- }
+ default:
+ if ( $(this).text() ) {
+ columns += '{"sClass": "'+ getElementClass( this ) +'"},';
+ } else {
+ columns += '{ "bSortable": false },';
+ }
break;
}
count++;
- });
- columns = columns.substring(0, columns.length - 1 );
- sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
- eval('sortColumn =[' + sortColumn + ']');
- eval('columns =[' + columns + ']');
+ });
+ columns = columns.substring(0, columns.length - 1 );
+ sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
+ eval('sortColumn =[' + sortColumn + ']');
+ eval('columns =[' + columns + ']');
- var currTable = cj(tabId);
- if (currTable) {
- // contains the dataTables master records
- var s = cj(document).dataTableSettings;
- if (s != 'undefined') {
- var len = s.length;
- for (var i=0; i < len; i++) {
- // if already exists, remove from the array
- if (s[i].sInstance = tabId) {
- s.splice(i,1);
- }
- }
+ var currTable = $(tabId);
+ if (currTable) {
+ // contains the dataTables master records
+ var s = $(document).dataTableSettings;
+ if (s != 'undefined') {
+ var len = s.length;
+ for (var i=0; i < len; i++) {
+ // if already exists, remove from the array
+ if (s[i].sInstance = tabId) {
+ s.splice(i,1);
+ }
+ }
}
- }
+ }
- var noRecordFoundMsg = {/literal}'{ts escape="js"}There are no records.{/ts}'{literal};
+ var noRecordFoundMsg = {/literal}'{ts escape="js"}There are no records.{/ts}'{literal};
- oTable = null;
- if ( useAjax ) {
- oTable = cj(tabId).dataTable({
- "bFilter" : false,
- "bAutoWidth" : false,
- "aaSorting" : sortColumn,
- "aoColumns" : columns,
- "bProcessing": true,
- "bJQueryUI" : true,
- "asStripClasses" : [ "odd-row", "even-row" ],
- "sPaginationType": "full_numbers",
- "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
- "bServerSide": true,
- "sAjaxSource": sourceUrl,
- "oLanguage":{"sEmptyTable" : noRecordFoundMsg,
- "sZeroRecords" : noRecordFoundMsg },
+ oTable = null;
+ if ( useAjax ) {
+ oTable = $(tabId).dataTable({
+ "bFilter" : false,
+ "bAutoWidth" : false,
+ "aaSorting" : sortColumn,
+ "aoColumns" : columns,
+ "bProcessing": true,
+ "bJQueryUI" : true,
+ "asStripClasses" : [ "odd-row", "even-row" ],
+ "sPaginationType": "full_numbers",
+ "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
+ "bServerSide": true,
+ "sAjaxSource": sourceUrl,
+ "oLanguage":{"sEmptyTable" : noRecordFoundMsg,
+ "sZeroRecords" : noRecordFoundMsg },
- {/literal}{if !empty($callBack)}{literal}
- "fnDrawCallback": function() { checkSelected(); },
- {/literal}{/if}{literal}
+ {/literal}{if !empty($callBack)}{literal}
+ "fnDrawCallback": function() { checkSelected(); },
+ {/literal}{/if}{literal}
- "fnServerData": function ( sSource, aoData, fnCallback ) {
- cj.ajax( {
- "dataType": 'json',
- "type": "POST",
- "url": sSource,
- "data": aoData,
- "success": fnCallback
- });
- }
- });
- } else {
- oTable = cj(tabId).dataTable({
- "aaSorting" : sortColumn,
- "bPaginate" : false,
- "bLengthChange": true,
- "bFilter" : false,
- "bInfo" : false,
- "asStripClasses" : [ "odd-row", "even-row" ],
- "bAutoWidth" : false,
- "aoColumns" : columns,
- "bSort" : sortEnabled,
- "oLanguage":{"sEmptyTable" : noRecordFoundMsg,
- "sZeroRecords" : noRecordFoundMsg }
- });
- }
- var object;
+ "fnServerData": function ( sSource, aoData, fnCallback ) {
+ $.ajax( {
+ "dataType": 'json',
+ "type": "POST",
+ "url": sSource,
+ "data": aoData,
+ "success": fnCallback
+ });
+ }
+ });
+ } else {
+ oTable = $(tabId).dataTable({
+ "aaSorting" : sortColumn,
+ "bPaginate" : false,
+ "bLengthChange": true,
+ "bFilter" : false,
+ "bInfo" : false,
+ "asStripClasses" : [ "odd-row", "even-row" ],
+ "bAutoWidth" : false,
+ "aoColumns" : columns,
+ "bSort" : sortEnabled,
+ "oLanguage":{"sEmptyTable" : noRecordFoundMsg,
+ "sZeroRecords" : noRecordFoundMsg }
+ });
+ }
+ var object;
});
-});
-
-function getElementClass( element ) {
-if( cj(element).attr('class') ) return cj(element).attr('class');
-return '';
-}
-
-//function to fetch the occurence of element
-function getRowId(row,str){
- cj.each( row, function(i, n) {
- if( str === cj(n).attr('class') ) {
- optionId = i;
- }
- });
-return optionId;
-}
+ });
-//plugin to sort on currency
-var symbol = "{/literal}{$config->defaultCurrencySymbol($config->defaultSymbol)}{literal}";
-cj.fn.dataTableExt.oSort['currency-asc'] = function(a,b) {
- var x = (a == "-") ? 0 : a.replace( symbol, "" );
- var y = (b == "-") ? 0 : b.replace( symbol, "" );
- x = parseFloat( x );
- y = parseFloat( y );
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
-};
+ //plugin to sort on currency
+ var symbol = "{/literal}{$config->defaultCurrencySymbol($config->defaultSymbol)}{literal}";
+ cj.fn.dataTableExt.oSort['currency-asc'] = function(a,b) {
+ var x = (a == "-") ? 0 : a.replace( symbol, "" );
+ var y = (b == "-") ? 0 : b.replace( symbol, "" );
+ x = parseFloat( x );
+ y = parseFloat( y );
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+ };
-cj.fn.dataTableExt.oSort['currency-desc'] = function(a,b) {
- var x = (a == "-") ? 0 : a.replace( symbol, "" );
- var y = (b == "-") ? 0 : b.replace( symbol, "" );
- x = parseFloat( x );
- y = parseFloat( y );
- return ((x < y) ? 1 : ((x > y) ? -1 : 0));
-};
+ cj.fn.dataTableExt.oSort['currency-desc'] = function(a,b) {
+ var x = (a == "-") ? 0 : a.replace( symbol, "" );
+ var y = (b == "-") ? 0 : b.replace( symbol, "" );
+ x = parseFloat( x );
+ y = parseFloat( y );
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+ };
</script>
{/literal}
}
CRM.$(function($) {
- cj('.crm-group.payment_options-group').show();
+ $('.crm-group.payment_options-group').show();
- cj('input[name="payment_processor"]').change( function() {
- buildPaymentBlock( cj(this).val() );
+ $('input[name="payment_processor"]').change( function() {
+ buildPaymentBlock( $(this).val() );
});
});
{/if}
</div>
{/if}
-{literal}
-<script type="text/javascript">
-CRM.$(function($) {
- cj().crmaccordions();
-});
-</script>
-{/literal}