From: Andrew Hunt Date: Thu, 30 May 2013 03:34:49 +0000 (-0400) Subject: all search links removed from member dash X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0370ad2019f4f04fa28277ebdd9da925e8262e7c;p=civicrm-core.git all search links removed from member dash --- diff --git a/CRM/Activity/Form/Search.php b/CRM/Activity/Form/Search.php index f7352b2db7..fb9d5f7321 100644 --- a/CRM/Activity/Form/Search.php +++ b/CRM/Activity/Form/Search.php @@ -396,6 +396,12 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { if (!$this->_force) { return; } + + $this->_formValues['activity_role'] = 1; + $this->_formValues['activity_contact_name'] = ''; + $this->_defaults['activity_role'] = 1; + $this->_defaults['activity_contact_name'] = ''; + $status = CRM_Utils_Request::retrieve('status', 'String', $this); if ($status) { $this->_formValues['activity_status'] = $status; @@ -431,10 +437,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { $this->_single = TRUE; } } - - if (!empty($this->_defaults)) { - $this->setDefaults($this->_defaults); - } // Added for membership search @@ -446,8 +448,9 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { //$this->_formValues['activity_type_id'] = array(); $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name'); - $signup = CRM_Utils_Array::key('Membership Renewal', $activityTypes); - $renew = CRM_Utils_Array::key('Membership Signup', $activityTypes); + + $renew = CRM_Utils_Array::key('Membership Renewal', $activityTypes); + $signup = CRM_Utils_Array::key('Membership Signup', $activityTypes); switch ($signupType) { case 3: // signups and renewals @@ -465,28 +468,38 @@ class CRM_Activity_Form_Search extends CRM_Core_Form { } } - $dateLow = CRM_Utils_Request::retrieve('dateLow', 'Positive', + $dateLow = CRM_Utils_Request::retrieve('dateLow', 'String', CRM_Core_DAO::$_nullObject ); if ($dateLow) { + $dateLow = date('m/d/Y', strtotime($dateLow)); + $this->_formValues['activity_date_relative'] = 0; + $this->_defaults['activity_date_relative'] = 0; $this->_formValues['activity_date_low'] = $dateLow; $this->_defaults['activity_date_low'] = $dateLow; } - $dateHigh = CRM_Utils_Request::retrieve('dateHigh', 'Positive', + $dateHigh = CRM_Utils_Request::retrieve('dateHigh', 'String', CRM_Core_DAO::$_nullObject ); if ($dateHigh) { // Activity date time assumes midnight at the beginning of the date // This sets it to almost midnight at the end of the date - if ($dateHigh <= 99999999) { + /* if ($dateHigh <= 99999999) { $dateHigh = 1000000 * $dateHigh + 235959; - } + } */ + $dateHigh = date('m/d/Y', strtotime($dateHigh)); + $this->_formValues['activity_date_relative'] = 0; + $this->_defaults['activity_date_relative'] = 0; $this->_formValues['activity_date_high'] = $dateHigh; $this->_defaults['activity_date_high'] = $dateHigh; } + + if (!empty($this->_defaults)) { + $this->setDefaults($this->_defaults); + } } function getFormValues() { diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php index 13b8e1d218..2642b0d259 100644 --- a/CRM/Member/Page/DashBoard.php +++ b/CRM/Member/Page/DashBoard.php @@ -288,65 +288,65 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page { $totalCount['premonth']['new'] = array( 'count' => $newCountPreMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=1&dateLow=$preMonth&dateHigh=$preMonthEnd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=1&dateLow=$preMonth&dateHigh=$preMonthEnd" + //), ); $totalCount['premonth']['renew'] = array( 'count' => $renewCountPreMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=2&dateLow=$preMonth&dateHigh=$preMonthEnd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=2&dateLow=$preMonth&dateHigh=$preMonthEnd" + //), ); $totalCount['premonth']['total'] = array( 'count' => $totalCountPreMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=3&dateLow=$preMonth&dateHigh=$preMonthEnd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=3&dateLow=$preMonth&dateHigh=$preMonthEnd" + //), ); $totalCount['month']['new'] = array( 'count' => $newCountMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=1&dateLow=$monthStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=1&dateLow=$monthStart&dateHigh=$ymd" + //), ); $totalCount['month']['renew'] = array( 'count' => $renewCountMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=2&dateLow=$monthStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=2&dateLow=$monthStart&dateHigh=$ymd" + //), ); $totalCount['month']['total'] = array( 'count' => $totalCountMonth, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=3&dateLow=$monthStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=3&dateLow=$monthStart&dateHigh=$ymd" + //), ); $totalCount['year']['new'] = array( 'count' => $newCountYear, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=1&dateLow=$yearStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=1&dateLow=$yearStart&dateHigh=$ymd" + //), ); $totalCount['year']['renew'] = array( 'count' => $renewCountYear, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=2&dateLow=$yearStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=2&dateLow=$yearStart&dateHigh=$ymd" + //), ); $totalCount['year']['total'] = array( 'count' => $totalCountYear, - 'url' => CRM_Utils_System::url('civicrm/activity/search', - "reset=1&force=1&signupType=3&dateLow=$yearStart&dateHigh=$ymd" - ), + //'url' => CRM_Utils_System::url('civicrm/activity/search', + // "reset=1&force=1&signupType=3&dateLow=$yearStart&dateHigh=$ymd" + //), ); $totalCount['current']['total'] = array( @@ -377,7 +377,7 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page { //LCD add owner values $totalCount['premonth_owner']['premonth_owner'] = array( 'count' => $totalCountPreMonth_owner, - 'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$preMonth&end=$preMonthEnd&owner=1"), + // 'url' => CRM_Utils_System::url('civicrm/member/search', "reset=1&force=1&status=$status&start=$preMonth&end=$preMonthEnd&owner=1"), ); $totalCount['month_owner']['month_owner'] = array( @@ -412,7 +412,7 @@ class CRM_Member_Page_DashBoard extends CRM_Core_Page { $this->assign('totalCount', $totalCount); $this->assign('month', date('F', $monthStartTs)); $this->assign('year', date('Y', $monthStartTs)); - $this->assign('premonth', date('F', $preMonthYear)); + $this->assign('premonth', date('F', strtotime($preMonth))); $this->assign('currentMonth', date('F')); $this->assign('currentYear', date('Y')); $this->assign('isCurrent', $isCurrentMonth); diff --git a/templates/CRM/Member/Page/DashBoard.tpl b/templates/CRM/Member/Page/DashBoard.tpl index cbd28ee175..9cc2ab35e4 100644 --- a/templates/CRM/Member/Page/DashBoard.tpl +++ b/templates/CRM/Member/Page/DashBoard.tpl @@ -155,64 +155,96 @@ {ts}Totals (all types){/ts} {if $preMonth} - - {$totalCount.premonth.new.count} - - {$totalCount.premonth.renew.count} - - {$totalCount.premonth.total.count} - [ - {if $totalCount.premonth_owner.premonth_owner.url} - {$totalCount.premonth_owner.premonth_owner.count} - {else} - {$totalCount.premonth_owner.premonth_owner.count} - {/if} - ] - + + {if $totalCount.premonth.new.url}{$totalCount.premonth.new.count} + {else}{$totalCount.premonth.new.count}{/if} + + + {if $totalCount.premonth.renew.url}{$totalCount.premonth.renew.count} + {else}{$totalCount.premonth.renew.count}{/if} + + + {if $totalCount.premonth.total.url} + {$totalCount.premonth.total.count} + {else} + {$totalCount.premonth.total.count} + {/if} [ + {if $totalCount.premonth_owner.premonth_owner.url} + {$totalCount.premonth_owner.premonth_owner.count} + {else} + {$totalCount.premonth_owner.premonth_owner.count} + {/if}] + {/if} - - {$totalCount.month.new.count} - - {$totalCount.month.renew.count} - - {$totalCount.month.total.count} - [ - {if $totalCount.month_owner.month_owner.url} - {$totalCount.month_owner.month_owner.count} - {else} - {$totalCount.month_owner.month_owner.count} - {/if} - ] - - - {$totalCount.year.new.count} - - {$totalCount.year.renew.count} - - {$totalCount.year.total.count} - [ - {if $totalCount.year_owner.year_owner.url} - {$totalCount.year_owner.year_owner.count} - {else} - {$totalCount.year_owner.year_owner.count} - {/if} - ] - + + {if $totalCount.month.new.url}{$totalCount.month.new.count} + {else}{$totalCount.month.new.count}{/if} + + + {if $totalCount.month.renew.url}{$totalCount.month.renew.count} + {else}{$totalCount.month.renew.count}{/if} + + + {if $totalCount.month.total.url} + {$totalCount.month.total.count} + {else} + {$totalCount.month.total.count} + {/if} [ + {if $totalCount.month_owner.month_owner.url} + {$totalCount.month_owner.month_owner.count} + {else} + {$totalCount.month_owner.month_owner.count} + {/if}] + - - {if $isCurrent} - {$totalCount.current.total.count}  - [ - {$totalCount.current_owner.current_owner.count} ] + + {if $totalCount.year.new.url}{$totalCount.year.new.count} + {else}{$totalCount.year.new.count}{/if} + + + {if $totalCount.year.renew.url}{$totalCount.year.renew.count} + {else}{$totalCount.year.renew.count}{/if} + + + {if $totalCount.year.total.url} + {$totalCount.year.total.count} + {else} + {$totalCount.year.total.count} + {/if} [ + {if $totalCount.year_owner.year_owner.url} + {$totalCount.year_owner.year_owner.count} + {else} + {$totalCount.year_owner.year_owner.count} + {/if}] + - {else} - {$totalCount.total.total.count}  - [ - {$totalCount.total_owner.total_owner.count} ] + + {if $isCurrent} + {if $row.total.total.url} + {$totalCount.current.total.count} + {else} + {$totalCount.current.total.count} + {/if} [ + {if $row.total_owner.total_owner.url} + {$totalCount.current_owner.current_owner.count} + {else} + {$totalCount.current_owner.current_owner.count} + {/if} ] + {else} + {if $totalCount.total.url} + {$totalCount.total.total.count} + {else} + {$totalCount.total.total.count} + {/if} [ + {if $totalCount.total_owner.total_owner.url} + {$totalCount.total_owner.total_owner.count} + {else} + {$totalCount.total_owner.total_owner.count} + {/if} ] + {/if} + - {/if} - {* member/search?reset=1&force=1¤t=1 *} Primary member counts (those who "own" the membership rather than receiving via relationship) are in [brackets].