Skip to content
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

Merged
merged 12 commits into from
Mar 13, 2017
Merged

#1872 update pages for deactivated families #2046

merged 12 commits into from
Mar 13, 2017

Conversation

simonkp
Copy link

@simonkp simonkp commented Mar 4, 2017

  1. Update to dashboard page fixes Update pages to remove deactivated families #1872
  • Addded functions to DashboardService to fetch the updated and latest
    families and members.
  • Converted queries to ORM and filtered out deactivated families.
  1. Add deactivated filter to Family view and person view pages. fixes Update pages to remove deactivated families #1872
  • Added filters to fetch only active families /members from active
    families only to the following pages.
    -- FamilyList.php, SelectList.php
  1. Deactivated (Inactive) families listing - fixes Deactivated (Inactive) families listing #1873

* 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
Deactivated (Inactive) families listing #1873
* modified the FamilyView.php to handle inactive families listing by
passing ?mode=inactive

fixes #1873
@DawoudIO DawoudIO added this to the 2.7.0 milestone Mar 5, 2017
Copy link
Contributor

@DawoudIO DawoudIO left a 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
Copy link
Contributor

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()
Copy link
Contributor

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

Copy link
Author

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?

Copy link
Contributor

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()
Copy link
Contributor

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

if (strtolower($sMode) == 'Inactive'){
$families = $familyService->getDeactivatedFamilies();
} else {
$sMode = 'Active';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed

Copy link
Author

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.

$sPageTitle = gettext('Family List');
require 'Include/Header.php';
// Filter received user input as needed
if (isset($_GET['mode'])) {
Copy link
Contributor

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

Copy link
Author

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%">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to datatable

Copy link
Author

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);
Copy link
Contributor

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>
Copy link
Contributor

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 ;
Copy link
Contributor

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

Copy link
Author

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?

@DawoudIO
Copy link
Contributor

DawoudIO commented Mar 8, 2017

@rakess70 does this address your Question about deactivated families

@DawoudIO
Copy link
Contributor

DawoudIO commented Mar 8, 2017

please apply https://styleci.io/analyses/q53Vpx

@DawoudIO DawoudIO merged commit 276c966 into ChurchCRM:develop Mar 13, 2017
@simonkp simonkp deleted the #1872-update-pages-for-deactivated-families branch March 17, 2017 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants