Skip to content

Commit

Permalink
replaced $sRootPath with SystemURLs::getRootPath() (#1840)
Browse files Browse the repository at this point in the history
* replaced $sRootPath with SystemURLs::getRootPath()

* Apply fixes from StyleCI (#1841)

* fixed if check

* format cleanup and global cleanup

* Apply fixes from StyleCI (#1847)

* :(

* using SystemURLs::getRootPath()

* more sRoothPath

* SystemURLs::getRootPath() cleanup

* fixed imports
  • Loading branch information
DawoudIO authored Feb 5, 2017
1 parent b005d28 commit 7f33870
Show file tree
Hide file tree
Showing 33 changed files with 551 additions and 466 deletions.
4 changes: 3 additions & 1 deletion src/CartToFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
require 'Include/Config.php';
require 'Include/Functions.php';

use ChurchCRM\dto\SystemURLs;

// Security: User must have add records permission
if (!$_SESSION['bAddRecords']) {
Redirect('Menu.php');
Expand Down Expand Up @@ -164,7 +166,7 @@

echo '<tr class="'.$sRowClass.'">';
echo '<td align="center">'.$count++.'</td>';
echo "<td><img src='".$sRootPath.'/api/persons/'.$per_ID."/photo' class='direct-chat-img'> &nbsp <a href=\"PersonView.php?PersonID=".$per_ID.'">'.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).'</a></td>';
echo "<td><img src='".SystemURLs::getRootPath().'/api/persons/'.$per_ID."/photo' class='direct-chat-img'> &nbsp <a href=\"PersonView.php?PersonID=".$per_ID.'">'.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).'</a></td>';

echo '<td align="center">';
if ($per_fam_ID == 0) {
Expand Down
94 changes: 51 additions & 43 deletions src/CartView.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
require 'Include/Functions.php';
require 'Include/LabelFunctions.php';

use ChurchCRM\dto\SystemURLs;

use ChurchCRM\dto\SystemConfig;

if (isset($_POST['rmEmail'])) {
Expand All @@ -46,7 +48,8 @@
if (!array_key_exists('Message', $_GET)) {
?>
<p class="text-center callout callout-warning"><?= gettext('You have no items in your cart.') ?> </p>
<?php
<?php

} else {
switch ($_GET['Message']) {
case 'aMessage': ?>
Expand Down Expand Up @@ -91,38 +94,42 @@
<input type="submit" class="btn" name="gotolabels"
value="<?= gettext('Go To Labels') ?>">
</form>
<?php
<?php

} ?>

<!-- BEGIN CART FUNCTIONS -->


<?php
<?php
if (count($_SESSION['aPeopleCart']) > 0) {
?>
?>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Cart Functions</h3>
</div>
<div class="box-body">
<a href="CartView.php?Action=EmptyCart" class="btn btn-app"><i class="fa fa-trash"></i><?= gettext('Empty Cart') ?></a>
<?php if ($_SESSION['bManageGroups']) {
?>
?>
<a href="CartToGroup.php" class="btn btn-app"><i class="fa fa-object-ungroup"></i><?= gettext('Empty Cart to Group') ?></a>
<?php
} ?>
<?php

} ?>
<?php if ($_SESSION['bAddRecords']) {
?>
?>
<a href="CartToFamily.php" class="btn btn-app"><i class="fa fa-users"></i><?= gettext('Empty Cart to Family') ?></a>
<?php
} ?>
<?php

} ?>
<a href="CartToEvent.php" class="btn btn-app"><i class="fa fa-ticket"></i><?= gettext('Empty Cart to Event') ?></a>

<?php if ($bExportCSV) {
?>
?>
<a href="CSVExport.php?Source=cart" class="btn btn-app"><i class="fa fa-file-excel-o"></i><?= gettext('CSV Export') ?></a>
<?php
} ?>
<?php

} ?>
<a href="MapUsingGoogle.php?GroupID=0" class="btn btn-app"><i class="fa fa-map-marker"></i><?= gettext('Map Cart') ?></a>
<a href="Reports/NameTags.php?labeltype=74536&labelfont=times&labelfontsize=36" class="btn btn-app"><i class="fa fa-file-pdf-o"></i><?= gettext('Name Tags') ?></a>
<?php
Expand Down Expand Up @@ -211,7 +218,8 @@ function codename()
<!-- /.box-body -->
</div>
<!-- /.box -->
<?php
<?php

} ?>
<!-- Default box -->
<div class="box">
Expand All @@ -224,36 +232,36 @@ function codename()
<?php
LabelGroupSelect('groupbymode');

echo ' <tr><td>'.gettext('Bulk Mail Presort').'</td>';
echo ' <td>';
echo ' <input name="bulkmailpresort" type="checkbox" onclick="codename()"';
echo ' id="BulkMailPresort" value="1" ';
if (array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) {
echo 'checked';
}
echo ' ><br></td></tr>';

echo ' <tr><td>'.gettext('Quiet Presort').'</td>';
echo ' <td>';
echo ' <input ';
if (array_key_exists('buildmailpresort', $_COOKIE) && !$_COOKIE['bulkmailpresort']) {
echo 'disabled ';
} // This would be better with $_SESSION variable
echo ' <tr><td>'.gettext('Bulk Mail Presort').'</td>';
echo ' <td>';
echo ' <input name="bulkmailpresort" type="checkbox" onclick="codename()"';
echo ' id="BulkMailPresort" value="1" ';
if (array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) {
echo 'checked';
}
echo ' ><br></td></tr>';

echo ' <tr><td>'.gettext('Quiet Presort').'</td>';
echo ' <td>';
echo ' <input ';
if (array_key_exists('buildmailpresort', $_COOKIE) && !$_COOKIE['bulkmailpresort']) {
echo 'disabled ';
} // This would be better with $_SESSION variable
// instead of cookie ... (save $_SESSION in MySQL)
echo 'name="bulkmailquiet" type="checkbox" onclick="codename()"';
echo ' id="QuietBulkMail" value="1" ';
if (array_key_exists('bulkmailquiet', $_COOKIE) && $_COOKIE['bulkmailquiet'] && array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) {
echo 'checked';
}
echo ' ><br></td></tr>';
echo ' id="QuietBulkMail" value="1" ';
if (array_key_exists('bulkmailquiet', $_COOKIE) && $_COOKIE['bulkmailquiet'] && array_key_exists('buildmailpresort', $_COOKIE) && $_COOKIE['bulkmailpresort']) {
echo 'checked';
}
echo ' ><br></td></tr>';

ToParentsOfCheckBox('toparents');
LabelSelect('labeltype');
FontSelect('labelfont');
FontSizeSelect('labelfontsize');
StartRowStartColumn();
IgnoreIncompleteAddresses();
LabelFileType(); ?>
ToParentsOfCheckBox('toparents');
LabelSelect('labeltype');
FontSelect('labelfont');
FontSizeSelect('labelfontsize');
StartRowStartColumn();
IgnoreIncompleteAddresses();
LabelFileType(); ?>

<tr>
<td></td>
Expand All @@ -267,7 +275,7 @@ function codename()

<?php

} ?>
} ?>

<!-- END CART FUNCTIONS -->

Expand Down Expand Up @@ -329,7 +337,7 @@ function codename()
}

echo '<tr class="'.$sRowClass.'">';
echo '<td><img src="'.$sRootPath.'/api/persons/'.$per_ID.'/photo" class="direct-chat-img"> &nbsp <a href="PersonView.php?PersonID='.$per_ID.'">'.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).'</a></td>';
echo '<td><img src="'.SystemURLs::getRootPath().'/api/persons/'.$per_ID.'/photo" class="direct-chat-img"> &nbsp <a href="PersonView.php?PersonID='.$per_ID.'">'.FormatFullName($per_Title, $per_FirstName, $per_MiddleName, $per_LastName, $per_Suffix, 1).'</a></td>';

echo '<td align="center">'.$sValidAddy.'</td>';
echo '<td align="center">'.$sValidEmail.'</td>';
Expand Down
3 changes: 2 additions & 1 deletion src/DepositSlipEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
require 'Include/Functions.php';

use ChurchCRM\DepositQuery;
use ChurchCRM\dto\SystemURLs;

$iDepositSlipID = 0;
$thisDeposit = 0;
Expand Down Expand Up @@ -201,7 +202,7 @@
</div>
<!-- End Delete Confirm Modal -->

<script type="text/javascript" src="<?= $sRootPath ?>/skin/js/DepositSlipEditor.js"></script>
<script type="text/javascript" src="<?= SystemURLs::getRootPath() ?>/skin/js/DepositSlipEditor.js"></script>
<?php
$fundData = [];
foreach ($thisDeposit->getFundTotals() as $tmpfund) {
Expand Down
3 changes: 2 additions & 1 deletion src/FamilyView.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use ChurchCRM\Service\TimelineService;
use ChurchCRM\dto\SystemConfig;
use ChurchCRM\FamilyQuery;
use ChurchCRM\dto\SystemURLs;

$timelineService = new TimelineService();
$mailchimp = new MailChimpService();
Expand Down Expand Up @@ -978,6 +979,6 @@ class="btn btn-success"><i class="fa fa-check"></i> <?= gettext("Verified In Per

} ?>

<script src="<?= $sRootPath; ?>/skin/js/FamilyView.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/FamilyView.js"></script>

<?php require "Include/Footer.php" ?>
4 changes: 3 additions & 1 deletion src/FindDepositSlip.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
require 'Include/Config.php';
require 'Include/Functions.php';

use ChurchCRM\dto\SystemURLs;

$iDepositSlipID = $_SESSION['iCurrentDeposit'];

//Set the page title
Expand Down Expand Up @@ -113,6 +115,6 @@
</div>
</div>
</div>
<script src="<?= $sRootPath; ?>/skin/js/FindDepositSlip.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/FindDepositSlip.js"></script>

<?php require 'Include/Footer.php' ?>
14 changes: 8 additions & 6 deletions src/GenerateSeedData.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
require 'Include/Config.php';
require 'Include/Functions.php';

use ChurchCRM\dto\SystemURLs;

// Security: User must have Manage Groups permission
if (!$_SESSION['bAdmin']) {
Redirect('Menu.php');
Expand Down Expand Up @@ -51,28 +53,28 @@
url: window.CRM.root + '/api/data/seed/families/' + $("#Num_Families").val(), // the url where we want to POST
dataType : 'json', // what type of data do we expect back from the server
encode : true,
beforeSend : function () {
beforeSend : function () {
$('#results').empty();
$('#results').append('<div class="text-center"><i class="fa fa-spinner fa-spin"></i><h3> <?= gettext('Loading Seed Data') ?> </h3></div>');
}
})
.done(function(data) {
console.log(data);
$('#results').empty();
$('#results').append('<pre>'+JSON.stringify(data,null,4) +'</pre>');
$('#results').append('<pre>'+JSON.stringify(data,null,4) +'</pre>');
});







});



</script>

<!-- PACE -->
<script src="<?= $sRootPath ?>/skin/adminlte/plugins/pace/pace.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/pace/pace.min.js"></script>
<?php
require 'Include/Footer.php';
?>
4 changes: 2 additions & 2 deletions src/GroupEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//Include the function library
require 'Include/Config.php';
require 'Include/Functions.php';
use ChurchCRM\Group;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\GroupQuery;
use ChurchCRM\ListOptionQuery;
use ChurchCRM\Service\GroupService;
Expand Down Expand Up @@ -178,6 +178,6 @@
var roleCount = groupRoleData.length;
var groupID =<?= $iGroupID ?>;
</script>
<script src="<?= $sRootPath ?>/skin/js/GroupEditor.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/js/GroupEditor.js"></script>

<?php require 'Include/Footer.php' ?>
Loading

0 comments on commit 7f33870

Please sign in to comment.