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

General whitespace cleanup #7074

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 33 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
16 changes: 2 additions & 14 deletions src/AddDonors.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?php

/*******************************************************************************
*
* filename : AddDonors.php
* website : https://churchcrm.io
* copyright : Copyright 2009 Michael Wilt
*
* This script adds people who have donated but not registered as buyers to the
* buyer list so they can get statements too.
*
******************************************************************************/

//Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand Down Expand Up @@ -41,7 +29,7 @@

// Get all the people listed as donors for this fundraiser
$sSQL = "SELECT a.per_id as donorID FROM donateditem_di
LEFT JOIN person_per a ON di_donor_ID=a.per_ID
LEFT JOIN person_per a ON di_donor_ID=a.per_ID
WHERE di_FR_ID = '" . $iFundRaiserID . "' ORDER BY a.per_id";
$rsDonors = RunQuery($sSQL);

Expand All @@ -63,7 +51,7 @@

if ($donorID > 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;
}
Expand Down
17 changes: 2 additions & 15 deletions src/BackupDatabase.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?php

/*******************************************************************************
*
* filename : BackupDatabase.php
* last change : 2016-01-04
* description : Creates a backup file of the database.
*
* https://churchcrm.io/
* Copyright 2003 Chris Gebhardt
*
******************************************************************************/

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand All @@ -23,8 +11,6 @@
// Otherwise, re-direct them to the main menu.
AuthenticationManager::redirectHomeIfNotAdmin();


// Set the page title and include HTML header
$sPageTitle = gettext('Backup Database');
require 'Include/Header.php';

Expand Down Expand Up @@ -67,4 +53,5 @@

<script src="<?= SystemURLs::getRootPath() ?>/skin/js/BackupDatabase.js"></script>

<?php require 'Include/Footer.php' ?>
<?php
require 'Include/Footer.php';
17 changes: 3 additions & 14 deletions src/BatchWinnerEntry.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<?php

/*******************************************************************************
*
* filename : BatchWinnerEntry.php
* last change : 2011-04-01
* website : https://churchcrm.io
* copyright : Copyright 2011 Michael Wilt
*
******************************************************************************/

//Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand All @@ -33,10 +23,9 @@
extract(mysqli_fetch_array($rsDeposit));
}

//Set the page title
$sPageTitle = gettext('Batch Winner Entry');

//Is this the second pass?
// Is this the second pass?
if (isset($_POST['EnterWinners'])) {
for ($row = 0; $row < 10; $row += 1) {
$buyer = $_POST["Paddle$row"];
Expand Down Expand Up @@ -130,5 +119,5 @@
</div>
</form>
</div>

<?php require 'Include/Footer.php' ?>
<?php
require 'Include/Footer.php';
17 changes: 2 additions & 15 deletions src/CSVCreateFile.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<?php

/*******************************************************************************
*
* filename : CSVCreateFile.php
* last change : 2003-06-11
* website : https://churchcrm.io
* copyright : Copyright 2001-2003 Deane Barker, Chris Gebhardt, Michael Wilt
*
******************************************************************************/

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand Down Expand Up @@ -70,10 +60,7 @@
$aSecurityType[$lst_OptionID] = $lst_OptionName;
}

//
// Prepare the MySQL query
//

$sJoinFamTable = ' LEFT JOIN family_fam ON per_fam_ID = fam_ID ';
$sPerTable = 'person_per';

Expand Down Expand Up @@ -217,8 +204,8 @@

if ($sFormat === 'rollup') {
$sSQL = "(SELECT *, 0 AS memberCount, per_LastName AS SortMe FROM $sPerTable $sJoinFamTable WHERE per_fam_ID = 0 $sWhereExt)
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";
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";
}
Expand Down
21 changes: 4 additions & 17 deletions src/CSVExport.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
<?php

/*******************************************************************************
*
* filename : CSVExport.php
* description : options for creating csv file
*
* https://churchcrm.io/
* Copyright 2001-2002 Phillip Hullquist, Deane Barker
*
******************************************************************************/

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand All @@ -22,11 +11,11 @@
RedirectUtils::securityRedirect("CSVExport");
}

//Get Classifications for the drop-down
// Get Classifications for the drop-down
$sSQL = 'SELECT * FROM list_lst WHERE lst_ID = 1 ORDER BY lst_OptionSequence';
$rsClassifications = RunQuery($sSQL);

//Get Family Roles for the drop-down
// Get Family Roles for the drop-down
$sSQL = 'SELECT * FROM list_lst WHERE lst_ID = 2 ORDER BY lst_OptionSequence';
$rsFamilyRoles = RunQuery($sSQL);

Expand All @@ -51,7 +40,6 @@
$aSecurityType[$lst_OptionID] = $lst_OptionName;
}

// Set the page title and include HTML header
$sPageTitle = gettext('CSV Export');
require 'Include/Header.php';
?>
Expand All @@ -68,7 +56,6 @@
<?= gettext('Required') ?>
</div>


<div class="col-md-4">
<label><?= gettext('Title') ?>:</label>
<input type="checkbox" name="Title" value="1">
Expand Down Expand Up @@ -460,5 +447,5 @@
</div>

</form>

<?php require 'Include/Footer.php' ?>
<?php
require 'Include/Footer.php';
15 changes: 1 addition & 14 deletions src/CSVImport.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
<?php

/*******************************************************************************
*
* filename : CSVImport.php
* last change : 2003-10-02
* description : Tool for importing CSV person data into InfoCentral
*
* https://churchcrm.io/
* Copyright 2003 Chris Gebhardt
*
******************************************************************************/

namespace ChurchCRM;

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand All @@ -32,6 +20,7 @@
AuthenticationManager::redirectHomeIfNotAdmin();

$logger = LoggerUtils::getAppLogger();

/**
* A monogamous society is assumed, however it can be patriarchal or matriarchal
**/
Expand Down Expand Up @@ -109,7 +98,6 @@ public function assignRoles()
}
}

// Set the page title and include HTML header
$sPageTitle = gettext('CSV Import');
require 'Include/Header.php'; ?>

Expand Down Expand Up @@ -957,4 +945,3 @@ function GetAge(int $Month, int $Day, ?int $Year): int
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/MemberView.js" ></script>
<?php
require 'Include/Footer.php';
?>
16 changes: 0 additions & 16 deletions src/CartToEvent.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
<?php

/*******************************************************************************
*
* filename : CartToEvent.php
* last change : 2005-09-09
* description : Add cart records to an event
*
* https://churchcrm.io/
* Copyright 2001-2003 Phillip Hullquist, Deane Barker, Chris Gebhardt
* Copyright 2005 Todd Pillars
* Copyright 2012 Michael Wilt
*
******************************************************************************/

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand Down Expand Up @@ -52,7 +38,6 @@
RedirectUtils::redirect('v2/cart?Action=EmptyCart&Message=aMessage&iCount=' . $iCount . '&iEID=' . $iEventID);
}

// Set the page title and include HTML header
$sPageTitle = gettext('Add Cart to Event');
require 'Include/Header.php';

Expand Down Expand Up @@ -98,4 +83,3 @@
}

require 'Include/Footer.php';
?>
17 changes: 2 additions & 15 deletions src/CartToFamily.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?php

/*******************************************************************************
*
* filename : CartToFamily.php
* last change : 2003-10-09
* description : Add cart records to a family
*
* https://churchcrm.io/
* Copyright 2003 Chris Gebhardt
*
******************************************************************************/

// Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';

Expand Down Expand Up @@ -145,7 +133,6 @@
}
}

// Set the page title and include HTML header
$sPageTitle = gettext('Add Cart to Family');
require 'Include/Header.php';

Expand Down Expand Up @@ -239,7 +226,6 @@
<td><p class="MediumLargeText"><?= gettext('If adding a new family, enter data below.') ?></p></td>
</tr>


<tr>
<td class="LabelColumn"><?= gettext('Family Name') ?>:</td>
<td class="TextColumnWithBottomBorder"><input type="text" Name="FamilyName" value="<?= $sName ?>" maxlength="48"><span style="color: red;"><?= $sNameError ?></span></td>
Expand Down Expand Up @@ -363,4 +349,5 @@
}
?>
</div>
<?php require 'Include/Footer.php'; ?>
<?php
require 'Include/Footer.php';
Loading
Loading