Skip to content

Commit

Permalink
Dashboard Person #3822 (#4143)
Browse files Browse the repository at this point in the history
* removed unused updatedFamilies & latestFamilies

fixed title to persons from members

* fix #3822

removed usused methods
  • Loading branch information
DawoudIO committed Mar 18, 2018
1 parent def904c commit 2c2373d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 41 deletions.
33 changes: 0 additions & 33 deletions src/ChurchCRM/Service/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,6 @@ public function getGroupStats()
return $data;
}


/**
* //Return last edited families. only active families selected
* @param int $limit
* @return array|\ChurchCRM\Family[]|mixed|\Propel\Runtime\ActiveRecord\ActiveRecordInterface[]|\Propel\Runtime\Collection\ObjectCollection
*/
public function getUpdatedFamilies($limit = 12)
{
return FamilyQuery::create()
->filterByDateDeactivated(null)
->orderByDateLastEdited('DESC')
->limit($limit)
->find();

}

/**
* Return newly added families. Only active families selected
* @param int $limit
* @return array|\ChurchCRM\Family[]|mixed|\Propel\Runtime\ActiveRecord\ActiveRecordInterface[]|\Propel\Runtime\Collection\ObjectCollection
*/
public function getLatestFamilies($limit = 12)
{

return FamilyQuery::create()
->filterByDateDeactivated(null)
->filterByDateLastEdited(null)
->orderByDateEntered('DESC')
->limit($limit)
->find();
}

/**
* Return last edited members. Only from active families selected
* @param int $limit
Expand All @@ -121,7 +89,6 @@ public function getLatestMembers($limit = 12)
return PersonQuery::create()
->leftJoinWithFamily()
->where('Family.DateDeactivated is null')
->filterByDateLastEdited(null)
->orderByDateEntered('DESC')
->limit($limit)
->find();
Expand Down
11 changes: 3 additions & 8 deletions src/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,13 @@
require 'Include/Functions.php';
use ChurchCRM\DepositQuery;
use ChurchCRM\Service\DashboardService;
use ChurchCRM\Service\FinancialService;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\ChurchMetaData;
use ChurchCRM\dto\MenuEventsCount;

$financialService = new FinancialService();
$dashboardService = new DashboardService();
//Last edited active families
$updatedFamilies = $dashboardService->getUpdatedFamilies(10);
//Newly added active families
$latestFamilies = $dashboardService->getLatestFamilies(10);

//last Edited members from Active families
$updatedMembers = $dashboardService->getUpdatedMembers(12);
//Newly added members from Active families
Expand Down Expand Up @@ -357,7 +352,7 @@
<div class="box box-solid">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?= gettext('Latest Members') ?></h3>
<h3 class="box-title"><?= gettext('Latest Persons') ?></h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
Expand Down Expand Up @@ -391,7 +386,7 @@
<div class="box box-solid">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?= gettext('Updated Members') ?></h3>
<h3 class="box-title"><?= gettext('Updated Persons') ?></h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
Expand Down

0 comments on commit 2c2373d

Please sign in to comment.