-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1872 update pages for deactivated families #2046
#1872 update pages for deactivated families #2046
Conversation
* Addded functions to DashboardService to fetch the updated and latest families and members. * Converted queries to ORM and filtered out deactivated families. fixes # 1872
* added filters to fetch only active families /members from active families only to the following pages. -- FamilyList.php, SelectList.php fixes #1872
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do some testing tonight but this is the code changes needed
/** | ||
* //Return last edited families. only active families selected | ||
* @param int $limit | ||
* @return array|\ChurchCRM\Family[]|mixed|\Propel\Runtime\ActiveRecord\ActiveRecordInterface[]|\Propel\Runtime\Collection\ObjectCollection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
*/ | ||
public function getUpdatedFamilies($limit = 12) | ||
{ | ||
return FamilyQuery::create() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think now that we have ORM, these can be moved inline as we are trying to kill the old style services if we can
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think We should move towards keeping the model and view separately. logic should be in the model classes. Should I move this to Family (Model/ChurchCRM/Family.php?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crossan007 what say you... i agree with both ways...
*/ | ||
public function getActiveFamilies() | ||
{ | ||
return FamilyQuery::create() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here simple ORM that is only used once should be now inline
src/FamilyList.php
Outdated
if (strtolower($sMode) == 'Inactive'){ | ||
$families = $familyService->getDeactivatedFamilies(); | ||
} else { | ||
$sMode = 'Active'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will resolve the #1873 (Deactivated (Inactive) families listing) without creating a separate page. If inactive is passed, it will get getDeactivatedFamilies.
src/FamilyList.php
Outdated
$sPageTitle = gettext('Family List'); | ||
require 'Include/Header.php'; | ||
// Filter received user input as needed | ||
if (isset($_GET['mode'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the better way to do this is to set the default mode
then do a single if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
<tbody> | ||
<?php | ||
<div class="box-body"> | ||
<table id="families" class="table table-striped table-bordered data-table" cellspacing="0" width="100%"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to datatable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is already a data table. class data-table is included.
$dashboardService = new DashboardService(); | ||
$personCount = $dashboardService->getPersonCount(); | ||
$familyCount = $dashboardService->getFamilyCount(); | ||
$groupStats = $dashboardService->getGroupStats(); | ||
//Last edited active families | ||
$updatedFamilies = $dashboardService->getUpdatedFamilies(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move inline
src/Menu.php
Outdated
<a href="FamilyView.php?FamilyID=<?= $family->getId() ?>"><?= $family->getName() ?></a> | ||
</td> | ||
<td><?= $family->getAddress() ?></td> | ||
<td><?= date_format($family->getDateEntered(),SystemConfig::getValue('sDateFormatLong')) ?></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -0,0 +1,6 @@ | |||
UPDATE `menuconfig_mcf` SET content_english = 'View Active Families', `content` = 'View Active Families' WHERE `mid` = 15; | |||
|
|||
DELETE FROM `menuconfig_mcf` where `mid` = 16 ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you del 16? then creating a new one... what was #16 before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16 is a new one, there was no 16 before. i thought if this script get a second run somehow, it should delete and reinsert. not required?
@rakess70 does this address your Question about deactivated families |
please apply https://styleci.io/analyses/q53Vpx |
Style CI fixes
families and members.
families only to the following pages.
-- FamilyList.php, SelectList.php
passing ?mode=inactive