From 70a00dfe64f6e667f64cb13653f585600a4dda0e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 1 Oct 2014 11:22:02 -0400 Subject: [PATCH] Copy dashboard element templates from CiviCRM core. These will be modified to our needs later. * CRM/Memberdashboard/Page/MemberDashboard.php (buildDashboard): Change template path. * templates/CRM/Memberdashboard/Page/Element/CiviContribute.tpl: New file. * templates/CRM/Memberdashboard/Page/Element/CiviMember.tpl: New file. --- CRM/Memberdashboard/Page/MemberDashboard.php | 3 +- .../Page/Element/CiviContribute.tpl | 123 ++++++++++++++++++ .../Page/Element/CiviMember.tpl | 94 +++++++++++++ 3 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 templates/CRM/Memberdashboard/Page/Element/CiviContribute.tpl create mode 100644 templates/CRM/Memberdashboard/Page/Element/CiviMember.tpl diff --git a/CRM/Memberdashboard/Page/MemberDashboard.php b/CRM/Memberdashboard/Page/MemberDashboard.php index 2f5df7e..401de6e 100644 --- a/CRM/Memberdashboard/Page/MemberDashboard.php +++ b/CRM/Memberdashboard/Page/MemberDashboard.php @@ -56,7 +56,8 @@ class CRM_Memberdashboard_Page_MemberDashboard extends CRM_Core_Page { return array( 'class' => 'crm-dashboard-' . strtolower($component->name), 'sectionTitle' => $elem['title'], - 'templatePath' => $userDashboard->getTemplateFileName(), + 'templatePath' => 'CRM/Memberdashboard/Page/Element/' . + $component->name . '.tpl', 'weight' => $elem['weight'], ); }, array_filter(CRM_Core_Component::getEnabledComponents(), function($component) { diff --git a/templates/CRM/Memberdashboard/Page/Element/CiviContribute.tpl b/templates/CRM/Memberdashboard/Page/Element/CiviContribute.tpl new file mode 100644 index 0000000..2c51618 --- /dev/null +++ b/templates/CRM/Memberdashboard/Page/Element/CiviContribute.tpl @@ -0,0 +1,123 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM version 4.5 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM. | + | | + | CiviCRM is free software; you can copy, modify, and distribute it | + | under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | + | | + | CiviCRM is distributed in the hope that it will be useful, but | + | WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | + | at info[AT]civicrm[DOT]org. If you have questions about the | + | GNU Affero General Public License or the licensing of CiviCRM, | + | see the CiviCRM license FAQ at http://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +
+ {if $contribute_rows} + {strip} + + + + + + + + + + + {foreach from=$contribute_rows item=row} + + + + + + + + {/foreach} +
{ts}Total Amount{/ts}{ts}Financial Type{/ts}{ts}Received date{/ts}{ts}Receipt Sent{/ts}{ts}Status{/ts}
{$row.total_amount|crmMoney:$row.currency} {if $row.amount_level } - {$row.amount_level} {/if} + {if $row.contribution_recur_id} +
{ts}(Recurring Contribution){/ts} + {/if} +
{$row.financial_type}{$row.receive_date|truncate:10:''|crmDate}{$row.receipt_date|truncate:10:''|crmDate}{$row.contribution_status}
+ {/strip} + {if $contributionSummary.total.count gt 12} + {ts}Contact us for information about contributions prior to those listed above.{/ts} + {/if} + {else} +
+
+ {ts}There are no contributions on record for you.{/ts} +
+ {/if} + + + {if $honor} + {if $honorRows} + {strip} +
+ {ts}Contributions made in your honor{/ts}: +
+ + + + + + + + + + + {foreach from=$honorRows item=row} + + + + + + + + + + {/foreach} +
{ts}Contributor{/ts}{ts}Amount{/ts}{ts}Type{/ts}{ts}Financial Type{/ts}{ts}Received date{/ts}{ts}Receipt Sent{/ts}{ts}Status{/ts}
{$row.display_name}{$row.amount}{$row.honor_type}{$row.type}{$row.receive_date|truncate:10:''|crmDate}{$row.receipt_date|truncate:10:''|crmDate}{$row.contribution_status}
+ {/strip} + {/if} + {/if} + + {if $recur} + {if $recurRows} + {strip} +
+ + + + + + + + + {foreach from=$recurRows item=row key=id} + + + + + + + + {/foreach} +
{ts}Terms:{/ts}{ts}Status{/ts}{ts}Installments{/ts}{ts}Created{/ts}
every {$recurRows.$id.frequency_interval} {$recurRows.$id.frequency_unit} for {$recurRows.$id.installments} installments{$recurRows.$id.recur_status}{if $recurRows.$id.completed}{$recurRows.$id.completed}/{$recurRows.$id.installments} + {else}0/{$recurRows.$id.installments} {/if}{$recurRows.$id.create_date|crmDate}{$recurRows.$id.action|replace:'xx':$recurRows.id}
+ {/strip} + {/if} + {/if} +
diff --git a/templates/CRM/Memberdashboard/Page/Element/CiviMember.tpl b/templates/CRM/Memberdashboard/Page/Element/CiviMember.tpl new file mode 100644 index 0000000..7d1c215 --- /dev/null +++ b/templates/CRM/Memberdashboard/Page/Element/CiviMember.tpl @@ -0,0 +1,94 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM version 4.5 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM. | + | | + | CiviCRM is free software; you can copy, modify, and distribute it | + | under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | + | | + | CiviCRM is distributed in the hope that it will be useful, but | + | WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | + | at info[AT]civicrm[DOT]org. If you have questions about the | + | GNU Affero General Public License or the licensing of CiviCRM, | + | see the CiviCRM license FAQ at http://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +
+{if $activeMembers} +
+
+ {strip} + + + + + + + + + + {foreach from=$activeMembers item=activeMember} + + + + + + + + + {/foreach} +
{ts}Membership{/ts}{ts}Member Since{/ts}{ts}Start Date{/ts}{ts}End Date{/ts}{ts}Status{/ts}
{$activeMember.membership_type}{$activeMember.join_date|crmDate}{$activeMember.start_date|crmDate}{$activeMember.end_date|crmDate}{$activeMember.status}{if $activeMember.renewPageId}[ {ts}Renew Now{/ts} ]{/if}
+ {/strip} + +
+
+{/if} + +{if $inActiveMembers} +
+

+
{ts}Expired / Inactive Memberships{/ts}
+
+ {strip} + + + + + + + + + {foreach from=$inActiveMembers item=inActiveMember} + + + + + + + + + {/foreach} +
{ts}Membership{/ts}{ts}Start Date{/ts}{ts}End Date{/ts}{ts}Status{/ts}
{$inActiveMember.membership_type}{$inActiveMember.start_date|crmDate}{$inActiveMember.end_date|crmDate}{$inActiveMember.status}{if $inActiveMember.renewPageId}[ {ts}Renew Now{/ts} ]{/if}
+ {/strip} + +
+
+{/if} + +{if NOT ($activeMembers or $inActiveMembers)} +
+
+ {ts}There are no memberships on record for you.{/ts} +
+{/if} +
-- 2.25.1