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

Export Emails to CVS: Exclude Inactive Groups #1865

Merged
merged 26 commits into from
Mar 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b858973
moved group to ORM
DawoudIO Feb 8, 2017
f24a55d
fixed cleanup error
DawoudIO Feb 8, 2017
4b85509
Apply fixes from StyleCI (#1866)
DawoudIO Feb 8, 2017
60ab4e7
adding isActive & EnableEmailExport flags to the DB
DawoudIO Feb 8, 2017
fea7303
added default values
DawoudIO Feb 9, 2017
689551a
added 2.6.0-groups.sql
DawoudIO Feb 9, 2017
0ee9af4
fixed sql error
DawoudIO Feb 9, 2017
b9f43b7
correct line fixed
DawoudIO Feb 9, 2017
bae2e73
merge develop
DawoudIO Feb 25, 2017
93cf026
style cleanup
DawoudIO Feb 25, 2017
aeaa479
added bootstrap-toggle
DawoudIO Feb 25, 2017
fca0b85
Apply fixes from StyleCI (#2006)
DawoudIO Feb 25, 2017
602c394
more style cleanup
DawoudIO Feb 25, 2017
f3b1272
using toggle buttons to show current db status
DawoudIO Feb 25, 2017
2070c72
removed extra breaks
DawoudIO Feb 25, 2017
c4d0568
Apply fixes from StyleCI (#2007)
DawoudIO Feb 25, 2017
e50ef97
JS cleanup
DawoudIO Feb 26, 2017
5d2c515
added API/Calls to taggel status and email export
DawoudIO Feb 26, 2017
0d860f8
Merge branch 'develop' into email-export-cleanup
DawoudIO Feb 26, 2017
d94d7eb
Merge branch 'develop' into email-export-cleanup
DawoudIO Feb 27, 2017
f9acb20
Update 2.7.0-groups.sql
DawoudIO Feb 27, 2017
ab5d07a
fixed bad ORM convert
DawoudIO Feb 27, 2017
a24bf3c
only loading Active & Enabled for Email Export.
DawoudIO Feb 27, 2017
30631ea
unused GroupService
DawoudIO Feb 27, 2017
aaeeeaf
Merge branch 'develop' into email-export-cleanup
DawoudIO Mar 3, 2017
54b8a8c
Merge branch 'develop' into email-export-cleanup
crossan007 Mar 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/GroupList.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
require 'Include/Config.php';
require 'Include/Functions.php';

use ChurchCRM\Service\GroupService;

//Set the page title
$sPageTitle = gettext('Group Listing');
$groupService = new GroupService();
require 'Include/Header.php'; ?>

<div class="box box-body">
Expand Down
19 changes: 9 additions & 10 deletions src/email/MemberEmailExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@
require '../Include/Config.php';
require '../Include/Functions.php';

use ChurchCRM\Service\GroupService;
use ChurchCRM\Service\SundaySchoolService;
use ChurchCRM\GroupQuery;
use ChurchCRM\dto\SystemConfig;

$groupService = new GroupService();
$sundaySchoolService = new SundaySchoolService();
$groups = $groupService->getGroups();
$groups = GroupQuery::create()->filterByActive(true)->filterByIncludeInEmailExport(true)->find();

$colNames = [];
array_push($colNames, 'CRM ID');
array_push($colNames, 'FirstName');
array_push($colNames, 'LastName');
array_push($colNames, 'Email');
foreach ($groups as $group) {
array_push($colNames, $group['groupName']);
array_push($colNames, $group->getName());
}

$sundaySchoolsParents = [];
foreach ($groups as $group) {
if ($group['grp_Type'] == 4) {
if ($group->isSundaySchool()) {
$sundaySchoolParents = [];
$kids = $sundaySchoolService->getKidsFullDetails($group['id']);
$kids = $sundaySchoolService->getKidsFullDetails($group->getId());
$parentIds = [];
foreach ($kids as $kid) {
if ($kid['dadId'] != '') {
Expand All @@ -34,7 +33,7 @@
array_push($parentIds, $kid['momId']);
}
}
$sundaySchoolsParents[$group['id']] = $parentIds;
$sundaySchoolsParents[$group->getId()] = $parentIds;
}
}

Expand All @@ -52,9 +51,9 @@
array_push($row, $person['lastName']);
array_push($row, $person['email']);
foreach ($groups as $group) {
$groupRole = $person[$group['groupName']];
if ($groupRole == '' && $group['grp_Type'] == 4) {
if (in_array($person['id'], $sundaySchoolsParents[$group['id']])) {
$groupRole = $person[$group->getName()];
if ($groupRole == '' && $group->isSundaySchool()) {
if (in_array($person['id'], $sundaySchoolsParents[$group->getId()])) {
$groupRole = 'Parent';
}
}
Expand Down