<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
*
*/
function preProcess() {
+
+ //CRM-13901 don't show dashboard to contacts with limited view writes & it does not relect
+ //what they have access to
+ //@todo implement acls on dashboard querys (preferably via api to enhance that at the same time)
+ if(!CRM_Core_Permission::check(array('view all contacts', 'edit all contacts'))) {
+ $this->showMembershipSummary = FALSE;
+ $this->assign('membershipSummary', FALSE);
+ return;
+ }
+ $this->assign('membershipSummary', TRUE);
CRM_Utils_System::setTitle(ts('CiviMember'));
$membershipSummary = array();
$preMonth = date("Y-m-d", mktime(0, 0, 0, date("m") - 1, 01, date("Y")));
// You can force the dashboard to display based upon a certain date
$ym = CRM_Utils_Array::value('date', $_GET);
-
+
if ($ym) {
if (preg_match('/^\d{6}$/', $ym) == 0 ||
!checkdate(substr($ym, 4, 2), 1, substr($ym, 0, 4)) ||
$status = implode(',', $status);
/* Disabled for lack of appropriate search
-
+
The Membership search isn't able to properly filter by join or renewal events.
Until that works properly, the subtotals shouldn't get links.
-
+
foreach ($membershipSummary as $typeID => $details) {
foreach ($details as $key => $value) {
switch ($key) {
}
}
*/
-
+
// Temporary replacement for current totals column
-
+
foreach ($membershipSummary as $typeID => $details) {
if (!$isCurrentMonth) {
$membershipSummary[$typeID]['total']['total']['url'] = CRM_Utils_System::url('civicrm/member/search',