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

Update/dev from master #2083

Merged
merged 21 commits into from
Mar 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
169 changes: 138 additions & 31 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions demo/ChurchCRM-Database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- Host: localhost Database: churchcrm
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0.14.04.2
-- Date: Sun, 15 Jan 2017 19:40:49 -0500
-- Date: Sat, 25 Feb 2017 09:54:45 -0500

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -130,7 +130,7 @@ CREATE TABLE `config_cfg` (
LOCK TABLES `config_cfg` WRITE;
/*!40000 ALTER TABLE `config_cfg` DISABLE KEYS */;
SET autocommit=0;
INSERT INTO `config_cfg` VALUES (6,'sDirRoleHead','1'),(10,'aFinanceQueries','28,30,31,32'),(27,'sSMTPHost','127.0.0.1:1025'),(48,'bHideFriendDate',''),(49,'bHideFamilyNewsletter',''),(50,'bHideWeddingDate',''),(51,'bHideLatLon',''),(52,'bUseDonationEnvelopes',''),(58,'bUseScannedChecks',''),(65,'sTimeZone','America/Detroit'),(67,'cfgForceUppercaseZip',''),(72,'bEnableNonDeductible',''),(80,'sEnableSelfRegistration','1'),(999,'bRegistered',''),(1003,'sChurchName','Demo Church'),(1004,'sChurchAddress','123 Main St'),(1005,'sChurchCity','Kansas City,'),(1006,'sChurchState','MO'),(1007,'sChurchZip','64105'),(1008,'sChurchPhone','555 123 4234'),(1009,'sChurchEmail','demo@churchcrm.io'),(1010,'sHomeAreaCode','555'),(1014,'sTaxSigner','Elder Joe Smith'),(1016,'sReminderSigner','Elder Joe Smith'),(1025,'sConfirmSigner','Elder Joe Smith'),(1027,'sPledgeSummary2','as of'),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of'),(1034,'sChurchChkAcctNum','111111111'),(1035,'sEnableGravatarPhotos',''),(1036,'sEnableExternalBackupTarget',''),(1037,'sExternalBackupType','WebDAV'),(1046,'sLastIntegrityCheckTimeStamp','2017-02-11 13:15:26'),(1047,'sChurchCountry','United States');
INSERT INTO `config_cfg` VALUES (23,'sDefaultCountry','United States'),(27,'sSMTPHost','127.0.0.1:1025'),(10,'aFinanceQueries','28,30,31,32'),(28,'sSMTPAuth',''),(48,'bHideFriendDate',''),(49,'bHideFamilyNewsletter',''),(50,'bHideWeddingDate',''),(51,'bHideLatLon',''),(52,'bUseDonationEnvelopes',''),(58,'bUseScannedChecks',''),(65,'sTimeZone','America/Detroit'),(67,'cfgForceUppercaseZip',''),(72,'bEnableNonDeductible',''),(80,'sEnableSelfRegistration','1'),(999,'bRegistered',''),(1003,'sChurchName','Main St. Cathedral'),(1004,'sChurchAddress','123 Main St'),(1005,'sChurchCity','Kansas City'),(1006,'sChurchState','MO'),(1007,'sChurchZip','64106'),(1008,'sChurchPhone','555 123 4234'),(1009,'sChurchEmail','demo@churchcrm.io'),(1010,'sHomeAreaCode','555'),(1014,'sTaxSigner','Elder Joe Smith'),(1016,'sReminderSigner','Elder Joe Smith'),(1025,'sConfirmSigner','Elder Joe Smith'),(1027,'sPledgeSummary2','as of'),(1028,'sDirectoryDisclaimer1','Every effort was made to insure the accuracy of this directory. If there are any errors or omissions, please contact the church office.This directory is for the use of the people of'),(1034,'sChurchChkAcctNum','111111111'),(1035,'sEnableGravatarPhotos','1'),(1036,'sEnableExternalBackupTarget',''),(1037,'sExternalBackupType','WebDAV'),(1046,'sLastIntegrityCheckTimeStamp','2017-02-11 13:15:26'),(1047,'sChurchCountry','United States'),(21,'sDefaultCity','Kansas City'),(22,'sDefaultState','MO');
/*!40000 ALTER TABLE `config_cfg` ENABLE KEYS */;
UNLOCK TABLES;
COMMIT;
Expand Down Expand Up @@ -1520,4 +1520,4 @@ COMMIT;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on: Sat, 11 Feb 2017 13:16:32 -0500
-- Dump completed on: Sat, 25 Feb 2017 09:54:45 -0500
9 changes: 9 additions & 0 deletions docs/Development/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ We love to hear ideas from other ChurchInfo and ChurchCRM users! It's what make
* "Develop" is less strict. If code is not perfect, but provides adequate functionality, it may be merged into develop. All known bugs are should have new issues opened so that the issues are tracked.
* Features should be developed in a separate branch named accordingly

## Testing

All PRs require appropriate tests of each piece of code that is modified. PRs lacking proper tests will not be merged. Please see our [testing documentation](http://docs.churchcrm.io/en/develop/Development/Tests/)

*We are happy to help you write tests, but tests are required.*

## Submitting Changes

* Push your changes to a topic branch in your fork of the repository.
Expand All @@ -42,6 +48,9 @@ Please familiarize yourself with the [documentation](http://docs.churchcrm.io/en
* If you're changing anything in the API, please update the API documentation.
* If you are changing something that affects the user interface, please update the appropriate documentation and help files to ensure continued user friendliness of the application.




## Functional References

### Environment Variables (dto classes)
Expand Down
6 changes: 4 additions & 2 deletions docs/Development/Release.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Release Rules

1. ChurchCRM Major (0.x.x) and Minor (x.0.x) builds will only be released on Monday nights.
1. ChurchCRM Major (0.x.x) and Minor (x.0.x) releases will only occur on Monday, Tuesday, or Wednesday nights.

1. If a Monday night build is blocked by a P0 bug, then that major or minor release will be delayed until the following Monday.
1. If the release is blocked by a P0 bug, then the release will be delayed until the next release window.

2. Release Candidates will be made available one week before the targeted release date.

2. ChurchCRM patch builds (x.x.0) may be released at any time, upon validation that the patch:

Expand Down
1 change: 1 addition & 0 deletions docs/Development/Testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

7 changes: 7 additions & 0 deletions docs/Development/Tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Tests

## Page Tests
ChurchCRM uses [Behat](http://behat.org/en/latest/quick_start.html) for page load testing [Behavior Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development).

## Unit Tests
Unit testing is not yet fully implemented.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"ionicons": "2.0.1",
"font-awesome": "4.7.0",
"fullcalendar": "3.0.1",
"jquery-photo-uploader": "1.0.9",
"jquery-photo-uploader": "1.0.11",
"initial-js": "0.3.4",
"bootstrap-toggle": "2.2.2"
},
Expand All @@ -49,6 +49,8 @@
"changelogs": "scripts/gen-changelogs.sh",
"orm-gen": "src/vendor/propel/propel/bin/propel --config-dir=propel model:build && cd src/ && composer dump-autoload",
"composer-install": "cd src/ && composer install",
"composer-update": " cd src/ && composer update"
"composer-update": " cd src/ && composer update",
"tests-install": "cd tests/ && composer install",
"test": "cd tests/behat/ && ../vendor/bin/behat"
}
}
18 changes: 14 additions & 4 deletions src/ChurchCRM/Service/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getPersonStats()
$data = [];
$sSQL = 'select lst_OptionName as Classification, count(*) as count
from person_per INNER JOIN list_lst ON per_cls_ID = lst_OptionID
INNER JOIN family_fam ON family_fam.fam_ID = person_per.per_fam_ID
LEFT JOIN family_fam ON family_fam.fam_ID = person_per.per_fam_ID
WHERE lst_ID =1 and family_fam.fam_DateDeactivated is null
group by per_cls_ID, lst_OptionName order by count desc;';
$rsClassification = RunQuery($sSQL);
Expand All @@ -49,7 +49,7 @@ public function getDemographic()
{
$stats = [];
$sSQL = 'select count(*) as numb, per_Gender, per_fmr_ID
from person_per JOIN family_fam ON family_fam.fam_ID = person_per.per_fam_ID
from person_per LEFT JOIN family_fam ON family_fam.fam_ID = person_per.per_fam_ID
where family_fam.fam_DateDeactivated is null
group by per_Gender, per_fmr_ID order by per_fmr_ID;';
$rsGenderAndRole = RunQuery($sSQL);
Expand Down Expand Up @@ -85,7 +85,12 @@ public function getDemographic()
$role = gettext('Other');
}

$stats["$role - $gender"] = $row['numb'];
array_push($stats, array(
"key" => "$role - $gender",
"value" => $row['numb'],
"gender" => $row['per_Gender'],
"role" => $row['per_fmr_ID'])
);
}

return $stats;
Expand All @@ -96,7 +101,12 @@ public function getGroupStats()
$sSQL = 'select
(select count(*) from group_grp) as Groups,
(select count(*) from group_grp where grp_Type = 4 ) as SundaySchoolClasses,
(select count(*) from person_per,group_grp grp, person2group2role_p2g2r person_grp, family_fam where fam_ID =per_fam_ID and fam_DateDeactivated is null and person_grp.p2g2r_rle_ID = 2 and grp_Type = 4 and grp.grp_ID = person_grp.p2g2r_grp_ID and person_grp.p2g2r_per_ID = per_ID) as SundaySchoolKidsCount
(Select count(*) from person_per
INNER JOIN person2group2role_p2g2r ON p2g2r_per_ID = per_ID
INNER JOIN group_grp ON grp_ID = p2g2r_grp_ID
LEFT JOIN family_fam ON fam_ID = per_fam_ID
where fam_DateDeactivated is null and
p2g2r_rle_ID = 2 and grp_Type = 4) as SundaySchoolKidsCount
from dual ;
';
$rsQuickStat = RunQuery($sSQL);
Expand Down
28 changes: 24 additions & 4 deletions src/FamilyView.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,14 @@
<div class="box box-primary">
<div class="box-body">
<div class="image-container">
<img data-src="<?= SystemURLs::getRootPath() ?>/api/families/<?= $family->getId() ?>/thumbnail"
data-name="<?= $family->getName()?>" alt="" class="initials-image img-circle img-responsive profile-user-img"/>
<img data-src="<?= SystemURLs::getRootPath() ?>/api/families/<?= $family->getId() ?>/photo"
data-name="<?= $family->getName()?>" alt="" class="initials-image img-rounded img-responsive profile-user-img profile-family-img"/>
<?php if ($bOkToEdit): ?>
<div class="after">
<div class="buttons">
<a class="hide" id="view-larger-image-btn" href="#" title="<?= gettext("View Photo") ?>">
<i class="fa fa-search-plus"></i>
</a>&nbsp;
<a href="#" data-toggle="modal" data-target="#upload-image" title="<?= gettext("Upload Photo") ?>">
<i class="fa fa-camera"></i>
</a>&nbsp;
Expand Down Expand Up @@ -909,6 +912,7 @@ class="fa fa-cart-plus"></i> <?= gettext("Add All Family Members to Cart") ?></a

<!-- Modal -->
<div id="photoUploader"></div>

<div class="modal fade" id="confirm-delete-image" tabindex="-1" role="dialog" aria-labelledby="delete-Image-label"
aria-hidden="true">
<div class="modal-dialog">
Expand Down Expand Up @@ -998,7 +1002,8 @@ class="btn btn-success"><i class="fa fa-check"></i> <?= gettext("Verified In Per
} ?>
<script src="<?= SystemURLs::getRootPath() ?>/skin/jquery-photo-uploader/PhotoUploader.js" type="text/javascript"></script>
<link href="<?= SystemURLs::getRootPath() ?>/skin/jquery-photo-uploader/PhotoUploader.css" rel="stylesheet">
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/FamilyView.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/FamilyView.js" type="text/javascript"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/MemberView.js" type="text/javascript"></script>
<script>
window.CRM.currentFamily = <?= $iFamilyID ?>;
window.CRM.currentActive = <?= (empty($fam_DateDeactivated) ? 'true' : 'false') ?>;
Expand Down Expand Up @@ -1050,14 +1055,29 @@ class="btn btn-success"><i class="fa fa-check"></i> <?= gettext("Verified In Per
});

window.CRM.photoUploader = $("#photoUploader").PhotoUploader({
url: window.CRM.root + "/api/families/<?= $iFamilyID ?>/photo",
url: window.CRM.root + "/api/families/" + familyId + "/photo",
maxPhotoSize: window.CRM.maxUploadSize,
photoHeight: 400,
photoWidth: 400,
done: function(e) {
location.reload();
}
});


contentExists(window.CRM.root + "/api/families/" + familyId + "/photo", function(success) {
if (success) {
$("#view-larger-image-btn").removeClass('hide');

$("#view-larger-image-btn").click(function() {
bootbox.alert({
title: "<?= gettext('Family Photo') ?>",
message: '<img class="img-rounded img-responsive center-block" src="<?= SystemURLs::getRootPath() ?>/api/families/' + familyId + '/photo" />',
backdrop: true
});
});
}
});

});
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/Include/Config.php.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*******************************************************************************
*
* filename : Include/Config.php
* website : http://www.churchdb.org
* website : http://www.churchcrm.io
* description : global configuration
*
******************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions src/Include/FooterNotLoggedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<strong><?= gettext('Copyright') ?> &copy; 2015-2017 <a href="http://www.churchcrm.io" target="_blank"><b>Church</b>CRM</a>.</strong> <?= gettext('All rights reserved')?>.
</div>


<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/select2/select2.full.min.js"></script>

<!-- Bootstrap 3.3.5 -->
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/bootstrap/js/bootstrap.min.js"></script>
<!-- iCheck -->
Expand Down
23 changes: 14 additions & 9 deletions src/MembersDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@
$demographicStats = $dashboardService->getDemographic();

$sSQL = 'select count(*) as numb, per_Gender from person_per, family_fam
where fam_ID =per_fam_ID and fam_DateDeactivated is null and per_Gender in (1,2) and per_fmr_ID in (1,2) group by per_Gender ;';
where fam_ID =per_fam_ID and fam_DateDeactivated is null
and per_Gender in (1,2) and
per_fmr_ID not in (' . SystemConfig::getValue('sDirRoleChild') . ')
group by per_Gender ;';
$rsAdultsGender = RunQuery($sSQL);

$sSQL = 'select count(*) as numb, per_Gender from person_per , family_fam
where fam_ID =per_fam_ID and fam_DateDeactivated is null and per_Gender in (1,2) and per_fmr_ID not in (1,2) group by per_Gender ;';
where fam_ID =per_fam_ID and fam_DateDeactivated is null
and per_Gender in (1,2)
and per_fmr_ID in (' . SystemConfig::getValue('sDirRoleChild') . ')
group by per_Gender ;';
$rsKidsGender = RunQuery($sSQL);

$sSQL = 'select lst_OptionID,lst_OptionName from list_lst where lst_ID = 1;';
Expand Down Expand Up @@ -222,7 +228,6 @@ class="fa fa-map-pin"></i><?= gettext('Update All Family Coordinates') ?></a>
href="DirectoryReports.php"><?= gettext('Members Directory') ?></a><br><?= gettext('Printable directory of all members, grouped by family where assigned') ?>
</p>
<?php

} ?>
<a class="MediumText" href="LettersAndLabels.php"><?php echo gettext('Letters and Mailing Labels'); ?></a>
<br><?php echo gettext('Generate letters and mailing labels.'); ?>
Expand Down Expand Up @@ -261,20 +266,21 @@ class="fa fa-map-pin"></i><?= gettext('Update All Family Coordinates') ?></a>
<th>% <?= gettext('of Members') ?></th>
<th style="width: 40px"><?= gettext('Count') ?></th>
</tr>
<?php foreach ($demographicStats as $key => $value) {
<?php foreach($demographicStats as $demStat){
?>
<tr>
<td> <?= $key ?></td>
<td>
<a href="SelectList.php?mode=person&Gender=<?= $demStat['gender'] ?>&FamilyRole=<?= $demStat['role'] ?>"><?= gettext($demStat['key']) ?></a>
</td>
<td>
<div class="progress progress-xs progress-striped active">
<div class="progress-bar progress-bar-success"
style="width: <?= round($value / $personCount['personCount'] * 100) ?>%"></div>
style="width: <?= round($demStat['value'] / $personCount['personCount'] * 100) ?>%"></div>
</div>
</td>
<td><span class="badge bg-green"><?= $value ?></span></td>
<td><span class="badge bg-green"><?= $demStat['value'] ?></span></td>
</tr>
<?php

} ?>
</table>
</div>
Expand Down Expand Up @@ -312,7 +318,6 @@ class="fa fa-map-pin"></i><?= gettext('Update All Family Coordinates') ?></a>
<td><span class="badge bg-green"><?= $value ?></span></td>
</tr>
<?php

} ?>
</table>
<!-- /.box-body-->
Expand Down
26 changes: 25 additions & 1 deletion src/PersonView.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,14 @@
<div class="box box-primary">
<div class="box-body box-profile">
<div class="image-container">
<img data-name="<?= $person->getFullName()?>" data-src = "<?= SystemURLs::getRootPath().'/api/persons/'.$person->getId().'/thumbnail' ?>" class="initials-image profile-user-img img-responsive img-circle">
<img data-name="<?= $person->getFullName()?>" data-src ="<?= SystemURLs::getRootPath().'/api/persons/'.$person->getId().'/photo' ?>"
class="initials-image profile-user-img img-responsive img-rounded profile-user-img-md">
<?php if ($bOkToEdit): ?>
<div class="after">
<div class="buttons">
<a id="view-larger-image-btn" class="hide" href="#" title="<?= gettext("View Photo") ?>">
<i class="fa fa-search-plus"></i>
</a>&nbsp;
<a href="#" class="" data-toggle="modal" data-target="#upload-image" title="<?= gettext("Upload Photo") ?>">
<i class="fa fa-camera"></i>
</a>&nbsp;
Expand Down Expand Up @@ -928,6 +932,7 @@ class="form-control select2" style="width:100%" data-placeholder="Select ...">
</div>
<script src="<?= SystemURLs::getRootPath() ?>/skin/jquery-photo-uploader/PhotoUploader.js" type="text/javascript"></script>
<link href="<?= SystemURLs::getRootPath() ?>/skin/jquery-photo-uploader/PhotoUploader.css" rel="stylesheet">
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/MemberView.js" type="text/javascript"></script>
<script>
var person_ID = <?= $iPersonID ?>;
function GroupRemove(Group, Person) {
Expand Down Expand Up @@ -993,6 +998,25 @@ function GroupAdd() {
};
$("#assigned-volunteer-opps-table").DataTable(options);
$("#assigned-properties-table").DataTable(options);


contentExists(window.CRM.root + "/api/persons/" + person_ID + "/photo", function(success) {
if (success) {
$("#view-larger-image-btn").removeClass('hide');

$("#view-larger-image-btn").click(function() {
bootbox.alert({
title: "<?= gettext('Photo') ?>",
message: '<img class="img-rounded img-responsive center-block" src="<?= SystemURLs::getRootPath() ?>/api/persons/' + person_ID + '/photo" />',
backdrop: true
});
});
}
});




});


Expand Down
Loading