0baed70b |
1 | {* |
2 | +--------------------------------------------------------------------+ |
3 | | CiviCRM version 4.3 | |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | |
8 | | | |
9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
10 | | under the terms of the GNU Affero General Public License | |
11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
12 | | | |
13 | | CiviCRM is distributed in the hope that it will be useful, but | |
14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
16 | | See the GNU Affero General Public License for more details. | |
17 | | | |
18 | | You should have received a copy of the GNU Affero General Public | |
19 | | License and the CiviCRM Licensing Exception along | |
20 | | with this program; if not, contact CiviCRM LLC | |
21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
24 | +--------------------------------------------------------------------+ |
25 | *} |
26 | {* template for adding form elements for soft credit form*} |
50046260 |
27 | |
28 | {include file="CRM/Contact/Form/NewContact.tpl"} |
29 | {* <tr id="softCreditID" class="crm-contribution-form-block-soft_credit_to"><td class="label">{$form.soft_credit_to.label}</td> |
0baed70b |
30 | <td {$valueStyle}> |
31 | {$form.soft_credit_to.html} {help id="id-soft_credit"} |
32 | {if $siteHasPCPs} |
33 | <div id="showPCPLink"><a href='#' onclick='showPCP(); return false;'>{ts}credit this contribution to a personal campaign page{/ts}</a>{help id="id-link_pcp"}</div> |
34 | {/if} |
35 | </td> |
36 | </tr> |
50046260 |
37 | {if $siteHasPCPs} |
0baed70b |
38 | <tr id="pcpID" class="crm-contribution-form-block-pcp_made_through_id"> |
39 | <td class="label">{$form.pcp_made_through.label}</td> |
40 | <td> |
41 | {$form.pcp_made_through.html} |
42 | <span class="showSoftCreditLink">{ts}<a href="#" onclick='showSoftCredit(); return false;'>unlink from personal campaign page</a>{/ts}</span><br /> |
43 | <span class="description">{ts}Search for the Personal Campaign Page by the fund-raiser's last name or email address.{/ts}</span> |
44 | <div class="spacer"></div> |
45 | <div class="crm-contribution-form-block-pcp_details"> |
46 | <table class="crm-contribution-form-table-credit_to_pcp"> |
47 | <tr id="pcpDisplayRollID" class="crm-contribution-form-block-pcp_display_in_roll"><td class="label">{$form.pcp_display_in_roll.label}</td> |
48 | <td>{$form.pcp_display_in_roll.html}</td> |
49 | </tr> |
50 | <tr id="nickID" class="crm-contribution-form-block-pcp_roll_nickname"> |
51 | <td class="label">{$form.pcp_roll_nickname.label}</td> |
52 | <td>{$form.pcp_roll_nickname.html|crmAddClass:big}<br /> |
53 | <span class="description">{ts}Name or nickname contributor wants to be displayed in the Honor Roll. Enter "Anonymous" for anonymous contributions.{/ts}</span></td> |
54 | </tr> |
55 | <tr id="personalNoteID" class="crm-contribution-form-block-pcp_personal_note"> |
56 | <td class="label" style="vertical-align: top">{$form.pcp_personal_note.label}</td> |
57 | <td>{$form.pcp_personal_note.html} |
58 | <span class="description">{ts}Personal message submitted by contributor for display in the Honor Roll.{/ts}</span> |
59 | </td> |
60 | </tr> |
61 | </table> |
62 | </div> |
63 | </td> |
64 | </tr> |
65 | {/if} |
50046260 |
66 | *} |
0baed70b |
67 | {literal} |
68 | <script type="text/javascript"> |
69 | var url = "{/literal}{$dataUrl}{literal}"; |
70 | |
71 | cj('#soft_credit_to').autocomplete( url, { width : 180, selectFirst : false, matchContains: true |
72 | }).result( function(event, data, formatted) { |
73 | cj( "#soft_contact_id" ).val( data[1] ); |
74 | }); |
75 | {/literal} |
76 | |
77 | // load form during form rule. |
78 | {if $buildPriceSet}{literal}buildAmount( );{/literal}{/if} |
79 | |
80 | {if $siteHasPCPs} |
81 | {literal} |
82 | var pcpUrl = "{/literal}{$pcpDataUrl}{literal}"; |
83 | |
84 | cj('#pcp_made_through').autocomplete( pcpUrl, { width : 360, selectFirst : false, matchContains: true |
85 | }).result( function(event, data, formatted) { |
86 | cj( "#pcp_made_through_id" ).val( data[1] ); |
87 | }); |
88 | {/literal} |
89 | |
90 | {if $pcpLinked} |
91 | {literal}hideSoftCredit( );{/literal}{* hide soft credit on load if we have PCP linkage *} |
92 | {else} |
93 | {literal}cj('#pcpID').hide();{/literal}{* hide PCP section *} |
94 | {/if} |
95 | |
96 | {literal} |
97 | function hideSoftCredit ( ){ |
98 | cj("#softCreditID").hide(); |
99 | } |
100 | function showPCP( ) { |
101 | cj('#pcpID').show(); |
102 | cj("#softCreditID").hide(); |
103 | } |
104 | function showSoftCredit( ) { |
105 | cj('#pcp_made_through_id').val(''); |
106 | cj('#pcp_made_through').val(''); |
107 | cj('#pcp_roll_nickname').val(''); |
108 | cj('#pcp_personal_note').val(''); |
109 | cj('#pcp_display_in_roll').attr('checked', false); |
110 | cj("#pcpID").hide(); |
111 | cj('#softCreditID').show(); |
112 | } |
113 | {/literal} |
114 | {/if} |
115 | </script> |
116 | |
117 | |
118 | |
119 | |
120 | |
121 | |