diff --git a/.editorconfig b/.editorconfig index 050478d68a..c6e9bd351a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,6 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -# 2 space indentation [*.{php,scss,js,json}] indent_size = 4 charset = utf-8 diff --git a/.gitattributes b/.gitattributes index 9e7ab1994c..d1c1f726d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,33 @@ -* text=auto -* eol=lf -*.jpg binary -*.git binary -*.png binary -*.xcf binary -*.pdf binary -*.mo binary +# Define text file attributes: +# - Treat them astext +# - Ensure no CRLF line-endings, neither on checkout nor on checkin +# - Detect whitespace errors: +# - Exposed by default in `git diff --color` on the CLI +# - Validate with `git diff --check` +# - Deny applying with `git apply --whitespace=error-all` +# - Fix automatically with `git apply --whitespace=fix` + +*.css text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.html text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=4 diff=html +*.js text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.json text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.lock text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=4 +*.md text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.php text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=4 diff=php +*.po text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.sh text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.sql text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.svg text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 +*.twig text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=4 +*.xml text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=4 +*.yml text eol=lf whitespace=space-before-tab,tab-in-indent,trailing-space,tabwidth=2 + +# Define binary file attributes: +# - Do not treat them as text +*.gif binary +*.ico binary +*.jpg binary +*.mo binary +*.pdf binary +*.png binary +*.ttf binary diff --git a/src/AddDonors.php b/src/AddDonors.php index ec42b3f653..983c4b9793 100644 --- a/src/AddDonors.php +++ b/src/AddDonors.php @@ -1,17 +1,5 @@ 0 && mysqli_num_rows($rsBuyer) == 0) { $sSQL = "INSERT INTO paddlenum_pn (pn_Num, pn_fr_ID, pn_per_ID) - VALUES ('$extraPaddleNum', '$iFundRaiserID', '$donorID')"; + VALUES ('$extraPaddleNum', '$iFundRaiserID', '$donorID')"; RunQuery($sSQL); $extraPaddleNum = $extraPaddleNum + 1; } diff --git a/src/BackupDatabase.php b/src/BackupDatabase.php index 1c427140ca..0ffafc839f 100644 --- a/src/BackupDatabase.php +++ b/src/BackupDatabase.php @@ -1,17 +1,5 @@ /skin/js/BackupDatabase.js"> - + - - + 0 $sWhereExt GROUP BY per_fam_ID HAVING memberCount = 1) - UNION (SELECT *, COUNT(*) AS memberCount, fam_Name AS SortMe FROM $sPerTable $sJoinFamTable WHERE per_fam_ID > 0 $sWhereExt GROUP BY per_fam_ID HAVING memberCount > 1) ORDER BY SortMe"; + UNION (SELECT *, COUNT(*) AS memberCount, fam_Name AS SortMe FROM $sPerTable $sJoinFamTable WHERE per_fam_ID > 0 $sWhereExt GROUP BY per_fam_ID HAVING memberCount = 1) + UNION (SELECT *, COUNT(*) AS memberCount, fam_Name AS SortMe FROM $sPerTable $sJoinFamTable WHERE per_fam_ID > 0 $sWhereExt GROUP BY per_fam_ID HAVING memberCount > 1) ORDER BY SortMe"; } else { $sSQL = "SELECT * FROM $sPerTable $sJoinFamTable WHERE 1 = 1 $sWhereExt $sGroupBy ORDER BY per_LastName"; } diff --git a/src/CSVExport.php b/src/CSVExport.php index 1280d5083c..8797544998 100644 --- a/src/CSVExport.php +++ b/src/CSVExport.php @@ -1,16 +1,5 @@ @@ -68,7 +56,6 @@ -
@@ -460,5 +447,5 @@
- - + @@ -957,4 +945,3 @@ function GetAge(int $Month, int $Day, ?int $Year): int diff --git a/src/CartToEvent.php b/src/CartToEvent.php index 9ad35ab951..1c743ec1de 100644 --- a/src/CartToEvent.php +++ b/src/CartToEvent.php @@ -1,19 +1,5 @@ diff --git a/src/CartToFamily.php b/src/CartToFamily.php index 43b39c369d..cecd94fc8c 100644 --- a/src/CartToFamily.php +++ b/src/CartToFamily.php @@ -1,17 +1,5 @@

- : @@ -363,4 +349,5 @@ } ?> - +orderByName() - ->find(); +$ormGroups = GroupQuery::Create()->orderByName()->find(); -// Set the page title and include HTML header $sPageTitle = gettext('Add Cart to Group'); require 'Include/Header.php'; if (count($_SESSION['aPeopleCart']) > 0) { - ?> +?> @@ -100,6 +85,4 @@ echo '

' . gettext('Your cart is empty!') . '

'; } - require 'Include/Footer.php'; -?> diff --git a/src/Checkin.php b/src/Checkin.php index f9064fa190..98bb36ab33 100644 --- a/src/Checkin.php +++ b/src/Checkin.php @@ -1,21 +1,7 @@ filterByInActive(1, Criteria::NOT_EQUAL) ->find(); @@ -218,7 +198,6 @@ class="col-sm-2 control-label"> $attendee->save(); } - //delete if (isset($_POST['Delete'])) { EventAttendQuery::create() @@ -299,10 +278,8 @@ class="col-sm-2 control-label">
@@ -321,7 +298,7 @@ class="col-sm-2 control-label"> filterByEventId($EventID) ->find(); @@ -460,7 +437,6 @@ function loadPerson($iPersonID) $familyRole = gettext('(No assigned family)'); } - $html = '
' . '

' . $person->getTitle() . ' ' . $person->getFullName() . '

' . '
' . $familyRole . '
' . diff --git a/src/ChurchCRM/Bootstrapper.php b/src/ChurchCRM/Bootstrapper.php index 6a3c6e53c7..4ff535efb9 100644 --- a/src/ChurchCRM/Bootstrapper.php +++ b/src/ChurchCRM/Bootstrapper.php @@ -276,9 +276,8 @@ private static function buildConnectionManagerConfig(): array private static function configureUserEnvironment(): void // TODO: This function needs to stop creating global variable-variables. { global $cnInfoCentral; - if (AuthenticationManager::validateUserSessionIsActive(false)) { // set on POST to /session/begin + if (AuthenticationManager::validateUserSessionIsActive(false)) { // set on POST to /session/begin // Load user variables from user config table. - // ************************************************** $sSQL = 'SELECT ucfg_name, ucfg_value AS value ' . "FROM userconfig_ucfg WHERE ucfg_per_ID='" . AuthenticationManager::getCurrentUser()->getId() . "'"; $rsConfig = mysqli_query($cnInfoCentral, $sSQL); // Can't use RunQuery -- not defined yet diff --git a/src/ChurchCRM/Reports/ChurchInfoReport.php b/src/ChurchCRM/Reports/ChurchInfoReport.php index 8f9e9f7513..30c028d211 100644 --- a/src/ChurchCRM/Reports/ChurchInfoReport.php +++ b/src/ChurchCRM/Reports/ChurchInfoReport.php @@ -1,16 +1,5 @@ paperFormat); diff --git a/src/ChurchCRM/Service/DashboardService.php b/src/ChurchCRM/Service/DashboardService.php index fac01e7492..3c57d7d204 100644 --- a/src/ChurchCRM/Service/DashboardService.php +++ b/src/ChurchCRM/Service/DashboardService.php @@ -43,7 +43,7 @@ public function getPersonCount(): array { $personCount = PersonQuery::Create('per') ->useFamilyQuery('fam', 'left join') - ->filterByDateDeactivated(null) + ->filterByDateDeactivated(null) ->endUse() ->count(); $data = ['personCount' => $personCount]; @@ -88,7 +88,7 @@ public function getGroupStats(): array 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 + p2g2r_rle_ID = 2 and grp_Type = 4) as SundaySchoolKidsCount from dual ; '; $rsQuickStat = RunQuery($sSQL); diff --git a/src/ChurchCRM/Service/PersonService.php b/src/ChurchCRM/Service/PersonService.php index 17b332459c..718d65468b 100644 --- a/src/ChurchCRM/Service/PersonService.php +++ b/src/ChurchCRM/Service/PersonService.php @@ -13,12 +13,12 @@ class PersonService public function search(string $searchTerm, $includeFamilyRole = true): array { $searchLikeString = '%' . $searchTerm . '%'; - $people = PersonQuery::create()-> - filterByFirstName($searchLikeString, Criteria::LIKE)-> - _or()->filterByMiddleName($searchLikeString, Criteria::LIKE)-> - _or()->filterByLastName($searchLikeString, Criteria::LIKE)-> - _or()->filterByEmail($searchLikeString, Criteria::LIKE)-> - limit(15)->find(); + $people = PersonQuery::create() + ->filterByFirstName($searchLikeString, Criteria::LIKE) + ->_or()->filterByMiddleName($searchLikeString, Criteria::LIKE) + ->_or()->filterByLastName($searchLikeString, Criteria::LIKE) + ->_or()->filterByEmail($searchLikeString, Criteria::LIKE) + ->limit(15)->find(); $return = []; foreach ($people as $person) { $values['id'] = $person->getId(); @@ -58,8 +58,8 @@ public function search(string $searchTerm, $includeFamilyRole = true): array public function getPeopleEmailsAndGroups(): array { $sSQL = "SELECT per_FirstName, per_LastName, per_Email, per_ID, group_grp.grp_Name, lst_OptionName - from person_per - left JOIN person2group2role_p2g2r on + from person_per + left JOIN person2group2role_p2g2r on person2group2role_p2g2r.p2g2r_per_ID = person_per.per_id left JOIN group_grp ON diff --git a/src/ChurchCRM/model/ChurchCRM/Person.php b/src/ChurchCRM/model/ChurchCRM/Person.php index 07a8eb691e..7bc28fc0e5 100644 --- a/src/ChurchCRM/model/ChurchCRM/Person.php +++ b/src/ChurchCRM/model/ChurchCRM/Person.php @@ -584,7 +584,6 @@ public function getCustomFields($allPersonCustomFields, $customMapping, &$Custom } $thisPersonCustomFields = $rawQry->findOneByPerId($this->getId()); - // get custom column names and values $personCustom = []; if ($thisPersonCustomFields) { @@ -595,7 +594,6 @@ public function getCustomFields($allPersonCustomFields, $customMapping, &$Custom $personCustom[] = $temp; $CustomList[$temp] += 1; - if (array_key_exists($value, $customMapping[$column]['Elements'])) { $temp = $name_func($customMapping[$column]['Name'], $customMapping[$column]['Elements'][$value]); $personCustom[] = $temp; diff --git a/src/ChurchCRM/view/MenuRenderer.php b/src/ChurchCRM/view/MenuRenderer.php index 823841bf44..7cd19631fd 100644 --- a/src/ChurchCRM/view/MenuRenderer.php +++ b/src/ChurchCRM/view/MenuRenderer.php @@ -67,7 +67,6 @@ private static function renderSubMenuItem(MenuItem $menuItem): void hasCounters()) { diff --git a/src/ConvertIndividualToFamily.php b/src/ConvertIndividualToFamily.php index 693389e805..8438b4e281 100644 --- a/src/ConvertIndividualToFamily.php +++ b/src/ConvertIndividualToFamily.php @@ -1,26 +1,5 @@ getType() . ' ' . gettext('Deposit Slip Number: ') . $iDepositSlipID; //Is this the second pass? @@ -181,7 +170,6 @@
- +require 'Include/Footer.php'; diff --git a/src/DirectoryReports.php b/src/DirectoryReports.php index 56ffb92ea7..a9242ca993 100644 --- a/src/DirectoryReports.php +++ b/src/DirectoryReports.php @@ -1,18 +1,5 @@ isCreateDirectoryEnabled()); -// Set the page title and include HTML header $sPageTitle = gettext('Directory reports'); require 'Include/Header.php'; ?>
- -
@@ -278,7 +262,6 @@ echo ''; } ?> -


@@ -286,4 +269,5 @@

- +save(); $bGetKeyBack = true; - // Existing record (update) + // Existing record (update) } else { $donatedItem = DonatedItemQuery::create()->findOneById($iDonatedItemID); $donatedItem @@ -131,21 +120,21 @@ RedirectUtils::redirect("DonatedItemEditor.php?CurrentFundraiser=$iCurrentFundraiser&linkBack=", $linkBack); } } else { - //FirstPass + //FirstPass //Are we editing or adding? if (strlen($iDonatedItemID) > 0) { //Editing.... //Get all the data on this record $sSQL = "SELECT di_ID, di_Item, di_multibuy, di_donor_ID, di_buyer_ID, - a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, - b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, - di_title, di_description, di_sellprice, di_estprice, di_materialvalue, - di_minimum, di_picture - FROM donateditem_di - LEFT JOIN person_per a ON di_donor_ID=a.per_ID - LEFT JOIN person_per b ON di_buyer_ID=b.per_ID - WHERE di_ID = '" . $iDonatedItemID . "'"; + a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, + b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, + di_title, di_description, di_sellprice, di_estprice, di_materialvalue, + di_minimum, di_picture + FROM donateditem_di + LEFT JOIN person_per a ON di_donor_ID=a.per_ID + LEFT JOIN person_per b ON di_buyer_ID=b.per_ID + WHERE di_ID = '" . $iDonatedItemID . "'"; $rsDonatedItem = RunQuery($sSQL); extract(mysqli_fetch_array($rsDonatedItem)); @@ -213,29 +202,29 @@ - +
- +
@@ -258,26 +247,26 @@
- - + +
@@ -290,8 +279,7 @@
- +
@@ -310,7 +298,7 @@
-
+
@@ -323,12 +311,11 @@ isAddRecordsEnabled()) : ?> - + - - + -
- -
- - + - + - - + 0) { $aArrJoin = implode(',', $aArr); $sSQL = 'SELECT t1.per_ID, t1.per_Title, t1.per_FirstName, t1.per_MiddleName, t1.per_LastName, t1.per_Suffix, t1.per_Email, t1.per_HomePhone, t1.per_Country, t1.per_MembershipDate, t2.fam_HomePhone, t2.fam_Country, t1.per_Gender - FROM person_per AS t1, family_fam AS t2 - WHERE t1.per_fam_ID = t2.fam_ID AND t1.per_ID NOT IN (' . $aArrJoin . ") AND per_cls_ID IN ('1','2','5') - ORDER BY t1.per_LastName, t1.per_ID"; + FROM person_per AS t1, family_fam AS t2 + WHERE t1.per_fam_ID = t2.fam_ID AND t1.per_ID NOT IN (' . $aArrJoin . ") AND per_cls_ID IN ('1','2','5') + ORDER BY t1.per_LastName, t1.per_ID"; } else { $sSQL = "SELECT t1.per_ID, t1.per_Title, t1.per_FirstName, t1.per_MiddleName, t1.per_LastName, t1.per_Suffix, t1.per_Email, t1.per_HomePhone, t1.per_Country, t1.per_MembershipDate, t2.fam_HomePhone, t2.fam_Country, t1.per_Gender FROM person_per AS t1, family_fam AS t2 WHERE t1.per_fam_ID = t2.fam_ID AND per_cls_ID IN ('1','2','5') - ORDER BY t1.per_LastName, t1.per_ID"; + ORDER BY t1.per_LastName, t1.per_ID"; } $sPageTitle = gettext('Event Nonattendees'); } elseif ($sPostChoice === 'Guests') { $sSQL = 'SELECT t1.per_ID, t1.per_Title, t1.per_FirstName, t1.per_MiddleName, t1.per_LastName, t1.per_Suffix, t1.per_HomePhone, t1.per_Country, t1.per_Gender FROM person_per AS t1, events_event AS t2, event_attend AS t3 WHERE t1.per_ID = t3.person_id AND t2.event_id = t3.event_id AND t3.event_id = ' . $iEventId . " AND per_cls_ID IN ('0','3') - ORDER BY t1.per_LastName, t1.per_ID"; + ORDER BY t1.per_LastName, t1.per_ID"; $sPageTitle = gettext('Event Guests'); } } elseif ($sGetAction === 'List' && !empty($sGetEvent)) { @@ -122,147 +111,142 @@ // Construct the form ?> -
-

+

- -


- ' . gettext($type_name) . - '' . "
\n"; - } - ?> + +


+ ' . gettext($type_name) . + '' . "
\n"; + } + ?>
- - 0) { ?> -
-
-

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

+
+
+ + + + + + + + + + + + + + + + - - + + - - - -
+ + + + + + - - - -
- - - - - -
-
-
- - - - - + +
+
+
+ + + + + +
+
+
+ + + + + - name="Type" value="" class="btn btn-default"> -
-
+ $gOpps = RunQuery($gSQL); + $gNumGuestAttend = mysqli_fetch_row($gOpps)[0]; ?> + name="Type" value="" class="btn btn-default"> + +
+
- 0) { ?> -
-
-

-
-
- - - - - - - - - - - - - - - - - - - -
' . $aEmail[$row] . '' : '' ?>
+
+
+

+
+
+ + + + + + + + + + + + + + + + + + + +
' . $aEmail[$row] . '' : '' ?>
+
-
-
- - - - + - + diff --git a/src/EventNames.php b/src/EventNames.php index cd30054840..8548ee8021 100644 --- a/src/EventNames.php +++ b/src/EventNames.php @@ -337,5 +337,5 @@ $('#eventNames').DataTable(window.CRM.plugin.dataTable); }); - - + -
- - +getCountryCode(), $pasfut = 'past'); if ((strlen($dWeddingDate) > 0) && $dateString === false) { $sWeddingDateError = '' - . gettext('Not a valid Wedding Date') . ''; + . gettext('Not a valid Wedding Date') . ''; $bErrorFlag = true; } else { $dWeddingDate = $dateString; @@ -215,7 +203,7 @@ if (strlen($sEmail) > 0) { if (checkEmail($sEmail) == false) { $sEmailError = '' - . gettext('Email is Not Valid') . ''; + . gettext('Email is Not Valid') . ''; $bErrorFlag = true; $sEmail = null; } @@ -335,7 +323,7 @@ $note->save(); RunQuery('LOCK TABLES person_custom WRITE'); $sSQL = 'INSERT INTO person_custom (per_ID) VALUES (' - . $dbPersonId . ')'; + . $dbPersonId . ')'; RunQuery($sSQL); RunQuery('UNLOCK TABLES'); } @@ -553,9 +541,7 @@ } require 'Include/Header.php'; - ?> -
@@ -572,67 +558,66 @@
- + + ?>
-

+

- +
- +
- +
-

+

- -
- - - maxlength="10" size="8"> + + maxlength="10" size="8">
-
-
-
- - -
-
- - -
-
- +
+
+ + +
+
+ + +
+
+ @@ -642,7 +627,7 @@

- +
@@ -653,10 +638,10 @@
- "' data-mask> + "' data-mask> > + echo ' checked'; + } ?>>
@@ -665,8 +650,8 @@
- "' data-mask/> - > + "' data-mask /> + >
@@ -675,7 +660,7 @@
- "' data-mask> + "' data-mask> >
@@ -691,13 +676,13 @@ -
-
- > -
- +
+ > + + @@ -719,276 +704,276 @@ ">
+ ?>
- -
-
-

-
- -
-
-
-
-
- - +
+
+

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

-
- -
-
-
- isEnabledSecurity($aSecurityType[$fam_custom_FieldSec])) { + ?> +
+
+

+
+ +
+
+
+ isEnabledSecurity($aSecurityType[$fam_custom_FieldSec])) { ?> -
-
- - ' . $aCustomErrors[$fam_custom_Field] . ''; - echo '
'; - } - } ?> -
-
- -
-
-

-
- -
-
-
+
+
+ + 0) { - ?> - - - -
-
new person records.') : '' ?>
-


-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - '; - } - echo '
- -
-
- - - - - - - - - - - - - - - - -
- -
-
'; - - echo '
'; - } - - echo ''; - echo ''; - - echo ' '; - if (AuthenticationManager::getCurrentUser()->isAddRecordsEnabled()) { - echo ' '; - } - echo ' 0) { - echo " onclick=\"javascript:document.location='v2/family/$iFamilyID';\">"; - } else { - echo " onclick=\"javascript:document.location='" . SystemURLs::getRootPath() . "/v2/family';\">"; - } - echo ''; - ?> - - - + } ?> +
+
+

+
+ +
+
+
+ + 0) { + ?> + + + +
+
new person records.') : '' ?>
+


+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + '; + } + echo '
+ +
+
+ + + + + + + + + + + + + + + + +
+ +
+
'; + + echo '
'; + } + + echo ''; + echo ''; + + echo ' '; + if (AuthenticationManager::getCurrentUser()->isAddRecordsEnabled()) { + echo ' '; + } + echo ' 0) { + echo " onclick=\"javascript:document.location='v2/family/$iFamilyID';\">"; + } else { + echo " onclick=\"javascript:document.location='" . SystemURLs::getRootPath() . "/v2/family';\">"; + } + echo ''; + ?> + + diff --git a/src/FindDepositSlip.php b/src/FindDepositSlip.php index 08dc44fc75..62d6adc908 100644 --- a/src/FindDepositSlip.php +++ b/src/FindDepositSlip.php @@ -1,15 +1,5 @@ - - +
-
- - - - - - - - - - - - - - - - - - - - -
:
: - -
: - -
- + + + + + + + + + + + + + + + + + + + + + +
:
: + +
: + +
+
- +
-setSearchLimit(InputUtils::legacyFilterInput($_GET['Number'], 'int')); - $currentUser->save(); -} + setSearchLimit(InputUtils::legacyFilterInput($_GET['Number'], 'int')); + $currentUser->save(); + } -// Select the proper sort SQL -switch ($sSort) { - case 'number': - $sOrderSQL = 'ORDER BY fr_ID DESC'; - break; - default: - $sOrderSQL = ' ORDER BY fr_Date DESC, fr_ID DESC'; - break; -} + // Select the proper sort SQL + switch ($sSort) { + case 'number': + $sOrderSQL = 'ORDER BY fr_ID DESC'; + break; + default: + $sOrderSQL = ' ORDER BY fr_Date DESC, fr_ID DESC'; + break; + } -// Append a LIMIT clause to the SQL statement -$tableSizeSetting = AuthenticationManager::getCurrentUser() - ->getSetting("ui.table.size"); -if (empty($tableSizeSetting)) { - $iPerPage = 10; -} else { - $iPerPage = $tableSizeSetting->getValue(); -} -if (empty($_GET['Result_Set'])) { - $Result_Set = 0; -} else { - $Result_Set = InputUtils::legacyFilterInput($_GET['Result_Set'], 'int'); -} -$sLimitSQL = " LIMIT $Result_Set, $iPerPage"; - -// Build SQL query -$sSQL = "SELECT fr_ID, fr_Date, fr_Title FROM fundraiser_fr $sCriteria $sOrderSQL $sLimitSQL"; -$sSQLTotal = "SELECT COUNT(fr_ID) FROM fundraiser_fr $sCriteria"; - -// Execute SQL statement and get total result -$rsDep = RunQuery($sSQL); -$rsTotal = RunQuery($sSQLTotal); -list($Total) = mysqli_fetch_row($rsTotal); - -echo '
'; -echo '
'; -// Show previous-page link unless we're at the first page -if ($Result_Set < $Total && $Result_Set > 0) { - $thisLinkResult = $Result_Set - $iPerPage; - if ($thisLinkResult < 0) { - $thisLinkResult = 0; - } - echo '' . gettext('Previous Page') . '  '; -} + // Append a LIMIT clause to the SQL statement + $tableSizeSetting = AuthenticationManager::getCurrentUser() + ->getSetting("ui.table.size"); + if (empty($tableSizeSetting)) { + $iPerPage = 10; + } else { + $iPerPage = $tableSizeSetting->getValue(); + } + if (empty($_GET['Result_Set'])) { + $Result_Set = 0; + } else { + $Result_Set = InputUtils::legacyFilterInput($_GET['Result_Set'], 'int'); + } + $sLimitSQL = " LIMIT $Result_Set, $iPerPage"; + + // Build SQL query + $sSQL = "SELECT fr_ID, fr_Date, fr_Title FROM fundraiser_fr $sCriteria $sOrderSQL $sLimitSQL"; + $sSQLTotal = "SELECT COUNT(fr_ID) FROM fundraiser_fr $sCriteria"; + + // Execute SQL statement and get total result + $rsDep = RunQuery($sSQL); + $rsTotal = RunQuery($sSQLTotal); + list($Total) = mysqli_fetch_row($rsTotal); + + echo '
'; + echo ''; + // Show previous-page link unless we're at the first page + if ($Result_Set < $Total && $Result_Set > 0) { + $thisLinkResult = $Result_Set - $iPerPage; + if ($thisLinkResult < 0) { + $thisLinkResult = 0; + } + echo '' . gettext('Previous Page') . '  '; + } -// Calculate starting and ending Page-Number Links -$Pages = ceil($Total / $iPerPage); -$startpage = (ceil($Result_Set / $iPerPage)) - 6; -if ($startpage <= 2) { - $startpage = 1; -} -$endpage = (ceil($Result_Set / $iPerPage)) + 9; -if ($endpage >= ($Pages - 1)) { - $endpage = $Pages; -} + // Calculate starting and ending Page-Number Links + $Pages = ceil($Total / $iPerPage); + $startpage = (ceil($Result_Set / $iPerPage)) - 6; + if ($startpage <= 2) { + $startpage = 1; + } + $endpage = (ceil($Result_Set / $iPerPage)) + 9; + if ($endpage >= ($Pages - 1)) { + $endpage = $Pages; + } -// Show Link "1 ..." if startpage does not start at 1 -if ($startpage != 1) { - echo "1 ... "; -} + // Show Link "1 ..." if startpage does not start at 1 + if ($startpage != 1) { + echo "1 ... "; + } -// Display page links -if ($Pages > 1) { - for ($c = $startpage; $c <= $endpage; $c++) { - $b = $c - 1; - $thisLinkResult = $iPerPage * $b; - if ($thisLinkResult != $Result_Set) { - echo "$c "; - } else { - echo '  [ ' . $c . ' ]  '; + // Display page links + if ($Pages > 1) { + for ($c = $startpage; $c <= $endpage; $c++) { + $b = $c - 1; + $thisLinkResult = $iPerPage * $b; + if ($thisLinkResult != $Result_Set) { + echo "$c "; + } else { + echo '  [ ' . $c . ' ]  '; + } } } -} -// Show Link "... xx" if endpage is not the maximum number of pages -if ($endpage != $Pages) { - $thisLinkResult = ($Pages - 1) * $iPerPage; - echo " $Pages"; -} + // Show Link "... xx" if endpage is not the maximum number of pages + if ($endpage != $Pages) { + $thisLinkResult = ($Pages - 1) * $iPerPage; + echo " $Pages"; + } -// Show next-page link unless we're at the last page -if ($Result_Set >= 0 && $Result_Set < $Total) { - $thisLinkResult = $Result_Set + $iPerPage; - if ($thisLinkResult < $Total) { - echo "  " . gettext('Next Page') . '  '; + // Show next-page link unless we're at the last page + if ($Result_Set >= 0 && $Result_Set < $Total) { + $thisLinkResult = $Result_Set + $iPerPage; + if ($thisLinkResult < $Total) { + echo "  " . gettext('Next Page') . '  '; + } } -} -// Display Record Limit -echo ''; -if (isset($sSort)) { - echo ''; -} + // Display Record Limit + echo ''; + if (isset($sSort)) { + echo ''; + } -$sLimit5 = ''; -$sLimit10 = ''; -$sLimit20 = ''; -$sLimit25 = ''; -$sLimit50 = ''; - -if ($iPerPage === 5) { - $sLimit5 = 'selected'; -} elseif ($iPerPage === 10) { - $sLimit10 = 'selected'; -} elseif ($iPerPage === 20) { - $sLimit20 = 'selected'; -} elseif ($iPerPage === 25) { - $sLimit25 = 'selected'; -} elseif ($iPerPage === 50) { - $sLimit50 = 'selected'; -} + $sLimit5 = ''; + $sLimit10 = ''; + $sLimit20 = ''; + $sLimit25 = ''; + $sLimit50 = ''; + + if ($iPerPage === 5) { + $sLimit5 = 'selected'; + } elseif ($iPerPage === 10) { + $sLimit10 = 'selected'; + } elseif ($iPerPage === 20) { + $sLimit20 = 'selected'; + } elseif ($iPerPage === 25) { + $sLimit25 = 'selected'; + } elseif ($iPerPage === 50) { + $sLimit50 = 'selected'; + } -echo '     ' . gettext('Display:') . "  -   - -

'; - -// Column Headings -echo "\n - \n - \n - \n - \n - \n - "; - -// Display Deposits -while (list($fr_ID, $fr_Date, $fr_Title) = mysqli_fetch_row($rsDep)) { - echo "'; - echo ""; - echo ""; - // Get deposit total - echo ""; -} -echo '
" . gettext('Edit') . "" . gettext('Number') . "" . gettext('Date') . "" . gettext('Title') . "
" . gettext('Edit') . '$fr_ID$fr_Date$fr_Title
'; -?> + echo '     ' . gettext('Display:') . "  +   + +

'; + + // Column Headings + echo "\n + \n + \n + \n + \n + \n + "; + + // Display Deposits + while (list($fr_ID, $fr_Date, $fr_Title) = mysqli_fetch_row($rsDep)) { + echo "'; + echo ""; + echo ""; + // Get deposit total + echo ""; + } + echo '
" . gettext('Edit') . "" . gettext('Number') . "" . gettext('Date') . "" . gettext('Title') . "
" . gettext('Edit') . '$fr_ID$fr_Date$fr_Title
'; + ?>
- +reload(); $iFundRaiserID = $fundraiser->getId(); - // Existing record (update) + // Existing record (update) } else { $fundraiser = FundRaiserQuery::create()->findOneById($iFundRaiserID); $fundraiser @@ -120,13 +110,13 @@ if ($iFundRaiserID > 0) { //Get the items for this fundraiser $sSQL = "SELECT di_ID, di_Item, di_multibuy, - a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, - b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, - di_title, di_sellprice, di_estprice, di_materialvalue, di_minimum - FROM donateditem_di - LEFT JOIN person_per a ON di_donor_ID=a.per_ID - LEFT JOIN person_per b ON di_buyer_ID=b.per_ID - WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY di_multibuy,SUBSTR(di_item,1,1),cast(SUBSTR(di_item,2) as unsigned integer),SUBSTR(di_item,4)"; + a.per_FirstName as donorFirstName, a.per_LastName as donorLastName, + b.per_FirstName as buyerFirstName, b.per_LastName as buyerLastName, + di_title, di_sellprice, di_estprice, di_materialvalue, di_minimum + FROM donateditem_di + LEFT JOIN person_per a ON di_donor_ID=a.per_ID + LEFT JOIN person_per b ON di_buyer_ID=b.per_ID + WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY di_multibuy,SUBSTR(di_item,1,1),cast(SUBSTR(di_item,2) as unsigned integer),SUBSTR(di_item,4)"; $rsDonatedItems = RunQuery($sSQL); } else { $rsDonatedItems = 0; @@ -142,130 +132,131 @@ ?>
-
- - - - - - + - - + -
- - - 0) { - echo '\n"; - echo '\n"; - echo '\n"; - echo '\n"; - echo '\n"; - } - ?> -
- - - - - +
:
- - + - - - -
: + + + 0) { + echo '\n"; + echo '\n"; + echo '\n"; + echo '\n"; + echo '\n"; + } + ?> +
:
-
+ + + + + + + + + + + + + + + +
:
:
:
+
+ -
+
-: -
-
- - - - - - - - - - - - - - - -: +
+
+
+ + + + + + + + + + + + + - $sRowClass = 'RowColorA'; ?> - - - - - - - - - - - - - + + + + + + + + + + + + + + -
- - -   - -   - -   - -   - -   - -   - -   - -   - - Delete -
+ + +   + +   + +   + +   + +   + +   + +   + +   + + Delete +
-
+ +
- +/skin/js/GeoPage.js"> diff --git a/src/GetText.php b/src/GetText.php index 2fcd373b47..199ce89ab9 100644 --- a/src/GetText.php +++ b/src/GetText.php @@ -1,16 +1,5 @@ isManageGroupsEnabled()); -//Set the page title $sPageTitle = gettext('Group Editor'); $groupService = new GroupService(); -//Get the GroupID from the querystring. Redirect to Menu if no groupID is present, since this is an edit-only form. + +// Get the GroupID from the querystring. Redirect to Menu if no groupID is present, since this is an edit-only form. if (array_key_exists('GroupID', $_GET)) { $iGroupID = InputUtils::legacyFilterInput($_GET['GroupID'], 'int'); } else { @@ -198,5 +187,5 @@ var groupID =; - - +

- -
isManageGroupsEnabled()) { - ?> - +?>
@@ -84,7 +65,5 @@ }); - diff --git a/src/GroupPropsEditor.php b/src/GroupPropsEditor.php index 9bd2102aca..73dd12f22b 100644 --- a/src/GroupPropsEditor.php +++ b/src/GroupPropsEditor.php @@ -1,17 +1,5 @@ - -

-
- -
- +
+

+
+ +
+ - -
-
-

-
-
-
- - - - // Make sure we're at the beginning of the properties list resource (2nd pass code used it) - mysqli_data_seek($rsPropList, 0); +
+
+

+
+
+ - while ($rowPropList = mysqli_fetch_array($rsPropList, MYSQLI_BOTH)) { - extract($rowPropList); ?> -
- - + + +
: + ' . $aPropErrors[$prop_Field] . ''; + // Make sure we're at the beginning of the properties list resource (2nd pass code used it) + mysqli_data_seek($rsPropList, 0); + + while ($rowPropList = mysqli_fetch_array($rsPropList, MYSQLI_BOTH)) { + extract($rowPropList); ?> + + + + + + - - - - - - - -
: + ' . $aPropErrors[$prop_Field] . ''; + } ?> +
-

- -   - -
- +
+

+ +   + +
+ +
-
- - diff --git a/src/GroupPropsFormEditor.php b/src/GroupPropsFormEditor.php index 20b87389f3..53f67aad30 100644 --- a/src/GroupPropsFormEditor.php +++ b/src/GroupPropsFormEditor.php @@ -1,21 +1,5 @@ - 9) { - $newListID = $aTemp[0] + 1; - } else { - $newListID = 10; - } - - // Insert into the lists table with an example option. - $listOption = new ListOption(); - $listOption - ->setId($newListID) - ->setOptionId(1) - ->setOptionSequence(1) - ->setOptionName(gettext('Default Option')); - $listOption->save(); + if (isset($_POST[$iPropID . 'show'])) { + $aPersonDisplayFields[$iPropID] = true; + } else { + $aPersonDisplayFields[$iPropID] = false; + } + } - $newSpecial = "'$newListID'"; + // If no errors, then update. + if (!$bErrorFlag) { + for ($iPropID = 1; $iPropID <= $numRows; $iPropID++) { + if ($aPersonDisplayFields[$iPropID]) { + $temp = 'true'; } else { - $newSpecial = 'NULL'; + $temp = 'false'; } - // Insert into the master table - $sSQL = "INSERT INTO `groupprop_master` - ( `grp_ID` , `prop_ID` , `prop_Field` , `prop_Name` , `prop_Description` , `type_ID` , `prop_Special` ) - VALUES ('" . $iGroupID . "', '" . $newRowNum . "', 'c" . $newFieldNum . "', '" . $newFieldName . "', '" . $newFieldDesc . "', '" . $newFieldType . "', $newSpecial);"; - RunQuery($sSQL); - - // Insert into the group-specific properties table - $sSQL = 'ALTER TABLE `groupprop_' . $iGroupID . '` ADD `c' . $newFieldNum . '` '; + $sSQL = "UPDATE groupprop_master + SET `prop_Name` = '" . $aNameFields[$iPropID] . "', + `prop_Description` = '" . $aDescFields[$iPropID] . "', + `prop_Special` = " . $aSpecialFields[$iPropID] . ", + `prop_PersonDisplay` = '" . $temp . "' + WHERE `grp_ID` = '" . $iGroupID . "' AND `prop_ID` = '" . $iPropID . "';"; - switch ($newFieldType) { - case 1: - $sSQL .= "ENUM('false', 'true')"; - break; - case 2: - $sSQL .= 'DATE'; - break; - case 3: - $sSQL .= 'VARCHAR(50)'; - break; - case 4: - $sSQL .= 'VARCHAR(100)'; - break; - case 5: - $sSQL .= 'TEXT'; - break; - case 6: - $sSQL .= 'YEAR'; - break; - case 7: - $sSQL .= "ENUM('winter', 'spring', 'summer', 'fall')"; - break; - case 8: - $sSQL .= 'INT'; - break; - case 9: - $sSQL .= 'MEDIUMINT(9)'; - break; - case 10: - $sSQL .= 'DECIMAL(10,2)'; - break; - case 11: - $sSQL .= 'VARCHAR(30)'; + RunQuery($sSQL); + } + } + } else { + // Check if we're adding a field + if (isset($_POST['AddField'])) { + $newFieldType = InputUtils::legacyFilterInput($_POST['newFieldType'], 'int'); + $newFieldName = InputUtils::legacyFilterInput($_POST['newFieldName']); + $newFieldDesc = InputUtils::legacyFilterInput($_POST['newFieldDesc']); + + if (strlen($newFieldName) == 0) { + $bNewNameError = true; + } else { + $sSQL = 'SELECT prop_Name FROM groupprop_master WHERE grp_ID = ' . $iGroupID; + $rsPropNames = RunQuery($sSQL); + while ($aRow = mysqli_fetch_array($rsPropNames)) { + if ($aRow[0] == $newFieldName) { + $bDuplicateNameError = true; break; - case 12: - $sSQL .= 'TINYINT(4)'; + } } - $sSQL .= ' DEFAULT NULL ;'; - RunQuery($sSQL); + if (!$bDuplicateNameError) { + // Get the new prop_ID (highest existing plus one) + $sSQL = 'SELECT prop_ID FROM groupprop_master WHERE grp_ID = ' . $iGroupID; + $rsPropList = RunQuery($sSQL); + $newRowNum = mysqli_num_rows($rsPropList) + 1; + + // Find the highest existing field number in the group's table to determine the next free one. + // This is essentially an auto-incrementing system where deleted numbers are not re-used. + $tableName = 'groupprop_' . $iGroupID; + + $fields = mysqli_query($cnInfoCentral, 'SELECT * FROM ' . $tableName); + $newFieldNum = mysqli_num_fields($fields); + + // If we're inserting a new custom-list type field, create a new list and get its ID + if ($newFieldType == 12) { + // Get the first available lst_ID for insertion. lst_ID 0-9 are reserved for permanent lists. + $sSQL = 'SELECT MAX(lst_ID) FROM list_lst'; + $aTemp = mysqli_fetch_array(RunQuery($sSQL)); + if ($aTemp[0] > 9) { + $newListID = $aTemp[0] + 1; + } else { + $newListID = 10; + } - $bNewNameError = false; - } - } - } + // Insert into the lists table with an example option. + $listOption = new ListOption(); + $listOption + ->setId($newListID) + ->setOptionId(1) + ->setOptionSequence(1) + ->setOptionName(gettext('Default Option')); + $listOption->save(); - // Get data for the form as it now exists.. - $sSQL = 'SELECT * FROM groupprop_master WHERE grp_ID = ' . $iGroupID . ' ORDER BY prop_ID'; + $newSpecial = "'$newListID'"; + } else { + $newSpecial = 'NULL'; + } - $rsPropList = RunQuery($sSQL); - $numRows = mysqli_num_rows($rsPropList); + // Insert into the master table + $sSQL = "INSERT INTO `groupprop_master` + ( `grp_ID` , `prop_ID` , `prop_Field` , `prop_Name` , `prop_Description` , `type_ID` , `prop_Special` ) + VALUES ('" . $iGroupID . "', '" . $newRowNum . "', 'c" . $newFieldNum . "', '" . $newFieldName . "', '" . $newFieldDesc . "', '" . $newFieldType . "', $newSpecial);"; + RunQuery($sSQL); + + // Insert into the group-specific properties table + $sSQL = 'ALTER TABLE `groupprop_' . $iGroupID . '` ADD `c' . $newFieldNum . '` '; + + switch ($newFieldType) { + case 1: + $sSQL .= "ENUM('false', 'true')"; + break; + case 2: + $sSQL .= 'DATE'; + break; + case 3: + $sSQL .= 'VARCHAR(50)'; + break; + case 4: + $sSQL .= 'VARCHAR(100)'; + break; + case 5: + $sSQL .= 'TEXT'; + break; + case 6: + $sSQL .= 'YEAR'; + break; + case 7: + $sSQL .= "ENUM('winter', 'spring', 'summer', 'fall')"; + break; + case 8: + $sSQL .= 'INT'; + break; + case 9: + $sSQL .= 'MEDIUMINT(9)'; + break; + case 10: + $sSQL .= 'DECIMAL(10,2)'; + break; + case 11: + $sSQL .= 'VARCHAR(30)'; + break; + case 12: + $sSQL .= 'TINYINT(4)'; + } - // Create arrays of the properties. - for ($row = 1; $row <= $numRows; $row++) { - $aRow = mysqli_fetch_array($rsPropList, MYSQLI_BOTH); - extract($aRow); + $sSQL .= ' DEFAULT NULL ;'; + RunQuery($sSQL); - // This is probably more clear than using a multi-dimensional array - $aNameFields[$row] = $prop_Name; - $aDescFields[$row] = $prop_Description; - $aSpecialFields[$row] = $prop_Special; - $aFieldFields[$row] = $prop_Field; - $aTypeFields[$row] = $type_ID; - $aPersonDisplayFields[$row] = ($prop_PersonDisplay == 'true'); - } -} + $bNewNameError = false; + } + } + } -// Construct the form -?> + // Get data for the form as it now exists.. + $sSQL = 'SELECT * FROM groupprop_master WHERE grp_ID = ' . $iGroupID . ' ORDER BY prop_ID'; -
+ $rsPropList = RunQuery($sSQL); + $numRows = mysqli_num_rows($rsPropList); -
- + // Create arrays of the properties. + for ($row = 1; $row <= $numRows; $row++) { + $aRow = mysqli_fetch_array($rsPropList, MYSQLI_BOTH); + extract($aRow); - -

-
- - - - - - - - - - - - - + - +
-
-
- ' . gettext('Invalid fields or selections. Changes not saved! Please correct and try again!') . ''; - } ?> -

- for ($row = 1; $row <= $numRows; $row++) { - ?> - - - + + + + + + + + + + + + + + + + - "; ?> - - + + for ($row = 1; $row <= $numRows; $row++) { + ?> + + + + + + + + + + + + + + + + + +
' . gettext('You must enter a name') . ' '; } ?> - - - - - - - - - - - - - - - - - - -

'; - } - if ($row < $numRows) { - echo "'; - } ?> + if ($numRows == 0) { + ?> +
+

+
+ +
+
+
+ ' . gettext('Invalid fields or selections. Changes not saved! Please correct and try again!') . ''; + } ?> +

- -
+

+
+ '; + } + if ($row < $numRows) { + echo "'; + } ?> + + "; ?> + + + +
' . gettext('You must enter a name') . ' '; + } ?> +
+ '; + echo ''; + + $sSQL = 'SELECT grp_ID,grp_Name FROM group_grp ORDER BY grp_Name'; + + $rsGroupList = RunQuery($sSQL); + + while ($aRow = mysqli_fetch_array($rsGroupList)) { + extract($aRow); + + echo ' + > +
+ + + + + + +
+ +
+
+
- '; - echo ''; - - $sSQL = 'SELECT grp_ID,grp_Name FROM group_grp ORDER BY grp_Name'; - - $rsGroupList = RunQuery($sSQL); - - while ($aRow = mysqli_fetch_array($rsGroupList)) { - extract($aRow); - - echo ' - > -
- - - - -
- + +
-
-

- - - - - - - -
-
:
- '; - for ($iOptionID = 1; $iOptionID <= count($aPropTypes); $iOptionID++) { - echo '
-
:
- -
' . gettext('You must enter a name') . '
'; - } - if ($bDuplicateNameError) { - echo '

' . gettext('That field name already exists.') . '
'; - } - ?> -   -
-
:
- -   +
+ + + + + + + + + +
+
:
+ '; + for ($iOptionID = 1; $iOptionID <= count($aPropTypes); $iOptionID++) { + echo '
+
:
+ +
' . gettext('You must enter a name') . '
'; + } + if ($bDuplicateNameError) { + echo '

' . gettext('That field name already exists.') . '
'; + } + ?> +   +
+
:
+ +   +
+ +
- -
-
-
+ +
-
- - + @@ -151,13 +137,10 @@

-
- - - - +findOneById($iGroupID); -//Look up the default role name +// Look up the default role name $defaultRole = ListOptionQuery::create()->filterById($thisGroup->getRoleListId())->filterByOptionId($thisGroup->getDefaultRole())->findOne(); -//Get the group's type name +// Get the group's type name if ($thisGroup->getType() > 0) { $sGroupType = ListOptionQuery::create()->filterById(3)->filterByOptionId($thisGroup->getType())->findOne()->getOptionName(); } else { $sGroupType = gettext('Unassigned'); } -//Get the Properties assigned to this Group +// Get the Properties assigned to this Group $sSQL = "SELECT pro_Name, pro_ID, pro_Prompt, r2p_Value, prt_Name, pro_prt_ID FROM record2property_r2p LEFT JOIN property_pro ON pro_ID = r2p_pro_ID LEFT JOIN propertytype_prt ON propertytype_prt.prt_ID = property_pro.pro_prt_ID WHERE pro_Class = 'g' AND r2p_record_ID = " . $iGroupID . - ' ORDER BY prt_Name, pro_Name'; + ' ORDER BY prt_Name, pro_Name'; $rsAssignedProperties = RunQuery($sSQL); -//Get all the properties +// Get all the properties $sSQL = "SELECT * FROM property_pro WHERE pro_Class = 'g' ORDER BY pro_Name"; $rsProperties = RunQuery($sSQL); @@ -65,37 +49,36 @@ $rsPropList = RunQuery($sSQL); $numRows = mysqli_num_rows($rsPropList); -//Set the page title $sPageTitle = gettext('Group View') . ' : ' . $thisGroup->getName(); require 'Include/Header.php'; ?>
-
-

-
-
+
+

+
+
- isManageGroupsEnabled()) { - echo '' . gettext('Edit this Group') . ''; - echo ''; ?> + isManageGroupsEnabled()) { + echo '' . gettext('Edit this Group') . ''; + echo ''; ?> getHasSpecialProps()) { - echo '' . gettext('Edit Group-Specific Properties Form') . ''; - } - }?> + if ($thisGroup->getHasSpecialProps()) { + echo '' . gettext('Edit Group-Specific Properties Form') . ''; + } + } ?> - - + + - getUserConfigString("sMailtoDelimiter"); - while (list($per_Email, $fam_Email, $virt_RoleName) = mysqli_fetch_row($rsEmailList)) { - $sEmail = SelectWhichInfo($per_Email, $fam_Email, false); - if ($sEmail) { - /* if ($sEmailLink) // Don't put delimiter before first email + $rsEmailList = RunQuery($sSQL); + $sEmailLink = ''; + $roleEmails = []; + $sMailtoDelimiter = AuthenticationManager::getCurrentUser()->getUserConfigString("sMailtoDelimiter"); + while (list($per_Email, $fam_Email, $virt_RoleName) = mysqli_fetch_row($rsEmailList)) { + $sEmail = SelectWhichInfo($per_Email, $fam_Email, false); + if ($sEmail) { + /* if ($sEmailLink) // Don't put delimiter before first email $sEmailLink .= $sMailtoDelimiter; */ - // Add email only if email address is not already in string - if (!stristr($sEmailLink, $sEmail)) { - $sEmailLink .= $sEmail .= $sMailtoDelimiter; - $roleEmails[$virt_RoleName] = $sEmailLink; + // Add email only if email address is not already in string + if (!stristr($sEmailLink, $sEmail)) { + $sEmailLink .= $sEmail .= $sMailtoDelimiter; + $roleEmails[$virt_RoleName] = $sEmailLink; + } } } - } - if ($sEmailLink) { - // Add default email if default email has been set and is not already in string - if (SystemConfig::getValue('sToEmailAddress') != '' && !stristr($sEmailLink, SystemConfig::getValue('sToEmailAddress'))) { - $sEmailLink .= $sMailtoDelimiter . SystemConfig::getValue('sToEmailAddress'); - } - $sEmailLink = urlencode($sEmailLink); // Mailto should comply with RFC 2368 - - if (AuthenticationManager::getCurrentUser()->isEmailEnabled()) { // Does user have permission to email groups - // Display link - ?> -
- - - -
+ if ($sEmailLink) { + // Add default email if default email has been set and is not already in string + if (SystemConfig::getValue('sToEmailAddress') != '' && !stristr($sEmailLink, SystemConfig::getValue('sToEmailAddress'))) { + $sEmailLink .= $sMailtoDelimiter . SystemConfig::getValue('sToEmailAddress'); + } + $sEmailLink = urlencode($sEmailLink); // Mailto should comply with RFC 2368 + + if (AuthenticationManager::getCurrentUser()->isEmailEnabled()) { // Does user have permission to email groups + // Display link + ?> +
+ + + +
-
- - - -
+
+ + + +
- isEmailEnabled()) { // Does user have permission to email groups - // Display link - echo '' . gettext('Text Group') . ''; - echo ''; + if ($sPhoneLink) { + if (AuthenticationManager::getCurrentUser()->isEmailEnabled()) { // Does user have permission to email groups + // Display link + echo '' . gettext('Text Group') . ''; + echo ''; + } } - } - ?> -
+ ?> +
getDescription() ?> -

+

+

+

-
-
-

-
-
-
-
:
-
:
-
-
+
+

+
+
+
+
:
+
:
+
+
-
-
-

-
-
- - - - -
- : - - getHasSpecialProps()) { - // Create arrays of the properties. - for ($row = 1; $row <= $numRows; $row++) { - $aRow = mysqli_fetch_array($rsPropList, MYSQLI_BOTH); - extract($aRow); - - $aNameFields[$row] = $prop_Name; - $aDescFields[$row] = $prop_Description; - $aFieldFields[$row] = $prop_Field; - $aTypeFields[$row] = $type_ID; - } - - // Construct the table +
+
+

+
+
+ + + '; - - //Alternate the row style - $sRowClass = AlternateRowStyle($sRowClass); - - $sAssignedProperties .= $pro_ID . ','; + } else { + echo '

' . gettext('Disabled for this group.') . '

'; } - echo '
+ : - if (!$numRows) { - echo '

'; - } else { - ?> - - - - - - '; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
' . $aPropTypes[$aTypeFields[$row]] . '' . $aNameFields[$row] . '' . $aDescFields[$row] . ' 
'; - } - } else { - echo '

' . gettext('Disabled for this group.') . '

'; - } - - //Print Assigned Properties - echo '

'; - echo '' . gettext('Assigned Properties') . ':'; - $sAssignedProperties = ','; - - //Was anything returned? - if (mysqli_num_rows($rsAssignedProperties) == 0) { - // No, indicate nothing returned - echo '

' . gettext('No property assignments') . '.

'; - } else { - // Display table of properties?> - - - - isManageGroupsEnabled()) { - echo ''; - echo ''; - } - echo ''; - - $last_pro_prt_ID = ''; - $bIsFirst = true; - - //Loop through the rows - while ($aRow = mysqli_fetch_array($rsAssignedProperties)) { - $pro_Prompt = ''; - $r2p_Value = ''; - - extract($aRow); - - if ($pro_prt_ID != $last_pro_prt_ID) { - echo ''; - - $bIsFirst = false; - $last_pro_prt_ID = $pro_prt_ID; - $sRowClass = 'RowColorB'; - } else { - echo ''; - echo ''; + if ($thisGroup->getHasSpecialProps()) { + // Create arrays of the properties. + for ($row = 1; $row <= $numRows; $row++) { + $aRow = mysqli_fetch_array($rsPropList, MYSQLI_BOTH); + extract($aRow); + + $aNameFields[$row] = $prop_Name; + $aDescFields[$row] = $prop_Description; + $aFieldFields[$row] = $prop_Field; + $aTypeFields[$row] = $type_ID; } - echo ''; - echo ''; - - if (strlen($pro_Prompt) > 0 && AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { - echo ''; - } else { - echo ''; - } + // Construct the table - if (AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { - echo ''; + ?> +
- - ' . gettext('Edit Value') . '' . gettext('Remove') . '
' . $prt_Name . '
 ' . $pro_Name . ' ' . $r2p_Value . ' ' . gettext('Edit Value') . ' ' . gettext('Remove') . ''; + if (!$numRows) { + echo '

'; } else { - echo '
 
+ + + + + + '; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
' . $aPropTypes[$aTypeFields[$row]] . '' . $aNameFields[$row] . '' . $aDescFields[$row] . ' 
'; } - - echo '
'; - } - - if (AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { - echo '
'; - echo '

'; - echo '' . gettext('Assign a New Property:') . ''; - echo ' + + + isManageGroupsEnabled()) { + echo ''; + echo ''; + } + echo ''; + + $last_pro_prt_ID = ''; + $bIsFirst = true; + + //Loop through the rows + while ($aRow = mysqli_fetch_array($rsAssignedProperties)) { + $pro_Prompt = ''; + $r2p_Value = ''; + + extract($aRow); + + if ($pro_prt_ID != $last_pro_prt_ID) { + echo ''; + + $bIsFirst = false; + $last_pro_prt_ID = $pro_prt_ID; + $sRowClass = 'RowColorB'; + } else { + echo ''; + echo ''; + } + + echo ''; + echo ''; + + if (strlen($pro_Prompt) > 0 && AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { + echo ''; + } else { + echo ''; + } + + if (AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { + echo ''; + } + + echo ''; + + //Alternate the row style + $sRowClass = AlternateRowStyle($sRowClass); + + $sAssignedProperties .= $pro_ID . ','; + } + + echo '
+ + ' . gettext('Edit Value') . '' . gettext('Remove') . '
' . $prt_Name . '
 ' . $pro_Name . ' ' . $r2p_Value . ' ' . gettext('Edit Value') . ' ' . gettext('Remove') . ''; + } else { + echo ' 
'; + } - //If the property doesn't already exist for this Person, write the '; - } - } + if (AuthenticationManager::getCurrentUser()->isManageGroupsEnabled()) { + echo ''; + echo '

'; + echo '' . gettext('Assign a New Property:') . ''; + echo ''; - echo ' '; - echo '

'; - } else { - echo '


'; - } - ?> + while ($aRow = mysqli_fetch_array($rsProperties)) { + extract($aRow); + //If the property doesn't already exist for this Person, write the '; + } + } + echo ''; + echo ' '; + echo '

'; + } else { + echo '


'; + } + ?>
-
-
- -
-
-

-
-
- -
- - -
-
-
-
- -
- - - -
-
-
- - + + +
+ +
+
+

+
+
+ +
+ + +
+
+
+
+ +
+ + +
- - - - + }); + }); + + + @@ -30,5 +16,3 @@ // Reset the Global Message $_SESSION['sGlobalMessage'] = ''; - -?> diff --git a/src/Include/Footer.php b/src/Include/Footer.php index 95f1189597..793cf6945a 100644 --- a/src/Include/Footer.php +++ b/src/Include/Footer.php @@ -1,16 +1,5 @@ diff --git a/src/Include/FooterNotLoggedIn.php b/src/Include/FooterNotLoggedIn.php index d02e7e33ff..2fa2c13372 100644 --- a/src/Include/FooterNotLoggedIn.php +++ b/src/Include/FooterNotLoggedIn.php @@ -9,7 +9,6 @@ © ChurchCRM. .
- diff --git a/src/Include/Functions.php b/src/Include/Functions.php index 38fc9ca51a..471a20ec7c 100644 --- a/src/Include/Functions.php +++ b/src/Include/Functions.php @@ -1,14 +1,5 @@ 11) { $sAMPM = gettext('pm'); if ($h > 12) { @@ -1275,8 +1260,6 @@ function formatNumber($iNumber, $sMode = 'integer') } } - - function FilenameToFontname($filename, $family) { if ($filename == $family) { diff --git a/src/Include/GetGroupArray.php b/src/Include/GetGroupArray.php index cb85e2f1b8..6375f973a1 100644 --- a/src/Include/GetGroupArray.php +++ b/src/Include/GetGroupArray.php @@ -1,24 +1,17 @@ /skin/js/CRMJSOM.js"> diff --git a/src/Include/Header.php b/src/Include/Header.php index 03a5335484..396528dfd6 100644 --- a/src/Include/Header.php +++ b/src/Include/Header.php @@ -51,7 +51,6 @@ Home - @@ -74,7 +73,6 @@
-
-