Skip to content

Commit

Permalink
Merge pull request #2 from tbar0970/master
Browse files Browse the repository at this point in the history
Update to orig.
  • Loading branch information
eb3nezer authored Mar 14, 2018
2 parents f2812f8 + bbe8adb commit d15a534
Show file tree
Hide file tree
Showing 1,716 changed files with 138,198 additions and 57,978 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/nbproject/private/
/nbproject/
/files/
conf.php
14 changes: 14 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->exclude('include/phpword')
->exclude('include/swiftmailer')
->exclude('resources')
->in(__DIR__)
;

return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::NONE_LEVEL)
->fixers(array('trailing_spaces', 'encoding'))
->finder($finder)
;
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Jethro PMM is the software that powers online services such as [Easy Jethro](htt

Download the latest version of Jethro from the [releases page](https://github.com/tbar0970/jethro-pmm/releases)

System requirements are:
* MySQL 5.1 or above
* PHP 5.3.0 or above
* Some web server (apache suggested)

The steps to install are:

1. Unzip the files into a web-accessible folder on your web server
2. Create a mysql database and database user for your jethro system to use
2. Create a mysql database and database user for your jethro system to use. If asked, choose utf8_unicode_ci as the character set and collation.
3. Edit Jethro's configuration file conf.php and fill in the essential details (system name, URL, database details). Further explanation can be found inside the file.
4. Open the jethro system URL in your web browser
5. If you encounter an error about MDB2.php not being found, you need to install the MDB2 PEAR library. If you have command line access this can be done by running
<code>pear install MDB2
pear install MDB2_Driver_mysql</code>
If you don't have command line access you can unzip [this ZIP file](http://sourceforge.net/project/showfiles.php?group_id=192555&package_id=247862&release_id=544189) into your Jethro folder.
6. In your web browser, the Jethro installer will start automatically and will prompt you for details to create the initial user account. When the installer completes, it will prompt you to log into the installed system.
7.
5.. In your web browser, the Jethro installer will start automatically and will prompt you for details to create the initial user account. When the installer completes, it will prompt you to log into the installed system.

# Documentation

Expand Down Expand Up @@ -68,10 +68,12 @@ Jethro is designed to facilitate and encourage good team ministry, so its name c

# Acknowledgements
Jethro development has been sponsored or contributed to by several churches worldwide:
* [Christ Church Inner West Anlgican Community](http://cciw.org.au), Sydney, Australia (founding sponsor)
* [Christ Church Inner West Anglican Community](http://cciw.org.au), Sydney, Australia (founding sponsor)
* [Redlands Presbyterian Church](http://www.redlands.org.au/), Queensland, Australia (sponsor of service planning features)
* [St Peter's Woolton](http://www.stpeters-woolton.org.uk), Liverpool, UK (sponsor of date field and photo features)
* [Coast Evanglical Church](http://www.coastec.net.au)</a>, Forster, Australia (sponsor of group-membership statuses, attendance enhancements and more)
* [Coast Evangelical Church](http://www.coastec.net.au)</a>, Forster, Australia (sponsor of group-membership statuses, attendance enhancements and more)
* [St George North Anglican Church](http://snac.org.au)</a>, Sydney, Australia (contributor of vCard export)
* [Macquarie Anglican Church](http://www.macquarieanglican.org/)</a>, Sydney, Australia (contributor of note-search and SMS-family feature)
* [Dalby Presbyterian Church](http://www.dpc.cc/)</a>, Queensland, Australia (sponsor of edit/delete note features)
* [Dalby Presbyterian Church](http://www.dpc.cc/)</a>, Queensland, Australia (sponsor of edit/delete note features and family photos)
* [Professional Standards Unit](http://safeministry.org.au), Anglican Diocese of Sydney (sponsor of custom fields etc)
There are also several github contributors whose input is invaluable.
17 changes: 12 additions & 5 deletions calls/call_contact_list.class.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<?php
class Call_Contact_List extends Call
{
function run()
function run()
{
$GLOBALS['system']->initErrorHandler();
require_once 'views/view_2_families__4_contact_list.class.php';
if (!$GLOBALS['user_system']->havePerm(View_Families__Contact_List::getMenuPermissionLevel())) return;
$view = new View_Families__Contact_List();
header('Content-disposition: attachment; filename="Contact-List.html"');
$view->processView();
$view->printResults();

switch (array_get($_REQUEST, 'format')) {
case 'docx':
header('Content-disposition: attachment; filename="Contact-List.docx"');
header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
$view->printDOCX();
break;
default:
header('Content-disposition: attachment; filename="Contact-List.html"');
$view->printResults(TRUE);
}
}
}

?>
19 changes: 16 additions & 3 deletions calls/call_csv.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
require_once 'include/odf_tools.class.php';
class Call_csv extends Call
{
function run()
function run()
{
if (empty($_REQUEST['personid'])) {
trigger_error("You must select some persons");
exit;
}
$fp = fopen('php://output', 'w');
header('Content-type: application/force-download');
header("Content-Type: application/download");
Expand All @@ -20,23 +24,32 @@ function run()
case 'person':
default:
$merge_data = $GLOBALS['system']->getDBObjectData('person', Array('id' => (array)$_POST['personid']));
foreach (Person::getCustomMergeData($_POST['personid']) as $personid => $data) {
$merge_data[$personid] += $data;
}
$dummy = new Person();
$dummy_family = new Family();
break;
}
$headerrow = Array('ID');

fputs($fp, '"ID",');// https://superuser.com/questions/210027/why-does-excel-think-csv-files-are-sylk
$headerrow = Array();
foreach (array_keys(reset($merge_data)) as $header) {
if ($header == 'familyid') continue;
if ($header == 'history') continue;
if ($header == 'feed_uuid') continue;
$headerrow[] = strtoupper($dummy->getFieldLabel($header));
}
fputcsv($fp, $headerrow);



foreach ($merge_data as $id => $row) {
@$dummy->populate($id, $row);
$outputrow = Array($id);
foreach ($row as $k => $v) {
if ($k == 'history') continue;
if ($k == 'familyid') continue;
if ($k == 'feed_uuid') continue;
if ($dummy->hasField($k)) {
$outputrow[] = $dummy->getFormattedValue($k, $v); // pass value to work around read-only fields
} else if ($dummy_family && $dummy_family->hasField($k)) {
Expand Down
25 changes: 6 additions & 19 deletions calls/call_documents.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class Call_Documents extends Call
{
function run()
function run()
{
$GLOBALS['system']->initErrorHandler();
require_once 'views/view_9_documents.class.php';
Expand All @@ -12,22 +12,9 @@ function run()
$view->serveFile();
exit();
}

?>
<html>
<head>
<?php include 'templates/head.template.php'; ?>
</head>
<body id="iframe">
<div id="body">
<?php
$view->printIframeContents();
?>
</div>
</body>
</html>
<?php
if (!empty($_REQUEST['zipfile'])) {
$view->serveZip();
exit;
}
}
}

?>
}
22 changes: 11 additions & 11 deletions calls/call_dtmf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class Call_DTMF extends Call
function run()
{
//samples per second
$sample_rate = isset($sample_rate) ? intval($sample_rate) : 8000;
$sample_rate = isset($sample_rate) ? intval($sample_rate) : 8000;

//signal length in milliseconds
$signal_length = isset($signal_length) ? intval($signal_length) : 100;
$signal_length = isset($signal_length) ? intval($signal_length) : 100;

//break between signals in milliseconds
$break_length = isset($break_length) ? intval($break_length) : 100;

//pause length in milliseconds - pause character is ','
$pause_length = isset($pause_length) ? intval($pause_length) : 500;
$pause_length = isset($pause_length) ? intval($pause_length) : 500;

//amplitude of wave file in the range 0-64
$amplitude = isset($amplitude) ? intval($amplitude) : 64;
Expand All @@ -46,16 +46,16 @@ function run()
//'spell' means that letters spell numbers like in 1-800-CALL-NOW.
//
//false means that letters of the specified case cannot not be used.
$upper_case = isset($upper_case) ? $upper_case : 'abcd';
$lower_case = isset($lower_case) ? $lower_case : 'spell';
$upper_case = isset($upper_case) ? $upper_case : 'abcd';
$lower_case = isset($lower_case) ? $lower_case : 'spell';

//build frequency tables
$lowfreqs = array(697, 770, 852, 941);
$highfreqs = array(1209, 1336, 1477, 1633);
$signals = array(
'1', '2', '3', 'A',
'4', '5', '6', 'B',
'7', '8', '9', 'C',
'1', '2', '3', 'A',
'4', '5', '6', 'B',
'7', '8', '9', 'C',
'*', '0', '#', 'D');
$i = 0; foreach ($signals as $signal) {
$low[$signal] = $lowfreqs[$i / 4] / $sample_rate * 2 * M_PI;
Expand All @@ -80,7 +80,7 @@ function run()

//remove frequently used formatting characters
//that are not part of the actual number
$n = strtr($n, '+-()',
$n = strtr($n, '+-()',
' ');
$n = str_replace(' ', '', $n);

Expand All @@ -93,7 +93,7 @@ function run()
$output .= str_repeat("\0", $pause_length * $sample_rate);
} else if ($low[$signal]) {
for ($j = 0; $j < $signal_length / 1000 * $sample_rate; $j++) {
$output .= chr(floor($amplitude * (sin($j * $low[$signal]) +
$output .= chr(floor($amplitude * (sin($j * $low[$signal]) +
sin($j * $high[$signal]))));
}
$output .= str_repeat("\0", $break_length / 1000 * $sample_rate);
Expand All @@ -120,7 +120,7 @@ function run()
header('Content-Length: ' . strlen($output));
header('Content-Type: audio/basic');
header('Content-Disposition: filename="' . $_REQUEST['n'] . '"');
header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+1 year')).' GMT');
header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+1 year')).' GMT');
header('Cache-Control: public, max-age='+365*24*60*60);
header('Pragma: cache');

Expand Down
41 changes: 22 additions & 19 deletions calls/call_email.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class Call_email extends Call
{
function run()
function run()
{
if (!empty($_REQUEST['print_popup'])) {
$GLOBALS['system']->initErrorHandler();
Expand All @@ -23,23 +23,26 @@ function run()
} else if (!empty($_REQUEST['roster_view'])) {
$view = $GLOBALS['system']->getDBObject('roster_view', (int)$_REQUEST['roster_view']);
$recips = $view->getAssignees($_REQUEST['start_date'], $_REQUEST['end_date']);
// TODO: find email-less people here?
} else {
switch (array_get($_REQUEST, 'email_type')) {
case 'family':
$GLOBALS['system']->includeDBClass('family');
$families = Family::getFamilyDataByMemberIDs($_POST['personid']);
$recips = $GLOBALS['system']->getDBObjectData('person', Array('age_bracket' => '0', '(familyid' => array_keys($families), '!email' => '', '!status' => 'archived'), 'AND');
$blanks =$GLOBALS['system']->getDBObjectData('person', Array('age_bracket' => '0', '(familyid' => array_keys($families), 'email' => '', '!status' => 'archived'), 'AND');
$archived = $GLOBALS['system']->getDBObjectData('person', Array('age_bracket' => '0', '(familyid' => array_keys($families), 'status' => 'archived'), 'AND');
break;
case 'person':
default:
$recips = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], '!email' => '', '!status' => 'archived'), 'AND');
$blanks = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], 'email' => '', '!status' => 'archived'), 'AND');
$archived = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], 'status' => 'archived'), 'AND');
$GLOBALS['system']->includeDBClass('person');
break;
if (empty($_REQUEST['personid'])) {
$recips = $emails = $blanks = $archived = Array();
} else {
switch (array_get($_REQUEST, 'email_type')) {
case 'family':
$GLOBALS['system']->includeDBClass('family');
$families = Family::getFamilyDataByMemberIDs($_POST['personid']);
$recips = $GLOBALS['system']->getDBObjectData('person', Array('(age_bracketid' => Age_Bracket::getAdults(), '(familyid' => array_keys($families), '!email' => '', '!status' => 'archived'), 'AND');
$blanks =$GLOBALS['system']->getDBObjectData('person', Array('(age_bracketid' => Age_Bracket::getAdults(), '(familyid' => array_keys($families), 'email' => '', '!status' => 'archived'), 'AND');
$archived = $GLOBALS['system']->getDBObjectData('person', Array('(age_bracketid' => Age_Bracket::getAdults(), '(familyid' => array_keys($families), 'status' => 'archived'), 'AND');
break;
case 'person':
default:
$recips = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], '!email' => '', '!status' => 'archived'), 'AND');
$blanks = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], 'email' => '', '!status' => 'archived'), 'AND');
$archived = $GLOBALS['system']->getDBObjectData('person', Array('id' => $_POST['personid'], 'status' => 'archived'), 'AND');
$GLOBALS['system']->includeDBClass('person');
break;
}
}
}

Expand Down Expand Up @@ -96,13 +99,13 @@ private function printModal($emails, $archived, $blanks) {
<?php
foreach ($chunks as $i => $chunk) {
?>
<a href="<?php echo $this->getHref($chunk, FALSE); ?>" class="btn" onclick="this.style.textDecoration='line-through'" <?php echo email_link_extras(); ?>>Email Batch #<?php echo $i; ?></a>
<a href="<?php echo $this->getHref($chunk, FALSE); ?>" class="btn" onclick="this.style.textDecoration='line-through'" <?php echo email_link_extras(); ?>>Email Batch #<?php echo ($i+1); ?></a>
<?php
}
?>
</p>
<?php
}
}
$this->printBlanks($blanks);

}
Expand Down
14 changes: 4 additions & 10 deletions calls/call_envelopes.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class Call_Envelopes extends Call
{
function run()
function run()
{

//Handle special IE contype request
Expand All @@ -14,7 +14,7 @@ function run()
$env = new Envelope_List();
$GLOBALS['system']->includeDBClass('family');
if (!empty($_REQUEST['familyid'])) {
$family =& $GLOBALS['system']->getDBObject('family', (int)$_REQUEST['familyid']);
$family = $GLOBALS['system']->getDBObject('family', (int)$_REQUEST['familyid']);
$env->addAddress($family->getAdultMemberNames()."\n".$family->getPostalAddress());
}
if (!empty($_REQUEST['personid'])) {
Expand Down Expand Up @@ -53,8 +53,8 @@ function run()
$env->addAddress($to."\n".$dummy->getPostalAddress());
}
} else {
$person =& $GLOBALS['system']->getDBObject('person', (int)$_REQUEST['personid']);
$family =& $GLOBALS['system']->getDBObject('family', $person->getValue('familyid'));
$person = $GLOBALS['system']->getDBObject('person', (int)$_REQUEST['personid']);
$family = $GLOBALS['system']->getDBObject('family', $person->getValue('familyid'));
$env->addAddress($person->toString()."\n".$family->getPostalAddress());
}
}
Expand Down Expand Up @@ -994,8 +994,6 @@ function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
$type=substr($file,$pos+1);
}
$type=strtolower($type);
$mqr=get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
if($type=='jpg' || $type=='jpeg')
$info=$this->_parsejpg($file);
elseif($type=='png')
Expand All @@ -1008,7 +1006,6 @@ function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
$this->Error('Unsupported image type: '.$type);
$info=$this->$mtd($file);
}
set_magic_quotes_runtime($mqr);
$info['i']=count($this->images)+1;
$this->images[$file]=$info;
}
Expand Down Expand Up @@ -1249,8 +1246,6 @@ function _putfonts()
$this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
$this->_out('endobj');
}
$mqr=get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
foreach($this->FontFiles as $file=>$info)
{
//Font file embedding
Expand Down Expand Up @@ -1288,7 +1283,6 @@ function _putfonts()
$this->_putstream($font);
$this->_out('endobj');
}
set_magic_quotes_runtime($mqr);
foreach($this->fonts as $k=>$font)
{
//Font objects
Expand Down
4 changes: 2 additions & 2 deletions calls/call_family_mailout_csv.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Call_Family_Mailout_CSV extends Call
function run()
{
header('Content-type: text/plain');
$group =& $GLOBALS['system']->getDBObject('person_group', (int)$_REQUEST['groupid']);
$group = $GLOBALS['system']->getDBObject('person_group', (int)$_REQUEST['groupid']);
header('Content-disposition: attachment; filename="'.str_replace('"', '\\"', $group->getValue('name')).'.csv"');
if (!empty($_REQUEST['groupid'])) {
$families = $GLOBALS['system']->getDBObjectData('family', Array('(family.id' => 'SELECT familyid FROM person JOIN person_group_membership pgm ON person.id = pgm.personid WHERE pgm.groupid = '.(int)$_REQUEST['groupid'], '!status' => 'archived'), 'AND', 'address_street');
Expand All @@ -29,7 +29,7 @@ function run()
echo '"'.str_replace('"', '\\"', $d).'",';
}
echo "\r\n";
}
}
}
}
}
Expand Down
Loading

0 comments on commit d15a534

Please sign in to comment.