Skip to content

Commit

Permalink
Ability to configure person/family notes to show in descending or asc…
Browse files Browse the repository at this point in the history
…ending order of time
  • Loading branch information
tbar0970 committed Aug 24, 2016
1 parent 351ffaf commit 074443c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions conf.php.sample.au
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ define('REQUIRE_INITIAL_NOTE', true);
// Whether users restricted by congregation or group can add persons and families
define('RESTRICTED_USERS_CAN_ADD', true);

// Order to show person/family notes. ASC for oldest notes first; DESC for newest notes first.
define('NOTES_ORDER', 'ASC');

// The order in which persons are listed when marking or reporting attendance for congregations or groups.
// "status" means person status for congregational attendance, and group membership status for groups.
// "person.status" means person status, even when marking attendance for a group.
Expand Down
3 changes: 3 additions & 0 deletions conf.php.sample.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ define('REQUIRE_INITIAL_NOTE', true);
// Whether users restricted by congregation or group can add persons and families
define('RESTRICTED_USERS_CAN_ADD', true);

// Order to show person/family notes. ASC for oldest notes first; DESC for newest notes first.
define('NOTES_ORDER', 'ASC');

// The order in which persons are listed when marking or reporting attendance for congregations or groups.
// "status" means person status for congregational attendance, and group membership status for groups.
// "person.status" means person status, even when marking attendance for a group.
Expand Down
3 changes: 3 additions & 0 deletions conf.php.sample.uk
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ define('REQUIRE_INITIAL_NOTE', true);
// Whether users restricted by congregation or group can add persons and families
define('RESTRICTED_USERS_CAN_ADD', true);

// Order to show person/family notes. ASC for oldest notes first; DESC for newest notes first.
define('NOTES_ORDER', 'ASC');

// The order in which persons are listed when marking or reporting attendance for congregations or groups.
// "status" means person status for congregational attendance, and group membership status for groups.
// "person.status" means person status, even when marking attendance for a group.
Expand Down
3 changes: 3 additions & 0 deletions conf.php.sample.usa
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ define('REQUIRE_INITIAL_NOTE', true);
// Whether users restricted by congregation or group can add persons and families
define('RESTRICTED_USERS_CAN_ADD', true);

// Order to show person/family notes. ASC for oldest notes first; DESC for newest notes first.
define('NOTES_ORDER', 'ASC');

// The order in which persons are listed when marking or reporting attendance for congregations or groups.
// "status" means person status for congregational attendance, and group membership status for groups.
// "person.status" means person status, even when marking attendance for a group.
Expand Down
7 changes: 5 additions & 2 deletions db_objects/person.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,11 @@ function getNotesHistory()

function _compareCreatedDates($a, $b)
{
return $a['created'] > $b['created'];

if (ifdef('NOTES_ORDER', 'ASC') == 'ASC') {
return $a['created'] > $b['created'];
} else {
return $a['created'] < $b['created'];
}
}

function validateFields()
Expand Down
3 changes: 2 additions & 1 deletion templates/view_family.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<li class="active"><a data-toggle="tab" href="#basic"><?php echo _('Basic Details')?></a></li>
<?php
if ($GLOBALS['user_system']->havePerm(PERM_VIEWNOTE)) {
$notes = $GLOBALS['system']->getDBObjectData('family_note', Array('familyid' => $family->id), 'OR', 'created');
$order =(ifdef('NOTES_ORDER', 'ASC') == 'ASC') ? 'ASC' : 'DESC';
$notes = $GLOBALS['system']->getDBObjectData('family_note', Array('familyid' => $family->id), 'OR', 'created '.$order);
?>
<li><a data-toggle="tab" href="#notes"><?php echo _('Notes')?> (<?php echo count($notes); ?>)</a></li>
<?php
Expand Down

0 comments on commit 074443c

Please sign in to comment.