Skip to content

Commit

Permalink
#114 only list members as formers if they have no active role
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Sep 12, 2015
1 parent 9c15655 commit 88e3d3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions adm_program/modules/messages/messages_write.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@
// select Users

$sql = 'SELECT usr_id, first_name.usd_value as first_name, last_name.usd_value as last_name,
email.usd_value as email, (SELECT count(1)
email.usd_value as email, (SELECT DISTINCT 1
FROM '.TBL_MEMBERS.' as temp
WHERE mem_usr_id = usr_id
AND ( mem_begin > \''.DATE_NOW.'\'
OR mem_end < \''.DATE_NOW.'\')) as former
AND mem_begin <= \''.DATE_NOW.'\'
AND mem_end >= \''.DATE_NOW.'\') as active
FROM '. TBL_MEMBERS. ', '. TBL_USERS. '
JOIN '. TBL_USER_DATA. ' as email
ON email.usd_usr_id = usr_id
Expand All @@ -375,15 +375,17 @@
AND usr_id <> '.$gCurrentUser->getValue('usr_id').'
AND usr_valid = 1
GROUP BY usr_id, first_name.usd_value, last_name.usd_value, email.usd_value
ORDER BY former, last_name, first_name';
ORDER BY active DESC, last_name ASC, first_name ASC';

$result = $gDb->query($sql);

$next = true;
$active = $gL10n->get('LST_ACTIVE_MEMBERS');

while ($row = $gDb->fetch_array($result)) {
if ($row['former'] == 1 && $next == true)
while ($row = $gDb->fetch_array($result))
{
// if former members were found then change the string for the group title
if ($row['active'] != 1 && $next == true)
{
$active = $gL10n->get('MSG_FORMER_MEMBERS');
$next = false;
Expand Down
2 changes: 1 addition & 1 deletion adm_program/system/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

define('ADMIDIO_VERSION_MAIN', 3);
define('ADMIDIO_VERSION_MINOR', 0);
define('ADMIDIO_VERSION_PATCH', 1);
define('ADMIDIO_VERSION_PATCH', 2);
define('ADMIDIO_VERSION_BETA', 0);
define('ADMIDIO_VERSION', ADMIDIO_VERSION_MAIN . '.' . ADMIDIO_VERSION_MINOR . '.' . ADMIDIO_VERSION_PATCH);

Expand Down

0 comments on commit 88e3d3c

Please sign in to comment.