From 7955489c562b4422282e5251bf9896fa623e431c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 1 Oct 2014 16:54:21 -0400 Subject: [PATCH] Add communications page. * CRM/Memberdashboard/Page/Communications.php: New file. * templates/CRM/Memberdashboard/Page/Communications.tpl: New file. * templates/CRM/Memberdashboard/Page/Element/CiviEvent.tpl: New file. * templates/CRM/Memberdashboard/Page/MemberDashboard.tpl: Link to new page. * xml/Menu/memberdashboard.xml (): Add item for new page. --- CRM/Memberdashboard/Page/Communications.php | 37 ++++++++++ .../Memberdashboard/Page/Communications.tpl | 30 ++++++++ .../Page/Element/CiviEvent.tpl | 72 +++++++++++++++++++ .../Memberdashboard/Page/MemberDashboard.tpl | 2 + xml/Menu/memberdashboard.xml | 6 ++ 5 files changed, 147 insertions(+) create mode 100644 CRM/Memberdashboard/Page/Communications.php create mode 100644 templates/CRM/Memberdashboard/Page/Communications.tpl create mode 100644 templates/CRM/Memberdashboard/Page/Element/CiviEvent.tpl diff --git a/CRM/Memberdashboard/Page/Communications.php b/CRM/Memberdashboard/Page/Communications.php new file mode 100644 index 0000000..8119172 --- /dev/null +++ b/CRM/Memberdashboard/Page/Communications.php @@ -0,0 +1,37 @@ +. + */ + +require_once 'CRM/Core/Page.php'; + +class CRM_Memberdashboard_Page_Communications extends CRM_Core_Page { + function run() { + $helper = new CRM_Memberdashboard_Page_ComponentHelper(array('CiviEvent')); + $helper->run(); + $this->assign('dashboardElements', $helper->buildDashboardElements()); + $gContact = new CRM_Contact_Page_View_UserDashBoard_GroupContact(); + $gContact->run(); + + CRM_Utils_System::setTitle('Communications'); + + parent::run(); + } +} diff --git a/templates/CRM/Memberdashboard/Page/Communications.tpl b/templates/CRM/Memberdashboard/Page/Communications.tpl new file mode 100644 index 0000000..9a12250 --- /dev/null +++ b/templates/CRM/Memberdashboard/Page/Communications.tpl @@ -0,0 +1,30 @@ +{* + FSF Member Dashboard + Copyright © 2014 Free Software Foundation, Inc. + + This file is a part of FSF Member Dashboard. + + FSF Member Dashboard is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public + License as published by the Free Software Foundation, either version + 3 of the License, or (at your option) any later version. + + FSF Member Dashboard 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with FSF Member Dashboard. If not, see + . +*} + +
+
+ {ts}Your Group(s){/ts} +
+ {include file="CRM/Contact/Page/View/UserDashBoard/GroupContact.tpl"} +
+ +{include file="CRM/Memberdashboard/Page/DashboardElement.tpl" + element=$dashboardElements.CiviEvent } diff --git a/templates/CRM/Memberdashboard/Page/Element/CiviEvent.tpl b/templates/CRM/Memberdashboard/Page/Element/CiviEvent.tpl new file mode 100644 index 0000000..fae0daa --- /dev/null +++ b/templates/CRM/Memberdashboard/Page/Element/CiviEvent.tpl @@ -0,0 +1,72 @@ +{* + +--------------------------------------------------------------------+ + | 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 $event_rows} + {strip} +
+ {ts}Click on the event name for more information.{/ts} +
+ + + + + + + + {counter start=0 skip=1 print=false} + {foreach from=$event_rows item=row} + + + + + + + {/foreach} +
{ts}Event{/ts}{ts}Event Date(s){/ts}{ts}Status{/ts}
{$row.event_title} + {$row.event_start_date|crmDate} + {if $row.event_end_date} +   -   + {* Only show end time if end date = start date *} + {if $row.event_end_date|date_format:"%Y%m%d" == $row.event_start_date|date_format:"%Y%m%d"} + {$row.event_end_date|crmDate:0:1} + {else} + {$row.event_end_date|crmDate} + {/if} + {/if} + {$row.participant_status} + {if $row.showConfirmUrl} + {ts}Confirm Registration{/ts} + {/if} +
+ {/strip} + {else} +
+
  + {ts}You are not registered for any current or upcoming Events.{/ts} + +
+ {/if} +
diff --git a/templates/CRM/Memberdashboard/Page/MemberDashboard.tpl b/templates/CRM/Memberdashboard/Page/MemberDashboard.tpl index c3f76d3..491dfae 100644 --- a/templates/CRM/Memberdashboard/Page/MemberDashboard.tpl +++ b/templates/CRM/Memberdashboard/Page/MemberDashboard.tpl @@ -19,6 +19,8 @@ . *} +Go to Communications + {include file="CRM/Memberdashboard/Page/DashboardElement.tpl" element=$dashboardElements.CiviMember } diff --git a/xml/Menu/memberdashboard.xml b/xml/Menu/memberdashboard.xml index df43904..e6b3b0b 100644 --- a/xml/Menu/memberdashboard.xml +++ b/xml/Menu/memberdashboard.xml @@ -6,4 +6,10 @@ MemberDashboard access CiviCRM + + civicrm/member-dashboard/communications + CRM_Memberdashboard_Page_Communications + MemberDashboard + access CiviCRM +
-- 2.25.1