From 3389d6e25f1e11b1804850a30672b33c2e47052e Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Sat, 4 May 2013 16:09:08 -0700 Subject: [PATCH] added delete link for soft credit, CRM-12463 --- templates/CRM/Contribute/Form/SoftCredit.js | 7 ++++ templates/CRM/Contribute/Form/SoftCredit.tpl | 42 ++++++++++---------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/templates/CRM/Contribute/Form/SoftCredit.js b/templates/CRM/Contribute/Form/SoftCredit.js index 001b210f46..4d6938f54c 100644 --- a/templates/CRM/Contribute/Form/SoftCredit.js +++ b/templates/CRM/Contribute/Form/SoftCredit.js @@ -49,4 +49,11 @@ cj(function($) { } }); + $('.delete-link').click(function(){ + var row = $(this).attr('row-no'); + $('#soft-credit-row-' + row).hide().find('input').val(''); + $('input[name="soft_credit_contact_select_id['+row+']"]').val(''); + return false; + }); + }); diff --git a/templates/CRM/Contribute/Form/SoftCredit.tpl b/templates/CRM/Contribute/Form/SoftCredit.tpl index a3111adef6..ca39d484a3 100644 --- a/templates/CRM/Contribute/Form/SoftCredit.tpl +++ b/templates/CRM/Contribute/Form/SoftCredit.tpl @@ -26,27 +26,29 @@ {* template for adding form elements for soft credit form*} -{section name='i' start=1 loop=$rowCount} -{assign var='rowNumber' value=$smarty.section.i.index} - - + {section name='i' start=1 loop=$rowCount} + {assign var='rowNumber' value=$smarty.section.i.index} + + + + + + {/section} + + - -{/section} - - - -
{ts}Select Contact{/ts}
{ts}Select Contact{/ts} + {assign var='createNewStatus' value=true} + {if !$showCreateNew and $rowNumber lt $showSoftCreditRow} + {assign var='createNewStatus' value=false} + {/if} + {include file="CRM/Contact/Form/NewContact.tpl" noLabel=true skipBreak=true blockNo=$rowNumber + prefix="soft_credit_" showNewSelect=$createNewStatus} + + {$form.soft_credit_amount.$rowNumber.label} {$form.soft_credit_amount.$rowNumber.html|crmAddClass:eight} +  {ts}delete{/ts} +
- {assign var='createNewStatus' value=true} - {if !$showCreateNew and $rowNumber lt $showSoftCreditRow} - {assign var='createNewStatus' value=false} - {/if} - {include file="CRM/Contact/Form/NewContact.tpl" noLabel=true skipBreak=true blockNo=$rowNumber - prefix="soft_credit_" showNewSelect=$createNewStatus} + {ts}add another soft credit{/ts} - {$form.soft_credit_amount.$rowNumber.label} {$form.soft_credit_amount.$rowNumber.html|crmAddClass:eight} -
- {ts}add another soft credit{/ts} -
\ No newline at end of file -- 2.25.1