From 8539f25df68e9a120935392af49ab535dcbec1a7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 18 Dec 2013 16:01:18 -0800 Subject: [PATCH] CRM-13932 - Fix deprecated useages of .attr --- js/Common.js | 12 ++--- templates/CRM/Campaign/Form/Gotv.tpl | 12 ++--- templates/CRM/Campaign/Form/ResultOptions.tpl | 2 +- templates/CRM/Contact/Form/Merge.tpl | 16 ++----- templates/CRM/Contact/Form/Relationship.tpl | 14 +++--- templates/CRM/Contact/Form/Search/Custom.tpl | 4 +- templates/CRM/Contact/Form/Selector.tpl | 8 ++-- templates/CRM/Contact/Form/ShareAddress.tpl | 2 +- .../CRM/Contribute/Form/Contribution.tpl | 4 +- .../CRM/Contribute/Form/Contribution/Main.tpl | 4 +- .../Form/Contribution/MembershipBlock.tpl | 8 ++-- .../Form/Contribution/OnBehalfOf.tpl | 20 ++++---- .../Form/Contribution/PremiumBlock.tpl | 6 +-- .../Form/ContributionPage/Amount.tpl | 12 ++--- templates/CRM/Core/BillingBlock.tpl | 6 +-- templates/CRM/Custom/Form/Group.tpl | 2 +- .../CRM/Event/Cart/Form/Checkout/Payment.tpl | 2 +- templates/CRM/Event/Form/EventFees.tpl | 2 +- .../Event/Form/ManageEvent/Registration.tpl | 8 ++-- templates/CRM/Event/Form/Participant.tpl | 6 +-- templates/CRM/Financial/Form/Export.tpl | 2 +- templates/CRM/Mailing/Form/Schedule.tpl | 4 +- templates/CRM/Mailing/Form/Search.tpl | 6 +-- templates/CRM/Mailing/Form/Settings.tpl | 7 ++- templates/CRM/Member/Form/Membership.tpl | 46 +++++++++---------- templates/CRM/Member/Form/MembershipBlock.tpl | 2 +- .../CRM/Member/Form/MembershipRenewal.tpl | 8 ++-- templates/CRM/Member/Form/Task/Label.js | 6 +-- templates/CRM/Price/Form/Calculate.tpl | 6 +-- templates/CRM/Price/Form/ParticipantCount.tpl | 6 +-- templates/CRM/Report/Form/Criteria.tpl | 6 +-- templates/CRM/Report/Form/Instance.tpl | 2 +- templates/CRM/SMS/Form/Schedule.tpl | 4 +- templates/CRM/UF/Form/Field.tpl | 14 +++--- templates/CRM/common/additionalBlocks.tpl | 14 +++--- templates/CRM/common/batchCopy.tpl | 8 ++-- 36 files changed, 140 insertions(+), 151 deletions(-) diff --git a/js/Common.js b/js/Common.js index 4e38c1e704..0ea2147290 100644 --- a/js/Common.js +++ b/js/Common.js @@ -184,12 +184,8 @@ function showHideByValue(trigger_field_id, trigger_value, target_element_id, tar * @return */ function toggleCheckboxVals(fldPrefix, object) { - if (object.id == 'toggleSelect' && cj(object).is(':checked')) { - cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', true); - } - else { - cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').attr('checked', false); - } + var val = (object.id == 'toggleSelect' && cj(object).is(':checked')); + cj('Input[id*="' + fldPrefix + '"],Input[id*="toggleSelect"]').prop('checked', val); // change the class of selected rows on_load_init_checkboxes(object.form.name); } @@ -293,8 +289,8 @@ function checkPerformAction(fldPrefix, form, taskButton, selection) { */ function checkSelectedBox(chkName) { var checkElement = cj('#' + chkName); - if (checkElement.attr('checked')) { - cj('input[value=ts_sel]:radio').attr('checked', true); + if (checkElement.prop('checked')) { + cj('input[value=ts_sel]:radio').prop('checked', true); checkElement.parents('tr').addClass('crm-row-selected'); } else { diff --git a/templates/CRM/Campaign/Form/Gotv.tpl b/templates/CRM/Campaign/Form/Gotv.tpl index f1d7166184..b5c9555298 100755 --- a/templates/CRM/Campaign/Form/Gotv.tpl +++ b/templates/CRM/Campaign/Form/Gotv.tpl @@ -175,7 +175,7 @@ function processVoterData( element, operation ) if ( operation == 'release' ) { data['operation'] = operation; data['activity_id'] = cj( element ).val( ); - data['isDelete'] = cj( element ).attr( 'checked') ? 1:0; + data['isDelete'] = cj( element ).prop('checked') ? 1:0; } else if ( operation == 'reserve' ) { var interviewerId = cj( '#survey_interviewer_id' ).val( ); data['operation'] = operation; @@ -183,11 +183,11 @@ function processVoterData( element, operation ) data['target_contact_id'] = cj( element ).val( ); data['source_contact_id'] = interviewerId; data['assignee_contact_id'] = interviewerId; - data['isReserved'] = cj( element ).attr( 'checked') ? 1:0; + data['isReserved'] = cj( element ).prop('checked') ? 1:0; } else if ( operation == 'gotv' ) { data['operation'] = operation; data['activity_id'] = cj( element ).val( ); - data['hasVoted'] = cj( element ).attr( 'checked') ? 1: 0; + data['hasVoted'] = cj( element ).prop('checked') ? 1: 0; } data['surveyTitle'] = {/literal}'{$surveyTitle|escape:javascript}'{literal}; @@ -204,11 +204,11 @@ function processVoterData( element, operation ) cj( msgId ).fadeIn('slow').fadeOut('slow'); if ( operation == 'release' ) { msg = '{/literal}{ts escape='js'}Save as voted.{/ts}{literal}'; - var isDeleted = cj( element ).attr( 'checked') ? 1:0; + var isDeleted = cj( element ).prop('checked') ? 1:0; if ( !isDeleted ) msg = '{/literal}{ts escape='js'}Save as non voted.{/ts}{literal}'; } else if ( operation == 'gotv' ) { msg = '{/literal}{ts escape='js'}Vote Recorded.{/ts}{literal}'; - var hasVoted = cj( element ).attr( 'checked') ? 1:0; + var hasVoted = cj( element ).prop('checked') ? 1:0; var trObject = cj( '[id^="survey_activity['+ cj( element ).val() +']"]' ).parents('tr' ); var methodName = 'addClass'; if ( !hasVoted ) { @@ -217,7 +217,7 @@ function processVoterData( element, operation ) } eval( 'trObject.' + methodName + "( 'name disabled' )" ); } else if ( operation == 'reserve' ) { - if ( cj( element ).attr( 'checked') ) { + if ( cj( element ).prop('checked') ) { msg = '{/literal}{ts escape='js'}Reserved.{/ts}{literal}'; } else { msg = '{/literal}{ts escape='js'}Released.{/ts}{literal}'; diff --git a/templates/CRM/Campaign/Form/ResultOptions.tpl b/templates/CRM/Campaign/Form/ResultOptions.tpl index bcf6a9aa3b..a40880a4f9 100644 --- a/templates/CRM/Campaign/Form/ResultOptions.tpl +++ b/templates/CRM/Campaign/Form/ResultOptions.tpl @@ -151,7 +151,7 @@ } if ( result[key].is_default == 1 ) { - cj('#radio'+countRows+' input').attr('checked', 'true'); + cj('#radio'+countRows+' input').prop('checked', true); } if ( countRows > 1 ) { diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index 7bae2d328d..b6472b416f 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -149,25 +149,19 @@ cj(document).ready(function(){ switch ( element['1'] ) { case 'addressee': - var ele = '#' + element['0'] + '_' + element['1']; + ele = '#' + element['0'] + '_' + element['1']; break; case 'email': case 'postal': - var ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2']; + ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2']; break; } if( ele ) { - cj(this).bind( 'click', function() { - - if( cj( this).attr( 'checked' ) ){ - cj('input' + ele ).attr('checked', true ); - cj('input' + ele + '_custom' ).attr('checked', true ); - } else { - cj('input' + ele ).attr('checked', false ); - cj('input' + ele + '_custom' ).attr('checked', false ); - } + cj(this).on('click', function() { + var val = cj(this).prop('checked'); + cj('input' + ele + ', input' + ele + '_custom').prop('checked', val); }); } }); diff --git a/templates/CRM/Contact/Form/Relationship.tpl b/templates/CRM/Contact/Form/Relationship.tpl index 2ff3da0ceb..6510367c28 100644 --- a/templates/CRM/Contact/Form/Relationship.tpl +++ b/templates/CRM/Contact/Form/Relationship.tpl @@ -415,14 +415,14 @@ cj( function( ) { cj('.pagerDisplay').on('click', '.contact_select input', function () { var valueSelected = cj(this).val(); - if ( cj(this).attr('checked') ) { + if ( cj(this).prop('checked') ) { contact_checked[valueSelected] = valueSelected; countSelected++; } else if( contact_checked[valueSelected] ) { delete contact_checked[valueSelected]; countSelected--; if ( useEmployer && employer_holdelement[valueSelected] ) { - cj( employer_holdelement[valueSelected] ).attr('checked',false); + cj( employer_holdelement[valueSelected] ).prop('checked',false); delete employer_checked[valueSelected]; delete employer_holdelement[valueSelected]; } @@ -436,11 +436,11 @@ cj( function( ) { if ( isRadio ) { employer_checked = new Array(); } - if ( cj(this).attr('checked') ) { + if ( cj(this).prop('checked') ) { // add validation to match with selected contacts if( !contact_checked[valueSelected] ) { cj(this).crmError({/literal}'{ts escape="js"}Current employer / Current employee should be among the selected contacts.{/ts}'{literal}); - cj(this).attr('checked',false); + cj(this).prop('checked',false); } else { employer_checked[valueSelected] = valueSelected; employer_holdelement[valueSelected] = this; @@ -458,7 +458,7 @@ cj( function( ) { function checkSelected( ) { cj('.pagerDisplay tbody tr .contact_select input').each( function( ) { if ( contact_checked[cj(this).val()] ) { - cj(this).attr('checked',true); + cj(this).prop('checked',true); } }); @@ -467,7 +467,7 @@ function checkSelected( ) { employer_holdelement = new Array(); cj('.pagerDisplay tbody tr .'+ employerClass +' input').each( function( ) { if ( employer_checked[cj(this).val()] ) { - cj(this).attr('checked',true); + cj(this).prop('checked',true); employer_holdelement[cj(this).val()] = this; } }); @@ -503,7 +503,7 @@ function submitAjaxData() { {/literal} {if $searchRows} {literal} cj(".contact_select .form-checkbox").each( function( ) { if (this) { - cj(this).attr('checked',true); + cj(this).prop('checked',true); } }); {/literal} {/if} {literal} diff --git a/templates/CRM/Contact/Form/Search/Custom.tpl b/templates/CRM/Contact/Form/Search/Custom.tpl index 8c03008a2b..1db46eee55 100644 --- a/templates/CRM/Contact/Form/Search/Custom.tpl +++ b/templates/CRM/Contact/Form/Search/Custom.tpl @@ -171,10 +171,10 @@ function toggleContactSelection( name, qfKey, selection ){ cj.post( Url, { qfKey: qfKey , variableType: 'multiple' , action: 'unselect' } ); {/literal} {foreach from=$rows item=row}{literal} - cj("#{/literal}{$row.checkbox}{literal}").removeAttr('checked');{/literal} + cj("#{/literal}{$row.checkbox}{literal}").prop('checked', false);{/literal} {/foreach} {literal} - cj("#toggleSelect").removeAttr('checked'); + cj("#toggleSelect").prop('checked', false); var formName = "{/literal}{$form.formName}{literal}"; on_load_init_checkboxes(formName); } diff --git a/templates/CRM/Contact/Form/Selector.tpl b/templates/CRM/Contact/Form/Selector.tpl index 3fbb83db51..21a2d27d88 100644 --- a/templates/CRM/Contact/Form/Selector.tpl +++ b/templates/CRM/Contact/Form/Selector.tpl @@ -147,7 +147,7 @@ diff --git a/templates/CRM/Mailing/Form/Settings.tpl b/templates/CRM/Mailing/Form/Settings.tpl index 4a2fe10afc..94f49db810 100644 --- a/templates/CRM/Mailing/Form/Settings.tpl +++ b/templates/CRM/Mailing/Form/Settings.tpl @@ -34,14 +34,13 @@ cj( function($) { cj(this).parent().parent().hide(); } }); - if (!cj('#override_verp').attr('checked')){ + if (!cj('#override_verp').prop('checked')){ cj('.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').attr('checked')) { - cj('#forward_replies').attr('checked',false); - cj('#auto_responder').attr('checked',false); + if (!cj('#override_verp').prop('checked')) { + cj('#forward_replies, #auto_responder').prop('checked', false); } }); diff --git a/templates/CRM/Member/Form/Membership.tpl b/templates/CRM/Member/Form/Membership.tpl index e4cdec27e9..61cf3eadfd 100644 --- a/templates/CRM/Member/Form/Membership.tpl +++ b/templates/CRM/Member/Form/Membership.tpl @@ -341,7 +341,7 @@ if ( !mode ) { // Offline form (mode = false) has the record_contribution checkbox cj('#record_contribution').click( function( ) { - if ( cj(this).attr('checked') ) { + if ( cj(this).prop('checked') ) { cj('#recordContribution').show( ); setPaymentBlock( false, true); } @@ -368,7 +368,7 @@ function setDifferentContactBlock( ) { // show/hide different contact section - if ( cj('#is_different_contribution_contact').attr('checked') ) { + if ( cj('#is_different_contribution_contact').prop('checked') ) { cj('#record-different-contact').show(); } else { @@ -403,7 +403,7 @@ {/literal}{if !$membershipMode}{literal} showHideMemberStatus(); function showHideMemberStatus() { - if ( cj( "#is_override" ).attr('checked' ) ) { + if ( cj( "#is_override" ).prop('checked' ) ) { cj('#memberStatus').show( ); cj('#memberStatus_show').hide( ); } @@ -433,11 +433,11 @@ {/literal}{if $action eq 1}{literal} if (!checkboxEvent) { if (allMemberships[memType]['total_amount_numeric'] > 0) { - cj('#record_contribution').attr('checked','checked'); + cj('#record_contribution').prop('checked','checked'); cj('#recordContribution').show(); } else { - cj('#record_contribution').removeAttr('checked'); + cj('#record_contribution').prop('checked', false); cj('#recordContribution').hide(); } } @@ -506,7 +506,7 @@ if ( allowAutoRenew || alreadyAutoRenew ) { cj( "#auto_renew" ).click(function( ) { if ( cj(this).attr( 'readonly' ) ) { - cj(this).attr( 'checked', true ); + cj(this).prop('checked', true ); } }); } @@ -525,7 +525,7 @@ //for update lets hide it when not already recurring. if ( action == 2 ) { //user can't cancel auto renew by unchecking. - if ( cj("#auto_renew").attr( 'checked' ) ) { + if ( cj("#auto_renew").prop('checked' ) ) { cj("#auto_renew").attr( 'readonly', true ); } else { @@ -542,7 +542,7 @@ //we don't have both required values. if ( !processorId || !membershipType ) { - cj("#auto_renew").attr( 'checked', false ); + cj("#auto_renew").prop('checked', false ); cj("#autoRenew").hide( ); return; } @@ -552,7 +552,7 @@ var currentOption = autoRenewOptions[membershipType]; if ( !currentOption || !recurProcessors[processorId] ) { - cj("#auto_renew").attr( 'checked', false ); + cj("#auto_renew").prop('checked', false ); cj("#autoRenew").hide( ); return; } @@ -560,29 +560,29 @@ if ( currentOption == 1 ) { cj("#autoRenew").show( ); if ( cj("#auto_renew").attr( 'readonly' ) ) { - cj("#auto_renew").attr('checked', false ); + cj("#auto_renew").prop('checked', false ); cj("#auto_renew").removeAttr( 'readonly' ); } } else if ( currentOption == 2 ) { cj("#autoRenew").show( ); - cj("#auto_renew").attr( 'checked', true ); + cj("#auto_renew").prop('checked', true ); cj("#auto_renew").attr( 'readonly', true ); } else { - cj("#auto_renew").attr( 'checked', false ); + cj("#auto_renew").prop('checked', false ); cj("#autoRenew").hide( ); } //play w/ receipt option. - if ( cj("#auto_renew").attr( 'checked' ) ) { + if ( cj("#auto_renew").prop('checked' ) ) { cj("#notice").hide( ); - cj("#send_receipt").attr( 'checked', false ); + cj("#send_receipt").prop('checked', false ); cj("#send-receipt").hide( ); } else { cj("#send-receipt").show( ); - if ( cj("#send_receipt").attr( 'checked' ) ) { + if ( cj("#send_receipt").prop('checked' ) ) { cj("#notice").show( ); } } @@ -592,13 +592,13 @@ {literal} function buildReceiptANDNotice( ) { - if ( cj("#auto_renew").attr( 'checked' ) ) { + if ( cj("#auto_renew").prop('checked' ) ) { cj("#notice").hide( ); cj("#send-receipt").hide( ); } else { cj("#send-receipt").show( ); - if ( cj("#send_receipt").attr( 'checked' ) ) { + if ( cj("#send_receipt").prop('checked' ) ) { cj("#notice").show( ); } } @@ -640,7 +640,7 @@ cj('#autoRenew').hide(); var autoRenew = cj("#auto_renew"); autoRenew.removeAttr( 'readOnly' ); - autoRenew.removeAttr( 'checked' ); + autoRenew.prop('checked', false ); {/literal}{/if}{literal} return; } @@ -714,13 +714,13 @@ cj('#autoRenew').hide(); var autoRenew = cj("#auto_renew"); autoRenew.removeAttr( 'readOnly' ); - autoRenew.removeAttr( 'checked' ); + autoRenew.prop('checked', false ); if ( autoRenewOption == 1 ) { cj('#autoRenew').show(); } else if ( autoRenewOption == 2 ) { autoRenew.attr( 'readOnly', true ); - autoRenew.attr( 'checked', true ); + autoRenew.prop('checked', true ); cj('#autoRenew').show(); } {/literal}{/if}{literal} @@ -730,7 +730,7 @@ if ( cj(this).attr('price') ) { switch( cj(this).attr('type') ) { case 'checkbox': - if ( cj(this).attr('checked') ) { + if ( cj(this).prop('checked') ) { eval( 'var option = ' + cj(this).attr('price') ) ; var ele = option[0]; var memTypeId = optionsMembershipTypes[ele]; @@ -747,7 +747,7 @@ break; case 'radio': - if ( cj(this).attr('checked') && cj(this).val() ) { + if ( cj(this).prop('checked') && cj(this).val() ) { var memTypeId = optionsMembershipTypes[cj(this).val()]; if ( memTypeId && cj.inArray(memTypeId, currentMembershipType) == -1 ) { currentMembershipType[count] = memTypeId; @@ -811,7 +811,7 @@ } function enableAmountSection( setContributionType ) { - if ( !cj('#record_contribution').attr('checked') ) { + if ( !cj('#record_contribution').prop('checked') ) { cj('#record_contribution').click( ); cj('#recordContribution').show( ); } diff --git a/templates/CRM/Member/Form/MembershipBlock.tpl b/templates/CRM/Member/Form/MembershipBlock.tpl index b9bd1055d4..88e0e7c1cc 100644 --- a/templates/CRM/Member/Form/MembershipBlock.tpl +++ b/templates/CRM/Member/Form/MembershipBlock.tpl @@ -158,7 +158,7 @@ // function to show/hide membership block fields function showHideMembershipBlock( ) { - if ( cj('#member_is_active').attr('checked') ) { + if ( cj('#member_is_active').prop('checked') ) { cj('#memberFields').show(); } else { cj('#memberFields').hide(); diff --git a/templates/CRM/Member/Form/MembershipRenewal.tpl b/templates/CRM/Member/Form/MembershipRenewal.tpl index 217fb1c763..554366162a 100644 --- a/templates/CRM/Member/Form/MembershipRenewal.tpl +++ b/templates/CRM/Member/Form/MembershipRenewal.tpl @@ -339,7 +339,7 @@ cj(function () { cj('#record_contribution').click(function () { - if (cj(this).attr('checked')) { + if (cj(this).prop('checked')) { cj('#recordContribution').show(); setPaymentBlock(true); } @@ -371,11 +371,11 @@ if (!checkboxEvent) { if (allMemberships[memType]['total_amount_numeric'] > 0) { - cj('#record_contribution').attr('checked', 'checked'); + cj('#record_contribution').prop('checked', true); cj('#recordContribution').show(); } else { - cj('#record_contribution').removeAttr('checked'); + cj('#record_contribution').prop('checked', false); cj('#recordContribution').hide(); } } @@ -398,7 +398,7 @@ function setDifferentContactBlock() { //get the - if (cj('#contribution_contact').attr('checked')) { + if (cj('#contribution_contact').prop('checked')) { cj('#record-different-contact').show(); } else { diff --git a/templates/CRM/Member/Form/Task/Label.js b/templates/CRM/Member/Form/Task/Label.js index ee774b4956..367ea240c9 100644 --- a/templates/CRM/Member/Form/Task/Label.js +++ b/templates/CRM/Member/Form/Task/Label.js @@ -4,8 +4,8 @@ cj(function ($) { if($(this).is(":checked")) { $('#merge_same_address').attr('disabled', true); $('#merge_same_household').attr('disabled', true); - $('#merge_same_address').attr('checked', false); - $('#merge_same_household').attr('checked', false); + $('#merge_same_address').prop('checked', false); + $('#merge_same_household').prop('checked', false); } else { $('#merge_same_address').attr('disabled', false); @@ -14,4 +14,4 @@ cj(function ($) { }); -}); \ No newline at end of file +}); diff --git a/templates/CRM/Price/Form/Calculate.tpl b/templates/CRM/Price/Form/Calculate.tpl index 37b8713a1a..5421ba6911 100644 --- a/templates/CRM/Price/Form/Calculate.tpl +++ b/templates/CRM/Price/Form/Calculate.tpl @@ -57,7 +57,7 @@ cj("input,#priceset select,#priceset").each(function () { optionPart = option[1].split(optionSep); addprice = parseFloat( optionPart[0] ); - if( cj(this).attr('checked') ) { + if( cj(this).prop('checked') ) { totalfee += addprice; price[ele] += addprice; } @@ -65,7 +65,7 @@ cj("input,#priceset select,#priceset").each(function () { //event driven calculation of element. cj(this).click( function(){ - if ( cj(this).attr('checked') ) { + if ( cj(this).prop('checked') ) { totalfee += addprice; price[ele] += addprice; } else { @@ -92,7 +92,7 @@ cj("input,#priceset select,#priceset").each(function () { price[ele] = 0; } - if( cj(this).attr('checked') ) { + if( cj(this).prop('checked') ) { totalfee = parseFloat(totalfee) + addprice - parseFloat(price[ele]); price[ele] = addprice; } diff --git a/templates/CRM/Price/Form/ParticipantCount.tpl b/templates/CRM/Price/Form/ParticipantCount.tpl index b19c9b02c9..6a5745e57b 100644 --- a/templates/CRM/Price/Form/ParticipantCount.tpl +++ b/templates/CRM/Price/Form/ParticipantCount.tpl @@ -53,13 +53,13 @@ addCount = parseInt(optionPart[1]); } - if( cj(this).attr('checked') ) { + if( cj(this).prop('checked') ) { pPartiCount += addCount; pPartiRef[ele] += addCount; } cj(this).click( function(){ - if( cj(this).attr('checked') ) { + if( cj(this).prop('checked') ) { pPartiCount += addCount; pPartiRef[ele] += addCount; } else { @@ -84,7 +84,7 @@ pPartiRef[ele] = 0; } - if( cj(this).attr('checked') ) { + if( cj(this).prop('checked') ) { pPartiCount = parseInt(pPartiCount) + addCount - parseInt(pPartiRef[ele]); pPartiRef[ele] = addCount; } diff --git a/templates/CRM/Report/Form/Criteria.tpl b/templates/CRM/Report/Form/Criteria.tpl index d4d1b15fa9..cfbd681aa8 100644 --- a/templates/CRM/Report/Form/Criteria.tpl +++ b/templates/CRM/Report/Form/Criteria.tpl @@ -138,7 +138,7 @@ cj('input[id^="order_by_section_"]').click(disPageBreak).each(disPageBreak); function disPageBreak() { - if (!cj(this).attr('checked')) { + if (!cj(this).prop('checked')) { cj(this).parent('td').next('td').children('input[id^="order_by_pagebreak_"]').attr({checked: false, disabled: "disabled"}); } else { @@ -151,8 +151,8 @@ // clear values on hidden field, so they're not saved cj('select#order_by_column_'+ i).val(''); cj('select#order_by_order_'+ i).val('ASC'); - cj('input#order_by_section_'+ i).attr('checked', false); - cj('input#order_by_pagebreak_'+ i).attr('checked', false); + cj('input#order_by_section_'+ i).prop('checked', false); + cj('input#order_by_pagebreak_'+ i).prop('checked', false); } {/literal} diff --git a/templates/CRM/Report/Form/Instance.tpl b/templates/CRM/Report/Form/Instance.tpl index b1fa6fa6e0..366f05f64b 100644 --- a/templates/CRM/Report/Form/Instance.tpl +++ b/templates/CRM/Report/Form/Instance.tpl @@ -126,7 +126,7 @@ var formName = {/literal}"{$form.formName}"{literal}; cj('#_qf_' + formName + '_submit_save').click ( function(){ - if ( cj('#is_navigation').attr('checked') && cj('#parent_id').val() == '') { + if ( cj('#is_navigation').prop('checked') && cj('#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); } diff --git a/templates/CRM/SMS/Form/Schedule.tpl b/templates/CRM/SMS/Form/Schedule.tpl index 7a3189793e..7a973d5f53 100644 --- a/templates/CRM/SMS/Form/Schedule.tpl +++ b/templates/CRM/SMS/Form/Schedule.tpl @@ -84,11 +84,11 @@ cj(function() { cj(function() { cj('#start_date_display').change( function( ) { if ( cj(this).val( ) ) { - cj('#now').attr( 'checked', false ); + cj('#now').prop('checked', false ); } }); cj('#now').change( function( ) { - if ( cj('#now').attr('checked', true ) ) { + if ( cj('#now').prop('checked', true ) ) { cj('#start_date_display').val( '' ); cj('#start_date').val( '' ); cj('#start_date_time').val( '' ); diff --git a/templates/CRM/UF/Form/Field.tpl b/templates/CRM/UF/Form/Field.tpl index 8eb895eee1..97e0ea719e 100644 --- a/templates/CRM/UF/Form/Field.tpl +++ b/templates/CRM/UF/Form/Field.tpl @@ -102,7 +102,7 @@ cj(function($) { } else if( $.inArray( "Search Profile", otherModule ) > -1 ){ $('#profile_visibility').show(); - $("#in_selector").attr('checked',true); + $("#in_selector").prop('checked',true); } else if( $.inArray( "Profile", otherModule ) == -1 && $.inArray( "Search Profile", otherModule ) == -1 ){ $('#profile_visibility').hide(); @@ -182,10 +182,10 @@ function showHideSeletorSearch() { if (cj("#visibility").val() == "User and User Admin Only") { is_search.hide(); in_selector.hide(); - cj("#is_searchable").attr('checked',false); + cj("#is_searchable").prop('checked',false); } else { - if (!cj("#is_view").attr('checked')) { + if (!cj("#is_view").prop('checked')) { is_search.show(); } var fldName = cj("#field_name_1").val(); @@ -236,7 +236,7 @@ function multiSummaryToggle(customId) { } else { if (cj('#is_multi_summary').is(':checked')) { - cj('#is_multi_summary').removeAttr('checked'); + cj('#is_multi_summary').prop('checked', false); } cj('.crm-uf-field-form-block-is_multi').hide(); } @@ -245,7 +245,7 @@ function multiSummaryToggle(customId) { } else { if (cj('#is_multi_summary').is(':checked')) { - cj('#is_multi_summary').removeAttr('checked'); + cj('#is_multi_summary').prop('checked', false); } cj('.crm-uf-field-form-block-is_multi').hide(); } @@ -253,9 +253,9 @@ function multiSummaryToggle(customId) { function viewOnlyShowHide() { var is_search = cj('#is_search_label, #is_search_html'); - if (cj("#is_view").attr('checked')) { + if (cj("#is_view").prop('checked')) { is_search.hide(); - cj("#is_searchable").attr('checked', false); + cj("#is_searchable").prop('checked', false); } else if (cj("#visibility").val() != "User and User Admin Only") { is_search.show(); diff --git a/templates/CRM/common/additionalBlocks.tpl b/templates/CRM/common/additionalBlocks.tpl index af2799d0bc..68bc99a316 100644 --- a/templates/CRM/common/additionalBlocks.tpl +++ b/templates/CRM/common/additionalBlocks.tpl @@ -101,27 +101,27 @@ function singleSelect( object ) { var execBlock = '#' + element['0'] + '-' + block + '-html Input[id*="' + element['2'] + '"]'; //element to check for checkbox - var elementChecked = cj( '#' + object ).attr('checked'); + var elementChecked = cj( '#' + object ).prop('checked'); if ( elementChecked ) { cj( execBlock ).each( function() { if ( cj(this).attr('id') != object ) { - cj(this).attr( 'checked', false ); + cj(this).prop('checked', false ); } }); } else { - cj( '#' + object ).attr( 'checked', false ); + cj( '#' + object ).prop('checked', false ); } //check if non of elements is set Primary / Allowed to Login. if( cj.inArray( element['2'].slice('2'), [ 'Primary', 'Login' ] ) != -1 ) { primary = false; cj( execBlock ).each( function( ) { - if ( cj(this).attr( 'checked' ) ) { + if ( cj(this).prop('checked' ) ) { primary = true; } }); if( ! primary ) { - cj('#' + object).attr( 'checked', true ); + cj('#' + object).prop('checked', true ); } } } @@ -132,7 +132,7 @@ function removeBlock( blockName, blockId ) { return clearFirstBlock(blockName , blockId); } - if ( cj( "#"+ blockName + "_" + blockId + "_IsPrimary").attr('checked') ) { + if ( cj( "#"+ blockName + "_" + blockId + "_IsPrimary").prop('checked') ) { var primaryBlockId = 1; // consider next block as a primary, // when user delete first block @@ -148,7 +148,7 @@ function removeBlock( blockName, blockId ) { } // finally sets the primary address - cj( '#'+ blockName + '_' + primaryBlockId + '_IsPrimary').attr('checked', true); + cj( '#'+ blockName + '_' + primaryBlockId + '_IsPrimary').prop('checked', true); } //remove the spacer for address block only. diff --git a/templates/CRM/common/batchCopy.tpl b/templates/CRM/common/batchCopy.tpl index 5e40f94fa9..4542eebb31 100644 --- a/templates/CRM/common/batchCopy.tpl +++ b/templates/CRM/common/batchCopy.tpl @@ -83,7 +83,7 @@ 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 +']["])').removeAttr('checked'); + cj('.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() { @@ -91,16 +91,16 @@ 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]').attr('checked',true).change(); + 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]').attr('checked',true).change(); + cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change(); } else { - cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').removeAttr('checked').change(); + cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change(); } } } -- 2.25.1