PageRenderTime 52ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/public_html/sites/all/modules/civicrm/templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl

https://github.com/timstephenson/NatureBridge
Smarty Template | 195 lines | 152 code | 17 blank | 26 comment | 19 complexity | 06e6b7ec2f846e94cc5507570d0850d4 MD5 | raw file
  1. {*
  2. +--------------------------------------------------------------------+
  3. | CiviCRM version 4.0 |
  4. +--------------------------------------------------------------------+
  5. | Copyright CiviCRM LLC (c) 2004-2011 |
  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. {if $membershipBlock}
  27. <div id="membership" class="crm-group membership-group">
  28. {if $context EQ "makeContribution"}
  29. <fieldset>
  30. {if $renewal_mode }
  31. {if $membershipBlock.renewal_title}
  32. <legend>{$membershipBlock.renewal_title}</legend>
  33. {/if}
  34. {if $membershipBlock.renewal_text}
  35. <div id="membership-intro" class="crm-section membership_renewal_intro-section">
  36. <p>{$membershipBlock.renewal_text}</p>
  37. </div>
  38. {/if}
  39. {else}
  40. {if $membershipBlock.new_title}
  41. <legend>{$membershipBlock.new_title}</legend>
  42. {/if}
  43. {if $membershipBlock.new_text}
  44. <div id="membership-intro" class="crm-section membership_new_intro-section">
  45. <p>{$membershipBlock.new_text}</p>
  46. </div>
  47. {/if}
  48. {/if}
  49. {/if}
  50. {if $context neq "makeContribution" }
  51. <div class="header-dark">
  52. {if $renewal_mode }
  53. {if $membershipBlock.renewal_title}
  54. {$membershipBlock.renewal_title}
  55. {else}
  56. {ts}Select a Membership Renewal Level{/ts}
  57. {/if}
  58. {else}
  59. {if $membershipBlock.new_title}
  60. {$membershipBlock.new_title}
  61. {else}
  62. {ts}Select a Membership Level{/ts}
  63. {/if}
  64. {/if}
  65. </div>
  66. {/if}
  67. {strip}
  68. <table id="membership-listings">
  69. {foreach from=$membershipTypes item=row }
  70. <tr {if $context EQ "makeContribution" OR $context EQ "thankContribution" }class="odd-row" {/if}valign="top">
  71. {if $showRadio }
  72. {assign var="pid" value=$row.id}
  73. <td style="width: 1em;">{$form.selectMembership.$pid.html}</td>
  74. {else}
  75. <td>&nbsp;</td>
  76. {/if}
  77. <td style="width: auto;">
  78. <span class="bold">{$row.name} &nbsp;
  79. {if ($membershipBlock.display_min_fee AND $context EQ "makeContribution") AND $row.minimum_fee GT 0 }
  80. {if $is_separate_payment OR ! $form.amount.label}
  81. - {$row.minimum_fee|crmMoney}
  82. {else}
  83. {ts 1=$row.minimum_fee|crmMoney}(contribute at least %1 to be eligible for this membership){/ts}
  84. {/if}
  85. {/if}
  86. </span><br />
  87. {$row.description} &nbsp;
  88. </td>
  89. <td style="width: auto;">
  90. {* Check if there is an existing membership of this type (current_membership NOT empty) and if the end-date is prior to today. *}
  91. {if $row.current_membership AND $context EQ "makeContribution" }
  92. {if $row.current_membership|date_format:"%Y%m%d" LT $smarty.now|date_format:"%Y%m%d"}
  93. <br /><em>{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expired on %1.{/ts}</em>
  94. {else}
  95. <br /><em>{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expires on %1.{/ts}</em>
  96. {/if}
  97. {else}
  98. &nbsp;
  99. {/if}
  100. </td>
  101. </tr>
  102. {/foreach}
  103. <tr id="allow_auto_renew">
  104. <td style="width: auto;">{$form.auto_renew.html}</td>
  105. <td style="width: auto;">
  106. {$form.auto_renew.label}
  107. <div class="description crm-auto-renew-cancel-info">({ts}Your initial membership fee will be processed once you complete the confirmation step. You will be able to cancel automatic renewals at any time by logging in to your account or contacting us.{/ts})</div>
  108. </td>
  109. </tr>
  110. {if $showRadio}
  111. {if $showRadioNoThanks } {* Provide no-thanks option when Membership signup is not required - per membership block configuration. *}
  112. <tr class="odd-row">
  113. <td>{$form.selectMembership.no_thanks.html}</td>
  114. <td colspan="2"><strong>{ts}No thank you{/ts}</strong></td>
  115. </tr>
  116. {/if}
  117. {/if}
  118. </table>
  119. {/strip}
  120. {if $context EQ "makeContribution"}
  121. </fieldset>
  122. {/if}
  123. </div>
  124. {literal}
  125. <script type="text/javascript">
  126. cj(function(){
  127. showHideAutoRenew( null );
  128. });
  129. function showHideAutoRenew( memTypeId )
  130. {
  131. var considerUserInput = {/literal}'{$takeUserSubmittedAutoRenew}'{literal};
  132. if ( memTypeId ) considerUserInput = false;
  133. if ( !memTypeId ) memTypeId = cj('input:radio[name="selectMembership"]:checked').val();
  134. //does this page has only one membership type.
  135. var singleMembership = {/literal}'{$singleMembership}'{literal};
  136. if ( !memTypeId && singleMembership ) memTypeId = cj("#selectMembership").val( );
  137. var renewOptions = {/literal}{$autoRenewMembershipTypeOptions}{literal};
  138. var currentOption = eval( "renewOptions." + 'autoRenewMembershipType_' + memTypeId );
  139. funName = 'hide();';
  140. var readOnly = false;
  141. var isChecked = false;
  142. if ( currentOption == 1 ) {
  143. funName = 'show();';
  144. //uncomment me, if we'd like
  145. //to load auto_renew checked.
  146. //isChecked = true;
  147. } else if ( currentOption == 2 ) {
  148. funName = 'show();';
  149. isChecked = readOnly = true;
  150. }
  151. var autoRenew = cj("#auto_renew");
  152. if ( considerUserInput ) isChecked = autoRenew.attr( 'checked' );
  153. //its a normal recur contribution.
  154. if ( cj( "is_recur" ) &&
  155. ( cj( 'input:radio[name="is_recur"]:checked').val() == 1 ) ) {
  156. isChecked = false;
  157. funName = 'hide();';
  158. }
  159. //when we do show auto_renew read only
  160. //which implies it should be checked.
  161. if ( readOnly && funName == 'show();' ) isChecked = true;
  162. autoRenew.attr( 'readonly', readOnly );
  163. autoRenew.attr( 'checked', isChecked );
  164. eval( "cj('#allow_auto_renew')." + funName );
  165. }
  166. {/literal}{if $allowAutoRenewMembership}{literal}
  167. cj( function( ) {
  168. //keep read only always checked.
  169. cj( "#auto_renew" ).click(function( ) {
  170. if ( cj(this).attr( 'readonly' ) ) {
  171. cj(this).attr( 'checked', true );
  172. }
  173. });
  174. });
  175. {/literal}{/if}{literal}
  176. </script>
  177. {/literal}
  178. {/if}{* membership block end here *}