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

Self Registration #935

Merged
merged 77 commits into from
Oct 22, 2016
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e1f3090
setup for external site.
DawoudIO Aug 23, 2016
47c9985
added missing sRootPath
DawoudIO Aug 23, 2016
d4d2b53
more framework setup
DawoudIO Aug 23, 2016
8fb6029
added user pages
DawoudIO Aug 23, 2016
90831d8
placeholders
DawoudIO Aug 23, 2016
73c4a93
fixed spelling
DawoudIO Aug 23, 2016
bbfec91
2.0.0 RC2
DawoudIO Aug 25, 2016
ef1289b
merge dev
DawoudIO Aug 25, 2016
e08ba93
added gettext
DawoudIO Aug 25, 2016
b20e275
family form created
DawoudIO Aug 25, 2016
fd5005f
fixed name
DawoudIO Aug 26, 2016
53b007d
added error handling
DawoudIO Aug 26, 2016
79ccdfc
passing date from family form 1 to form 2
DawoudIO Aug 26, 2016
97bda25
create a family object and store it in the seesion
DawoudIO Aug 27, 2016
bf8220b
merge develop
DawoudIO Aug 31, 2016
49d90ac
Disable Self Registration / Verification by default
DawoudIO Sep 1, 2016
bf27c05
get Config by name
DawoudIO Sep 1, 2016
60f9db7
check self registration setting before offering the feature
DawoudIO Sep 1, 2016
5f4e612
forms are now complete
DawoudIO Sep 1, 2016
fd16b3b
extra html
DawoudIO Sep 1, 2016
7eff64a
Merge branch 'develop' into external-mvc-site
crossan007 Sep 2, 2016
d04b12c
merge develop
DawoudIO Oct 2, 2016
c65a6e5
removed extra stuff for now
DawoudIO Oct 2, 2016
668cb56
moving to a common file
DawoudIO Oct 2, 2016
483f6bb
moving to sub folders
DawoudIO Oct 2, 2016
ebb4a12
common error handler file
DawoudIO Oct 2, 2016
efdd475
reverted
DawoudIO Oct 2, 2016
2b0c686
"revert"
DawoudIO Oct 2, 2016
a6727fb
moved to new SystemService namespace
DawoudIO Oct 2, 2016
f1ed079
\
DawoudIO Oct 2, 2016
34db614
added missing config
DawoudIO Oct 2, 2016
f368834
fixed path
DawoudIO Oct 2, 2016
086d6f1
added "sRootPath" => $_SESSION['sRootPath']
DawoudIO Oct 2, 2016
bb8aa13
fixed include path
DawoudIO Oct 2, 2016
a4f09f4
moving settings.php
DawoudIO Oct 2, 2016
09cd194
added settings
DawoudIO Oct 2, 2016
b225d48
removed getConfig
DawoudIO Oct 2, 2016
c14e69a
added ConfigQuery
DawoudIO Oct 2, 2016
d68a4ae
new button style
DawoudIO Oct 2, 2016
c3679be
cleanner html and text for church = primary and button = next
DawoudIO Oct 2, 2016
66a6e68
moving system config to a single class
DawoudIO Oct 7, 2016
2ea1e02
get all config not just general
DawoudIO Oct 7, 2016
025d8d8
renamed to $systemConfig
DawoudIO Oct 7, 2016
51f320c
cleanup
DawoudIO Oct 7, 2016
a262e2a
input-mask is now included by default
DawoudIO Oct 7, 2016
3baaa29
input-mask is now in all footers
DawoudIO Oct 7, 2016
2d80b34
/plugins/input-mask/ is in all footers
DawoudIO Oct 7, 2016
5d2f934
include church crm css
DawoudIO Oct 7, 2016
9b6892f
merge develop
DawoudIO Oct 8, 2016
ad38da0
removed unused import
DawoudIO Oct 8, 2016
6195192
- added hide age
DawoudIO Oct 8, 2016
fa2d725
Fixed Case for Family Phones
DawoudIO Oct 9, 2016
231d24b
added getAddress
DawoudIO Oct 9, 2016
d018bcd
Now there is a final confirmation page
DawoudIO Oct 9, 2016
4f45d3f
renamed family register
DawoudIO Oct 11, 2016
997a588
cleaner server path for registration
DawoudIO Oct 11, 2016
9f79d80
Confirm working
DawoudIO Oct 11, 2016
c046cfc
done working
DawoudIO Oct 11, 2016
5217753
Self Registration in timeline
DawoudIO Oct 11, 2016
65473fa
working save person / family
DawoudIO Oct 15, 2016
779e136
Birthday and Phone are working now
DawoudIO Oct 15, 2016
a14aa57
Merge branch 'develop' into external-mvc-site
DawoudIO Oct 15, 2016
b9af958
Set Enterted By as Unknown
DawoudIO Oct 15, 2016
abd239e
Merge branch 'external-mvc-site' of https://github.com/ChurchCRM/CRM …
DawoudIO Oct 15, 2016
ba9666c
merge from develop
DawoudIO Oct 17, 2016
37ac605
merge from develop
DawoudIO Oct 20, 2016
8c00c6d
moved to ChurchCRM
DawoudIO Oct 20, 2016
a25d151
fixed bath to reports
DawoudIO Oct 20, 2016
c6f66d8
fresh install has self regestration disabled
DawoudIO Oct 21, 2016
d191958
cleanner class auto-loading
DawoudIO Oct 21, 2016
bfc471e
removed setting title as birthday
DawoudIO Oct 21, 2016
8171698
removed unset colummns to ensure we don't have a missmatch
DawoudIO Oct 21, 2016
20ab8c1
added missing zip code
DawoudIO Oct 21, 2016
cb61699
reverted to old way of require
DawoudIO Oct 21, 2016
c5e1c6a
removed unsigned fro EnteredBy for Person and Family
DawoudIO Oct 21, 2016
2f6aa52
self reg has EnteredBy = -1
DawoudIO Oct 21, 2016
bec4491
Note Created By Now works for Self Registration
DawoudIO Oct 22, 2016
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
54 changes: 54 additions & 0 deletions src/ChurchCRM/dto/SystemConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace ChurchCRM\dto;

use ChurchCRM\Child;
use ChurchCRM\Config;

class SystemConfig
{
/**
* @var Config[]
*/
private $configs;

/**
* @param Config[] $configs
*/
function init($configs)
{
$this->configs = $configs;
}

function getValue($name)
{
$config = $this->getRawConfig($name);
if (!is_null($config)) {
return $config->getValue();
}
return NULL;
}

function setValue($name, $value)
{
$config = $this->getRawConfig($name);
if (!is_null($config)) {
$config->setValue($value);
}
}

/**
* @param $name
* @return Config
*
*/
function getRawConfig($name)
{
foreach ($this->configs as $config) {
if ($config->getName() == $name) {
return $config;
}
}
return NULL;
}
}
82 changes: 39 additions & 43 deletions src/FamilyEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

$aFirstNameError = array();
$aBirthDateError = array();
$aperFlags = array();
$aperFlags = array();

//Is this the second pass?
if (isset($_POST["FamilySubmit"]) || isset($_POST["FamilySubmitAndAdd"]))
Expand Down Expand Up @@ -153,7 +153,7 @@
$nEnvelope = 0;
if (array_key_exists ("Envelope", $_POST))
$nEnvelope = FilterInput($_POST["Envelope"], "int");

if(is_numeric($nEnvelope)){ // Only integers are allowed as Envelope Numbers
if(intval($nEnvelope)==floatval($nEnvelope))
$nEnvelope= "'" . intval($nEnvelope) . "'";
Expand Down Expand Up @@ -182,7 +182,7 @@
$bNoFormat_HomePhone = isset($_POST["NoFormat_HomePhone"]);
$bNoFormat_WorkPhone = isset($_POST["NoFormat_WorkPhone"]);
$bNoFormat_CellPhone = isset($_POST["NoFormat_CellPhone"]);

//Loop through the Family Member 'quick entry' form fields
for ($iCount = 1; $iCount <= $iFamilyMemberRows; $iCount++)
{
Expand Down Expand Up @@ -211,7 +211,7 @@
}

// Validate any family member birthdays
if ((strlen($aFirstNames[$iCount]) > 0) && (strlen($aBirthYears[$iCount]) > 0))
if ((strlen($aFirstNames[$iCount]) > 0) && (strlen($aBirthYears[$iCount]) > 0))
{
if (($aBirthYears[$iCount] > 2155) || ($aBirthYears[$iCount] < 1901))
{
Expand Down Expand Up @@ -241,7 +241,7 @@
if ((strlen($dWeddingDate) > 0) && ($dWeddingDate != "0000-00-00")) {
$dateString = parseAndValidateDate($dWeddingDate, $locale = "<?= $localeInfo->getCountryCode() ?>", $pasfut = "past");
if ( $dateString === FALSE ) {
$sWeddingDateError = "<span style=\"color: red; \">"
$sWeddingDateError = "<span style=\"color: red; \">"
. gettext("Not a valid Wedding Date") . "</span>";
$bErrorFlag = true;
} else {
Expand All @@ -255,7 +255,7 @@
if (strlen($sEmail) > 0)
{
if ( checkEmail($sEmail) == false ) {
$sEmailError = "<span style=\"color: red; \">"
$sEmailError = "<span style=\"color: red; \">"
. gettext("Email is Not Valid") . "</span>";
$bErrorFlag = true;
} else {
Expand Down Expand Up @@ -318,22 +318,22 @@
fam_Latitude,
fam_Longitude,
fam_Envelope)
VALUES ('" .
$sName . "','" .
$sAddress1 . "','" .
$sAddress2 . "','" .
$sCity . "','" .
$sState . "','" .
$sZip . "','" .
$sCountry . "','" .
$sHomePhone . "','" .
$sWorkPhone . "','" .
$sCellPhone . "','" .
$sEmail . "'," .
$dWeddingDate . ",'" .
date("YmdHis") . "'," .
$_SESSION['iUserID'] . "," .
$bSendNewsLetterString . "," .
VALUES ('" .
$sName . "','" .
$sAddress1 . "','" .
$sAddress2 . "','" .
$sCity . "','" .
$sState . "','" .
$sZip . "','" .
$sCountry . "','" .
$sHomePhone . "','" .
$sWorkPhone . "','" .
$sCellPhone . "','" .
$sEmail . "'," .
$dWeddingDate . ",'" .
date("YmdHis") . "'," .
$_SESSION['iUserID'] . "," .
$bSendNewsLetterString . "," .
$bOkToCanvassString . ",'" .
$iCanvasser . "'," .
$nLatitude . "," .
Expand Down Expand Up @@ -362,7 +362,7 @@
"fam_EditedBy = " . $_SESSION['iUserID'] . "," .
"fam_SendNewsLetter = " . $bSendNewsLetterString;
if ($_SESSION['bCanvasser'])
$sSQL .= ", fam_OkToCanvass = " . $bOkToCanvassString .
$sSQL .= ", fam_OkToCanvass = " . $bOkToCanvassString .
", fam_Canvasser = '" . $iCanvasser . "'";
$sSQL .= " WHERE fam_ID = " . $iFamilyID;
$bGetKeyBack = false;
Expand All @@ -381,7 +381,7 @@

$sSQL = "INSERT INTO `family_custom` (`fam_ID`) VALUES ('" . $iFamilyID . "')";
RunQuery($sSQL);

// Add property if assigned
if ($iPropertyID)
{
Expand Down Expand Up @@ -439,7 +439,7 @@
$aBirthYears[$iCount],
$aClassification[$iCount])";
RunQuery($sSQL);
$sSQL = "INSERT INTO person_custom (per_ID) VALUES ("
$sSQL = "INSERT INTO person_custom (per_ID) VALUES ("
. mysql_insert_id() . ")";
RunQuery($sSQL);
RunQuery("UNLOCK TABLES");
Expand Down Expand Up @@ -484,7 +484,7 @@
$note->setEntered($_SESSION['iUserID']);
$note->save();
}

// Update the custom person fields.
if ($numCustomFields > 0)
{
Expand Down Expand Up @@ -534,7 +534,7 @@
$sSQL = "SELECT * FROM family_fam WHERE fam_ID = " . $iFamilyID;
$rsFamily = RunQuery($sSQL);
extract(mysql_fetch_array($rsFamily));

$iFamilyID = $fam_ID;
$sName = $fam_Name;
$sAddress1 = $fam_Address1;
Expand Down Expand Up @@ -562,16 +562,16 @@
$sSQL = "SELECT * FROM family_custom WHERE fam_ID = " . $iFamilyID;
$rsCustomData = RunQuery($sSQL);
$aCustomData = mysql_fetch_array($rsCustomData, MYSQL_BOTH);

$aCustomErrors = array();

if ($numCustomFields >0) {
mysql_data_seek($rsCustomFields,0);
while ($rowCustomField = mysql_fetch_array($rsCustomFields, MYSQL_BOTH) ) {
$aCustomErrors[$rowCustomField['fam_custom_Field']] = false;
}
}

$sSQL = "SELECT * FROM person_per LEFT JOIN family_fam ON per_fam_ID = fam_ID WHERE per_fam_ID =" . $iFamilyID . " ORDER BY per_fmr_ID";
$rsMembers = RunQuery($sSQL);
$iCount = 0;
Expand All @@ -583,8 +583,8 @@
$iFamilyMemberRows++;
$aFirstNames[$iCount] = $per_FirstName;
$aMiddleNames[$iCount] = $per_MiddleName;
$aLastNames[$iCount] = $per_LastName;
$aSuffix[$iCount] = $per_Suffix;
$aLastNames[$iCount] = $per_LastName;
$aSuffix[$iCount] = $per_Suffix;
$aGenders[$iCount] = $per_Gender;
$aRoles[$iCount] = $per_fmr_ID;
$aBirthMonths[$iCount] = $per_BirthMonth;
Expand All @@ -608,7 +608,7 @@
$iClassification = "0";
$iFamilyMemberRows = 6;
$bOkToCanvass = 1;

$iFamilyID = -1;
$sName = "";
$sAddress1 = "";
Expand All @@ -625,7 +625,7 @@
$iCanvasser = -1;
$dWeddingDate = "";
$nLatitude = 0.0;
$nLongitude = 0.0;
$nLongitude = 0.0;

//Loop through the Family Member 'quick entry' form fields
for ($iCount = 1; $iCount <= $iFamilyMemberRows; $iCount++)
Expand All @@ -644,7 +644,7 @@
$aPersonIDs[$iCount] = 0;
$aUpdateBirthYear[$iCount] = 0;
}

$aCustomData = array ();
$aCustomErrors = array ();
if ($numCustomFields > 0) {
Expand All @@ -654,7 +654,7 @@
$aCustomData[$fam_custom_Field] = '';
$aCustomErrors[$fam_custom_Field] = false;
}
}
}
}
}

Expand Down Expand Up @@ -1034,8 +1034,8 @@
<input name="BirthYear<?= $iCount ?>" type="text" value="<?= $aBirthYears[$iCount] ?>" size="4" maxlength="4">
<div><font color="red"><?php if (array_key_exists ($iCount, $aBirthDateError)) echo $aBirthDateError[$iCount]; ?></font></div>
<?php }
else
{
else
{
$UpdateBirthYear = 0;
}
?>
Expand Down Expand Up @@ -1063,7 +1063,7 @@
echo "</table>";
echo "</div></div>";
}

echo "<td colspan=\"2\" align=\"center\">";
echo "<input type=\"hidden\" Name=\"UpdateBirthYear\" value=\"".$UpdateBirthYear."\">";

Expand All @@ -1076,10 +1076,6 @@
echo " onclick=\"javascript:document.location='FamilyList.php';\">";
echo "</td></tr></form></table>";
?>
<!-- InputMask -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {
Expand Down
7 changes: 7 additions & 0 deletions src/Include/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
<!-- AdminLTE App -->
<script src="<?= $sRootPath ?>/skin/adminlte/dist/js/app.min.js"></script>

<!-- InputMask -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>


<script src="<?= $sRootPath ?>/skin/js/DataTables.js"></script>
<script src="<?= $sRootPath ?>/skin/js/Tooltips.js"></script>
<script src="<?= $sRootPath ?>/skin/js/Events.js"></script>
Expand Down
10 changes: 10 additions & 0 deletions src/Include/FooterNotLoggedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
<script src="<?= $sRootPath ?>/skin/adminlte/bootstrap/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/iCheck/icheck.min.js"></script>

<!-- AdminLTE App -->
<script src="<?= $sRootPath ?>/skin/adminlte/dist/js/app.min.js"></script>

<!-- InputMask -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>

<script>
$(function () {
$('input').iCheck({
Expand Down
7 changes: 6 additions & 1 deletion src/Include/HeaderNotLoggedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<!-- Custom ChurchCRM styles -->
<link rel="stylesheet" href="<?= $sRootPath ?>/skin/churchcrm.min.css">

<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="<?= $sRootPath ?>/skin/adminlte/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
Expand All @@ -21,7 +24,9 @@

<!-- jQuery JS -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/jQuery/jQuery-2.2.0.min.js"></script>
<title>ChurchCRM: <?= gettext($sPageTitle) ?></title>

<title>ChurchCRM: <?= $sPageTitle ?></title>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we giving up on translating page titles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no we moved gettext to each page this way we can extract it if we do it in the headers i don't get what to translate


</head>
<body class="hold-transition login-page">

Expand Down
9 changes: 7 additions & 2 deletions src/Include/LoadConfigs.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@

use ChurchCRM\Service\SystemService;
use ChurchCRM\Version;
use ChurchCRM\ConfigQuery;
use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\LocaleInfo;


if (!function_exists("mysql_failure")) {
function mysql_failure($message)
{
Expand All @@ -48,7 +49,7 @@ function mysql_failure($message)
<h3>ChurchCRM – Setup failure</h3>

<div class='alert alert-danger text-center' style='margin-top: 20px;'>
<?= $message ?>
<?= gettext($message) ?>
</div>
</div>
<?php
Expand Down Expand Up @@ -96,6 +97,10 @@ function mysql_failure($message)

// Read values from config table into local variables
// **************************************************

$systemConfig = new SystemConfig();
$systemConfig->init(ConfigQuery::create()->find());

$sSQL = "SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value "
. "FROM config_cfg WHERE cfg_section='General'";
$rsConfig = mysql_query($sSQL); // Can't use RunQuery -- not defined yet
Expand Down
File renamed without changes.
File renamed without changes.
Loading