Permalink
Browse files

Removes emergency contact info from main member listing. Closes #29.

  • Loading branch information...
elplatt committed Oct 8, 2012
1 parent d4e8849 commit 31a3f4542d80cc8869b9307cbf85ef2fc2f1e7b2
Showing with 18 additions and 5 deletions.
  1. +6 −1 crm/include/member/page.inc.php
  2. +12 −4 crm/include/member/table.inc.php
@@ -58,7 +58,12 @@ function member_page (&$page_data, $page_name, $options) {
// Add view tab
if (user_access('member_view')) {
$view .= theme('member_filter_form');
- $view .= theme('table', 'member', array('filter'=>$_SESSION['member_filter'], 'show_export'=>true));
+ $opts = array(
+ 'filter'=>$_SESSION['member_filter']
+ , 'show_export'=>true
+ , 'exclude'=>array('emergencyName', 'emergencyPhone')
+ );
+ $view .= theme('table', 'member', $opts);
page_add_content_top($page_data, $view, 'View');
}
@@ -68,8 +68,12 @@ function member_table ($opts = NULL) {
$table['columns'][] = array('title'=>'Membership','class'=>'');
$table['columns'][] = array('title'=>'E-Mail','class'=>'');
$table['columns'][] = array('title'=>'Phone','class'=>'');
- $table['columns'][] = array('title'=>'Emergency Contact','class'=>'');
- $table['columns'][] = array('title'=>'Emergency Phone','class'=>'');
+ if (!array_key_exists('exclude', $opts) || !in_array('emergencyName', $opts['exclude'])) {
+ $table['columns'][] = array('title'=>'Emergency Contact','class'=>'');
+ }
+ if (!array_key_exists('exclude', $opts) || !in_array('emergencyPhone', $opts['exclude'])) {
+ $table['columns'][] = array('title'=>'Emergency Phone','class'=>'');
+ }
}
// Add ops column
if (!$export && (user_access('member_edit') || user_access('member_delete'))) {
@@ -109,8 +113,12 @@ function member_table ($opts = NULL) {
$row[] = $plan;
$row[] = $member['contact']['email'];
$row[] = $member['contact']['phone'];
- $row[] = $member['contact']['emergencyName'];
- $row[] = $member['contact']['emergencyPhone'];
+ if (!array_key_exists('exclude', $opts) || !in_array('emergencyName', $opts['exclude'])) {
+ $row[] = $member['contact']['emergencyName'];
+ }
+ if (!array_key_exists('exclude', $opts) || !in_array('emergencyPhone', $opts['exclude'])) {
+ $row[] = $member['contact']['emergencyPhone'];
+ }
}
// Construct ops array

0 comments on commit 31a3f45

Please sign in to comment.