From b326977221d6035cb906e3f1d5fc4c4a2fdf98d3 Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 08:17:27 -0700 Subject: [PATCH 1/2] locale-cleanup parts of #2684 --- src/AutoPaymentEditor.php | 1372 ++++++++++++++++++++++--------------- src/CartView.php | 652 +++++++++--------- src/FamilyView.php | 626 +++++++++-------- src/Login.php | 32 +- src/UserList.php | 59 +- 5 files changed, 1502 insertions(+), 1239 deletions(-) diff --git a/src/AutoPaymentEditor.php b/src/AutoPaymentEditor.php index dce728bfe2..7ea35a3111 100644 --- a/src/AutoPaymentEditor.php +++ b/src/AutoPaymentEditor.php @@ -14,6 +14,8 @@ //Include the function library require 'Include/Config.php'; require 'Include/Functions.php'; +require 'bin/vancowebservices.php'; + use ChurchCRM\Utils\InputUtils; use ChurchCRM\dto\SystemConfig; @@ -24,7 +26,7 @@ //Get Family name if ($iFamily) { - $sSQL = 'SELECT * FROM family_fam where fam_ID = '.$iFamily; + $sSQL = 'SELECT * FROM family_fam where fam_ID = ' . $iFamily; $rsFamily = RunQuery($sSQL); extract(mysqli_fetch_array($rsFamily)); } else { @@ -92,35 +94,35 @@ aut_Serial, aut_DateLastEdited, aut_EditedBy) - VALUES ('. - $iFamily.','. - $bEnableBankDraft.','. - $bEnableCreditCard.','. - "'".$dNextPayDate."',". - "'".$iFYID."',". - "'".$nAmount."',". - "'".$iInterval."',". - "'".$iFund."',". - "'".$tFirstName."',". - "'".$tLastName."',". - "'".$tAddress1."',". - "'".$tAddress2."',". - "'".$tCity."',". - "'".$tState."',". - "'".$tZip."',". - "'".$tCountry."',". - "'".$tPhone."',". - "'".$tEmail."',". - "'".$tCreditCard."',". - "'".$tExpMonth."',". - "'".$tExpYear."',". - "'".$tBankName."',". - "'".$tRoute."',". - "'".$tAccount."',". - "'". 1 ."',". - "'".date('YmdHis')."',". - $_SESSION['iUserID']. - ')'; + VALUES (' . + $iFamily . ',' . + $bEnableBankDraft . ',' . + $bEnableCreditCard . ',' . + "'" . $dNextPayDate . "'," . + "'" . $iFYID . "'," . + "'" . $nAmount . "'," . + "'" . $iInterval . "'," . + "'" . $iFund . "'," . + "\"" . $tFirstName . "\"," . + "\"" . $tLastName . "\"," . + "\"" . $tAddress1 . "\"," . + "\"" . $tAddress2 . "\"," . + "\"" . $tCity . "\"," . + "\"" . $tState . "\"," . + "'" . $tZip . "'," . + "\"" . $tCountry . "\"," . + "'" . $tPhone . "'," . + "'" . $tEmail . "'," . + "'" . $tCreditCard . "'," . + "'" . $tExpMonth . "'," . + "'" . $tExpYear . "'," . + "'" . $tBankName . "'," . + "'" . $tRoute . "'," . + "'" . $tAccount . "'," . + "'" . 1 . "'," . + "'" . date('YmdHis') . "'," . + $_SESSION['iUserID'] . + ')'; RunQuery($sSQL); $sSQL = 'SELECT MAX(aut_ID) AS iAutID FROM autopayment_aut'; @@ -128,7 +130,7 @@ extract(mysqli_fetch_array($rsAutID)); } -$sPageTitle = gettext('Automatic payment configuration for the '.$fam_Name.' family'); +$sPageTitle = gettext('Automatic payment configuration for the ') . $fam_Name . gettext(' family'); //Is this the second pass? if (isset($_POST['Submit'])) { @@ -175,34 +177,34 @@ $tRoute = InputUtils::LegacyFilterInput($_POST['Route']); $tAccount = InputUtils::LegacyFilterInput($_POST['Account']); - $sSQL = 'UPDATE autopayment_aut SET '. - 'aut_FamID = '.$iFamily.','. - 'aut_EnableBankDraft ='.$bEnableBankDraft.','. - 'aut_EnableCreditCard ='.$bEnableCreditCard.','. - "aut_NextPayDate ='".$dNextPayDate."',". - "aut_Amount ='".$nAmount."',". - "aut_FYID ='".$iFYID."',". - "aut_Interval ='".$iInterval."',". - "aut_Fund ='".$iFund."',". - "aut_FirstName ='".$tFirstName."',". - "aut_LastName ='".$tLastName."',". - "aut_Address1 ='".$tAddress1."',". - "aut_Address2 ='".$tAddress2."',". - "aut_City ='".$tCity."',". - "aut_State ='".$tState."',". - "aut_Zip ='".$tZip."',". - "aut_Country ='".$tCountry."',". - "aut_Phone ='".$tPhone."',". - "aut_Email ='".$tEmail."',". - "aut_CreditCard ='".$tCreditCard."',". - "aut_ExpMonth ='".$tExpMonth."',". - "aut_ExpYear ='".$tExpYear."',". - "aut_BankName ='".$tBankName."',". - "aut_Route ='".$tRoute."',". - "aut_Account ='".$tAccount."',". - "aut_DateLastEdited ='".date('YmdHis')."',". - 'aut_EditedBy ='.$_SESSION['iUserID']. - ' WHERE aut_ID = '.$iAutID; + $sSQL = 'UPDATE autopayment_aut SET ' . + 'aut_FamID = ' . $iFamily . ',' . + 'aut_EnableBankDraft =' . $bEnableBankDraft . ',' . + 'aut_EnableCreditCard =' . $bEnableCreditCard . ',' . + "aut_NextPayDate ='" . $dNextPayDate . "'," . + "aut_Amount ='" . $nAmount . "'," . + "aut_FYID ='" . $iFYID . "'," . + "aut_Interval ='" . $iInterval . "'," . + "aut_Fund ='" . $iFund . "'," . + "aut_FirstName ='" . $tFirstName . "'," . + "aut_LastName ='" . $tLastName . "'," . + "aut_Address1 ='" . $tAddress1 . "'," . + "aut_Address2 ='" . $tAddress2 . "'," . + "aut_City ='" . $tCity . "'," . + "aut_State ='" . $tState . "'," . + "aut_Zip ='" . $tZip . "'," . + "aut_Country ='" . $tCountry . "'," . + "aut_Phone ='" . $tPhone . "'," . + "aut_Email ='" . $tEmail . "'," . + "aut_CreditCard ='" . $tCreditCard . "'," . + "aut_ExpMonth ='" . $tExpMonth . "'," . + "aut_ExpYear ='" . $tExpYear . "'," . + "aut_BankName ='" . $tBankName . "'," . + "aut_Route ='" . $tRoute . "'," . + "aut_Account ='" . $tAccount . "'," . + "aut_DateLastEdited ='" . date('YmdHis') . "'," . + 'aut_EditedBy =' . $_SESSION['iUserID'] . + ' WHERE aut_ID = ' . $iAutID; RunQuery($sSQL); if (isset($_POST['Submit'])) { @@ -211,11 +213,11 @@ Redirect($linkBack); } else { //Send to the view of this pledge - Redirect('AutoPaymentEditor.php?AutID='.$iAutID.'&FamilyID='.$iFamily.'&linkBack=', $linkBack); + Redirect('AutoPaymentEditor.php?AutID=' . $iAutID . '&FamilyID=' . $iFamily . '&linkBack=', $linkBack); } } } else { // not submitting, just get ready to build the page - $sSQL = 'SELECT * FROM autopayment_aut WHERE aut_ID = '.$iAutID; + $sSQL = 'SELECT * FROM autopayment_aut WHERE aut_ID = ' . $iAutID; $rsAutopayment = RunQuery($sSQL); extract(mysqli_fetch_array($rsAutopayment)); @@ -275,530 +277,760 @@ if (SystemConfig::getValue('sElectronicTransactionProcessor') == 'Vanco') { ?> - - + -
- - - - - - - - - + +
- - -
- - - - - + + + +
: - + + + + + + + - -
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + $fun_name"; - if ($fun_active != 'true') { - echo ' ('.gettext('inactive').')'; - } - echo ''; - } - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: + +
> + > + >
:
: + +
: + +
1
2
+
+
+
>Bank Draft - >Credit Card - >Disable
:
: - -
: -
+
1
2
- 0) { - ?> - - - Save this record to enable storing private data at Vanco - -
-
- - + +
+ 0) { + ?> + " + onclick="CreatePaymentMethod();"/> + + Save this record to enable storing private data at Vanco + +
+
+ + \ No newline at end of file diff --git a/src/CartView.php b/src/CartView.php index ea2ad6e77b..ee656fac6d 100644 --- a/src/CartView.php +++ b/src/CartView.php @@ -1,29 +1,29 @@
- -

- +

+ -

-

+

\n"; - echo '
'; -} else { + } + echo '

\n"; + echo ''; + } else { // Create array with Classification Information (lst_ID = 1) $sClassSQL = 'SELECT * FROM list_lst WHERE lst_ID=1 ORDER BY lst_OptionSequence'; - $rsClassification = RunQuery($sClassSQL); - unset($aClassificationName); - $aClassificationName[0] = 'Unassigned'; - while ($aRow = mysqli_fetch_array($rsClassification)) { - extract($aRow); - $aClassificationName[intval($lst_OptionID)] = $lst_OptionName; - } + $rsClassification = RunQuery($sClassSQL); + unset($aClassificationName); + $aClassificationName[0] = 'Unassigned'; + while ($aRow = mysqli_fetch_array($rsClassification)) { + extract($aRow); + $aClassificationName[intval($lst_OptionID)] = $lst_OptionName; + } // Create array with Family Role Information (lst_ID = 2) $sFamRoleSQL = 'SELECT * FROM list_lst WHERE lst_ID=2 ORDER BY lst_OptionSequence'; - $rsFamilyRole = RunQuery($sFamRoleSQL); - unset($aFamilyRoleName); - $aFamilyRoleName[0] = 'Unassigned'; - while ($aRow = mysqli_fetch_array($rsFamilyRole)) { - extract($aRow); - $aFamilyRoleName[intval($lst_OptionID)] = $lst_OptionName; - } + $rsFamilyRole = RunQuery($sFamRoleSQL); + unset($aFamilyRoleName); + $aFamilyRoleName[0] = 'Unassigned'; + while ($aRow = mysqli_fetch_array($rsFamilyRole)) { + extract($aRow); + $aFamilyRoleName[intval($lst_OptionID)] = $lst_OptionName; + } - $sSQL = 'SELECT * FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN ('.ConvertCartToString($_SESSION['aPeopleCart']).') ORDER BY per_LastName'; - $rsCartItems = RunQuery($sSQL); - $iNumPersons = mysqli_num_rows($rsCartItems); + $sSQL = 'SELECT * FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN (' . ConvertCartToString($_SESSION['aPeopleCart']) . ') ORDER BY per_LastName'; + $rsCartItems = RunQuery($sSQL); + $iNumPersons = mysqli_num_rows($rsCartItems); - $sSQL = 'SELECT distinct per_fam_ID FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN ('.ConvertCartToString($_SESSION['aPeopleCart']).') ORDER BY per_fam_ID'; - $iNumFamilies = mysqli_num_rows(RunQuery($sSQL)); + $sSQL = 'SELECT distinct per_fam_ID FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID IN (' . ConvertCartToString($_SESSION['aPeopleCart']) . ') ORDER BY per_fam_ID'; + $iNumFamilies = mysqli_num_rows(RunQuery($sSQL)); - if ($iNumPersons > 16) { - ?> -
- -
- + if ($iNumPersons > 16) { + ?> +
+ +
+ - + - 0) { - ?> -
-
-

Cart Functions

-
-
- - - - 0) { ?> - - - - - - - - - - +
+

+
+
+ + + + + + + + - // Email Cart links - // Note: This will email entire group, even if a specific role is currently selected. - $sSQL = "SELECT per_Email, fam_Email + + + + + + ".gettext('Email Cart').''; - echo "".gettext('Email (BCC)').''; + if ($bEmailMailto) { // Does user have permission to email groups + // Display link + echo "" . gettext('Email Cart') . ''; + echo "" . gettext('Email (BCC)') . ''; + } } - } - //Text Cart Link - $sSQL = "SELECT per_CellPhone, fam_CellPhone FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID NOT IN (SELECT per_ID FROM person_per INNER JOIN record2property_r2p ON r2p_record_ID = per_ID INNER JOIN property_pro ON r2p_pro_ID = pro_ID AND pro_Name = 'Do Not SMS') AND per_ID IN (".ConvertCartToString($_SESSION['aPeopleCart']).')'; - $rsPhoneList = RunQuery($sSQL); - $sPhoneLink = ''; - $sCommaDelimiter = ', '; - - while (list($per_CellPhone, $fam_CellPhone) = mysqli_fetch_row($rsPhoneList)) { - $sPhone = SelectWhichInfo($per_CellPhone, $fam_CellPhone, false); - if ($sPhone) { - /* if ($sPhoneLink) // Don't put delimiter before first phone - $sPhoneLink .= $sCommaDelimiter; */ - // Add phone only if phone is not already in string - if (!stristr($sPhoneLink, $sPhone)) { - $sPhoneLink .= $sPhone .= $sCommaDelimiter; + //Text Cart Link + $sSQL = "SELECT per_CellPhone, fam_CellPhone FROM person_per LEFT JOIN family_fam ON person_per.per_fam_ID = family_fam.fam_ID WHERE per_ID NOT IN (SELECT per_ID FROM person_per INNER JOIN record2property_r2p ON r2p_record_ID = per_ID INNER JOIN property_pro ON r2p_pro_ID = pro_ID AND pro_Name = 'Do Not SMS') AND per_ID IN (" . ConvertCartToString($_SESSION['aPeopleCart']) . ')'; + $rsPhoneList = RunQuery($sSQL); + $sPhoneLink = ''; + $sCommaDelimiter = ', '; + + while (list($per_CellPhone, $fam_CellPhone) = mysqli_fetch_row($rsPhoneList)) { + $sPhone = SelectWhichInfo($per_CellPhone, $fam_CellPhone, false); + if ($sPhone) { + /* if ($sPhoneLink) // Don't put delimiter before first phone + $sPhoneLink .= $sCommaDelimiter; */ + // Add phone only if phone is not already in string + if (!stristr($sPhoneLink, $sPhone)) { + $sPhoneLink .= $sPhone .= $sCommaDelimiter; + } } } - } - if ($sPhoneLink) { - if ($bEmailMailto) { // Does user have permission to email groups + if ($sPhoneLink) { + if ($bEmailMailto) { // Does user have permission to email groups - // Display link - echo 'Text Cart'; - echo ''; - } - } ?> - - - -
- -
- - - -
-
-

-
-
-
- + //--> + + + + + '; - echo ' '; - - echo ' '; - echo '
'.gettext('Bulk Mail Presort').''; - echo '
'.gettext('Quiet Presort').''; - echo ' + +
+
+

+
+
+ + + '; + echo ' '; + + echo ' '; + echo ' '; + + ToParentsOfCheckBox('toparents'); + LabelSelect('labeltype'); + FontSelect('labelfont'); + FontSizeSelect('labelfontsize'); + StartRowStartColumn(); + IgnoreIncompleteAddresses(); + LabelFileType(); ?> + + + + + +
' . gettext('Bulk Mail Presort') . ''; + echo '
' . gettext('Quiet Presort') . ''; + echo '
+ +
+
+ +
+ + +
'; - - ToParentsOfCheckBox('toparents'); - LabelSelect('labeltype'); - FontSelect('labelfont'); - FontSizeSelect('labelfontsize'); - StartRowStartColumn(); - IgnoreIncompleteAddresses(); - LabelFileType(); ?> - - - - - - -
- - - - - - - + } ?> - - 0): ?> -
-
-

- .

-
-
- - + + + + 0): ?> +
+
+

+ + .

+
+
+
+ @@ -290,101 +299,104 @@ function codename() - - - - 0) { - $sEmail = $per_WorkEmail; - } - - if (strlen($sEmail)) { - $sValidEmail = gettext('Yes'); - if (!stristr($sEmailLink, $sEmail)) { - $email_array[] = $sEmail; - - if ($iEmailNum == 0) { - // Comma is not needed before first email address - $sEmailLink .= $sEmail; - $iEmailNum++; - } else { - $sEmailLink .= $sMailtoDelimiter.$sEmail; - } + + + + 0) { + $sEmail = $per_WorkEmail; + } + + if (strlen($sEmail)) { + $sValidEmail = gettext('Yes'); + if (!stristr($sEmailLink, $sEmail)) { + $email_array[] = $sEmail; + + if ($iEmailNum == 0) { + // Comma is not needed before first email address + $sEmailLink .= $sEmail; + $iEmailNum++; + } else { + $sEmailLink .= $sMailtoDelimiter . $sEmail; + } + } + } else { + $sValidEmail = gettext('No'); + } + + $sAddress1 = SelectWhichInfo($per_Address1, $fam_Address1, false); + $sAddress2 = SelectWhichInfo($per_Address2, $fam_Address2, false); + + if (strlen($sAddress1) > 0 || strlen($sAddress2) > 0) { + $sValidAddy = gettext('Yes'); + } else { + $sValidAddy = gettext('No'); + } + + $personName = $per_FirstName . ' ' . $per_LastName; + $thumbnail = SystemURLs::getRootPath() . '/api/persons/' . $per_ID . '/thumbnail'; ?> + + + + + + + + + + + + +
+   + + + + +
+
+
+ + + + + -Deleted Email message succesfuly'; -} -?> + RunQuery($sSQL); + echo 'Deleted Email message succesfuly'; + } + + ?> diff --git a/src/FamilyView.php b/src/FamilyView.php index 7265d4a256..79efb11486 100644 --- a/src/FamilyView.php +++ b/src/FamilyView.php @@ -56,7 +56,7 @@ $family->activate(); } $family->save(); - Redirect("FamilyView.php?FamilyID=". $_POST['FID']); + Redirect("FamilyView.php?FamilyID=" . $_POST['FID']); exit; } // Get the list of funds @@ -66,7 +66,7 @@ if (isset($_POST["UpdatePledgeTable"]) && $_SESSION['bFinance']) { $_SESSION['sshowPledges'] = isset($_POST["ShowPledges"]); $_SESSION['sshowPayments'] = isset($_POST["ShowPayments"]); - $_SESSION['sshowSince'] = DateTime::createFromFormat("Y-m-d", InputUtils::LegacyFilterInput($_POST["ShowSinceDate"])) ; + $_SESSION['sshowSince'] = DateTime::createFromFormat("Y-m-d", InputUtils::LegacyFilterInput($_POST["ShowSinceDate"])); } $dSQL = "SELECT fam_ID FROM family_fam order by fam_Name"; @@ -102,14 +102,14 @@ // Get the lists of custom person fields $sSQL = "SELECT family_custom_master.* FROM family_custom_master ORDER BY fam_custom_Order"; - $rsFamCustomFields = RunQuery($sSQL); +$rsFamCustomFields = RunQuery($sSQL); // Get the custom field data for this person. $sSQL = "SELECT * FROM family_custom WHERE fam_ID = " . $iFamilyID; - $rsFamCustomData = RunQuery($sSQL); - $aFamCustomData = mysqli_fetch_array($rsFamCustomData, MYSQLI_BOTH); +$rsFamCustomData = RunQuery($sSQL); +$aFamCustomData = mysqli_fetch_array($rsFamCustomData, MYSQLI_BOTH); - $family = FamilyQuery::create()->findPk($iFamilyID); +$family = FamilyQuery::create()->findPk($iFamilyID); //Get the pledges for this family $sSQL = "SELECT plg_plgID, plg_FYID, plg_date, plg_amount, plg_schedule, plg_method, @@ -120,7 +120,7 @@ LEFT JOIN person_per a ON plg_EditedBy = a.per_ID LEFT JOIN donationfund_fun b ON plg_fundID = b.fun_ID WHERE plg_famID = " . $iFamilyID . " ORDER BY pledge_plg.plg_date"; - $rsPledges = RunQuery($sSQL); +$rsPledges = RunQuery($sSQL); //Get the automatic payments for this family $sSQL = "SELECT *, a.per_FirstName AS EnteredFirstName, @@ -130,7 +130,7 @@ LEFT JOIN person_per a ON aut_EditedBy = a.per_ID LEFT JOIN donationfund_fun b ON aut_Fund = b.fun_ID WHERE aut_famID = " . $iFamilyID . " ORDER BY autopayment_aut.aut_NextPayDate"; - $rsAutoPayments = RunQuery($sSQL); +$rsAutoPayments = RunQuery($sSQL); //Get the Properties assigned to this Family $sSQL = "SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID @@ -139,147 +139,154 @@ LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID WHERE pro_Class = 'f' AND r2p_record_ID = " . $iFamilyID . " ORDER BY prt_Name, pro_Name"; - $rsAssignedProperties = RunQuery($sSQL); +$rsAssignedProperties = RunQuery($sSQL); //Get all the properties $sSQL = "SELECT * FROM property_pro WHERE pro_Class = 'f' ORDER BY pro_Name"; - $rsProperties = RunQuery($sSQL); +$rsProperties = RunQuery($sSQL); //Get classifications $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 1 ORDER BY lst_OptionSequence"; - $rsClassifications = RunQuery($sSQL); +$rsClassifications = RunQuery($sSQL); // Get Field Security List Matrix $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 5 ORDER BY lst_OptionSequence"; - $rsSecurityGrp = RunQuery($sSQL); +$rsSecurityGrp = RunQuery($sSQL); - while ($aRow = mysqli_fetch_array($rsSecurityGrp)) { - extract($aRow); - $aSecurityType[$lst_OptionID] = $lst_OptionName; - } +while ($aRow = mysqli_fetch_array($rsSecurityGrp)) { + extract($aRow); + $aSecurityType[$lst_OptionID] = $lst_OptionName; +} //Set the spacer cell width $iTableSpacerWidth = 10; // Format the phone numbers $sHomePhone = ExpandPhoneNumber($fam_HomePhone, $fam_Country, $dummy); - $sWorkPhone = ExpandPhoneNumber($fam_WorkPhone, $fam_Country, $dummy); - $sCellPhone = ExpandPhoneNumber($fam_CellPhone, $fam_Country, $dummy); +$sWorkPhone = ExpandPhoneNumber($fam_WorkPhone, $fam_Country, $dummy); +$sCellPhone = ExpandPhoneNumber($fam_CellPhone, $fam_Country, $dummy); - $sFamilyEmails = array(); +$sFamilyEmails = array(); - $bOkToEdit = ($_SESSION['bEditRecords'] || ($_SESSION['bEditSelf'] && ($iFamilyID == $_SESSION['iFamID']))); ?> +$bOkToEdit = ($_SESSION['bEditRecords'] || ($_SESSION['bEditSelf'] && ($iFamilyID == $_SESSION['iFamID']))); ?> - +
+} ?>
-
-
-
- - -
-
- "> - -   - "> - -   - isPhotoLocal()): ?> - "> - - - +
+
+
+ + +
+
+ "> + +   + "> + +   + isPhotoLocal()): ?> + "> + + + +
-
- -
-

- + +
+

+ + } ?>
  • : getAddress() ?>
    - - "); - } - } else { - $bHideLatLon = true; - } ?> + href="http://maps.google.com/?q=getAddress() ?>" + target="_blank">getAddress() ?>
    + + "); + } + } else { + $bHideLatLon = true; + } ?>
  • + } + if (!SystemConfig::getValue("bHideFamilyNewsletter")) { /* Newsletter can be hidden - General Settings */ ?>
  • : ">">
  • + class="fa fa-"> + + } + if (!SystemConfig::getValue("bHideWeddingDate") && $fam_WeddingDate != "") { /* Wedding Date can be hidden - General Settings */ ?>
  • :
  • -
  • + } + if (SystemConfig::getValue("bUseDonationEnvelopes")) { + ?> +
  • +
  • + } + if ($sHomePhone != "") { + ?>
  • :
  • + href="tel:"> + } + if ($sWorkPhone != "") { + ?>
  • :
  • + href="tel:"> + } + if ($sCellPhone != "") { + ?>
  • :
  • + href="tel:"> -
  • : + } + if ($fam_Email != "") { + ?> +
  • :
  • isActive()) { - ?> + ?>
  • : isEmailInMailChimp($fam_Email) ?>
  • ">
-
-

- - - 0)) { - ?> - - - - 0)) { - ?> - - - - - -
+
+

+ + + 0)) { + ?> + + + + 0)) { + ?> + + + + + +
- + + class="fa fa-sticky-note"> + } ?> - + class="fa fa-cart-plus"> - - + ?> + +
@@ -363,22 +370,25 @@ class="fa fa-cart-plus"> getPeople() as $person) { - ?> - - - - getFullName() ?> - - - getFamilyRoleName(); - $labelColor = 'label-default'; - if ($famRole == 'Head of Household') { - } elseif ($famRole == 'Spouse') { - $labelColor = 'label-info'; - } elseif ($famRole == 'Child') { - $labelColor = 'label-warning'; - } ?> + ?> + + + + getFullName() ?> + + + getFamilyRoleName(); + $labelColor = 'label-default'; + if ($famRole == 'Head of Household') { + } elseif ($famRole == 'Spouse') { + $labelColor = 'label-info'; + } elseif ($famRole == 'Child') { + $labelColor = 'label-warning'; + } ?> @@ -387,11 +397,11 @@ class="fa fa-cart-plus"> getEmail(); - if ($tmpEmail != "") { - array_push($sFamilyEmails, $tmpEmail); ?> + if ($tmpEmail != "") { + array_push($sFamilyEmails, $tmpEmail); ?> + } ?> @@ -401,25 +411,26 @@ class="fa fa-cart-plus"> + ?> - + + } ?> + } ?>
@@ -437,13 +448,13 @@ class="fa fa-cart-plus"> + ?>
  • + } ?> @@ -455,14 +466,14 @@ class="fa fa-cart-plus"> format("Y-m-d") ?> + echo $now->format("Y-m-d") ?> getForFamily($iFamilyID) as $item) { - ?> + ?>
  • @@ -472,14 +483,14 @@ class="fa fa-cart-plus"> + ?> + } else { + ?> + } ?>
    @@ -487,29 +498,31 @@ class="fa fa-cart-plus"> + ?> + } ?>
  • + } ?>
    @@ -519,31 +532,31 @@ class="fa fa-cart-plus"> + if (mysqli_num_rows($rsAssignedProperties) == 0) { + ?>
    "; - echo ""; - echo "" . gettext("Type") . ""; - echo "" . gettext("Name") . ""; - echo "" . gettext("Value") . ""; - - if ($bOkToEdit) { - echo "" . gettext("Edit Value") . ""; - echo "" . gettext("Remove") . ""; - } + echo ""; + echo "" . gettext("Type") . ""; + echo "" . gettext("Name") . ""; + echo "" . gettext("Value") . ""; + + if ($bOkToEdit) { + echo "" . gettext("Edit Value") . ""; + echo "" . gettext("Remove") . ""; + } - echo ""; + echo ""; - $last_pro_prt_ID = ""; - $bIsFirst = true; + $last_pro_prt_ID = ""; + $bIsFirst = true; //Loop through the rows while ($aRow = mysqli_fetch_array($rsAssignedProperties)) { @@ -592,47 +605,50 @@ class="fa fa-cart-plus"> "; - } - if ($bOkToEdit) { - ?> + } + if ($bOkToEdit) { + ?>

    :

    -
    -
    - +
    +
    + +
    +
    + " name="Submit2"> +
    -
    - " name="Submit2"> -
    -
    + } ?>
    + ?>
    0) { - ?> + ?> @@ -690,11 +706,11 @@ class="fa fa-cart-plus">
    + href="AutoPaymentEditor.php?AutID=&FamilyID=&linkBack=FamilyView.php?FamilyID="> + href="AutoPaymentDelete.php?AutID=&linkBack=FamilyView.php?FamilyID=">   @@ -707,7 +723,7 @@ class="fa fa-cart-plus">
    + } ?>

    @@ -721,49 +737,50 @@ class="fa fa-cart-plus"> > + echo " checked"; + } ?>> > + echo " checked"; + } ?>> format('Y-m-d'); - } ?> + if ($_SESSION['sshowSince'] != null) { + $showSince = $_SESSION['sshowSince']->format('Y-m-d'); + } ?> - name="UpdatePledgeTable" + + name="UpdatePledgeTable" style="font-size: 8pt;"> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + $_SESSION['sshowSince']) + ($_SESSION['sshowSince'] == "" || DateTime::createFromFormat("Y-m-d", $plg_date) > $_SESSION['sshowSince']) ) { ?> @@ -817,11 +834,11 @@ class="fa fa-cart-plus"> + - - +
    Edit + href="PledgeEditor.php?GroupKey=&linkBack=FamilyView.php?FamilyID=">Edit Delete + href="PledgeDelete.php?GroupKey=&linkBack=FamilyView.php?FamilyID=">Delete   @@ -833,7 +850,7 @@ class="fa fa-cart-plus"> @@ -848,10 +865,10 @@ class="fa fa-cart-plus"> + } ?> + ?>

    + } ?> - -

    + +
    -

    404

    @@ -948,24 +968,25 @@ class="btn btn-success"> Meanwhile, you may") ?> + href="/MembersDashboard.php">

    - + diff --git a/src/Login.php b/src/Login.php index 4f622cc04f..70d05a2b4e 100644 --- a/src/Login.php +++ b/src/Login.php @@ -143,9 +143,6 @@ } - - - // Set the page title and include HTML header $sPageTitle = gettext('Login'); require 'Include/HeaderNotLoggedIn.php'; @@ -186,35 +183,30 @@ -
    +
    - - + ?> + +
    -
    - -
    -
    +
    + class="fa fa-sign-in">
    -
    -
    + - +
    diff --git a/src/UserList.php b/src/UserList.php index 3ab55bac36..8975ff6a7d 100644 --- a/src/UserList.php +++ b/src/UserList.php @@ -61,42 +61,49 @@
    -    +    getId() != $_SESSION['user']->getId()) { - ?> - - + ?> + + + + getPerson()->getFullName() ?> getPerson()->getFullName() ?> getLastLogin(SystemConfig::getValue('sDateFormatShort')) ?> getLoginCount() ?> isLocked()) { - ?> + ?> getFailedLogins() ?> - getFailedLogins(); - } - if ($user->getFailedLogins()> 0) { - ?> - - + getFailedLogins(); + } + if ($user->getFailedLogins() > 0) { + ?> + + -    +    getId() != $_SESSION['user']->getId() && !empty($user->getEmail())) { - ?> - - + ?> + +

    @@ -117,7 +124,7 @@ function deleteUser(userId, userName) { bootbox.confirm({ title: "", message: '

    ' + - ' '+ userName +'

    ', + ' ' + userName + '

    ', callback: function (result) { if (result) { $.ajax({ @@ -139,7 +146,7 @@ function restUserLoginCount(userId, userName) { bootbox.confirm({ title: "", message: '

    ' + - ': '+ userName +'

    ', + ": " + userName + "

    ", callback: function (result) { if (result) { $.ajax({ @@ -160,7 +167,7 @@ function resetUserPassword(userId, userName) { bootbox.confirm({ title: "", message: '

    ' + - ': '+ userName +'

    ', + ": " + userName + "

    ", callback: function (result) { if (result) { $.ajax({ From e8393a6e0e85e26bcf047e5e1805b174b0ddddaa Mon Sep 17 00:00:00 2001 From: George Dawoud Date: Mon, 3 Jul 2017 08:18:57 -0700 Subject: [PATCH 2/2] Apply fixes from StyleCI (#2685) --- src/AutoPaymentEditor.php | 28 ++--- src/CartView.php | 56 ++++----- src/FamilyView.php | 258 +++++++++++++++++++------------------- src/Login.php | 4 +- src/UserList.php | 24 ++-- 5 files changed, 185 insertions(+), 185 deletions(-) diff --git a/src/AutoPaymentEditor.php b/src/AutoPaymentEditor.php index 7ea35a3111..0d9a37a8b3 100644 --- a/src/AutoPaymentEditor.php +++ b/src/AutoPaymentEditor.php @@ -708,10 +708,10 @@ function CreatePaymentMethod() { $.ajax({ type: "POST", url: "", + echo 'https://www.vancodev.com/cgi-bin/wsnvptest.vps'; + } else { + echo 'https://www.vancoservices.com/cgi-bin/wsnvp.vps'; + } ?>", data: { "sessionid": "", "nvpvar": "", @@ -790,10 +790,10 @@ function CreatePaymentMethod() { + echo $linkBack; +} else { + echo 'Menu.php'; +} ?>';"> @@ -828,16 +828,16 @@ function CreatePaymentMethod() { > + echo ' checked'; + } ?>> > + echo ' checked'; + } ?>> > + echo ' checked'; + } ?>> diff --git a/src/CartView.php b/src/CartView.php index ee656fac6d..353ff06b56 100644 --- a/src/CartView.php +++ b/src/CartView.php @@ -230,36 +230,36 @@ function codename() { ' . gettext('Bulk Mail Presort') . ''; - echo ' '; - echo '
    '; - - echo ' ' . gettext('Quiet Presort') . ''; - echo ' '; - echo ' ' . gettext('Bulk Mail Presort') . ''; + echo ' '; + echo '
    '; + + echo ' ' . gettext('Quiet Presort') . ''; + echo ' '; + echo '
    '; - - ToParentsOfCheckBox('toparents'); - LabelSelect('labeltype'); - FontSelect('labelfont'); - FontSizeSelect('labelfontsize'); - StartRowStartColumn(); - IgnoreIncompleteAddresses(); - LabelFileType(); ?> + echo ' id="QuietBulkMail" value="1" '; + if (array_key_exists('bulkmailquiet', $_COOKIE) && $_COOKIE['bulkmailquiet'] && array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) { + echo 'checked'; + } + echo ' >
    '; + + ToParentsOfCheckBox('toparents'); + LabelSelect('labeltype'); + FontSelect('labelfont'); + FontSizeSelect('labelfontsize'); + StartRowStartColumn(); + IgnoreIncompleteAddresses(); + LabelFileType(); ?> diff --git a/src/FamilyView.php b/src/FamilyView.php index 79efb11486..e15aae719b 100644 --- a/src/FamilyView.php +++ b/src/FamilyView.php @@ -102,14 +102,14 @@ // Get the lists of custom person fields $sSQL = "SELECT family_custom_master.* FROM family_custom_master ORDER BY fam_custom_Order"; -$rsFamCustomFields = RunQuery($sSQL); + $rsFamCustomFields = RunQuery($sSQL); // Get the custom field data for this person. $sSQL = "SELECT * FROM family_custom WHERE fam_ID = " . $iFamilyID; -$rsFamCustomData = RunQuery($sSQL); -$aFamCustomData = mysqli_fetch_array($rsFamCustomData, MYSQLI_BOTH); + $rsFamCustomData = RunQuery($sSQL); + $aFamCustomData = mysqli_fetch_array($rsFamCustomData, MYSQLI_BOTH); -$family = FamilyQuery::create()->findPk($iFamilyID); + $family = FamilyQuery::create()->findPk($iFamilyID); //Get the pledges for this family $sSQL = "SELECT plg_plgID, plg_FYID, plg_date, plg_amount, plg_schedule, plg_method, @@ -120,7 +120,7 @@ LEFT JOIN person_per a ON plg_EditedBy = a.per_ID LEFT JOIN donationfund_fun b ON plg_fundID = b.fun_ID WHERE plg_famID = " . $iFamilyID . " ORDER BY pledge_plg.plg_date"; -$rsPledges = RunQuery($sSQL); + $rsPledges = RunQuery($sSQL); //Get the automatic payments for this family $sSQL = "SELECT *, a.per_FirstName AS EnteredFirstName, @@ -130,7 +130,7 @@ LEFT JOIN person_per a ON aut_EditedBy = a.per_ID LEFT JOIN donationfund_fun b ON aut_Fund = b.fun_ID WHERE aut_famID = " . $iFamilyID . " ORDER BY autopayment_aut.aut_NextPayDate"; -$rsAutoPayments = RunQuery($sSQL); + $rsAutoPayments = RunQuery($sSQL); //Get the Properties assigned to this Family $sSQL = "SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID @@ -139,47 +139,47 @@ LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID WHERE pro_Class = 'f' AND r2p_record_ID = " . $iFamilyID . " ORDER BY prt_Name, pro_Name"; -$rsAssignedProperties = RunQuery($sSQL); + $rsAssignedProperties = RunQuery($sSQL); //Get all the properties $sSQL = "SELECT * FROM property_pro WHERE pro_Class = 'f' ORDER BY pro_Name"; -$rsProperties = RunQuery($sSQL); + $rsProperties = RunQuery($sSQL); //Get classifications $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 1 ORDER BY lst_OptionSequence"; -$rsClassifications = RunQuery($sSQL); + $rsClassifications = RunQuery($sSQL); // Get Field Security List Matrix $sSQL = "SELECT * FROM list_lst WHERE lst_ID = 5 ORDER BY lst_OptionSequence"; -$rsSecurityGrp = RunQuery($sSQL); + $rsSecurityGrp = RunQuery($sSQL); -while ($aRow = mysqli_fetch_array($rsSecurityGrp)) { - extract($aRow); - $aSecurityType[$lst_OptionID] = $lst_OptionName; -} + while ($aRow = mysqli_fetch_array($rsSecurityGrp)) { + extract($aRow); + $aSecurityType[$lst_OptionID] = $lst_OptionName; + } //Set the spacer cell width $iTableSpacerWidth = 10; // Format the phone numbers $sHomePhone = ExpandPhoneNumber($fam_HomePhone, $fam_Country, $dummy); -$sWorkPhone = ExpandPhoneNumber($fam_WorkPhone, $fam_Country, $dummy); -$sCellPhone = ExpandPhoneNumber($fam_CellPhone, $fam_Country, $dummy); + $sWorkPhone = ExpandPhoneNumber($fam_WorkPhone, $fam_Country, $dummy); + $sCellPhone = ExpandPhoneNumber($fam_CellPhone, $fam_Country, $dummy); -$sFamilyEmails = array(); + $sFamilyEmails = array(); -$bOkToEdit = ($_SESSION['bEditRecords'] || ($_SESSION['bEditSelf'] && ($iFamilyID == $_SESSION['iFamID']))); ?> + $bOkToEdit = ($_SESSION['bEditRecords'] || ($_SESSION['bEditSelf'] && ($iFamilyID == $_SESSION['iFamID']))); ?> + ?>
    + } ?>
    @@ -211,11 +211,11 @@ class="initials-image img-rounded img-responsive profile-user-img profile-family

    + ?> + } ?>
    • : @@ -224,69 +224,69 @@ class="btn btn-primary btn-block"> target="_blank">getAddress() ?>
      "); - } - } else { - $bHideLatLon = true; - } ?> + if (SystemConfig::getValue("iChurchLatitude") && SystemConfig::getValue("iChurchLongitude")) { + $sDistance = GeoUtils::LatLonDistance(SystemConfig::getValue("iChurchLatitude"), SystemConfig::getValue("iChurchLongitude"), $fam_Latitude, $fam_Longitude); + $sDirection = GeoUtils::LatLonBearing(SystemConfig::getValue("iChurchLatitude"), SystemConfig::getValue("iChurchLongitude"), $fam_Latitude, $fam_Longitude); + echo $sDistance . " " . strtolower(SystemConfig::getValue("sDistanceUnit")) . " " . $sDirection . " " . gettext(" of church
      "); + } + } else { + $bHideLatLon = true; + } ?>
    • + } + if (!SystemConfig::getValue("bHideFamilyNewsletter")) { /* Newsletter can be hidden - General Settings */ ?>
    • : ">">
    • + } + if (!SystemConfig::getValue("bHideWeddingDate") && $fam_WeddingDate != "") { /* Wedding Date can be hidden - General Settings */ ?>
    • :
    • + } + if (SystemConfig::getValue("bUseDonationEnvelopes")) { + ?>
    • + } + if ($sHomePhone != "") { + ?>
    • :
    • + } + if ($sWorkPhone != "") { + ?>
    • :
    • + } + if ($sCellPhone != "") { + ?>
    • :
    • + } + if ($fam_Email != "") { + ?>
    • :
    • isActive()) { - ?> + ?>
    • : isEmailInMailChimp($fam_Email) ?>
    • 0)) { - ?> + ?> + } ?> 0)) { - ?> + ?> + } ?> + ?> + } ?>
      getPeople() as $person) { - ?> + ?> getFullName() ?> getFamilyRoleName(); - $labelColor = 'label-default'; - if ($famRole == 'Head of Household') { - } elseif ($famRole == 'Spouse') { - $labelColor = 'label-info'; - } elseif ($famRole == 'Child') { - $labelColor = 'label-warning'; - } ?> + $labelColor = 'label-default'; + if ($famRole == 'Head of Household') { + } elseif ($famRole == 'Spouse') { + $labelColor = 'label-info'; + } elseif ($famRole == 'Child') { + $labelColor = 'label-warning'; + } ?> @@ -397,11 +397,11 @@ class="user-link">getFullName() ?> getEmail(); - if ($tmpEmail != "") { - array_push($sFamilyEmails, $tmpEmail); ?> + if ($tmpEmail != "") { + array_push($sFamilyEmails, $tmpEmail); ?> + } ?> @@ -411,7 +411,7 @@ class="user-link">getFullName() ?> + ?> @@ -426,11 +426,11 @@ class="user-link">getFullName() ?> + } ?> + } ?>
    @@ -466,14 +466,14 @@ class="user-link">getFullName() ?>
  • format("Y-m-d") ?> + echo $now->format("Y-m-d") ?>
  • getForFamily($iFamilyID) as $item) { - ?> + ?>
  • @@ -483,14 +483,14 @@ class="user-link">getFullName() ?>

    + ?> + } else { + ?> + } ?>

    @@ -498,31 +498,31 @@ class="user-link">getFullName() ?>
    + ?> + } ?>
  • + } ?>
    @@ -532,31 +532,31 @@ class="fa fa-trash"> + if (mysqli_num_rows($rsAssignedProperties) == 0) { + ?>
    "; - echo ""; - echo "" . gettext("Type") . ""; - echo "" . gettext("Name") . ""; - echo "" . gettext("Value") . ""; - - if ($bOkToEdit) { - echo "" . gettext("Edit Value") . ""; - echo "" . gettext("Remove") . ""; - } + echo ""; + echo "" . gettext("Type") . ""; + echo "" . gettext("Name") . ""; + echo "" . gettext("Value") . ""; - echo ""; + if ($bOkToEdit) { + echo "" . gettext("Edit Value") . ""; + echo "" . gettext("Remove") . ""; + } - $last_pro_prt_ID = ""; - $bIsFirst = true; + echo ""; + + $last_pro_prt_ID = ""; + $bIsFirst = true; //Loop through the rows while ($aRow = mysqli_fetch_array($rsAssignedProperties)) { @@ -605,9 +605,9 @@ class="fa fa-trash"> //Close the table echo ""; - } - if ($bOkToEdit) { - ?> + } + if ($bOkToEdit) { + ?>

    :

    @@ -638,17 +638,17 @@ class="fa fa-trash">
    + } ?>
    + ?>
    0) { - ?> + ?> @@ -723,7 +723,7 @@ class="fa fa-trash"> } ?>
    + } ?>

    @@ -737,18 +737,18 @@ class="fa fa-trash">

    > + echo " checked"; + } ?>> > + echo " checked"; + } ?>> format('Y-m-d'); - } ?> + if ($_SESSION['sshowSince'] != null) { + $showSince = $_SESSION['sshowSince']->format('Y-m-d'); + } ?> @@ -779,8 +779,8 @@ class="fa fa-trash"> @@ -865,10 +865,10 @@ class="fa fa-trash">

    + } ?> + ?>

    + } ?>
    @@ -926,28 +926,28 @@ class="fa fa-trash">

    0) { - ?> + ?>

      + ?>
    • + } ?>

    + } ?>