Merge pull request #2375 from colemanw/master
[civicrm-core.git] / templates / CRM / Contribute / Form / SoftCredit.tpl
index 27ba3801e1b3e9e7346462de6dc149ffd05ee5bf..71bec1c2b4509beb1af412182ce6f61b05352bb3 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
  +--------------------------------------------------------------------+
 *}
 {* template for adding form elements for soft credit form*}
-  <tr id="softCreditID" class="crm-contribution-form-block-soft_credit_to"><td class="label">{$form.soft_credit_to.label}</td>
-    <td {$valueStyle}>
-      {$form.soft_credit_to.html} {help id="id-soft_credit"}
-      {if $siteHasPCPs}
-        <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>
-      {/if}
-    </td>
-  </tr>
-    {if $siteHasPCPs}{* Credit contribution to PCP. *}
-    <tr id="pcpID" class="crm-contribution-form-block-pcp_made_through_id">
-      <td class="label">{$form.pcp_made_through.label}</td>
-      <td>
-        {$form.pcp_made_through.html} &nbsp;
-        <span class="showSoftCreditLink">{ts}<a href="#" onclick='showSoftCredit(); return false;'>unlink from personal campaign page</a>{/ts}</span><br />
-        <span class="description">{ts}Search for the Personal Campaign Page by the fund-raiser's last name or email address.{/ts}</span>
-        <div class="spacer"></div>
-        <div class="crm-contribution-form-block-pcp_details">
-          <table class="crm-contribution-form-table-credit_to_pcp">
-            <tr id="pcpDisplayRollID" class="crm-contribution-form-block-pcp_display_in_roll"><td class="label">{$form.pcp_display_in_roll.label}</td>
-              <td>{$form.pcp_display_in_roll.html}</td>
-            </tr>
-            <tr id="nickID" class="crm-contribution-form-block-pcp_roll_nickname">
-              <td class="label">{$form.pcp_roll_nickname.label}</td>
-              <td>{$form.pcp_roll_nickname.html|crmAddClass:big}<br />
-                <span class="description">{ts}Name or nickname contributor wants to be displayed in the Honor Roll. Enter "Anonymous" for anonymous contributions.{/ts}</span></td>
-            </tr>
-            <tr id="personalNoteID" class="crm-contribution-form-block-pcp_personal_note">
-              <td class="label" style="vertical-align: top">{$form.pcp_personal_note.label}</td>
-              <td>{$form.pcp_personal_note.html}
-                <span class="description">{ts}Personal message submitted by contributor for display in the Honor Roll.{/ts}</span>
-              </td>
-            </tr>
-          </table>
+{if $honor_block_is_active}
+  {crmRegion name="contribution-soft-credit-block"}
+    <legend>{$honor_block_title}</legend>
+    <div class="crm-section honor_block_text-section">
+      {$honor_block_text}
+    </div>
+    {if $form.soft_credit_type_id.html}
+      <div class="crm-section {$form.soft_credit_type_id.name}-section">
+        <div class="content" >
+          {$form.soft_credit_type_id.html}
+          <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('soft_credit_type_id', '{$form.formName}');enableHonorType(); return false;">{ts}clear{/ts}</a>)</span>
+          <div class="description">{ts}Select an option to reveal honoree information fields.{/ts}</div>
         </div>
+      </div>
+    {/if}
+  {/crmRegion}
+{else}
+<table class="form-layout-compressed crm-soft-credit-block">
+  {section name='i' start=1 loop=$rowCount}
+    {assign var='rowNumber' value=$smarty.section.i.index}
+    <tr id="soft-credit-row-{$rowNumber}"
+        class="crm-contribution-form-block-soft_credit_to {if $rowNumber gte $showSoftCreditRow}hiddenElement{/if}">
+      <td class="label">{ts}Select Contact{/ts}</td>
+      <td>
+        {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 focus=false}
+      </td>
+      <td>
+        {$form.soft_credit_amount.$rowNumber.label}&nbsp;{$form.soft_credit_amount.$rowNumber.html|crmAddClass:eight}
+      </td>
+      <td>
+        {$form.soft_credit_type.$rowNumber.label}&nbsp;{$form.soft_credit_type.$rowNumber.html|crmAddClass:eight}
+        &nbsp;<a class="delete-link" row-no={$rowNumber} href="#">{ts}delete{/ts}</a>
       </td>
     </tr>
-    {/if}
-
- {literal}
- <script type="text/javascript">
- var url = "{/literal}{$dataUrl}{literal}";
-
-  cj('#soft_credit_to').autocomplete( url, { width : 180, selectFirst : false, matchContains: true
-  }).result( function(event, data, formatted) {
-      cj( "#soft_contact_id" ).val( data[1] );
-  });
- {/literal}
-
-// load form during form rule.
-{if $buildPriceSet}{literal}buildAmount( );{/literal}{/if}
-
-{if $siteHasPCPs}
-  {literal}
-  var pcpUrl = "{/literal}{$pcpDataUrl}{literal}";
-
-  cj('#pcp_made_through').autocomplete( pcpUrl, { width : 360, selectFirst : false, matchContains: true
-  }).result( function(event, data, formatted) {
-      cj( "#pcp_made_through_id" ).val( data[1] );
-  });
-{/literal}
-
-  {if $pcpLinked}
-    {literal}hideSoftCredit( );{/literal}{* hide soft credit on load if we have PCP linkage *}
-  {else}
-    {literal}cj('#pcpID').hide();{/literal}{* hide PCP section *}
-  {/if}
-
-  {literal}
-  function hideSoftCredit ( ){
-    cj("#softCreditID").hide();
-  }
-  function showPCP( ) {
-    cj('#pcpID').show();
-    cj("#softCreditID").hide();
-  }
-  function showSoftCredit( ) {
-    cj('#pcp_made_through_id').val('');
-    cj('#pcp_made_through').val('');
-    cj('#pcp_roll_nickname').val('');
-    cj('#pcp_personal_note').val('');
-    cj('#pcp_display_in_roll').attr('checked', false);
-    cj("#pcpID").hide();
-    cj('#softCreditID').show();
-  }
-  {/literal}
+  {/section}
+  <tr>
+    <td></td>
+    <td>
+      <a href="#" id="addMoreSoftCredit">{ts}add another soft credit{/ts}</a>
+    </td>
+  </tr>
+</table>
 {/if}
-</script>
-
-
-
-
-
-